mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
LibJS: Implement WeakRef changes from 'Symbol as WeakMap Keys Proposal'
This commit is contained in:
parent
dbd0110721
commit
53ed8decaf
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