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

> So afaict this shouldn't be a big issue for Chrome, at least; we'll just continue using distinct code that's written to intentionally match Maps/Sets in behavior but without expectation of code-sharing.

That's actually my concern: the problem is that re-using `MapIteratorPrototype` means that the implementation of `MapIteratorPrototype.next` _must_ be polymorphic across actual backing Maps and also all of the various maplikes. (In practice it's probably just a dispatch at the start of the implementation, which is not free, but maybe is cheap enough not to worry about?) If you used a custom prototype, each implementation could be specialized to the kind of thing which actually backs it.

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

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

Received on Tuesday, 10 May 2022 18:56:15 UTC