mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] compiler: minor cleanup
This commit merges two nested ifs and explicitly joins an array instead of relying on array -> string coercion
This commit is contained in:
committed by
Lucas Perais - lpe@odoo
parent
9823a4e7dd
commit
28672096a2
@@ -761,7 +761,7 @@ export class CodeGenerator {
|
||||
if (!current) break;
|
||||
}
|
||||
}
|
||||
this.addLine(`let ${block!.children.map((c) => c.varName)};`, codeIdx);
|
||||
this.addLine(`let ${block!.children.map((c) => c.varName).join(", ")};`, codeIdx);
|
||||
}
|
||||
}
|
||||
return block!.varName;
|
||||
@@ -863,7 +863,7 @@ export class CodeGenerator {
|
||||
if (!current) break;
|
||||
}
|
||||
}
|
||||
this.addLine(`let ${block!.children.map((c) => c.varName)};`, codeIdx);
|
||||
this.addLine(`let ${block!.children.map((c) => c.varName).join(", ")};`, codeIdx);
|
||||
}
|
||||
|
||||
// note: this part is duplicated from end of compilemulti:
|
||||
@@ -998,8 +998,7 @@ export class CodeGenerator {
|
||||
}
|
||||
}
|
||||
if (isNewBlock) {
|
||||
if (block!.hasDynamicChildren) {
|
||||
if (block!.children.length) {
|
||||
if (block!.hasDynamicChildren && block!.children.length) {
|
||||
const code = this.target.code;
|
||||
const children = block!.children.slice();
|
||||
let current = children.shift();
|
||||
@@ -1010,8 +1009,7 @@ export class CodeGenerator {
|
||||
if (!current) break;
|
||||
}
|
||||
}
|
||||
this.addLine(`let ${block!.children.map((c) => c.varName)};`, codeIdx);
|
||||
}
|
||||
this.addLine(`let ${block!.children.map((c) => c.varName).join(", ")};`, codeIdx);
|
||||
}
|
||||
|
||||
const args = block!.children.map((c) => c.varName).join(", ");
|
||||
|
||||
Reference in New Issue
Block a user