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

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

Issue 1564803002: Specialize message for parts as entry point (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
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 0c585aca42b7e2ab05f5a703fed4793ca0410e54..ca4b23fbab0b98ebb08ddd69a7f3ff06f3e5d345 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -649,16 +649,24 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
libraryCanonicalUriMap.remove(resolvedUri);
return null;
}
- DiagnosticMessage error = reporter.withCurrentElement(
- compilationUnit,
- () => reporter.createMessage(
- compilationUnit.partTag, MessageKind.IMPORT_PART_OF));
- DiagnosticMessage info = reporter.withCurrentElement(
- importingLibrary,
- () => reporter.createMessage(
- node,
- MessageKind.IMPORT_PART_OF_HERE));
- reporter.reportError(error, <DiagnosticMessage>[info]);
+ if (importingLibrary == null) {
+ DiagnosticMessage error = reporter.withCurrentElement(
+ compilationUnit,
+ () => reporter.createMessage(
+ compilationUnit.partTag, MessageKind.LOAD_PART_OF));
+ reporter.reportError(error);
+ } else {
+ DiagnosticMessage error = reporter.withCurrentElement(
+ compilationUnit,
+ () => reporter.createMessage(
+ compilationUnit.partTag, MessageKind.IMPORT_PART_OF));
+ DiagnosticMessage info = reporter.withCurrentElement(
+ importingLibrary,
+ () => reporter.createMessage(
+ node,
+ MessageKind.IMPORT_PART_OF_HERE));
+ reporter.reportError(error, [info]);
+ }
}
return processLibraryTags(handler, element).then((_) {
reporter.withCurrentElement(element, () {

Powered by Google App Engine
This is Rietveld 408576698