mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:27:46 +00:00
LibJS: Only allow TimeZone this value in Temporal.TimeZone#id
This is a normative change in the Temporal spec.
See: 2644fc6
This commit is contained in:
parent
803e96f0c5
commit
6c8c34ed6c
2 changed files with 10 additions and 5 deletions
|
@ -3,8 +3,12 @@ describe("correct behavior", () => {
|
|||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
expect(timeZone.id).toBe("UTC");
|
||||
});
|
||||
});
|
||||
|
||||
test("works with any this value", () => {
|
||||
expect(Reflect.get(Temporal.TimeZone.prototype, "id", "foo")).toBe("foo");
|
||||
describe("errors", () => {
|
||||
test("this value must be a Temporal.TimeZone object", () => {
|
||||
expect(() => {
|
||||
Reflect.get(Temporal.TimeZone.prototype, "id", "foo");
|
||||
}).toThrowWithMessage(TypeError, "Not an object of type Temporal.TimeZone");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue