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

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

Issue 2009773004: Remove reference to compiler from libary loader, fix analyzer warning (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « pkg/compiler/lib/src/js_backend/no_such_method_registry.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/library_loader.dart
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index 2df480edf34e5b481538cd5cb3850320f3e05e26..3a2e2a33d287ef7cebdb6d437e2a95e3c3432e08 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -7,9 +7,8 @@ library dart2js.library_loader;
import 'dart:async';
import 'common/names.dart' show Uris;
-import 'common/tasks.dart' show CompilerTask, GenericTask;
+import 'common/tasks.dart' show CompilerTask, Measurer;
import 'common.dart';
-import 'compiler.dart' show Compiler;
import 'elements/elements.dart'
show
CompilationUnitElement,
@@ -115,8 +114,8 @@ typedef Future<Iterable<LibraryElement>> ReuseLibrariesFunction(
* A 'resource URI' is an absolute URI with a scheme supported by the input
* provider. For the standard implementation this means a URI with the 'file'
* scheme. Readable URIs are converted into resource URIs as part of the
- * [Compiler.readScript] method. In the standard implementation the package URIs
- * are converted to file URIs using the package root URI provided on the
+ * [ScriptLoader.readScript] method. In the standard implementation the package
+ * URIs are converted to file URIs using the package root URI provided on the
* command line as base. If the package root URI is
* 'file:///current/working/dir/' then the package URI 'package:foo/bar.dart'
* will be resolved to the resource URI
@@ -134,13 +133,14 @@ typedef Future<Iterable<LibraryElement>> ReuseLibrariesFunction(
*/
abstract class LibraryLoaderTask implements CompilerTask {
factory LibraryLoaderTask(
- Compiler compiler,
ResolvedUriTranslator uriTranslator,
ScriptLoader scriptLoader,
ElementScanner scriptScanner,
LibraryDeserializer deserializer,
LibraryLoaderListener listener,
- Environment environment) = _LibraryLoaderTask;
+ Environment environment,
+ DiagnosticReporter reporter,
+ Measurer measurer) = _LibraryLoaderTask;
/// Returns all libraries that have been loaded.
Iterable<LibraryElement> get libraries;
@@ -297,13 +297,12 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
/// conditional imports.
final Environment environment;
- final Compiler compiler;
- DiagnosticReporter get reporter => compiler.reporter;
+ final DiagnosticReporter reporter;
- _LibraryLoaderTask(Compiler compiler, this.uriTranslator, this.scriptLoader,
- this.scanner, this.deserializer, this.listener, this.environment)
- : compiler = compiler,
- super(compiler.measurer);
+ _LibraryLoaderTask(this.uriTranslator, this.scriptLoader,
+ this.scanner, this.deserializer, this.listener, this.environment,
+ this.reporter, Measurer measurer)
+ : super(measurer);
String get name => 'LibraryLoader';
@@ -386,7 +385,7 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
// Wrap in Future to shield against errors in user code.
return reuseLibraries(libraryCanonicalUriMap.values);
}).catchError((exception, StackTrace trace) {
- compiler.reportCrashInUserCode(
+ reporter.onCrashInUserCode(
'Uncaught exception in reuseLibraries', exception, trace);
throw exception; // Async rethrow.
}).then((Iterable<LibraryElement> reusedLibraries) {
« no previous file with comments | « pkg/compiler/lib/src/js_backend/no_such_method_registry.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698