summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/setCallEvalMiddle2.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/setCallEvalMiddle2.js')
-rw-r--r--js/src/jit-test/tests/basic/setCallEvalMiddle2.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/setCallEvalMiddle2.js b/js/src/jit-test/tests/basic/setCallEvalMiddle2.js
new file mode 100644
index 000000000..b93622f36
--- /dev/null
+++ b/js/src/jit-test/tests/basic/setCallEvalMiddle2.js
@@ -0,0 +1,18 @@
+eval(1); // avoid global shape change when we call eval below
+function q() {
+ var x = 1;
+ function f() {
+ function g() {
+ var t=0;
+ for (var i=0; i<3; i++)
+ x = i;
+ assertEq(x, 2);
+ eval("var x = 3");
+ };
+ g();
+ g();
+ assertEq(x, 2);
+ }
+ f();
+}
+q();