Index: lib/src/js_ast/printer.dart |
diff --git a/lib/src/js/printer.dart b/lib/src/js_ast/printer.dart |
similarity index 99% |
rename from lib/src/js/printer.dart |
rename to lib/src/js_ast/printer.dart |
index 955f6d9cbf2a008b9ba05668b3602dbf4bfc4d87..87a104f364f3e774831d49589422dd795d7bf6bb 100644 |
--- a/lib/src/js/printer.dart |
+++ b/lib/src/js_ast/printer.dart |
@@ -1270,10 +1270,25 @@ class Printer extends TypeScriptTypePrinter implements NodeVisitor { |
} |
visitNameSpecifier(NameSpecifier node) { |
- out(node.name); |
+ if (node.isStar) { |
+ out('*'); |
+ } else { |
+ var importName = node.name.name; |
+ out(importName); |
+ |
+ if (node.asName == null) { |
+ // If our local was renamed, generate an implicit "as". |
+ // This is a convenience feature so imports can be renamed. |
+ var localName = localNamer.getName(node.name); |
+ if (localName != importName) { |
+ out(' as '); |
+ out(localName); |
+ } |
+ } |
+ } |
if (node.asName != null) { |
out(' as '); |
- out(node.asName); |
+ visitIdentifier(node.asName); |
} |
} |