mirror of
https://github.com/tc39/test262.git
synced 2025-07-22 05:24:38 +02:00
Transform legacy format to harness assertions: test/built-ins/J*/**/*.js
This commit is contained in:
parent
ec9c9b8dfd
commit
2944eb2eca
@ -8,9 +8,11 @@ description: Tests that JSON.parse treats "__proto__" as a regular property name
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var x = JSON.parse('{"__proto__":[]}');
|
var x = JSON.parse('{"__proto__":[]}');
|
||||||
if (Object.getPrototypeOf(x) !== Object.prototype) {
|
|
||||||
throw new Test262Error('#1: JSON.parse confused by "__proto__"');
|
assert.sameValue(
|
||||||
}
|
Object.getPrototypeOf(x),
|
||||||
if (!Array.isArray(x.__proto__)) {
|
Object.prototype,
|
||||||
throw new Test262Error('#2: JSON.parse did not set "__proto__" as a regular property');
|
'Object.getPrototypeOf("JSON.parse(\'{"__proto__":[]}\')") returns Object.prototype'
|
||||||
}
|
);
|
||||||
|
|
||||||
|
assert(Array.isArray(x.__proto__), 'Array.isArray(x.__proto__) must return true');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user