diff options
Diffstat (limited to 'js/src/jit-test/tests/closures/setname-1.js')
-rw-r--r-- | js/src/jit-test/tests/closures/setname-1.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/closures/setname-1.js b/js/src/jit-test/tests/closures/setname-1.js new file mode 100644 index 000000000..63e3be3f4 --- /dev/null +++ b/js/src/jit-test/tests/closures/setname-1.js @@ -0,0 +1,26 @@ +actual = ''; +expected = '4,4,4,4,4,'; + +function f() { + var k = 0; + + function g() { + for (var i = 0; i < 5; ++i) { + k = i; + } + } + + function h() { + for (var i = 0; i < 5; ++i) { + appendToActual(k); + } + } + + g(); + h(); +} + +f(); + + +assertEq(actual, expected) |