1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 22:45:07 +00:00

LibJS: Do not trim whitespace from property names when they're numbers

Fixes #7803.
This commit is contained in:
sin-ack 2021-06-18 16:21:52 +00:00 committed by Linus Groh
parent 3abcfcc178
commit c5073cb287
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,7 @@
test("indexing the array doesn't strip whitespace if it's a number", () => {
var a = [];
a[1] = 1;
expect(a["1"]).toBe(1);
expect(a[" 1 "]).toBeUndefined();
});