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

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: Created 7 years, 5 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 9f24fc63d2d6ff54a701a543e3dd905a5e346d73..6e27c0b8cf98fe11d4eb29235e6beb9d087f7644 100644
--- a/sdk/lib/_internal/compiler/implementation/apiimpl.dart
+++ b/sdk/lib/_internal/compiler/implementation/apiimpl.dart
@@ -174,14 +174,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,
+ reportError(
+ node,
leg.MessageKind.GENERIC, {'text': 'Error: $exception'});
ahe 2013/08/06 15:01:00 Could you turn this into a non-generic message? F
Johnni Winther 2013/08/19 08:05:19 Done.
- throw new leg.CompilerCancelledException("$exception");
- }
+ return null;
}
SourceFile sourceFile = new SourceFile(resourceUri.toString(), text);
// We use [readableUri] as the URI for the script since need to preserve
@@ -220,34 +216,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