Index: pkg/compiler/lib/src/enqueue.dart |
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart |
index 7de0de1819a8c3352f4abbfb2f26ea9ddda7e7a5..8963fb3b6256f6f4c50db6f1ba687171fec877c2 100644 |
--- a/pkg/compiler/lib/src/enqueue.dart |
+++ b/pkg/compiler/lib/src/enqueue.dart |
@@ -35,20 +35,19 @@ class EnqueueTask extends CompilerTask { |
EnqueueTask(Compiler compiler) |
: this.compiler = compiler, |
super(compiler.measurer) { |
- _resolution = new ResolutionEnqueuer( |
- this, |
- compiler.options, |
- compiler.reporter, |
- compiler.options.analyzeOnly && compiler.options.analyzeMain |
- ? const DirectEnqueuerStrategy() |
- : const TreeShakingEnqueuerStrategy(), |
- compiler.backend.resolutionEnqueuerListener, |
- new ElementResolutionWorldBuilder( |
- compiler.backend, compiler.resolution, const OpenWorldStrategy()), |
- new ResolutionWorkItemBuilder(compiler.resolution)); |
- } |
- |
- ResolutionEnqueuer get resolution => _resolution; |
+ createResolutionEnqueuer(); |
+ } |
+ |
+ ResolutionEnqueuer get resolution { |
+ assert(invariant(NO_LOCATION_SPANNABLE, _resolution != null, |
+ message: "ResolutionEnqueuer has not been created yet.")); |
+ return _resolution; |
+ } |
+ |
+ ResolutionEnqueuer createResolutionEnqueuer() { |
+ return _resolution ??= |
+ compiler.backend.createResolutionEnqueuer(this, compiler); |
+ } |
Enqueuer createCodegenEnqueuer(ClosedWorld closedWorld) { |
return compiler.backend.createCodegenEnqueuer(this, compiler, closedWorld); |