summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/function-missing-arg.js
blob: 39c10b6649d8ee715f4c4cddbb7e7a0ab8a982f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
load("test-common.js");

function foo(a, b) { return a + b; }

try {
    assert(isNaN(foo()) === true);
    assert(isNaN(foo(1)) === true);
    assert(foo(2, 3) === 5);
    assert(foo(2, 3, 4) === 5);
    console.log("PASS");
} catch (e) {
    console.log("FAIL: " + e);
}