diff options
Diffstat (limited to 'js/src/jit-test/tests/closures/nameinc-loop.js')
-rw-r--r-- | js/src/jit-test/tests/closures/nameinc-loop.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/closures/nameinc-loop.js b/js/src/jit-test/tests/closures/nameinc-loop.js new file mode 100644 index 000000000..33c89d12e --- /dev/null +++ b/js/src/jit-test/tests/closures/nameinc-loop.js @@ -0,0 +1,24 @@ +actual = ''; +expected = '1,2,3,4,5,5,1,2,3,4,5,5,1,2,3,4,5,5,1,2,3,4,5,5,1,2,3,4,5,5,1,2,3,4,5,5,1,2,3,4,5,5,1,2,3,4,5,5,1,2,3,4,5,5,1,2,3,4,5,5,'; + +for (var i = 0; i < 10; ++i) { + var f = function() { + var p = 0; + + function g() { + for (var i = 0; i < 5; ++i) { + p++; + appendToActual(p); + } + } + + g(); + + appendToActual(p); + } + f(); +} + + + +assertEq(actual, expected) |