mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
Previously, "nested" time zone property bags were unwrapped up to one level. That is, this object: { timeZone: { // ...Temporal.TimeZone methods } } would not be considered to implement the TimeZone protocol, but would have its timeZone property used instead, if it were passed to an API that required a TimeZone protocol object. These nested property bags are no longer supported. Discussion: https://github.com/tc39/proposal-temporal/issues/2104#issuecomment-1409549753 Corresponding normative PR: https://github.com/tc39/proposal-temporal/pull/2485
21 lines
572 B
JavaScript
21 lines
572 B
JavaScript
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-temporal.zoneddatetime.from
|
|
description: Negative zero, as an extended year, is rejected
|
|
features: [Temporal, arrow-function]
|
|
---*/
|
|
|
|
const invalidStrings = [
|
|
"-000000-10-31T17:45Z",
|
|
"-000000-10-31T17:45+00:00[UTC]",
|
|
];
|
|
invalidStrings.forEach((timeZone) => {
|
|
assert.throws(
|
|
RangeError,
|
|
() => Temporal.ZonedDateTime.from({ year: 2000, month: 5, day: 2, timeZone }),
|
|
"reject minus zero as extended year"
|
|
);
|
|
});
|