mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] compiler: handle t-set as functions
This commit is contained in:
committed by
Mathieu Duckerts-Antoine
parent
f014b1a33e
commit
5b1132f01a
@@ -145,16 +145,19 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault } = helpers;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<p>43</p>\`);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
return block2();
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let b2 = block2();
|
||||
ctx[\`abc\`] = b2;
|
||||
ctx[\`abc\`] = new LazyValue(value1, ctx, node);
|
||||
let b3 = component(\`Child\`, {val: ctx['abc']}, key + \`__1\`, node, ctx);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user