mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 08:06:09 +00:00
18 lines
365 B
JavaScript
18 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);
|
|
}
|