1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 18:35:07 +00:00
serenity/Libraries/LibJS/Tests/function-length.js
2020-04-04 15:58:49 +02:00

17 lines
365 B
JavaScript

function assert(x) { if (!x) throw 1; }
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);
}