The global [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) class now (as of 2026) implements two new methods that do the same that that `DefaultMap` does. - `.getOrInsert()` - `.getOrInsertComputed()` Rather than being part of the constructor, it is handled on each call to `.get()`. --- Decision: - Keep `DefaultMap()` - Do not bother with polyfill - Do update API to redo `.get()` - Probably a good idea to check to see if anything still work with ESR (#337) --- - [x] Check to see if any uses of `DefaultMap()` would make migration tricky (e.g., plain `.get()` too convenient). - [x] Check against recent ESR versions of Firefox (at least what is in Debian bookworm) to see if a polyfill is required. - Polyfill would be needed. - [ ] If keeping `DefaultMap()`: - [x] Add `.getWithArguments()` that handles the current `.get()` enhancement - [x] Migrate uses - [x] Mark old enhancement as deprecated - [ ] Remove `.get()` argument enhancement
The global Map class now (as of 2026) implements two new methods that do the same that that
DefaultMapdoes..getOrInsert().getOrInsertComputed()Rather than being part of the constructor, it is handled on each call to
.get().Decision:
DefaultMap().get()DefaultMap()would make migration tricky (e.g., plain.get()too convenient).DefaultMap():.getWithArguments()that handles the current.get()enhancement.get()argument enhancement