summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/Error.js
blob: ddf78f28a9a896ae1cfd41a86a475d065718c84b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
try {
    var e;

    e = Error();
    assert(e.name === "Error");
    assert(e.message === "");

    e = Error(undefined);
    assert(e.name === "Error");
    assert(e.message === "");

    e = Error("test");
    assert(e.name === "Error");
    assert(e.message === "test");

    e = Error(42);
    assert(e.name === "Error");
    assert(e.message === "42");

    e = Error(null);
    assert(e.name === "Error");
    assert(e.message === "null");

    console.log("PASS");
} catch (e) {
    console.log("FAIL: " + e);
}