deno.land / std@0.224.0 / jsonc / testdata / test262 / JSON / parse / S15.12.2_A1.js

View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// Copyright 2011 the Sputnik authors. All rights reserved.// This code is governed by the BSD license found in the LICENSE file.
/*---info: JSON.parse must create a property with the given property namees5id: 15.12.2_A1description: Tests that JSON.parse treats "__proto__" as a regular property name---*/
var x = JSON.parse('{"__proto__":[]}');
assert.sameValue( Object.getPrototypeOf(x), Object.prototype, 'Object.getPrototypeOf("JSON.parse(\'{"__proto__":[]}\')") returns Object.prototype');
assert(Array.isArray(x.__proto__), 'Array.isArray(x.__proto__) must return true');
std

Version Info

Tagged at
4 months ago