FIX: Use Map instead of Object for caching (PR #14887)

Objects have default properties, such as “constructor” that can cause issues when using similar texts as keys.

GitHub

Any chances you could add a test as well?