Skip to content

Commit

Permalink
Merge pull request #209 from fkling/import_printer
Browse files Browse the repository at this point in the history
Fix printing ImportNamespaceSpecifier and ImportDefaultSpecifier.
  • Loading branch information
benjamn committed Aug 10, 2015
2 parents cb99299 + da200a4 commit 351fd38
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,18 @@ function genericPrintNoParens(path, options, print) {
return fromString("*");

case "ImportNamespaceSpecifier":
return concat(["* as ", path.call(print, "id")]);
var parts = ["* as "];
if (n.local) {
parts.push(path.call(print, "local"));
} else if (n.id) {
parts.push(path.call(print, "id"));
}
return concat(parts);

case "ImportDefaultSpecifier":
if (n.local) {
return path.call(print, "local");
}
return path.call(print, "id");

case "ExportDeclaration":
Expand Down

0 comments on commit 351fd38

Please sign in to comment.