diff options
Diffstat (limited to 'js/src/jit-test/tests/basic/testGeneratorDeepBail.js')
-rw-r--r-- | js/src/jit-test/tests/basic/testGeneratorDeepBail.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testGeneratorDeepBail.js b/js/src/jit-test/tests/basic/testGeneratorDeepBail.js new file mode 100644 index 0000000000..29abc8b1e1 --- /dev/null +++ b/js/src/jit-test/tests/basic/testGeneratorDeepBail.js @@ -0,0 +1,11 @@ +function testGeneratorDeepBail() { + function* g() { yield 2; } + var iterables = [[1], [], [], [], g()]; + + var total = 0; + for (let i = 0; i < iterables.length; i++) + for (let j of iterables[i]) + total += j; + return total; +} +assertEq(testGeneratorDeepBail(), 3); |