Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Temporal / PlainDateTime / prototype / since / argument-string-calendar-annotation-invalid-key.js
blobb5b7f9ce2c18e7d2fdb75e2974dc4930b7f846dc
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2024 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 esid: sec-temporal.plaindatetime.prototype.since
7 description: Annotation keys are lowercase-only
8 features: [Temporal]
9 ---*/
11 const invalidStrings = [
12   ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
13   ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
14   ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
16 const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
17 invalidStrings.forEach(([arg, descr]) => {
18   assert.throws(
19     RangeError,
20     () => instance.since(arg),
21     `annotation keys must be lowercase: ${arg} - ${descr}`
22   );
23 });
25 reportCompare(0, 0);