mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Marko v3: Fix indentation for var init with blocks
This commit is contained in:
parent
b7f8f2f3f1
commit
e89706acfb
@ -27,22 +27,19 @@ class Vars extends Node {
|
||||
return;
|
||||
}
|
||||
|
||||
codegen.incIndent(4);
|
||||
|
||||
for (let i=0; i<declarations.length; i++) {
|
||||
var declarator = declarations[i];
|
||||
|
||||
if (i === 0) {
|
||||
codegen.write(kind + ' ');
|
||||
} else {
|
||||
codegen.incIndent(4);
|
||||
codegen.writeLineIndent();
|
||||
}
|
||||
|
||||
codegen.generateCode(declarator);
|
||||
|
||||
if (i !== 0) {
|
||||
codegen.decIndent(4);
|
||||
}
|
||||
|
||||
if (i < declarations.length - 1) {
|
||||
codegen.write(',\n');
|
||||
} else {
|
||||
@ -51,7 +48,10 @@ class Vars extends Node {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(hasBody) {
|
||||
|
||||
codegen.decIndent(4);
|
||||
|
||||
if (hasBody) {
|
||||
codegen.generateCode(body);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user