summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/function-tosource-statement.js
blob: c0c990e4f1125746ed754dd72a6719e068e50e1a (plain)
1
2
3
4
5
6
7
8
9
10
11
function f1(a, b) {
    return a + b;
}
assertEq(f1.toString(), "function f1(a, b) {\n    return a + b;\n}");
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() { }");