fix code generator for this case:

if (foo) {
  with (bar)
    if (baz)
      x();
} else y();

(the compressor removes the brackets since the consequent consists of a
single statement, but the codegen must include the brackets because
otherwise the `else` would refer to the inner `if`)
This commit is contained in:
Mihai Bazon
2012-08-28 15:29:58 +03:00
parent ce8e8d57c0
commit 7fcb6bcb12
2 changed files with 8 additions and 8 deletions

View File

@@ -611,10 +611,7 @@ function OutputStream(options) {
}
b = b.alternative;
}
else if (b instanceof AST_While
|| b instanceof AST_Do
|| b instanceof AST_For
|| b instanceof AST_ForIn) {
else if (b instanceof AST_StatementWithBody) {
b = b.body;
}
else break;