Debian Codegraph @

js/src/tests/test262/built-ins/JSON/15.12-0-2.js

raw
1 // Copyright (c) 2012 Ecma International. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 This test should be run without any built-ins being added/augmented.
7 The name JSON must be bound to an object, and must not support [[Construct]].
8 step 4 in 11.2.2 should throw a TypeError exception.
9 es5id: 15.12-0-2
10 description: JSON must not support the [[Construct]] method
11 ---*/
12
13 var o = JSON;
14 assert.throws(TypeError, function() {
15 var j = new JSON();
16 });
17
18 reportCompare(0, 0);