diff options
Diffstat (limited to 'js/src/jit-test/tests/closures/nameinc-loop-missing.js')
-rw-r--r-- | js/src/jit-test/tests/closures/nameinc-loop-missing.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/closures/nameinc-loop-missing.js b/js/src/jit-test/tests/closures/nameinc-loop-missing.js new file mode 100644 index 000000000..72eae0e40 --- /dev/null +++ b/js/src/jit-test/tests/closures/nameinc-loop-missing.js @@ -0,0 +1,21 @@ +// |jit-test| error: ReferenceError + +for (var i = 0; i < 10; ++i) { + var f = function() { + var p = 0; + + function g() { + for (var i = 0; i < 5; ++i) { + p++; + x++; + print(p); + } + } + + g(); + + print(p); + } + f(); +} + |