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

Unified Diff: dart/frog/leg/frog_leg.dart

Issue 9417031: Mock up all remaining core library implementation classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 10 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/frog/leg/lib/core.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/frog_leg.dart
diff --git a/dart/frog/leg/frog_leg.dart b/dart/frog/leg/frog_leg.dart
index 73a23d5221d7d1984891efe21028a1c26c78629e..646e95bee362f4ec64b53b7ac466014270fbdaa7 100644
--- a/dart/frog/leg/frog_leg.dart
+++ b/dart/frog/leg/frog_leg.dart
@@ -108,6 +108,15 @@ class WorldCompiler extends Compiler {
print(script.file.getLocationMessage("cancel leg: $reason",
begin, end, true));
} else if (element !== null) {
+ if (element.position() === null) {
+ // Sometimes, the backend fakes up elements that have no
+ // position. So we use the enclosing element instead. It is
+ // not a good error location, but cancel really is "internal
+ // error" or "not implemented yet", so the vicinity is good
+ // enough for now.
+ element = element.enclosingElement;
+ // TODO(ahe): I plan to overhaul this infrastructure anyways.
+ }
withCurrentElement(element,
() => cancel(reason: reason, token: element.position()));
}
« no previous file with comments | « no previous file | dart/frog/leg/lib/core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698