Index: pkg/compiler/lib/src/closure.dart |
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart |
index 2ae7bd0834f8299928f9fc134e72774a6f2c9520..c69a01510b29c4277aadc82cb45fd0e8f3636073 100644 |
--- a/pkg/compiler/lib/src/closure.dart |
+++ b/pkg/compiler/lib/src/closure.dart |
@@ -4,7 +4,7 @@ |
import 'common/names.dart' show Identifiers; |
import 'common/resolution.dart' show ParsingContext, Resolution; |
-import 'common/tasks.dart' show CompilerTask; |
+import 'common/tasks.dart' show CompilerTask, Measurer; |
import 'common.dart'; |
import 'compiler.dart' show Compiler; |
import 'constants/expressions.dart'; |
@@ -23,6 +23,15 @@ import 'tree/tree.dart'; |
import 'util/util.dart'; |
import 'world.dart' show ClosedWorldRefiner; |
+abstract class ClosureConversionTask<T> extends CompilerTask |
+ implements ClosureDataLookup<T> { |
+ ClosureConversionTask(Measurer measurer) : super(measurer); |
+ |
+ //void analyzeClosures(); |
+ void convertClosures(Iterable<MemberEntity> processedEntities, |
+ ClosedWorldRefiner closedWorldRefiner); |
+} |
+ |
/// Class that provides information for how closures are rewritten/represented |
/// to preserve Dart semantics when compiled to JavaScript. Given a particular |
/// node to look up, it returns a information about the internal representation |
@@ -198,7 +207,7 @@ class ClosureRepresentationInfo { |
bool get isClosure => false; |
} |
-class ClosureTask extends CompilerTask implements ClosureDataLookup<Node> { |
+class ClosureTask extends ClosureConversionTask<Node> { |
Map<Node, ClosureScope> _closureInfoMap = <Node, ClosureScope>{}; |
Map<Element, ClosureClassMap> _closureMappingCache = |
<Element, ClosureClassMap>{}; |
@@ -211,6 +220,11 @@ class ClosureTask extends CompilerTask implements ClosureDataLookup<Node> { |
DiagnosticReporter get reporter => compiler.reporter; |
+ void convertClosures(Iterable<MemberEntity> processedEntities, |
+ ClosedWorldRefiner closedWorldRefiner) { |
+ createClosureClasses(closedWorldRefiner); |
+ } |
+ |
ClosureAnalysisInfo getClosureAnalysisInfo(Node node) { |
var value = _closureInfoMap[node]; |
return value == null ? const ClosureAnalysisInfo() : value; |