Chromium Code Reviews| Index: lib/src/codegen/js_codegen.dart |
| diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart |
| index 2e731517e2ac5d863f126823f623b3577a175d92..3b421f4e912f79c3d799512b4a9f32ca311efe4d 100644 |
| --- a/lib/src/codegen/js_codegen.dart |
| +++ b/lib/src/codegen/js_codegen.dart |
| @@ -1767,9 +1767,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator { |
| @override |
| JS.Block visitBlockFunctionBody(BlockFunctionBody node) { |
| var initArgs = _emitArgumentInitializers(node.parent); |
| - var block = visitBlock(node.block); |
| - if (initArgs != null) return new JS.Block([initArgs, block]); |
| - return block; |
| + var stmts = _visitList(node.block.statements) as List<JS.Statement>; |
| + if (initArgs != null) stmts.insert(0, initArgs); |
| + return new JS.Block(stmts); |
| } |
| @override |
| @@ -2932,7 +2932,8 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator { |
| } |
| } |
| - body.add(_visit(node.body)); |
| + body.add( |
| + new JS.Block(_visitList(node.body.statements) as List<JS.Statement>)); |
|
Leaf
2015/09/09 21:29:45
Will JS be ok with this hoisting if either the exc
Jennifer Messerly
2015/09/09 21:48:39
JS wouldn't care, unless we end up desugaring (_ca
Jennifer Messerly
2015/09/09 22:02:57
confirmed that it's spec'd that way.
|
| _catchParameter = savedCatch; |
| return _statement(body); |
| } |