Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Instant/from/argument-string-unknown-annotation.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) 2022 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.instant.from
7 description: Various forms of unknown annotation
8 features: [Temporal]
9 ---*/
10
11 const tests = [
12 ["1970-01-01T00:00Z[foo=bar]", "alone"],
13 ["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
14 ["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
15 ["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
16 ["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
17 ];
18
19 tests.forEach(([arg, description]) => {
20 const result = Temporal.Instant.from(arg);
21
22 assert.sameValue(
23 result.epochNanoseconds,
24 0n,
25 `unknown annotation (${description})`
26 );
27 });
28
29 reportCompare(0, 0);