Skip to content

Commit 85750f8

Browse files
committed
Use += in printer
1 parent fac71ce commit 85750f8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/handlebars/compiler/printer.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ PrintVisitor.prototype.pad = function(string) {
1515
let out = '';
1616

1717
for (let i = 0, l = this.padding; i < l; i++) {
18-
out = out + ' ';
18+
out += ' ';
1919
}
2020

21-
out = out + string + '\n';
21+
out += string + '\n';
2222
return out;
2323
};
2424

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

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

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

55-
out = out + this.pad('BLOCK:');
55+
out += this.pad('BLOCK:');
5656
this.padding++;
57-
out = out + this.pad(this.SubExpression(block));
57+
out += this.pad(this.SubExpression(block));
5858
if (block.program) {
59-
out = out + this.pad('PROGRAM:');
59+
out += this.pad('PROGRAM:');
6060
this.padding++;
61-
out = out + this.accept(block.program);
61+
out += this.accept(block.program);
6262
this.padding--;
6363
}
6464
if (block.inverse) {
6565
if (block.program) { this.padding++; }
66-
out = out + this.pad('{{^}}');
66+
out += this.pad('{{^}}');
6767
this.padding++;
68-
out = out + this.accept(block.inverse);
68+
out += this.accept(block.inverse);
6969
this.padding--;
7070
if (block.program) { this.padding--; }
7171
}

0 commit comments

Comments
 (0)