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

Unified Diff: pkg/dev_compiler/lib/src/js_ast/template.dart

Issue 2980113002: fix #27320, better DDC temp generation (Closed)
Patch Set: rebase Created 3 years, 5 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 | « pkg/dev_compiler/lib/src/js_ast/nodes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/js_ast/template.dart
diff --git a/pkg/dev_compiler/lib/src/js_ast/template.dart b/pkg/dev_compiler/lib/src/js_ast/template.dart
index 5ecb89ef819a832c3a193274ee841910d92c121f..7fd8b2d1bea19df0dd3cc810af11facc6aa19ea0 100644
--- a/pkg/dev_compiler/lib/src/js_ast/template.dart
+++ b/pkg/dev_compiler/lib/src/js_ast/template.dart
@@ -409,7 +409,7 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
Instantiator makeBody = visit(node.body);
return (arguments) {
return new For(makeInit(arguments), makeCondition(arguments),
- makeUpdate(arguments), makeBody(arguments));
+ makeUpdate(arguments)?.toVoidExpression(), makeBody(arguments));
};
}
@@ -460,8 +460,9 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
(arguments) => new Break(node.targetLabel);
Instantiator visitReturn(Return node) {
- Instantiator makeExpression = visitNullable(node.value);
- return (arguments) => new Return(makeExpression(arguments));
+ if (node.value == null) return (args) => new Return();
+ Instantiator makeExpression = visit(node.value);
+ return (args) => makeExpression(args).toReturn();
}
Instantiator visitDartYield(DartYield node) {
@@ -552,8 +553,8 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
String op = node.op;
Instantiator makeValue = visitNullable(node.value);
return (arguments) {
- return new Assignment.compound(
- makeLeftHandSide(arguments), op, makeValue(arguments));
+ return makeValue(arguments)
+ .toAssignExpression(makeLeftHandSide(arguments), op);
};
}
« no previous file with comments | « pkg/dev_compiler/lib/src/js_ast/nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698