prop-desc.js (1104B)
1 // Copyright (C) 2016 The V8 Project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-json-object 6 description: > 7 Property descriptor of JSON 8 info: | 9 The JSON Object 10 11 ... 12 The JSON object does not have a [[Construct]] internal method; 13 it is not possible to use the JSON object as a constructor with the new operator. 14 15 The JSON object does not have a [[Call]] internal method; 16 it is not possible to invoke the JSON object as a function. 17 18 17 ECMAScript Standard Built-in Objects: 19 20 Every other data property described in clauses 18 through 26 and in Annex B.2 21 has the attributes { [[Writable]]: true, [[Enumerable]]: false, 22 [[Configurable]]: true } unless otherwise specified. 23 includes: [propertyHelper.js] 24 ---*/ 25 26 assert.sameValue(typeof JSON, "object"); 27 28 assert.throws(TypeError, function() { 29 JSON(); 30 }, "no [[Call]]"); 31 32 assert.throws(TypeError, function() { 33 new JSON(); 34 }, "no [[Construct]]"); 35 36 verifyProperty(this, "JSON", { 37 enumerable: false, 38 writable: true, 39 configurable: true 40 }); 41 42 reportCompare(0, 0);