LibJS: Remove fallback value for get_offset_nanoseconds_for

This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/664f02d

Note that the tests are not comprehensive.
This commit is contained in:
Luke Wilde
2021-11-17 09:37:53 +00:00
committed by Linus Groh
parent f1784c9c87
commit 3666d2132b
Notes: sideshowbarker 2024-07-18 01:03:27 +09:00
20 changed files with 140 additions and 15 deletions

View File

@@ -170,3 +170,12 @@ describe("errors", () => {
}
});
});
describe("errors", () => {
test("custom time zone doesn't have a getOffsetNanosecondsFor function", () => {
const zonedDateTime = new Temporal.ZonedDateTime(0n, {});
expect(() => {
Temporal.PlainDateTime.from(zonedDateTime);
}).toThrowWithMessage(TypeError, "null is not a function");
});
});