mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:48:11 +00:00
LibJS: Allow BigInts as destructuring property names
These are simply treated as their numerical value which means that above 2^32 - 1 they are strings.
This commit is contained in:
parent
e663504df1
commit
fce2b33758
3 changed files with 37 additions and 1 deletions
|
@ -223,4 +223,11 @@ describe("evaluating", () => {
|
|||
expect(x).toBe("foo");
|
||||
expect(a).toBe(o.a);
|
||||
});
|
||||
|
||||
test("can use big int values as number-like properties", () => {
|
||||
let o = { "99999999999999999": 1 };
|
||||
let { 123n: a = "foo", 99999999999999999n: b = "bar" } = o;
|
||||
expect(a).toBe("foo");
|
||||
expect(b).toBe(1);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue