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

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

Issue 206193002: Remove cancel and make crash exit with code 253. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 9 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 | sdk/lib/_internal/compiler/implementation/closure.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f7a72f15e20bb013bb7adc2806b8ca75791a0684..bde352edba9f7943a359604836a77304d951dcd8 100644
--- a/sdk/lib/_internal/compiler/implementation/apiimpl.dart
+++ b/sdk/lib/_internal/compiler/implementation/apiimpl.dart
@@ -159,15 +159,16 @@ class Compiler extends leg.Compiler {
/**
* Reads the script designated by [readableUri].
*/
- Future<leg.Script> readScript(Uri readableUri,
- [elements.Element element, tree.Node node]) {
+ Future<leg.Script> readScript(leg.Spannable node, Uri readableUri) {
if (!readableUri.isAbsolute) {
- internalError('Relative uri $readableUri provided to readScript(Uri)',
- node: node);
+ internalError(node,
+ 'Relative uri $readableUri provided to readScript(Uri).');
}
- // TODO(johnniwinther): Add [:report(..., {Element element}):] to
- // report methods in Compiler.
+ // We need to store the current element since we are reporting read errors
+ // asynchronously and therefore need to restore the current element for
+ // [node] to be valid.
+ elements.Element element = currentElement;
void reportReadError(exception) {
withCurrentElement(element, () {
reportError(node,
@@ -176,7 +177,7 @@ class Compiler extends leg.Compiler {
});
}
- Uri resourceUri = translateUri(readableUri, node);
+ Uri resourceUri = translateUri(node, readableUri);
// TODO(johnniwinther): Wrap the result from [provider] in a specialized
// [Future] to ensure that we never execute an asynchronous action without
// setting up the current element of the compiler.
@@ -208,9 +209,9 @@ class Compiler extends leg.Compiler {
*
* See [LibraryLoader] for terminology on URIs.
*/
- Uri translateUri(Uri readableUri, tree.Node node) {
+ Uri translateUri(leg.Spannable node, Uri readableUri) {
switch (readableUri.scheme) {
- case 'package': return translatePackageUri(readableUri, node);
+ case 'package': return translatePackageUri(node, readableUri);
default: return readableUri;
}
}
@@ -265,7 +266,7 @@ class Compiler extends leg.Compiler {
return libraryRoot.resolve(patchPath);
}
- Uri translatePackageUri(Uri uri, tree.Node node) {
+ Uri translatePackageUri(leg.Spannable node, Uri uri) {
if (packageRoot == null) {
reportFatalError(
node, leg.MessageKind.PACKAGE_ROOT_NOT_SET, {'uri': uri});
@@ -302,7 +303,7 @@ class Compiler extends leg.Compiler {
callUserHandler(null, null, null, '$message', kind);
} else {
callUserHandler(
- translateUri(span.uri, null), span.begin, span.end, '$message', kind);
+ translateUri(null, span.uri), span.begin, span.end, '$message', kind);
}
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/closure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698