-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporal: Add tests for ZonedDateTime to PlainDate conversion.
Also rename leap second tests for consistency.
- Loading branch information
Showing
46 changed files
with
437 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.dateadd | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.dateAdd(arg, new Temporal.Duration())); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/day/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.day | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.day(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.dayofweek | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.dayOfWeek(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.dayofyear | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.dayOfYear(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.daysinmonth | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.daysInMonth(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.daysinweek | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.daysInWeek(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.daysinyear | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.daysInYear(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.inleapyear | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.inLeapYear(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/month/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.month | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.month(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/monthCode/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.monthcode | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.monthCode(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.monthsinyear | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.monthsInYear(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.weekofyear | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.weekOfYear(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Calendar/prototype/year/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.calendar.prototype.year | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Calendar("iso8601"); | ||
|
||
assert.throws(Test262Error, () => instance.year(arg)); |
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.duration.prototype.round | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.Duration(0, 0, 0, 365); | ||
|
||
assert.throws(Test262Error, () => instance.round({ relativeTo: arg, largestUnit: "years" })); |
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/PlainDate/prototype/equals/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.plaindate.prototype.equals | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.PlainDate(1976, 11, 18); | ||
|
||
assert.throws(Test262Error, () => instance.equals(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/PlainDate/prototype/since/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.plaindate.prototype.since | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.PlainDate(1976, 11, 18); | ||
|
||
assert.throws(Test262Error, () => instance.since(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
test/built-ins/Temporal/PlainDate/prototype/until/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.plaindate.prototype.until | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.PlainDate(1976, 11, 18); | ||
|
||
assert.throws(Test262Error, () => instance.until(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
...uilt-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.plaindatetime.prototype.withplaindate | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); | ||
|
||
assert.throws(Test262Error, () => instance.withPlainDate(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
.../built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.plaintime.prototype.toplaindatetime | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); | ||
|
||
assert.throws(Test262Error, () => instance.toPlainDateTime(arg)); |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
.../built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-zoneddatetime-convert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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.plaintime.prototype.tozoneddatetime | ||
description: An exception from TimeZone#getOffsetNanosecondsFor() is propagated. | ||
features: [Temporal] | ||
---*/ | ||
|
||
class TZ extends Temporal.TimeZone { | ||
constructor() { super("UTC") } | ||
getOffsetNanosecondsFor() { throw new Test262Error() } | ||
} | ||
|
||
const tz = new TZ(); | ||
const arg = new Temporal.ZonedDateTime(0n, tz); | ||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); | ||
|
||
assert.throws(Test262Error, () => instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" })); |
File renamed without changes.
Oops, something went wrong.