Description
I think that the following tests violate the semantics of implementation dependent [[Prototype]] of Global Object.
- /test/built-ins/Object/defineProperty/15.2.3.6-4-625gs.js
- /test/built-ins/Object/getPrototypeOf/15.2.3.2-2-30.js
- /test/built-ins/decodeURI/S15.1.3.1_A5.5.js
- /test/built-ins/decodeURIComponent/S15.1.3.2_A5.5.js
- /test/built-ins/encodeURI/S15.1.3.3_A5.5.js
- /test/built-ins/encodeURIComponent/S15.1.3.4_A5.5.js
- /test/built-ins/eval/prop-desc-enumerable.js
- /test/built-ins/parseFloat/S15.1.2.3_A7.5.js
- /test/built-ins/parseInt/S15.1.2.2_A9.5.js
- /test/language/global-code/decl-lex.js
According to the definition of Global Object, the [[Prototype]] internal slot of the global object is fully implementation-dependent. There is any restriction for it. Thus, we should not assume that [[Prototype]] of the global object is related to Object.prototype
. However, the above tests use this assumption.
For example, see the first test /test/built-ins/Object/defineProperty/15.2.3.6-4-625gs.js:
Object.defineProperty(Object.prototype,
"prop",
{
value: 1001,
writable: false,
enumerable: false,
configurable: false
}
);
var prop = 1002;
if (!(this.hasOwnProperty("prop") && prop === 1002)) {
throw "this.prop should take precedence over Object.prototype.prop";
}
In this case, this
points to the global object and this test tries to access this.hasOwnProperty
. If the [[Prototype]] of the global object is a chain including Object.prototype
, this.hasOwnProperty
points to Object.prototype.hasOwnProperty
but we should not assume that [[Prototype]] of the global object is a chain including Object.prototype
.