mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibJS: Implement Object.getOwnPropertyNames()
This commit is contained in:
parent
62d5f79388
commit
f95a119627
Notes:
sideshowbarker
2024-07-19 08:05:06 +09:00
Author: https://github.com/awesomekling
Commit: f95a119627
3 changed files with 36 additions and 0 deletions
15
Libraries/LibJS/Tests/Object.getOwnPropertyNames.js
Normal file
15
Libraries/LibJS/Tests/Object.getOwnPropertyNames.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
function assert(x) { if (!x) throw 1; }
|
||||
|
||||
try {
|
||||
var names = Object.getOwnPropertyNames([1, 2, 3]);
|
||||
|
||||
assert(names.length === 4);
|
||||
assert(names[0] === '0');
|
||||
assert(names[1] === '1');
|
||||
assert(names[2] === '2');
|
||||
assert(names[3] === 'length');
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue