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

Unified Diff: sdk/lib/_internal/compiler/implementation/apiimpl.dart

Issue 21544003: Handle missing imports/exports/parts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add example to warning. Created 7 years, 4 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: sdk/lib/_internal/compiler/implementation/apiimpl.dart
diff --git a/sdk/lib/_internal/compiler/implementation/apiimpl.dart b/sdk/lib/_internal/compiler/implementation/apiimpl.dart
index 7923de79cc7ee4e5497d77c04f642dc5f814a8bb..b15631a731f36759687f7d903c369a7699cb3e02 100644
--- a/sdk/lib/_internal/compiler/implementation/apiimpl.dart
+++ b/sdk/lib/_internal/compiler/implementation/apiimpl.dart
@@ -170,14 +170,10 @@ class Compiler extends leg.Compiler {
// directly. In effect, we don't support truly asynchronous API.
text = deprecatedFutureValue(provider(resourceUri));
} catch (exception) {
- if (node != null) {
- cancel("$exception", node: node);
- } else {
- reportError(
- null,
- leg.MessageKind.GENERIC, {'text': 'Error: $exception'});
- throw new leg.CompilerCancelledException("$exception");
- }
+ reportError(node,
+ leg.MessageKind.READ_SCRIPT_ERROR,
+ {'uri': readableUri, 'exception': exception});
+ return null;
}
SourceFile sourceFile = new SourceFile(resourceUri.toString(), text);
// We use [readableUri] as the URI for the script since need to preserve
@@ -216,34 +212,23 @@ class Compiler extends leg.Compiler {
}
}
if (!allowInternalLibraryAccess) {
- if (node != null && importingLibrary != null) {
+ if (importingLibrary != null) {
reportError(
node,
- leg.MessageKind.GENERIC,
- {'text':
- 'Error: Internal library $resolvedUri is not accessible from '
- '${importingLibrary.canonicalUri}.'});
+ leg.MessageKind.INTERNAL_LIBRARY_FROM,
+ {'resolvedUri': resolvedUri,
+ 'importingUri': importingLibrary.canonicalUri});
} else {
reportError(
- null,
- leg.MessageKind.GENERIC,
- {'text':
- 'Error: Internal library $resolvedUri is not accessible.'});
+ node,
+ leg.MessageKind.INTERNAL_LIBRARY,
+ {'resolvedUri': resolvedUri});
}
}
}
if (path == null) {
- if (node != null) {
- reportFatalError(
- node,
- leg.MessageKind.GENERIC,
- {'text': 'Error: Library not found ${resolvedUri}.'});
- } else {
- reportFatalError(
- null,
- leg.MessageKind.GENERIC,
- {'text': 'Error: Library not found ${resolvedUri}.'});
- }
+ reportError(node, leg.MessageKind.LIBRARY_NOT_FOUND,
+ {'resolvedUri': resolvedUri});
return null;
}
if (resolvedUri.path == 'html' ||

Powered by Google App Engine
This is Rietveld 408576698