diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/basic/function-tosource-statement.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/basic/function-tosource-statement.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,13 @@ +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) {}"); +assertEq(decompileBody(f2), ""); +function f3() { } +assertEq(f3.toString(), "function f3() { }"); +assertEq(decompileBody(f3), " ");