LibJS: Implement a nearly empty Intl.Locale object

This adds plumbing for the Intl.Locale object, constructor, and
prototype.
This commit is contained in:
Timothy Flynn 2021-09-02 08:32:43 -04:00 committed by Linus Groh
commit 2c10e9fdd3
Notes: sideshowbarker 2024-07-18 04:53:49 +09:00
12 changed files with 235 additions and 2 deletions

View file

@ -0,0 +1,3 @@
test("basic functionality", () => {
expect(Intl.Locale.prototype[Symbol.toStringTag]).toBe("Intl.Locale");
});

View file

@ -0,0 +1,13 @@
describe("errors", () => {
test("called without new", () => {
expect(() => {
Intl.Locale();
}).toThrowWithMessage(TypeError, "Intl.Locale constructor must be called with 'new'");
});
});
describe("normal behavior", () => {
test("length is 1", () => {
expect(Intl.Locale).toHaveLength(1);
});
});