Index: pkg/compiler/lib/src/closure.dart |
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart |
index 5bdd71b6038b2462da84182c986a4cf119f19a6c..d22d470b2c30ec03f44d6b846bf6a60b1e523270 100644 |
--- a/pkg/compiler/lib/src/closure.dart |
+++ b/pkg/compiler/lib/src/closure.dart |
@@ -55,7 +55,7 @@ abstract class ClosureDataLookup<T> { |
LoopClosureScope getLoopClosureScope(T loopNode); |
/// Accessor to the information about closures that the SSA builder will use. |
- ClosureScope getClosureScope(T node); |
+ ClosureScope getClosureScope(MemberEntity entity); |
} |
/// Class that represents one level of scoping information, whether this scope |
@@ -267,11 +267,17 @@ class ClosureTask extends ClosureConversionTask<Node> { |
createClosureClasses(closedWorldRefiner); |
} |
- ClosureScope getClosureScope(Node node) { |
+ ClosureScope _getClosureScope(Node node) { |
var value = _closureInfoMap[node]; |
return value == null ? const ClosureScope() : value; |
} |
+ ClosureScope getClosureScope(covariant MemberElement member) { |
+ ResolvedAst resolvedAst = member.resolvedAst; |
+ if (resolvedAst.kind != ResolvedAstKind.PARSED) return const ClosureScope(); |
+ return _getClosureScope(resolvedAst.node); |
+ } |
+ |
ScopeInfo getScopeInfo(Element member) { |
return getClosureToClassMapping(member); |
} |