| 1 |
// |reftest| shell-option(--enable-json-parse-with-source) skip-if(!JSON.hasOwnProperty('isRawJSON')||!xulRuntime.shell) -- json-parse-with-source is not enabled unconditionally, requires shell-options |
| 2 |
// Copyright (C) 2024 Igalia S.L. All rights reserved. |
| 3 |
// This code is governed by the BSD license found in the LICENSE file. |
| 4 |
|
| 5 |
/*--- |
| 6 |
esid: sec-built-in-function-objects |
| 7 |
description: > |
| 8 |
JSON.isRawJSON.name value and descriptor. |
| 9 |
info: | |
| 10 |
Every built-in function object, including constructors, has a *"name"* |
| 11 |
property whose value is a String. Unless otherwise specified, this value is |
| 12 |
the name that is given to the function in this specification. Functions that |
| 13 |
are identified as anonymous functions use the empty String as the value of |
| 14 |
the *"name"* property. For functions that are specified as properties of |
| 15 |
objects, the name value is the property name string used to access the |
| 16 |
function. Functions that are specified as get or set accessor functions of |
| 17 |
built-in properties have *"get"* or *"set"* (respectively) passed to the |
| 18 |
prefix parameter when calling CreateBuiltinFunction. |
| 19 |
|
| 20 |
The value of the *"name"* property is explicitly specified for each built-in |
| 21 |
function whose property key is a Symbol value. If such an explicitly |
| 22 |
specified value starts with the prefix *"get "* or *"set "* and the function |
| 23 |
for which it is specified is a get or set accessor function of a built-in |
| 24 |
property, the value without the prefix is passed to the name parameter, and |
| 25 |
the value *"get"* or *"set"* (respectively) is passed to the prefix |
| 26 |
parameter when calling CreateBuiltinFunction. |
| 27 |
|
| 28 |
Unless otherwise specified, the *"name"* property of a built-in function |
| 29 |
object has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, |
| 30 |
[[Configurable]]: *true* }. |
| 31 |
|
| 32 |
includes: [propertyHelper.js] |
| 33 |
features: [json-parse-with-source] |
| 34 |
---*/ |
| 35 |
|
| 36 |
verifyProperty(JSON.isRawJSON, 'name', { |
| 37 |
value: "isRawJSON", |
| 38 |
enumerable: false, |
| 39 |
writable: false, |
| 40 |
configurable: true |
| 41 |
}); |
| 42 |
|
| 43 |
reportCompare(0, 0); |