mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
LibJS: Implement Object.getOwnPropertyNames()
This commit is contained in:
parent
62d5f79388
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