ladybird/Libraries/LibJS/Tests/Object.getOwnPropertyNames.js
Brian Gianforcaro bc40908d32 LibJS: Use the native assert() implementation now avaiable in 'js -t'
Switch the LibJS test suite to use the native assert implementation
surfaced inside the js repl when it's launched in test mode.
2020-04-05 15:28:45 +02:00

13 lines
292 B
JavaScript

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