1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
var _quit; function testNestedDeepBail() { _quit = false; function loop() { for (var i = 0; i < 4; i++) ; } loop(); function f() { loop(); _quit = true; } var stk = [[1], [], [], [], []]; while (!_quit) stk.pop().forEach(f); } testNestedDeepBail();