summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/setCallEvalMiddle.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/setCallEvalMiddle.js')
-rw-r--r--js/src/jit-test/tests/basic/setCallEvalMiddle.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/setCallEvalMiddle.js b/js/src/jit-test/tests/basic/setCallEvalMiddle.js
new file mode 100644
index 000000000..71de2ac69
--- /dev/null
+++ b/js/src/jit-test/tests/basic/setCallEvalMiddle.js
@@ -0,0 +1,17 @@
+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;
+ };
+ g();
+ eval("var x = 3");
+ g();
+ assertEq(x, 2);
+ }
+ f();
+}
+q();