Re: [whatwg/webidl] Are operations on the `[[BackingMap]]` and `[[BackingSet]]` page-hookable? And if not, why not? (#254)

I might as well shave this yak while I'm here, since I want to fix #824 as well, and presenting an Infra object would do that well.

So it sounds like there's agreement on approach 3 from the OP:

> Specify that the size getter invokes the original value of the Set.prototype.size getter. Then this testcase should alert 0. Same with the various other forwarding getters.

I presume this applies to the other methods as well, so the backing set/map can *only* be observed by internal spec algorithms (otherwise, I believe step 7 of <https://webidl.spec.whatwg.org/#es-map-get-has> would have the same author-hooking issue).

It also looks like the only thing preventing us from just switching the backing store *entirely* to an Infra map/set is that we're using JS's MapIterator/SetIterator algos, which expect to be called on an actual ES Map or Set; they don't expose this object to the author, but they're written to depend on it when fetching the items.

We manually reproduce a bunch of the other map/set/etc method algos, tho - is there something I'm missing preventing us from just copying over the iterator algos, too?

I'm gonna start hacking at a PR assuming the answer is "no" and it would be fine to just copy the algos over.

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

Message ID: <whatwg/webidl/issues/254/1113584448@github.com>

Received on Friday, 29 April 2022 18:05:25 UTC