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 7a1124f744580a4887f4c612bab17b7518b7e736..b2fd29d3058d42536ae480494f789bfd0c841736 100644 |
--- a/pkg/js_ast/lib/src/printer.dart |
+++ b/pkg/js_ast/lib/src/printer.dart |
@@ -933,7 +933,10 @@ class Printer implements NodeVisitor { |
LiteralString selectorString = selector; |
String fieldWithQuotes = selectorString.value; |
if (isValidJavaScriptId(fieldWithQuotes)) { |
- if (access.receiver is LiteralNumber) out(" ", isWhitespace: true); |
+ if (access.receiver is LiteralNumber && |
+ lastCharCode != charCodes.$CLOSE_PAREN) { |
+ out(" ", isWhitespace: true); |
+ } |
out("."); |
startNode(selector); |
out(fieldWithQuotes.substring(1, fieldWithQuotes.length - 1)); |
@@ -941,7 +944,10 @@ class Printer implements NodeVisitor { |
return; |
} |
} else if (selector is Name) { |
- if (access.receiver is LiteralNumber) out(" ", isWhitespace: true); |
+ if (access.receiver is LiteralNumber && |
+ lastCharCode != charCodes.$CLOSE_PAREN) { |
+ out(" ", isWhitespace: true); |
+ } |
out("."); |
startNode(selector); |
selector.accept(this); |
@@ -1487,4 +1493,4 @@ class EnterExitNode { |
context.exitNode(node, startPosition, position, closingPosition); |
return parent; |
} |
-} |
+} |