Index: lib/src/codegen/js_printer.dart |
diff --git a/lib/src/codegen/js_printer.dart b/lib/src/codegen/js_printer.dart |
index e83548776dd33ac94b85b0dfb91f735230b2fdd1..81ea7252e3c4613097040c61755add39dbb34a07 100644 |
--- a/lib/src/codegen/js_printer.dart |
+++ b/lib/src/codegen/js_printer.dart |
@@ -72,12 +72,11 @@ class SourceMapPrintingContext extends JS.JavaScriptPrintingContext { |
void enterNode(JS.Node jsNode) { |
AstNode node = jsNode.sourceInformation; |
- if (node is CompilationUnit) { |
- unit = node; |
+ if (node == null || node.offset == -1) return; |
+ if (node.parent is CompilationUnit) { |
Jennifer Messerly
2015/11/09 18:38:46
We'll keep making the URI over and over, right? Si
vsm
2015/11/09 19:15:42
If there is a natural visit on the CompilationUnit
vsm
2015/11/09 19:15:42
BTW, I tested this with Angular - seems like we ha
|
+ unit = node.parent; |
uri = _makeRelativeUri(unit.element.source.uri); |
- return; |
} |
- if (unit == null || node == null || node.offset == -1) return; |
var loc = _location(node.offset); |
var name = _getIdentifier(node); |