Index: lib/compiler/implementation/compiler.dart |
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart |
index ef6ae15e0daa9ad80309eb28ce0ef37acf9cf4ec..6b130e442bb074e78040abd5a662f3bb11e6d8d2 100644 |
--- a/lib/compiler/implementation/compiler.dart |
+++ b/lib/compiler/implementation/compiler.dart |
@@ -977,7 +977,7 @@ class Compiler implements DiagnosticListener { |
// URI. |
throw 'Cannot find tokens to produce error message.'; |
} |
- if (uri === null) { |
+ if (uri === null && currentElement !== null) { |
ahe
2012/08/02 19:56:23
currentElement may not be null.
|
uri = currentElement.getCompilationUnit().script.uri; |
} |
return SourceSpan.withCharacterOffsets(begin, end, |
@@ -1089,4 +1089,6 @@ class SourceSpan { |
assert(endOffset >= beginOffset); |
return f(beginOffset, endOffset); |
} |
+ |
+ String toString() => 'SourceSpan($uri, $begin, $end)'; |
} |