Debian Codegraph @

js/src/tests/test262/built-ins/JSON/isRawJSON/builtin.js

raw
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-json.israwjson
7 description: >
8 JSON.isRawJSON meets the requirements for built-in objects
9 info: |
10 JSON.isRawJSON ( O )
11
12 18 ECMAScript Standard Built-in Objects
13 ...
14 Unless specified otherwise, a built-in object that is callable as a function
15 is a built-in function object with the characteristics described in 10.3.
16 Unless specified otherwise, the [[Extensible]] internal slot of a built-in
17 object initially has the value true. Every built-in function object has a
18 [[Realm]] internal slot whose value is the Realm Record of the realm for
19 which the object was initially created.
20 ...
21 Unless otherwise specified every built-in function and every built-in
22 constructor has the Function prototype object, which is the initial value of
23 the expression Function.prototype (20.2.3), as the value of its [[Prototype]]
24 internal slot.
25 ...
26 Built-in function objects that are not identified as constructors do not
27 implement the [[Construct]] internal method unless otherwise specified in the
28 description of a particular function.
29
30 features: [json-parse-with-source]
31 ---*/
32
33 assert(Object.isExtensible(JSON.isRawJSON), "JSON.isRawJSON is extensible");
34 assert.sameValue(
35 typeof JSON.isRawJSON,
36 'function',
37 'The value of `typeof JSON.isRawJSON` is "function"'
38 );
39 assert.sameValue(
40 Object.getPrototypeOf(JSON.isRawJSON),
41 Function.prototype,
42 'Object.getPrototypeOf(JSON.isRawJSON) must return the value of "Function.prototype"'
43 );
44
45 assert.sameValue(
46 Object.getOwnPropertyDescriptor(JSON.isRawJSON, "prototype"),
47 undefined,
48 "JSON.isRawJSON has no own prototype property"
49 );
50
51 reportCompare(0, 0);