mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:17:44 +00:00
LibJS: Start implementing ShadowRealm
This commit adds the ShadowRealm object itself, its constructor, and prototype (currently empty).
This commit is contained in:
parent
50f8755792
commit
d40331ef69
10 changed files with 216 additions and 0 deletions
|
@ -0,0 +1,20 @@
|
|||
describe("errors", () => {
|
||||
test("called without new", () => {
|
||||
expect(() => {
|
||||
ShadowRealm();
|
||||
}).toThrowWithMessage(TypeError, "ShadowRealm constructor must be called with 'new'");
|
||||
});
|
||||
});
|
||||
|
||||
describe("normal behavior", () => {
|
||||
test("length is 0", () => {
|
||||
expect(ShadowRealm).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const shadowRealm = new ShadowRealm();
|
||||
expect(typeof shadowRealm).toBe("object");
|
||||
expect(shadowRealm).toBeInstanceOf(ShadowRealm);
|
||||
expect(Object.getPrototypeOf(shadowRealm)).toBe(ShadowRealm.prototype);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue