Reflection of global bindings

Andreas Rossberg rossberg at google.com
Mon Dec 17 04:26:09 PST 2012


On 17 December 2012 13:01, Mark S. Miller <erights at google.com> wrote:
> On Mon, Dec 17, 2012 at 2:03 AM, Andreas Rossberg <rossberg at google.com> wrote:
>> 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).
>
> In general, I might be fine with that approach. But because of direct
> proxies, it doesn't work for invariant enforcement. Direct proxies can
> use the presence of a single invariant-violating object to create any
> number of other invariant-violating objects.

Yes, but is that a different problem than the global object itself?
Why would you expect anything else? And how would introducing an extra
set of internal attributes help?

Of course, I personally wouldn't mind being radical and simply forbid
proxying the global object altogether. But I assume that you are going
to say that there are important use cases. :)

/Andreas


More information about the es-discuss mailing list