mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS: Add DisposableStack{, Prototype, Constructor}
Since the async parts of the spec are not stage 3 at this point we don't add AsyncDisposableStack.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 11:06:06 +09:00
Author: https://github.com/davidot Commit: https://github.com/SerenityOS/serenity/commit/6255ca4a42 Pull-request: https://github.com/SerenityOS/serenity/pull/16630 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/linusg ✅
@@ -0,0 +1,18 @@
|
||||
test("constructor properties", () => {
|
||||
expect(DisposableStack).toHaveLength(0);
|
||||
expect(DisposableStack.name).toBe("DisposableStack");
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("called without new", () => {
|
||||
expect(() => {
|
||||
DisposableStack();
|
||||
}).toThrowWithMessage(TypeError, "DisposableStack constructor must be called with 'new'");
|
||||
});
|
||||
});
|
||||
|
||||
describe("normal behavior", () => {
|
||||
test("typeof", () => {
|
||||
expect(typeof new DisposableStack()).toBe("object");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user