mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] compiler: scope generated ids to their prefix
This means that unrelated ids (eg the id of a template, variable or key) not longer share the same incrementing counter, meaning that you no longer see a variable named "v2" unless another variable "v1" was generated previously, this is also true for block data.
This commit is contained in:
committed by
Aaron Bohy
parent
c7af885f43
commit
9f2e2bcc66
@@ -5,12 +5,12 @@ exports[`t-call (template calling) basic caller 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`_basic-callee\`);
|
||||
const callTemplate_1 = getTemplate(\`_basic-callee\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -34,10 +34,10 @@ exports[`t-call (template calling) basic caller, no parent node 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`_basic-callee\`);
|
||||
const callTemplate_1 = getTemplate(\`_basic-callee\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -60,7 +60,7 @@ exports[`t-call (template calling) call with several sub nodes on same line 1`]
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<span>hey</span>\`);
|
||||
@@ -74,7 +74,7 @@ exports[`t-call (template calling) call with several sub nodes on same line 1`]
|
||||
let b5 = block5();
|
||||
let b2 = multi([b3, b4, b5]);
|
||||
ctx[zero] = b2;
|
||||
let b6 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b6 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b6]);
|
||||
}
|
||||
}"
|
||||
@@ -100,7 +100,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`subTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`subTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<span>hey</span>\`);
|
||||
@@ -114,7 +114,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 1`] = `
|
||||
let b5 = block5();
|
||||
let b2 = multi([b3, b4, b5]);
|
||||
ctx[zero] = b2;
|
||||
let b6 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b6 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b6]);
|
||||
}
|
||||
}"
|
||||
@@ -125,7 +125,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 2`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`subSubTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`subSubTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<span>cascade 0</span>\`);
|
||||
@@ -137,7 +137,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 2`] = `
|
||||
let b4 = ctx[zero];
|
||||
let b2 = multi([b3, b4]);
|
||||
ctx[zero] = b2;
|
||||
let b5 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b5 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b5]);
|
||||
}
|
||||
}"
|
||||
@@ -148,7 +148,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 3`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`finalTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`finalTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block3 = createBlock(\`<span>cascade 1</span>\`);
|
||||
@@ -160,7 +160,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 3`] = `
|
||||
let b4 = ctx[zero];
|
||||
let b2 = multi([b3, b4]);
|
||||
ctx[zero] = b2;
|
||||
let b5 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b5 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b5]);
|
||||
}
|
||||
}"
|
||||
@@ -186,7 +186,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`subTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`subTemplate\`);
|
||||
|
||||
let block2 = createBlock(\`<span>hey</span>\`);
|
||||
let block4 = createBlock(\`<span>yay</span>\`);
|
||||
@@ -199,7 +199,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
let b4 = block4();
|
||||
let b1 = multi([b2, b3, b4]);
|
||||
ctx[zero] = b1;
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -209,7 +209,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`subSubTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`subSubTemplate\`);
|
||||
|
||||
let block2 = createBlock(\`<span>cascade 0</span>\`);
|
||||
|
||||
@@ -220,7 +220,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
let b3 = ctx[zero];
|
||||
let b1 = multi([b2, b3]);
|
||||
ctx[zero] = b1;
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -230,7 +230,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`finalTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`finalTemplate\`);
|
||||
|
||||
let block2 = createBlock(\`<span>cascade 1</span>\`);
|
||||
|
||||
@@ -241,7 +241,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
let b3 = ctx[zero];
|
||||
let b1 = multi([b2, b3]);
|
||||
ctx[zero] = b1;
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -271,8 +271,8 @@ exports[`t-call (template calling) dynamic t-call 1`] = `
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const template2 = (ctx['template']);
|
||||
let b2 = call(this, template2, ctx, node, key + \`__1\`);
|
||||
const template1 = (ctx['template']);
|
||||
let b2 = call(this, template1, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -311,7 +311,7 @@ exports[`t-call (template calling) inherit context 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -319,7 +319,7 @@ exports[`t-call (template calling) inherit context 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"foo\\", 1);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -341,14 +341,14 @@ exports[`t-call (template calling) recursive template, part 1 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`recursive\`);
|
||||
const callTemplate_1 = getTemplate(\`recursive\`);
|
||||
|
||||
let block1 = createBlock(\`<div><span>hey</span><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2;
|
||||
if (false) {
|
||||
b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
return block1([], [b2]);
|
||||
}
|
||||
@@ -360,7 +360,7 @@ exports[`t-call (template calling) recursive template, part 2 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`nodeTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`nodeTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -370,7 +370,7 @@ exports[`t-call (template calling) recursive template, part 2 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"node\\", ctx['root']);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -381,7 +381,7 @@ exports[`t-call (template calling) recursive template, part 2 2`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, getTemplate, withKey } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`nodeTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`nodeTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><block-child-0/></div>\`);
|
||||
|
||||
@@ -401,7 +401,7 @@ exports[`t-call (template calling) recursive template, part 2 2`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"node\\", ctx['subtree']);
|
||||
c_block2[i1] = withKey(callTemplate_2.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
c_block2[i1] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
@@ -415,7 +415,7 @@ exports[`t-call (template calling) recursive template, part 3 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`nodeTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`nodeTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -425,7 +425,7 @@ exports[`t-call (template calling) recursive template, part 3 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"node\\", ctx['root']);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -436,7 +436,7 @@ exports[`t-call (template calling) recursive template, part 3 2`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, getTemplate, withKey } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`nodeTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`nodeTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><block-child-0/></div>\`);
|
||||
|
||||
@@ -456,7 +456,7 @@ exports[`t-call (template calling) recursive template, part 3 2`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"node\\", ctx['subtree']);
|
||||
c_block2[i1] = withKey(callTemplate_2.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
c_block2[i1] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
@@ -470,7 +470,7 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`nodeTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`nodeTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -481,7 +481,7 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"recursive_idx\\", 1);
|
||||
setContextValue(ctx, \\"node\\", ctx['root']);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -492,7 +492,7 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, getTemplate, withKey } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`nodeTemplate\`);
|
||||
const callTemplate_1 = getTemplate(\`nodeTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<div><p><block-text-0/> <block-text-1/></p><block-child-0/></div>\`);
|
||||
|
||||
@@ -514,7 +514,7 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"node\\", ctx['subtree']);
|
||||
c_block2[i1] = withKey(callTemplate_2.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
c_block2[i1] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
@@ -528,7 +528,7 @@ exports[`t-call (template calling) scoped parameters 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
||||
|
||||
@@ -538,7 +538,7 @@ exports[`t-call (template calling) scoped parameters 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"foo\\", 42);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
let txt1 = ctx['foo'];
|
||||
return block1([txt1], [b2]);
|
||||
@@ -562,7 +562,7 @@ exports[`t-call (template calling) scoped parameters, part 2 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
||||
|
||||
@@ -573,7 +573,7 @@ exports[`t-call (template calling) scoped parameters, part 2 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"foo\\", 42);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
let txt1 = ctx['foo'];
|
||||
return block1([txt1], [b2]);
|
||||
@@ -597,12 +597,12 @@ exports[`t-call (template calling) t-call allowed on a non t node 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -626,7 +626,7 @@ exports[`t-call (template calling) t-call with body content as root of a templat
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`antony\`);
|
||||
const callTemplate_1 = getTemplate(\`antony\`);
|
||||
|
||||
let block1 = createBlock(\`<p>antony</p>\`);
|
||||
|
||||
@@ -635,7 +635,7 @@ exports[`t-call (template calling) t-call with body content as root of a templat
|
||||
ctx[isBoundary] = 1;
|
||||
let b1 = block1();
|
||||
ctx[zero] = b1;
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -660,14 +660,14 @@ exports[`t-call (template calling) t-call with t-if 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2;
|
||||
if (ctx['flag']) {
|
||||
b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
return block1([], [b2]);
|
||||
}
|
||||
@@ -692,7 +692,7 @@ exports[`t-call (template calling) t-call with t-set inside and body text conten
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -702,7 +702,7 @@ exports[`t-call (template calling) t-call with t-set inside and body text conten
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"val\\", \`yip yip\`);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -727,7 +727,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, getTemplate, withKey } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -747,7 +747,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"val3\\", ctx['val']*3);
|
||||
c_block2[i1] = withKey(callTemplate_2.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
c_block2[i1] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
@@ -775,7 +775,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 1`] =
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`main\`);
|
||||
const callTemplate_1 = getTemplate(\`main\`);
|
||||
|
||||
let block1 = createBlock(\`<p><block-child-0/></p>\`);
|
||||
|
||||
@@ -783,7 +783,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 1`] =
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"w\\", 'fromwrapper');
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -794,7 +794,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 2`] =
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, getTemplate, withKey } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -814,7 +814,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 2`] =
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"val3\\", ctx['val']*3);
|
||||
c_block2[i1] = withKey(callTemplate_2.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
c_block2[i1] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
@@ -844,8 +844,8 @@ exports[`t-call (template calling) t-call, conditional and t-set in t-call body
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`callee1\`);
|
||||
const callTemplate_4 = getTemplate(\`callee2\`);
|
||||
const callTemplate_1 = getTemplate(\`callee1\`);
|
||||
const callTemplate_2 = getTemplate(\`callee2\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
|
||||
@@ -855,12 +855,12 @@ exports[`t-call (template calling) t-call, conditional and t-set in t-call body
|
||||
let b2,b3;
|
||||
setContextValue(ctx, \\"v1\\", 'elif');
|
||||
if (ctx['v1']==='if') {
|
||||
b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
} else if (ctx['v1']==='elif') {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"v\\", 'success');
|
||||
b3 = callTemplate_4.call(this, ctx, node, key + \`__3\`);
|
||||
b3 = callTemplate_2.call(this, ctx, node, key + \`__2\`);
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
return block1([], [b2, b3]);
|
||||
@@ -900,7 +900,7 @@ exports[`t-call (template calling) t-esc inside t-call, with t-set outside 1`] =
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -908,7 +908,7 @@ exports[`t-call (template calling) t-esc inside t-call, with t-set outside 1`] =
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"v\\", \`Hi\`);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -933,14 +933,14 @@ exports[`t-call (template calling) with unused body 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
let b1 = text(\`WHEEE\`);
|
||||
ctx[zero] = b1;
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -963,7 +963,7 @@ exports[`t-call (template calling) with unused setbody 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -971,7 +971,7 @@ exports[`t-call (template calling) with unused setbody 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"qux\\", 3);
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -994,14 +994,14 @@ exports[`t-call (template calling) with used body 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
let b1 = text(\`ok\`);
|
||||
ctx[zero] = b1;
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1026,7 +1026,7 @@ exports[`t-call (template calling) with used setbody 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
@@ -1036,7 +1036,7 @@ exports[`t-call (template calling) with used setbody 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"foo\\", 'ok');
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
|
||||
Reference in New Issue
Block a user