diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/jaeger/bug663910.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/jaeger/bug663910.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,22 @@ +var otherGlobalSameCompartment = newGlobal("same-compartment"); +eval = otherGlobalSameCompartment.eval; +doesNotNeedParens(1, "if (xx) { }"); +needParens(2, "if (1, xx) { }"); +function doesNotNeedParens(section, pat) { + try { + f = new Function + } catch (e) {} + roundTripTest(section, f) +} +function needParens(section, pat, exp) { + var f, ft; + roundTripTest(section, f, exp) +} +function roundTripTest(section, f, exp) { + uf = "" + f + var euf; + try { + euf = eval("(" + uf + ")"); + } catch (e) { } + + euf +}