It only has to be a handful of accessors, no? I was thinking basically of
just the few things on the global object that need this treatment.
location, document, window, navigator, maybe a few others? And location is
the only one with a setter, so we're mostly just talking about getters on
the global object. Since it's the global object, you could just call the
getter directly and `this` will implicitly be the correct receiver when
called inside the context. So the remaining situations in which it's
difficult are in the parent frame when you want to do this one of the
handful of properties that have this treatment.

An option that might have uses in other places as well is a kind of
primitive version of call, bind, and apply that have the null prototype,
frozen treatment. They could be singletons over the entire runtime, across
realms, and be attached to any function in any realm (including these
accessors) without leaking anything.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to