Index: lib/compiler/implementation/compiler.dart |
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart |
index 7dd7384e3f11ed35aa005e8fbfc20e8394551259..13cec91b51610869a0f6d17fad896ac3f784e83e 100644 |
--- a/lib/compiler/implementation/compiler.dart |
+++ b/lib/compiler/implementation/compiler.dart |
@@ -886,7 +886,7 @@ class Compiler implements DiagnosticListener { |
// URI. |
throw 'Cannot find tokens to produce error message.'; |
} |
- if (uri === null) { |
+ if (uri === null && currentElement !== null) { |
uri = currentElement.getCompilationUnit().script.uri; |
} |
return SourceSpan.withCharacterOffsets(begin, end, |
@@ -998,4 +998,8 @@ class SourceSpan { |
assert(endOffset >= beginOffset); |
return f(beginOffset, endOffset); |
} |
+ |
+ String toString() { |
kasperl
2012/07/06 12:40:41
Use => notation?
Johnni Winther
2012/07/09 14:57:18
Done.
|
+ return 'SourceSpan($uri,$begin,$end)'; |
+ } |
} |