argument.js (981B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 2 // Copyright (C) 2024 André Bargull. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-temporal.instant.fromepochnanoseconds 7 description: > 8 TypeError thrown if input is of wrong primitive type. 9 info: | 10 Temporal.Instant.fromEpochNanoseconds ( epochNanoseconds ) 11 12 1. Set epochNanoseconds to ? ToBigInt(epochNanoseconds). 13 ... 14 features: [Temporal] 15 ---*/ 16 17 assert.throws(TypeError, () => Temporal.Instant.fromEpochNanoseconds(), "undefined"); 18 assert.throws(TypeError, () => Temporal.Instant.fromEpochNanoseconds(undefined), "undefined"); 19 assert.throws(TypeError, () => Temporal.Instant.fromEpochNanoseconds(null), "null"); 20 assert.throws(TypeError, () => Temporal.Instant.fromEpochNanoseconds(42), "number"); 21 assert.throws(TypeError, () => Temporal.Instant.fromEpochNanoseconds(Symbol()), "symbol"); 22 23 reportCompare(0, 0);