Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Instant/from/builtin.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2021 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-temporal.instant.from
7 description: Tests that Temporal.Instant.from meets the requirements for built-in objects
8 info: |
9 Built-in functions that are not constructors do not have a "prototype" property unless
10 otherwise specified in the description of a particular function.
11
12 Unless specified otherwise, a built-in object that is callable as a function is a built-in
13 function object with the characteristics described in 10.3. Unless specified otherwise, the
14 [[Extensible]] internal slot of a built-in object initially has the value true.
15
16 Unless otherwise specified every built-in function and every built-in constructor has the
17 Function prototype object [...] as the value of its [[Prototype]] internal slot.
18 features: [Temporal]
19 ---*/
20
21 assert.sameValue(Object.isExtensible(Temporal.Instant.from),
22 true, "Built-in objects must be extensible.");
23
24 assert.sameValue(Object.prototype.toString.call(Temporal.Instant.from),
25 "[object Function]", "Object.prototype.toString");
26
27 assert.sameValue(Object.getPrototypeOf(Temporal.Instant.from),
28 Function.prototype, "prototype");
29
30 assert.sameValue(Temporal.Instant.from.hasOwnProperty("prototype"),
31 false, "prototype property");
32
33 reportCompare(0, 0);