proposal-upsert: `emplace` cannot be correctly and incrementally polyfilled
The problem is that since emplace is defined not to call get and set, it can only be correctly polyfilled when completely reimplementing Map from scratch, as core-js does. In other words, it is impossible to build the functionality correctly by extending the Map prototype because you would not have the requisite privileged access to the underlying data structure.
My impression is that that would make this one of those features that we can all use in ~5 years when everyone is finally using engines that natively support it.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 24 (12 by maintainers)
If you want to make a rule it seems reasonable to start a thread in a place where the people who will be affected (and who can effect rule changes) would see it.
This is a thread based on a technical misunderstanding, and I am closing it.
@ljharb Thanks for the succinct clarification. I’ve never needed to use that pattern so I didn’t recognize it.
I’m going to take 24 hours to cool off from this. Thanks.