builtin.js (1507B)
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.plainyearmonth.from 7 description: Tests that Temporal.PlainYearMonth.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.PlainYearMonth.from), 22 true, "Built-in objects must be extensible."); 23 24 assert.sameValue(Object.prototype.toString.call(Temporal.PlainYearMonth.from), 25 "[object Function]", "Object.prototype.toString"); 26 27 assert.sameValue(Object.getPrototypeOf(Temporal.PlainYearMonth.from), 28 Function.prototype, "prototype"); 29 30 assert.sameValue(Temporal.PlainYearMonth.from.hasOwnProperty("prototype"), 31 false, "prototype property"); 32 33 reportCompare(0, 0);