ladybird/Libraries/LibJS/Tests/function-length.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

15 lines
324 B
JavaScript

try {
function foo() { }
assert(foo.length === 0);
assert((foo.length = 5) === 5);
assert(foo.length === 0);
function bar(a, b, c) {}
assert(bar.length === 3);
assert((bar.length = 5) === 5);
assert(bar.length === 3);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}