[whatwg/webidl] WIP: switching maplike/setlike to use infra maps and sets (PR #1138)

**THIS IS A WIP DRAFT SUBMITTED FOR REVIEW; DO NOT MERGE** 

Fixes #254, fixes #824.

This PR switches maplike and setlike interfaces from using a [[BackingMap]]/[[BackingSet]] ES Map/Set to use an Infra map/set instead. As explained in #254 and #824, this makes the interfaces vastly easier to work with in spec-ese (you can directly manipulate an Infra map/set, rather than having to carefully perform the ES algo dance) , and removes some underdefined behavior (as currently defined, the algorithms look up and utilize the equivalent methods on Map.prototype and Set.prototype, which can be author-supplied).

Unless the author is relying on the "replace the Map.prototype methods" behavior (I haven't tested if impls actually allow this, in any case), this change should be undetectable, and just result in specs using maplike or setlike interfaces having an easier, better-defined time manipulating them.

Progress:
* [x] Switched maplike and setlike to use an Infra map/set instead of a [[BackingMap]]/[[BackingSet]]
* [x] Switched @@iterator to go over the infra map/set (but still return an iterator with the right prototype)
* [x] Switch the rest of the Map methods to use the infra map
* [ ] Switch the rest of the Set methods to use the Infra set
* [ ] Moved the maplike/setlike @@iterator and forEach methods to live with the rest of their methods, rather than being in their own section
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/webidl/pull/1138

-- Commit Summary --

  * WIP: switching maplike/setlike to use infra maps and sets

-- File Changes --

    M index.bs (94)

-- Patch Links --

https://github.com/whatwg/webidl/pull/1138.patch
https://github.com/whatwg/webidl/pull/1138.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1138
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/pull/1138@github.com>

Received on Monday, 2 May 2022 23:53:02 UTC