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