summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/function-tosource-statement.js
blob: e5d1bb7c24b8b368de704c8f85020bec79952224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function f1(a, b) {
    return a + b;
}
assertEq(f1.toString(), "function f1(a, b) {\n    return a + b;\n}");
if (Function.prototype.toSource) {
    assertEq(f1.toSource(), f1.toString());
}
function f2(a, /* ))))pernicious comment */ b,
            c, // another comment((
            d) {}
assertEq(f2.toString(), "function f2(a, /* ))))pernicious comment */ b,\n            c, // another comment((\n            d) {}");
function f3() { }
assertEq(f3.toString(), "function f3() { }");