builtin.js (1272B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 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.duration 7 description: Tests that Temporal.Duration meets the requirements for built-in objects 8 info: | 9 Unless specified otherwise, a built-in object that is callable as a function is a built-in 10 function object with the characteristics described in 10.3. Unless specified otherwise, the 11 [[Extensible]] internal slot of a built-in object initially has the value true. 12 13 Unless otherwise specified every built-in function and every built-in constructor has the 14 Function prototype object [...] as the value of its [[Prototype]] internal slot. 15 features: [Temporal] 16 ---*/ 17 18 assert.sameValue(Object.isExtensible(Temporal.Duration), 19 true, "Built-in objects must be extensible."); 20 21 assert.sameValue(Object.prototype.toString.call(Temporal.Duration), 22 "[object Function]", "Object.prototype.toString"); 23 24 assert.sameValue(Object.getPrototypeOf(Temporal.Duration), 25 Function.prototype, "prototype"); 26 27 assert.sameValue(typeof Temporal.Duration.prototype, 28 "object", "prototype property"); 29 30 reportCompare(0, 0);