summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/closures/nameinc.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/closures/nameinc.js')
-rw-r--r--js/src/jit-test/tests/closures/nameinc.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/closures/nameinc.js b/js/src/jit-test/tests/closures/nameinc.js
new file mode 100644
index 0000000000..6909908913
--- /dev/null
+++ b/js/src/jit-test/tests/closures/nameinc.js
@@ -0,0 +1,21 @@
+actual = '';
+expected = '5,';
+
+function f() {
+ var p = 0;
+
+ function g() {
+ for (var i = 0; i < 5; ++i) {
+ p++;
+ }
+ }
+
+ g();
+
+ appendToActual(p);
+}
+
+f();
+
+
+assertEq(actual, expected)