Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 1305413006: fix readability regressions from previous block-scope CL (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698