1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibJS: Add length property to ScriptFunction

This commit is contained in:
Linus Groh 2020-04-04 14:34:27 +01:00 committed by Andreas Kling
parent cd3e2690eb
commit 4d931b524d
3 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,17 @@
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);
}