Skip to content

Commit

Permalink
Use += in printer
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdecker committed Aug 3, 2015
1 parent fac71ce commit 85750f8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/handlebars/compiler/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ PrintVisitor.prototype.pad = function(string) {
let out = '';

for (let i = 0, l = this.padding; i < l; i++) {
out = out + ' ';
out += ' ';
}

out = out + string + '\n';
out += string + '\n';
return out;
};

Expand All @@ -37,7 +37,7 @@ PrintVisitor.prototype.Program = function(program) {
}

for (i = 0, l = body.length; i < l; i++) {
out = out + this.accept(body[i]);
out += this.accept(body[i]);
}

this.padding--;
Expand All @@ -52,20 +52,20 @@ PrintVisitor.prototype.MustacheStatement = function(mustache) {
PrintVisitor.prototype.BlockStatement = function(block) {
let out = '';

out = out + this.pad('BLOCK:');
out += this.pad('BLOCK:');
this.padding++;
out = out + this.pad(this.SubExpression(block));
out += this.pad(this.SubExpression(block));
if (block.program) {
out = out + this.pad('PROGRAM:');
out += this.pad('PROGRAM:');
this.padding++;
out = out + this.accept(block.program);
out += this.accept(block.program);
this.padding--;
}
if (block.inverse) {
if (block.program) { this.padding++; }
out = out + this.pad('{{^}}');
out += this.pad('{{^}}');
this.padding++;
out = out + this.accept(block.inverse);
out += this.accept(block.inverse);
this.padding--;
if (block.program) { this.padding--; }
}
Expand Down

0 comments on commit 85750f8

Please sign in to comment.