Reflection of global bindings
rossberg at google.com
Mon Dec 17 02:03:20 PST 2012
On 15 December 2012 22:52, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
> So, to me, it sounds like that to continue down this path we should really add new non-reflected properties attributes that are the real control points for the ES semantics. Eg, we may need [[RealReadOnly]], [[RealDeletable]], and [[RealReconfigurable]] attributes to describe all the states and state transitions that are actually exist within the legacy DOM (and the pure ES global declaration semantics). As these attributes would not be reflected by Object.getOwnPropertyDescriptor/Object.defineProperty they would have to set in some other internal manner when object instances are created. Tis also means that Proxy based object implementations would also need to have some mechanism for emulating these "Real" attributes.
Now I'm really scared. Please let's not go there.
I see the following preferable solutions to deal with DOM features violating ES:
1. Lobby to fix the DOM and make it conform to ES instead of the other
way round. Alex Russell has argued for this repeatedly.
2. Where we can't (sadly, probably most cases), and are forced to
codify existing DOM hacks in ES, isolate these hacks as much as
possible. Specifically, in the current case, define them as specifics
of the global object (the global object is a lost cause anyway).
More information about the es-discuss