Use 'push' for all cases.

This commit is contained in:
Logan Smyth 2016-07-03 20:35:57 -07:00
parent caef91672d
commit f908f3fc88
2 changed files with 4 additions and 4 deletions

View File

@ -124,10 +124,10 @@ export default class Buffer {
* Add a space to the buffer unless it is compact.
*/
space() {
space(force: boolean = false) {
if (this.format.compact) return;
if (this.buf && !this.endsWith(" ") && !this.endsWith("\n")) {
if ((this.buf && !this.endsWith(" ") && !this.endsWith("\n")) || force) {
this.push(" ");
}
}

View File

@ -209,14 +209,14 @@ function variableDeclarationIdent() {
// "let " or "var " indentation.
this.token(",");
this.newline();
for (let i = 0; i < 4; i++) this.push(" ");
for (let i = 0; i < 4; i++) this.space(true);
}
function constDeclarationIdent() {
// "const " indentation.
this.token(",");
this.newline();
for (let i = 0; i < 6; i++) this.push(" ");
for (let i = 0; i < 6; i++) this.space(true);
}
export function VariableDeclaration(node: Object, parent: Object) {