[REF] compiler: introduce define helper, slightly refactor code

This commit is contained in:
Géry Debongnie
2022-03-06 10:27:07 +01:00
committed by Samuel Degueldre
parent 50355e6a3d
commit 998ecbb337
41 changed files with 931 additions and 935 deletions
@@ -41,7 +41,7 @@ exports[`t-ref ref in a t-call 1`] = `
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
return block1([], [b2]);
}
}"
@@ -94,17 +94,17 @@ exports[`t-ref refs in a loop 1`] = `
return function template(ctx, node, key = \\"\\") {
const refs = ctx.__owl__.refs;
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['items']);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['items']);;
for (let i1 = 0; i1 < l_block2; i1++) {
ctx[\`item\`] = v_block2[i1];
let key1 = ctx['item'];
const key1 = ctx['item'];
const tKey_1 = ctx['item'];
const v1 = ctx['item'];
let ref1 = (el) => refs[\`\${v1}\`] = el;
let txt1 = ctx['item'];
c_block2[i1] = withKey(block3([ref1, txt1]), tKey_1 + key1);
}
let b2 = list(c_block2);
const b2 = list(c_block2);
return block1([], [b2]);
}
}"