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

Unified Diff: pkg/dev_compiler/lib/src/compiler/code_generator.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 | « no previous file | pkg/dev_compiler/lib/src/compiler/js_metalet.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
index 30a3ea6c827763181a91b982de7edeab77bf9edb..b95cbfc2f6200a487bdd925acdc0a68511cedef1 100644
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
@@ -2652,7 +2652,7 @@ class CodeGenerator extends Object
fn.typeParams,
new JS.Block([
// Convert the function to an => function, to ensure `this` binding.
- new JS.Return(_toArrowFunction(fn))
+ _toArrowFunction(fn).toReturn()
]));
}
@@ -3422,7 +3422,8 @@ class CodeGenerator extends Object
var savedFunction = _currentFunction;
_currentFunction = node;
var initArgs = _emitArgumentInitializers(node.parent);
- var ret = annotate(new JS.Return(_visit(node.expression)), node.expression);
+ var ret = annotate(
+ _visit<JS.Expression>(node.expression).toReturn(), node.expression);
_currentFunction = savedFunction;
var _statements = initArgs != null ? [initArgs, ret] : [ret];
var block = annotate(new JS.Block(_statements), node);
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/js_metalet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698