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

Unified Diff: lib/src/js_ast/printer.dart

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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 | « lib/src/js_ast/precedence.dart ('k') | lib/src/js_ast/template.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « lib/src/js_ast/precedence.dart ('k') | lib/src/js_ast/template.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698