Use 'push' for all cases.
This commit is contained in:
parent
caef91672d
commit
f908f3fc88
@ -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(" ");
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user