LibJS: Adjust order of operations in ISO{Date,MonthDay}FromFields

This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/7dd90dc
This commit is contained in:
Linus Groh
2022-06-15 00:45:31 +01:00
parent 3bc54ac75a
commit 569c2dc1d0
Notes: sideshowbarker 2024-07-17 10:10:26 +09:00
8 changed files with 32 additions and 40 deletions

View File

@@ -113,13 +113,13 @@ describe("errors", () => {
test("missing fields", () => {
expect(() => {
Temporal.PlainDateTime.from({});
}).toThrowWithMessage(TypeError, "Required property year is missing or undefined");
}).toThrowWithMessage(TypeError, "Required property day is missing or undefined");
expect(() => {
Temporal.PlainDateTime.from({ year: 0 });
Temporal.PlainDateTime.from({ year: 0, day: 1 });
}).toThrowWithMessage(TypeError, "Required property month is missing or undefined");
expect(() => {
Temporal.PlainDateTime.from({ year: 0, month: 1 });
}).toThrowWithMessage(TypeError, "Required property day is missing or undefined");
Temporal.PlainDateTime.from({ month: 1, day: 1 });
}).toThrowWithMessage(TypeError, "Required property year is missing or undefined");
});
test("with 'reject' overflow option", () => {