make transformation tests compare output instead of ast
This commit is contained in:
@@ -60,7 +60,10 @@ CodeGenerator.prototype.newline = function (removeLast) {
|
||||
};
|
||||
|
||||
CodeGenerator.prototype.removeLastNewline = function () {
|
||||
if (this.isLast("\n")) this.buf = this.buf.slice(0, -1);
|
||||
if (this.isLast("\n")) {
|
||||
this.buf = this.buf.slice(0, -1);
|
||||
this.line--;
|
||||
}
|
||||
};
|
||||
|
||||
CodeGenerator.prototype.semicolon = function () {
|
||||
@@ -189,6 +192,8 @@ CodeGenerator.prototype.printSequence = function (print, nodes, opts) {
|
||||
|
||||
opts.print = function (node, i) {
|
||||
var needs = function (fn) {
|
||||
if (!self.opts.whitespace) return;
|
||||
|
||||
if (node.start != null) {
|
||||
// user node
|
||||
if (!fn(node)) return;
|
||||
@@ -217,7 +222,7 @@ CodeGenerator.prototype.printSequence = function (print, nodes, opts) {
|
||||
};
|
||||
|
||||
CodeGenerator.prototype.hasWhitespaceBetween = function (startToken, endToken) {
|
||||
if (!endToken || !this.opts.whitespace) return false;
|
||||
if (!endToken) return false;
|
||||
|
||||
var comments = this.ast.comments;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user