| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js.library_loader; | 5 library dart2js.library_loader; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'common/names.dart' show Uris; | 9 import 'common/names.dart' show Uris; |
| 10 import 'common/tasks.dart' show CompilerTask, Measurer; | 10 import 'common/tasks.dart' show CompilerTask, Measurer; |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 return reporter.withCurrentElement(library, () { | 541 return reporter.withCurrentElement(library, () { |
| 542 checkDuplicatedLibraryName(library); | 542 checkDuplicatedLibraryName(library); |
| 543 | 543 |
| 544 // Import dart:core if not already imported. | 544 // Import dart:core if not already imported. |
| 545 if (!importsDartCore && library.canonicalUri != Uris.dart_core) { | 545 if (!importsDartCore && library.canonicalUri != Uris.dart_core) { |
| 546 return createLibrary(handler, null, Uris.dart_core) | 546 return createLibrary(handler, null, Uris.dart_core) |
| 547 .then((LibraryElement coreLibrary) { | 547 .then((LibraryElement coreLibrary) { |
| 548 handler.registerDependency( | 548 handler.registerDependency( |
| 549 library, | 549 library, |
| 550 new SyntheticImportElement( | 550 new SyntheticImportElement( |
| 551 library.entryCompilationUnit, Uris.dart_core), | 551 library.entryCompilationUnit, Uris.dart_core, coreLibrary), |
| 552 coreLibrary); | 552 coreLibrary); |
| 553 }); | 553 }); |
| 554 } | 554 } |
| 555 }); | 555 }); |
| 556 }).then((_) { | 556 }).then((_) { |
| 557 return Future.forEach(libraryDependencies.toList(), | 557 return Future.forEach(libraryDependencies.toList(), |
| 558 (LibraryDependencyElementX libraryDependency) { | 558 (LibraryDependencyElementX libraryDependency) { |
| 559 return reporter.withCurrentElement(library, () { | 559 return reporter.withCurrentElement(library, () { |
| 560 return registerLibraryFromImportExport( | 560 return registerLibraryFromImportExport( |
| 561 handler, library, libraryDependency); | 561 handler, library, libraryDependency); |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 Future onLibrariesLoaded(LoadedLibraries results); | 1518 Future onLibrariesLoaded(LoadedLibraries results); |
| 1519 | 1519 |
| 1520 /// Called whenever a library element is created. | 1520 /// Called whenever a library element is created. |
| 1521 void onLibraryCreated(LibraryElement library); | 1521 void onLibraryCreated(LibraryElement library); |
| 1522 | 1522 |
| 1523 /// Called whenever a library is scanned from a script file. | 1523 /// Called whenever a library is scanned from a script file. |
| 1524 Future onLibraryScanned(LibraryElement library, LibraryLoader loader); | 1524 Future onLibraryScanned(LibraryElement library, LibraryLoader loader); |
| 1525 } | 1525 } |
| 1526 | 1526 |
| 1527 const _reuseLibrarySubtaskName = "Reuse library"; | 1527 const _reuseLibrarySubtaskName = "Reuse library"; |
| OLD | NEW |