1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/basic/function-tosource-statement.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,13 @@ 1.4 +function f1(a, b) { 1.5 + return a + b; 1.6 +} 1.7 +assertEq(f1.toString(), "function f1(a, b) {\n return a + b;\n}"); 1.8 +assertEq(f1.toSource(), f1.toString()); 1.9 +function f2(a, /* ))))pernicious comment */ b, 1.10 + c, // another comment(( 1.11 + d) {} 1.12 +assertEq(f2.toString(), "function f2(a, /* ))))pernicious comment */ b,\n c, // another comment((\n d) {}"); 1.13 +assertEq(decompileBody(f2), ""); 1.14 +function f3() { } 1.15 +assertEq(f3.toString(), "function f3() { }"); 1.16 +assertEq(decompileBody(f3), " ");