diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-08-28 15:29:58 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-08-28 15:29:58 +0300 |
commit | 7fcb6bcb1270d1688512e25704125edb5b35b3c5 (patch) | |
tree | 6c0b5b40cd2731d8f6f15eae6f816571ef05adcd /lib/output.js | |
parent | ce8e8d57c0d346dba9527b7a11b03364ce9ad1bb (diff) | |
download | tracifyjs-7fcb6bcb1270d1688512e25704125edb5b35b3c5.tar.gz tracifyjs-7fcb6bcb1270d1688512e25704125edb5b35b3c5.zip |
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`)
Diffstat (limited to 'lib/output.js')
-rw-r--r-- | lib/output.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/output.js b/lib/output.js index 1d9e5015..7cd3e3c0 100644 --- a/lib/output.js +++ b/lib/output.js @@ -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; |