1
Fork 0
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:
Andreas Kling 2020-03-29 01:08:25 +01:00
parent 62d5f79388
commit f95a119627
3 changed files with 36 additions and 0 deletions

View 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);
}