Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Instant/fromEpochMilliseconds/argument.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) 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.fromepochmilliseconds
7 description: >
8 TypeError thrown if input is of wrong primitive type.
9 info: |
10 Temporal.Instant.fromEpochMilliseconds ( epochMilliseconds )
11
12 1. Set epochMilliseconds to ? ToNumber(epochMilliseconds).
13 ...
14 features: [Temporal]
15 ---*/
16
17 assert.throws(TypeError, () => Temporal.Instant.fromEpochMilliseconds(42n), "number");
18 assert.throws(TypeError, () => Temporal.Instant.fromEpochMilliseconds(Symbol()), "symbol");
19
20 reportCompare(0, 0);