mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 16:46:08 +00:00
LibJS: Implement WeakRef changes from 'Symbol as WeakMap Keys Proposal'
This commit is contained in:
parent
dbd0110721
commit
53ed8decaf
Notes:
sideshowbarker
2024-07-17 20:58:35 +09:00
Author: https://github.com/IdanHo
Commit: 53ed8decaf
Pull-request: https://github.com/SerenityOS/serenity/pull/14361
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/linusg ✅
6 changed files with 69 additions and 26 deletions
|
@ -8,7 +8,7 @@ describe("errors", () => {
|
|||
[-100, Infinity, NaN, 152n, undefined].forEach(value => {
|
||||
expect(() => {
|
||||
new WeakRef(value);
|
||||
}).toThrowWithMessage(TypeError, "is not an object");
|
||||
}).toThrowWithMessage(TypeError, "cannot be held weakly");
|
||||
});
|
||||
});
|
||||
test("called without new", () => {
|
||||
|
@ -27,4 +27,9 @@ describe("normal behavior", () => {
|
|||
var a = new WeakRef({});
|
||||
expect(a instanceof WeakRef).toBeTrue();
|
||||
});
|
||||
|
||||
test("constructor with single symbol argument", () => {
|
||||
var a = new WeakRef(Symbol());
|
||||
expect(a instanceof WeakRef).toBeTrue();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue