| 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.dart'; | 9 import 'common.dart'; |
| 10 import 'common/names.dart' show | 10 import 'common/names.dart' show |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 * Handle a part tag in the scope of [library]. The [resolvedUri] given is | 570 * Handle a part tag in the scope of [library]. The [resolvedUri] given is |
| 571 * used as is, any URI resolution should be done beforehand. | 571 * used as is, any URI resolution should be done beforehand. |
| 572 */ | 572 */ |
| 573 Future scanPart(Part part, Uri resolvedUri, LibraryElement library) { | 573 Future scanPart(Part part, Uri resolvedUri, LibraryElement library) { |
| 574 if (!resolvedUri.isAbsolute) throw new ArgumentError(resolvedUri); | 574 if (!resolvedUri.isAbsolute) throw new ArgumentError(resolvedUri); |
| 575 Uri readableUri = uriTranslator.translate(library, resolvedUri, part); | 575 Uri readableUri = uriTranslator.translate(library, resolvedUri, part); |
| 576 if (readableUri == null) return new Future.value(); | 576 if (readableUri == null) return new Future.value(); |
| 577 return reporter.withCurrentElement(library, () { | 577 return reporter.withCurrentElement(library, () { |
| 578 return scriptLoader.readScript(readableUri, part).then((Script script) { | 578 return scriptLoader.readScript(readableUri, part).then((Script script) { |
| 579 if (script == null) return; | 579 if (script == null) return; |
| 580 return createUnitSync(script, library); | 580 createUnitSync(script, library); |
| 581 }); | 581 }); |
| 582 }); | 582 }); |
| 583 } | 583 } |
| 584 | 584 |
| 585 /** | 585 /** |
| 586 * Handle an import/export tag by loading the referenced library and | 586 * Handle an import/export tag by loading the referenced library and |
| 587 * registering its dependency in [handler] for the computation of the import/ | 587 * registering its dependency in [handler] for the computation of the import/ |
| 588 * export scope. If the tag does not contain a valid URI, then its dependency | 588 * export scope. If the tag does not contain a valid URI, then its dependency |
| 589 * is not registered in [handler]. | 589 * is not registered in [handler]. |
| 590 */ | 590 */ |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 /// Called after a request to load a library. The [results] will include all | 1517 /// Called after a request to load a library. The [results] will include all |
| 1518 /// transitive libraries loaded as a result of the initial request. | 1518 /// transitive libraries loaded as a result of the initial request. |
| 1519 Future onLibrariesLoaded(LoadedLibraries results); | 1519 Future onLibrariesLoaded(LoadedLibraries results); |
| 1520 | 1520 |
| 1521 /// Called whenever a library element is created. | 1521 /// Called whenever a library element is created. |
| 1522 void onLibraryCreated(LibraryElement library); | 1522 void onLibraryCreated(LibraryElement library); |
| 1523 | 1523 |
| 1524 /// Called whenever a library is scanned from a script file. | 1524 /// Called whenever a library is scanned from a script file. |
| 1525 Future onLibraryScanned(LibraryElement library, LibraryLoader loader); | 1525 Future onLibraryScanned(LibraryElement library, LibraryLoader loader); |
| 1526 } | 1526 } |
| OLD | NEW |