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

Unified Diff: pkg/dev_compiler/lib/src/compiler/js_metalet.dart

Issue 2559883002: fixes #28032, await in cascade (Closed)
Patch Set: Created 4 years 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/test/codegen/language/await_in_cascade_test.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/js_metalet.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/js_metalet.dart b/pkg/dev_compiler/lib/src/compiler/js_metalet.dart
index 8e341fe5e341d6602dfd73da10405117002a7bb3..3645dc1e9b6d0b0579d0485b05bc3dc18235c6cc 100644
--- a/pkg/dev_compiler/lib/src/compiler/js_metalet.dart
+++ b/pkg/dev_compiler/lib/src/compiler/js_metalet.dart
@@ -333,6 +333,7 @@ class _YieldFinder extends BaseVisitor {
bool hasYield = false;
bool hasThis = false;
bool _nestedFunction = false;
+
@override
visitThis(This node) {
hasThis = true;
@@ -353,6 +354,7 @@ class _YieldFinder extends BaseVisitor {
@override
visitNode(Node node) {
- if (!hasYield) super.visitNode(node);
Jennifer Messerly 2016/12/07 21:57:20 DOH!
+ if (hasYield && hasThis) return; // found both, nothing more to do.
+ super.visitNode(node);
}
}
« no previous file with comments | « no previous file | pkg/dev_compiler/test/codegen/language/await_in_cascade_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698