mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
53
Libraries/LibJS/Tests/object-expression-numeric-property.js
Normal file
53
Libraries/LibJS/Tests/object-expression-numeric-property.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
test("numeric properties", () => {
|
||||
const i32Max = 2 ** 31 - 1;
|
||||
const u32Max = 2 ** 32 - 1;
|
||||
const o = {
|
||||
[-1]: "foo",
|
||||
0: "foo",
|
||||
1: "foo",
|
||||
[i32Max - 1]: "foo",
|
||||
[i32Max]: "foo",
|
||||
[i32Max + 1]: "foo",
|
||||
[u32Max - 1]: "foo",
|
||||
[u32Max]: "foo",
|
||||
[u32Max + 1]: "foo",
|
||||
};
|
||||
// Numeric properties come first in Object.getOwnPropertyNames()'s output,
|
||||
// which means we can test what each is treated as internally.
|
||||
expect(Object.getOwnPropertyNames(o)).toEqual([
|
||||
// Numeric properties
|
||||
"0",
|
||||
"1",
|
||||
"2147483646",
|
||||
"2147483647",
|
||||
"2147483648",
|
||||
"4294967294",
|
||||
// Non-numeric properties
|
||||
"-1",
|
||||
"4294967295", // >= 2^32 - 1
|
||||
"4294967296", // >= 2^32 - 1
|
||||
]);
|
||||
});
|
||||
|
||||
test("big int properties", () => {
|
||||
const o = {
|
||||
[-1n]: "foo",
|
||||
0n: "foo",
|
||||
1n: "foo",
|
||||
[12345678901n]: "foo",
|
||||
[4294967294n]: "foo",
|
||||
[4294967295n]: "foo",
|
||||
};
|
||||
// Numeric properties come first in Object.getOwnPropertyNames()'s output,
|
||||
// which means we can test what each is treated as internally.
|
||||
expect(Object.getOwnPropertyNames(o)).toEqual([
|
||||
// Numeric properties
|
||||
"0",
|
||||
"1",
|
||||
"4294967294",
|
||||
// Non-numeric properties
|
||||
"-1",
|
||||
"12345678901", // >= 2^32 - 1
|
||||
"4294967295", // >= 2^32 - 1
|
||||
]);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue