more optimizations for some break/continue cases

This commit is contained in:
Mihai Bazon
2012-10-18 15:14:57 +03:00
parent 6aa56f92fe
commit afb7faa6fa
5 changed files with 216 additions and 9 deletions

View File

@@ -929,10 +929,10 @@ TreeWalker.prototype = {
} else {
for (var i = stack.length; --i >= 0;) {
var x = stack[i];
if (x instanceof AST_Switch) return x;
if (x instanceof AST_For || x instanceof AST_ForIn || x instanceof AST_DWLoop) {
return (x.body instanceof AST_BlockStatement ? x.body : x);
}
if (x instanceof AST_Switch
|| x instanceof AST_For
|| x instanceof AST_ForIn
|| x instanceof AST_DWLoop) return x;
}
}
}