1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:07:45 +00:00

LibJS: Throw TypeError if Instant.prototype.round() options is undefined

This is a normative change in the Temporal spec.

See: 943018f
This commit is contained in:
Linus Groh 2021-09-01 00:20:45 +01:00
parent 38bef3e28e
commit e845e7c814
3 changed files with 28 additions and 13 deletions

View file

@ -30,6 +30,13 @@ describe("errors", () => {
}).toThrowWithMessage(TypeError, "Not a Temporal.Instant");
});
test("missing options object", () => {
expect(() => {
const instant = new Temporal.Instant(1n);
instant.round();
}).toThrowWithMessage(TypeError, "Required options object is missing or undefined");
});
test("invalid rounding mode", () => {
expect(() => {
const instant = new Temporal.Instant(1n);