Re: [whatwg/webidl] Maplike/setlike iterators shouldn't use MapIteratorPrototype/etc (Issue #1142)

My point of using %MapIteratorPrototype% is just that, if we ever add anything to that proto (some map-specific iteration helpers?) we'd want them to be available for maplikes as well; it also defines the minimal set of methods we need for our purposes (rather than, say, the Generator prototype, which has `.return()` on it).

The algos involved don't invoke the internal slots at all, except hidden in the closure argument that's constructed and passed to CreateIteratorFromClosure, which is why it seemed appropriate to reuse that algo with a custom closure. Impls might internally implement things more directly, of course, and have their map iterator methods directly access the [[MapData]] rather than using a closure; if that's the case, and it's problematic for us to do a custom closure, then it's fine imo to just switch to a new prototype object defined to inherit from %IteratorPrototype%.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1142#issuecomment-1119108202
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1142/1119108202@github.com>

Received on Thursday, 5 May 2022 22:44:22 UTC