Index: pkg/js_ast/lib/src/printer.dart |
diff --git a/pkg/js_ast/lib/src/printer.dart b/pkg/js_ast/lib/src/printer.dart |
index c2deb1eefc2d591c29d19d193ba37b8e1c87e7f8..ff757b4cbd90d87ec1863be0751e3c695f2e6ad4 100644 |
--- a/pkg/js_ast/lib/src/printer.dart |
+++ b/pkg/js_ast/lib/src/printer.dart |
@@ -927,6 +927,11 @@ class Printer implements NodeVisitor { |
out(fieldWithQuotes.substring(1, fieldWithQuotes.length - 1)); |
return; |
} |
+ } else if (selector is Name) { |
+ if (access.receiver is LiteralNumber) out(" ", isWhitespace: true); |
+ out("."); |
+ out(selector.name); |
+ return; |
} |
out("["); |
visitNestedExpression(selector, EXPRESSION, |
@@ -992,6 +997,11 @@ class Printer implements NodeVisitor { |
} |
@override |
+ visitName(Name node) { |
+ out(node.name); |
+ } |
+ |
+ @override |
visitLiteralNumber(LiteralNumber node) { |
outputNumberWithRequiredWhitespace(node.value); |
} |
@@ -1067,6 +1077,8 @@ class Printer implements NodeVisitor { |
} else { |
out(name); |
} |
+ } else if (node.name is Name) { |
+ node.name.accept(this); |
} else { |
assert(node.name is LiteralNumber); |
LiteralNumber nameNumber = node.name; |