Chromium Code Reviews| 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); |
| } |
| } |