mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:40:07 +00:00
Fix a pair of superficial issues in generated JS
1. Catch bodies were unconditionally wrapped in a block, even when they were already a block. 2. Finally was on a line by itself and indented incorrectly because of an extra newline. Bug: Change-Id: I006cd2841c159a0fc86501bfaf282c7ad4c0ab0b Reviewed-on: https://dart-review.googlesource.com/23580 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com> Commit-Queue: Kevin Millikin <kmillikin@google.com>
This commit is contained in:
parent
f84f656d56
commit
4f551306f5
|
@ -500,7 +500,7 @@ class Printer extends TypeScriptTypePrinter implements NodeVisitor {
|
|||
visitNestedExpression(node.declaration, EXPRESSION,
|
||||
newInForInit: false, newAtStatementBegin: false);
|
||||
out(")");
|
||||
blockBody(node.body, needsSeparation: false, needsNewline: true);
|
||||
blockBody(node.body, needsSeparation: false, needsNewline: false);
|
||||
}
|
||||
|
||||
visitSwitch(Switch node) {
|
||||
|
|
|
@ -3304,7 +3304,7 @@ class ProgramCompiler
|
|||
|
||||
var catchVarDecl = _emitVariableRef(_catchParameter);
|
||||
_catchParameter = savedCatch;
|
||||
return new JS.Catch(catchVarDecl, new JS.Block([catchBody]));
|
||||
return new JS.Catch(catchVarDecl, catchBody.toBlock());
|
||||
}
|
||||
|
||||
JS.Statement _catchClauseGuard(Catch node, JS.Statement otherwise) {
|
||||
|
|
Loading…
Reference in a new issue