This commit is contained in:
Géry Debongnie
2021-10-11 17:48:15 +02:00
parent 8986f06448
commit 38380b0b12
+18 -20
View File
@@ -45,25 +45,23 @@ function compileValueNode(value: any, node: Element, qweb: QWeb, ctx: Compilatio
exprID = `scope.${value.id}`;
}
let protectID;
if (value.hasBody) {
ctx.rootContext.shouldDefineUtils = true;
protectID = ctx.startProtectScope();
ctx.addLine(
`${exprID} = ${exprID} instanceof utils.VDomArray ? utils.vDomToString(${exprID}) : ${exprID};`
);
}
let protectID;
if (value.hasBody) {
ctx.rootContext.shouldDefineUtils = true;
protectID = ctx.startProtectScope();
ctx.addLine(
`${exprID} = ${exprID} instanceof utils.VDomArray ? utils.vDomToString(${exprID}) : ${exprID};`
);
}
if (node.childNodes.length) {
// ctx.addLine(`c${ctx.parentNode}.push(...vnodeArray);`);
ctx.addIf(`!${exprID}`);
// if (node.childNodes.length) {
// ctx.addElse();
qweb._compileChildren(node, ctx);
// }
ctx.closeIf();
// ctx.addLine(`c${ctx.parentNode}.push(...vnodeArray);`);
ctx.addIf(`!${exprID}`);
// if (node.childNodes.length) {
// ctx.addElse();
qweb._compileChildren(node, ctx);
// }
ctx.closeIf();
}
if (ctx.parentTextNode) {
ctx.addIf(`${exprID} != null`);
@@ -84,9 +82,9 @@ function compileValueNode(value: any, node: Element, qweb: QWeb, ctx: Compilatio
}
ctx.closeIf();
}
if (value.hasBody) {
ctx.stopProtectScope(protectID);
}
if (value.hasBody) {
ctx.stopProtectScope(protectID);
}
// ctx.addIf(`${exprID} != null`);