Reflection of global bindings
bzbarsky at MIT.EDU
Sat Dec 15 10:02:07 PST 2012
On 12/15/12 12:48 PM, David Bruant wrote:
>> Sure, but those aren't properties on the _global_. They're properties
>> on a different object.
> Script authors can't observe the fact that it's a different object.
Yes, they can. The third and fourth alerts in my testcase constitute
just such an observation: per spec the third alert there must be looking
at a property of the global, and it is, while the fourth alert is
clearly looking at some other object, since it has a different value for
There's a slight wrench in here in that the script-visible "this" object
for non-strict functions is also supposed to be the global per spec, but
in practice it's the WindowProxy.
> They just have access to one WindowProxy object (they know it's the same with
> object identity).
They have direct access to just the WindowProxy. They have access to
property gets and sets on the actual global, though, via barewords.
> This object is the one that must show some consistency.
That, we agree on.
More information about the es-discuss