| 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..dfdc594619ac6376984d37b2845bd87bea917a9e 100644
|
| --- a/pkg/js_ast/lib/src/printer.dart
|
| +++ b/pkg/js_ast/lib/src/printer.dart
|
| @@ -360,7 +360,9 @@ class Printer implements NodeVisitor {
|
| out("else");
|
| if (elsePart is If) {
|
| pendingSpace = true;
|
| + startNode(elsePart);
|
| ifOut(elsePart, false);
|
| + endNode(elsePart);
|
| } else {
|
| blockBody(unwrapBlockIfSingleStatement(elsePart),
|
| needsSeparation: true, needsNewline: true);
|
| @@ -628,7 +630,10 @@ class Printer implements NodeVisitor {
|
| VarCollector vars = new VarCollector();
|
| vars.visitFunctionDeclaration(declaration);
|
| indent();
|
| - functionOut(declaration.function, declaration.name, vars);
|
| + startNode(declaration.function);
|
| + currentNode.closingPosition =
|
| + functionOut(declaration.function, declaration.name, vars);
|
| + endNode(declaration.function);
|
| lineOut();
|
| }
|
|
|
| @@ -924,7 +929,9 @@ class Printer implements NodeVisitor {
|
| if (isValidJavaScriptId(fieldWithQuotes)) {
|
| if (access.receiver is LiteralNumber) out(" ", isWhitespace: true);
|
| out(".");
|
| + startNode(selector);
|
| out(fieldWithQuotes.substring(1, fieldWithQuotes.length - 1));
|
| + endNode(selector);
|
| return;
|
| }
|
| }
|
| @@ -1012,7 +1019,9 @@ class Printer implements NodeVisitor {
|
| // in last position. Otherwise `[,]` (having length 1) would become
|
| // equal to `[]` (the empty array)
|
| // and [1,,] (array with 1 and a hole) would become [1,] = [1].
|
| + startNode(element);
|
| out(",");
|
| + endNode(element);
|
| continue;
|
| }
|
| if (i != 0) spaceOut();
|
| @@ -1059,6 +1068,7 @@ class Printer implements NodeVisitor {
|
|
|
| @override
|
| void visitProperty(Property node) {
|
| + startNode(node.name);
|
| if (node.name is LiteralString) {
|
| LiteralString nameString = node.name;
|
| String name = nameString.value;
|
| @@ -1072,6 +1082,7 @@ class Printer implements NodeVisitor {
|
| LiteralNumber nameNumber = node.name;
|
| out(nameNumber.value);
|
| }
|
| + endNode(node.name);
|
| out(":");
|
| spaceOut();
|
| visitNestedExpression(node.value, ASSIGNMENT,
|
|
|