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

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

Issue 1836033003: Fix exit_code_test after refactoring. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | tests/compiler/dart2js/exit_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index d7edb1ed28f291ff8bcd89a4a57ef6084946aa30..b49fdd03916ef1767819f098c47747ede473f614 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -401,7 +401,7 @@ abstract class Compiler implements LibraryLoaderListener {
tasks = [
dietParser = new DietParserTask(
this, enableConditionalDirectives: options.enableConditionalDirectives),
- scanner = new ScannerTask(this),
+ scanner = createScannerTask(),
serialization = new SerializationTask(this),
libraryLoader = new LibraryLoaderTask(this,
new _ResolvedUriTranslator(this),
@@ -414,7 +414,7 @@ abstract class Compiler implements LibraryLoaderListener {
enableConditionalDirectives: options.enableConditionalDirectives),
patchParser = new PatchParserTask(
this, enableConditionalDirectives: options.enableConditionalDirectives),
- resolver = new ResolverTask(this, backend.constantCompilerTask),
+ resolver = createResolverTask(),
closureToClassMapper = new closureMapping.ClosureTask(this),
checker = new TypeCheckerTask(this),
typesTask = new ti.TypesTask(this),
@@ -429,6 +429,18 @@ abstract class Compiler implements LibraryLoaderListener {
tasks.addAll(backend.tasks);
}
+ /// Creates the scanner task.
+ ///
+ /// Override this to mock the scanner for testing.
+ ScannerTask createScannerTask() => new ScannerTask(this);
+
+ /// Creates the resolver task.
+ ///
+ /// Override this to mock the resolver for testing.
+ ResolverTask createResolverTask() {
+ return new ResolverTask(this, backend.constantCompilerTask);
+ }
+
Universe get resolverWorld => enqueuer.resolution.universe;
Universe get codegenWorld => enqueuer.codegen.universe;
« no previous file with comments | « no previous file | tests/compiler/dart2js/exit_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698