diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/basic/bug511241.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/bug511241.js b/js/src/jit-test/tests/basic/bug511241.js new file mode 100644 index 0000000000..fe28febb93 --- /dev/null +++ b/js/src/jit-test/tests/basic/bug511241.js @@ -0,0 +1,15 @@ +var d = 1; +function heavy(x) { + eval(x); + return function lite() { + var s = 0; + for (var i = 0; i < 9; i++) + s += d; + return s; + }; +} + +var f1 = heavy("1"); +var f2 = heavy("var d = 100;"); +assertEq(f1(), 9); +assertEq(f2(), 900); |