not-a-constructor.js (700B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 2 // Copyright (C) 2021 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-temporal.now.instant 6 description: Temporal.Now.instant does not implement [[Construct]] 7 includes: [isConstructor.js] 8 features: [Reflect.construct, Temporal, arrow-function] 9 ---*/ 10 11 assert.sameValue(isConstructor(Temporal.Now.instant), false, 'isConstructor(Temporal.Now.instant) must return false'); 12 13 assert.throws(TypeError, () => { 14 new Temporal.Now.instant(); 15 }, 'new Temporal.Now.instant() throws a TypeError exception'); 16 17 reportCompare(0, 0);