More accurate global object definition?

David Bruant bruant.d at gmail.com
Fri Apr 26 15:13:17 PDT 2013


Hi,

ES5 remains pretty vague as far as the global object is concerned [1]. 
Specifically, the [[Class]] is left to the implementation suggesting 
that internal [[Get]], [[Set]], etc. are unbounded on what they can do. 
For instance, when doing "this.Object", an implementation could do 
anything and return anything and still be conformant which defeats the 
intuition of the fact that "Object" is a property of the global object.
I believe it'd be a good thing to pin down what's allowed and what is 
not for the global object. Specifically, a recent change in Firefox [2] 
made a lot of tests playing with the global object fail. However, due to 
lack of specification on the global object, these tests should currently 
be considered invalid [3].

Should these tests be invalid or the definition of the global object be 
made more accurate?

David

[1] http://www.ecma-international.org/ecma-262/5.1/#sec-15.1
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=828787
[3] https://bugs.ecmascript.org/show_bug.cgi?id=1453


More information about the es-discuss mailing list