Fix aux comment termination in lists and calls

This commit is contained in:
kpdecker 2015-12-18 01:37:26 -06:00
parent 3791491b79
commit 9e382b1686
4 changed files with 7 additions and 2 deletions

View File

@ -92,6 +92,7 @@ export function Decorator(node: Object) {
export function CallExpression(node: Object) {
this.print(node.callee, node);
if (node.loc) this.printAuxAfterComment();
this.push("(");

View File

@ -130,6 +130,10 @@ export default class Printer extends Buffer {
opts.iterator(node, i);
}
if (opts.separator && parent.loc) {
this.printAuxAfterComment();
}
if (opts.separator && i < len - 1) {
this.push(opts.separator);
}

View File

@ -9,7 +9,7 @@ import {foo as bar2} from "foo5";
export {test};
export var test = 5;
bar(foo);
bar(foo, bar2);
/* my comment */
bar2;

View File

@ -26,7 +26,7 @@ var _foo5 = require("foo5");
exports. /*after*/test = test;
var test = /*before*/exports. /*after*/test = 5;
/*before*/(0, _foo4.bar)(_foo2.default) /*after*/;
/*before*/(0, _foo4.bar) /*after*/( /*before*/_foo2.default /*after*/, /*before*/_foo5.foo /*after*/);
/* my comment */
/*before*/_foo5.foo; /*after*/