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

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

Issue 10382195: Don't report an internal error if attempting to compile a file that doesn't exist. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/apiimpl.dart
diff --git a/dart/lib/compiler/implementation/apiimpl.dart b/dart/lib/compiler/implementation/apiimpl.dart
index e805971029c4f60cc0a77e53c6554d198bbb408c..0064d06235a0abe25958284120fe437a80fa25cd 100644
--- a/dart/lib/compiler/implementation/apiimpl.dart
+++ b/dart/lib/compiler/implementation/apiimpl.dart
@@ -37,7 +37,7 @@ class Compiler extends leg.Compiler {
handler(null, null, null, message, false);
}
- leg.Script readScript(Uri uri, [tree.ScriptTag node]) {
+ leg.Script readScript(Uri uri, [tree.Node node]) {
if (uri.scheme == 'dart') {
uri = translateDartUri(uri, node);
} else if (uri.scheme == 'package') {
@@ -49,13 +49,19 @@ class Compiler extends leg.Compiler {
// directly. In effect, we don't support truly asynchronous API.
text = provider(uri).value;
} catch (var exception) {
- cancel("${uri}: $exception", node: node);
+ if (node !== null) {
+ cancel("$exception", node: node);
+ } else {
+ reportDiagnostic(const leg.SourceSpan(null, null, null),
+ "$exception", true);
+ throw new leg.CompilerCancelledException("$exception");
+ }
}
SourceFile sourceFile = new SourceFile(uri.toString(), text);
return new leg.Script(uri, sourceFile);
}
- translateDartUri(Uri uri, tree.ScriptTag node) {
+ translateDartUri(Uri uri, tree.Node node) {
String path = DART2JS_LIBRARY_MAP[uri.path];
if (path === null || uri.path.startsWith('_')) {
reportError(node, 'library not found ${uri}');
@@ -70,8 +76,7 @@ class Compiler extends leg.Compiler {
return libraryRoot.resolve(path);
}
- translatePackageUri(Uri uri, tree.ScriptTag node) =>
- packageRoot.resolve(uri.path);
+ translatePackageUri(Uri uri, tree.Node node) => packageRoot.resolve(uri.path);
bool run(Uri uri) {
try {
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698