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

Unified Diff: pkg/dev_compiler/lib/src/js_ast/nodes.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/compiler/js_metalet.dart ('k') | pkg/dev_compiler/lib/src/js_ast/template.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/js_ast/nodes.dart
diff --git a/pkg/dev_compiler/lib/src/js_ast/nodes.dart b/pkg/dev_compiler/lib/src/js_ast/nodes.dart
index 354e4f69115119211e029b41d5fc04cc0216e2b4..8317fdbeeaebb766f1c29d738902e6889b515de4 100644
--- a/pkg/dev_compiler/lib/src/js_ast/nodes.dart
+++ b/pkg/dev_compiler/lib/src/js_ast/nodes.dart
@@ -709,11 +709,16 @@ abstract class Expression extends Node {
Statement toStatement() => new ExpressionStatement(toVoidExpression());
Statement toReturn() => new Return(this);
+
+ // TODO(jmesserly): make this return a Yield?
Statement toYieldStatement({bool star: false}) =>
new ExpressionStatement(new Yield(this, star: star));
Expression toVoidExpression() => this;
- Expression toAssignExpression(Expression left) => new Assignment(left, this);
+ Expression toAssignExpression(Expression left, [String op]) =>
+ new Assignment.compound(left, op, this);
+
+ // TODO(jmesserly): make this work for more cases?
Statement toVariableDeclaration(Identifier name) =>
new VariableDeclarationList(
'let', [new VariableInitialization(name, this)]).toStatement();
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/js_metalet.dart ('k') | pkg/dev_compiler/lib/src/js_ast/template.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698