| 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 LibraryElement element = | 642 LibraryElement element = |
| 643 createLibrarySync(handler, script, resolvedUri); | 643 createLibrarySync(handler, script, resolvedUri); |
| 644 CompilationUnitElementX compilationUnit = element.entryCompilationUnit; | 644 CompilationUnitElementX compilationUnit = element.entryCompilationUnit; |
| 645 if (compilationUnit.partTag != null) { | 645 if (compilationUnit.partTag != null) { |
| 646 if (skipFileWithPartOfTag) { | 646 if (skipFileWithPartOfTag) { |
| 647 // TODO(johnniwinther): Avoid calling [Compiler.onLibraryCreated] | 647 // TODO(johnniwinther): Avoid calling [Compiler.onLibraryCreated] |
| 648 // for this library. | 648 // for this library. |
| 649 libraryCanonicalUriMap.remove(resolvedUri); | 649 libraryCanonicalUriMap.remove(resolvedUri); |
| 650 return null; | 650 return null; |
| 651 } | 651 } |
| 652 DiagnosticMessage error = reporter.withCurrentElement( | 652 if (importingLibrary == null) { |
| 653 compilationUnit, | 653 DiagnosticMessage error = reporter.withCurrentElement( |
| 654 () => reporter.createMessage( | 654 compilationUnit, |
| 655 compilationUnit.partTag, MessageKind.IMPORT_PART_OF)); | 655 () => reporter.createMessage( |
| 656 DiagnosticMessage info = reporter.withCurrentElement( | 656 compilationUnit.partTag, MessageKind.LOAD_PART_OF)); |
| 657 importingLibrary, | 657 reporter.reportError(error); |
| 658 () => reporter.createMessage( | 658 } else { |
| 659 node, | 659 DiagnosticMessage error = reporter.withCurrentElement( |
| 660 MessageKind.IMPORT_PART_OF_HERE)); | 660 compilationUnit, |
| 661 reporter.reportError(error, <DiagnosticMessage>[info]); | 661 () => reporter.createMessage( |
| 662 compilationUnit.partTag, MessageKind.IMPORT_PART_OF)); |
| 663 DiagnosticMessage info = reporter.withCurrentElement( |
| 664 importingLibrary, |
| 665 () => reporter.createMessage( |
| 666 node, |
| 667 MessageKind.IMPORT_PART_OF_HERE)); |
| 668 reporter.reportError(error, [info]); |
| 669 } |
| 662 } | 670 } |
| 663 return processLibraryTags(handler, element).then((_) { | 671 return processLibraryTags(handler, element).then((_) { |
| 664 reporter.withCurrentElement(element, () { | 672 reporter.withCurrentElement(element, () { |
| 665 handler.registerLibraryExports(element); | 673 handler.registerLibraryExports(element); |
| 666 }); | 674 }); |
| 667 return element; | 675 return element; |
| 668 }); | 676 }); |
| 669 }); | 677 }); |
| 670 }); | 678 }); |
| 671 } | 679 } |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 } | 1400 } |
| 1393 suffixes.add(const Link<Uri>().prepend(canonicalUri)); | 1401 suffixes.add(const Link<Uri>().prepend(canonicalUri)); |
| 1394 } | 1402 } |
| 1395 suffixChainMap[library] = suffixes; | 1403 suffixChainMap[library] = suffixes; |
| 1396 return; | 1404 return; |
| 1397 } | 1405 } |
| 1398 | 1406 |
| 1399 computeSuffixes(rootLibrary, const Link<Uri>()); | 1407 computeSuffixes(rootLibrary, const Link<Uri>()); |
| 1400 } | 1408 } |
| 1401 } | 1409 } |
| OLD | NEW |