mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
wip
This commit is contained in:
+18
-20
@@ -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`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user