| Index: lib/compiler/implementation/compiler.dart
|
| diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
|
| index f0e83debdde8babd1ab14f41d9ca46024330138b..5a78aebb613656459a9e50e4d5a1b8e179d72647 100644
|
| --- a/lib/compiler/implementation/compiler.dart
|
| +++ b/lib/compiler/implementation/compiler.dart
|
| @@ -162,6 +162,7 @@ abstract class Compiler implements DiagnosticListener {
|
| DietParserTask dietParser;
|
| ParserTask parser;
|
| PatchParserTask patchParser;
|
| + LibraryLoader libraryLoader;
|
| TreeValidatorTask validator;
|
| ResolverTask resolver;
|
| closureMapping.ClosureTask closureToClassMapper;
|
| @@ -207,6 +208,7 @@ abstract class Compiler implements DiagnosticListener {
|
| dietParser = new DietParserTask(this);
|
| parser = new ParserTask(this);
|
| patchParser = new PatchParserTask(this);
|
| + libraryLoader = new LibraryLoaderTask(this);
|
| validator = new TreeValidatorTask(this);
|
| resolver = new ResolverTask(this);
|
| closureToClassMapper = new closureMapping.ClosureTask(this);
|
| @@ -394,31 +396,12 @@ abstract class Compiler implements DiagnosticListener {
|
|
|
| void loadCoreImplLibrary() {
|
| Uri coreImplUri = new Uri.fromComponents(scheme: 'dart', path: 'coreimpl');
|
| - coreImplLibrary = scanner.loadLibrary(coreImplUri, null, coreImplUri);
|
| + coreImplLibrary = libraryLoader.loadLibrary(coreImplUri, null, coreImplUri);
|
| }
|
|
|
| void importHelperLibrary(LibraryElement library) {
|
| if (jsHelperLibrary !== null) {
|
| - scanner.importLibrary(library, jsHelperLibrary, null);
|
| - }
|
| - }
|
| -
|
| - void importCoreLibrary(LibraryElement library) {
|
| - if (coreLibrary === null) {
|
| - Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core');
|
| - coreLibrary = scanner.loadLibrary(coreUri, null, coreUri);
|
| - }
|
| - scanner.importLibrary(library,
|
| - coreLibrary,
|
| - null,
|
| - library.entryCompilationUnit);
|
| - }
|
| -
|
| - void patchDartLibrary(LibraryElement library, String dartLibraryPath) {
|
| - if (library.isPatched) return;
|
| - Uri patchUri = resolvePatchUri(dartLibraryPath);
|
| - if (patchUri !== null) {
|
| - patchParser.patchLibrary(patchUri, library);
|
| + libraryLoader.importLibrary(this, library, jsHelperLibrary, null);
|
| }
|
| }
|
|
|
| @@ -465,7 +448,7 @@ abstract class Compiler implements DiagnosticListener {
|
| void runCompiler(Uri uri) {
|
| log('compiling $uri ($BUILD_ID)');
|
| scanBuiltinLibraries();
|
| - mainApp = scanner.loadLibrary(uri, null, uri);
|
| + mainApp = libraryLoader.loadLibrary(uri, null, uri);
|
| libraries.forEach((_, library) {
|
| maybeEnableJSHelper(library);
|
| });
|
| @@ -861,5 +844,8 @@ bool invariant(Spannable spannable, var condition, {String message: null}) {
|
| if (condition is Function){
|
| condition = condition();
|
| }
|
| + if (!condition && message != null) {
|
| + print('assertion failed: $message');
|
| + }
|
| return spannable != null && condition;
|
| }
|
|
|