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

Unified Diff: pkg/compiler/lib/src/closure.dart

Issue 2975573002: Lookup getClosureScope by member instead of node (Closed)
Patch Set: Cleanup 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/compiler/lib/src/js_model/closure.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_model/closure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698