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
@@ -157,10 +157,10 @@ exports[`t-on handler is bound to proper owner, part 3 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -184,7 +184,7 @@ exports[`t-on handler is bound to proper owner, part 4 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { prepareList, getTemplate, withKey } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -196,7 +196,7 @@ exports[`t-on handler is bound to proper owner, part 4 1`] = `
|
||||
ctx[\`value_index\`] = i1;
|
||||
ctx[\`value_value\`] = k_block1[i1];
|
||||
let key1 = ctx['value'];
|
||||
c_block1[i1] = withKey(callTemplate_2.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
c_block1[i1] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`), key1);
|
||||
}
|
||||
return list(c_block1);
|
||||
}
|
||||
@@ -255,8 +255,8 @@ exports[`t-on t-on modifiers (native listener) t-on combined with t-esc 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
let txt2 = ctx['text'];
|
||||
return block1([hdlr1, txt2]);
|
||||
let txt1 = ctx['text'];
|
||||
return block1([hdlr1, txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -354,8 +354,8 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-f
|
||||
const v1 = ctx['onEdit'];
|
||||
const v2 = ctx['project'];
|
||||
let hdlr1 = [\\"prevent\\", ev=>v1(v2.id,ev), ctx];
|
||||
let txt2 = ctx['project'].name;
|
||||
c_block2[i1] = withKey(block3([hdlr1, txt2]), key1);
|
||||
let txt1 = ctx['project'].name;
|
||||
c_block2[i1] = withKey(block3([hdlr1, txt1]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -473,12 +473,12 @@ exports[`t-on t-on with t-call 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]);
|
||||
}
|
||||
}"
|
||||
@@ -503,12 +503,12 @@ exports[`t-on t-on, with arguments and t-call 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]);
|
||||
}
|
||||
}"
|
||||
|
||||
@@ -22,7 +22,7 @@ exports[`misc complex template 1`] = `
|
||||
let attr2 = \`card bg-\${ctx['klass']}-light\`;
|
||||
let attr3 = \`/runbot/batch/\${ctx['batch'].id}\`;
|
||||
let attr4 = \`badge badge-\${ctx['batch'].has_warning?'warning':'light'}\`;
|
||||
let txt5 = ctx['batch'].formated_age;
|
||||
let txt1 = ctx['batch'].formated_age;
|
||||
if (ctx['batch'].has_warning) {
|
||||
b2 = block2();
|
||||
}
|
||||
@@ -53,8 +53,8 @@ exports[`misc complex template 1`] = `
|
||||
ctx[\`commit_link\`] = v_block8[i1];
|
||||
let key1 = ctx['commit_link'].id;
|
||||
let b10,b11,b12,b13;
|
||||
let attr6 = \`/runbot/commit/\${ctx['commit_link'].commit_id}\`;
|
||||
let attr7 = \`badge badge-light batch_commit match_type_\${ctx['commit_link'].match_type}\`;
|
||||
let attr5 = \`/runbot/commit/\${ctx['commit_link'].commit_id}\`;
|
||||
let attr6 = \`badge badge-light batch_commit match_type_\${ctx['commit_link'].match_type}\`;
|
||||
if (ctx['commit_link'].match_type=='new') {
|
||||
b10 = block10();
|
||||
}
|
||||
@@ -67,13 +67,13 @@ exports[`misc complex template 1`] = `
|
||||
if (ctx['commit_link'].match_type=='base_head') {
|
||||
b13 = block13();
|
||||
}
|
||||
let txt8 = ctx['commit_link'].commit_dname;
|
||||
let attr9 = 'https://%s/commit/%s'%(ctx['commit_link'].commit_remote_url,ctx['commit_link'].commit_name);
|
||||
let txt10 = ctx['commit_link'].commit_subject;
|
||||
c_block8[i1] = withKey(block9([attr6, attr7, txt8, attr9, txt10], [b10, b11, b12, b13]), key1);
|
||||
let txt2 = ctx['commit_link'].commit_dname;
|
||||
let attr7 = 'https://%s/commit/%s'%(ctx['commit_link'].commit_remote_url,ctx['commit_link'].commit_name);
|
||||
let txt3 = ctx['commit_link'].commit_subject;
|
||||
c_block8[i1] = withKey(block9([attr5, attr6, txt2, attr7, txt3], [b10, b11, b12, b13]), key1);
|
||||
}
|
||||
b8 = list(c_block8);
|
||||
return block1([attr1, attr2, attr3, attr4, txt5], [b2, b3, b4, b6, b8]);
|
||||
return block1([attr1, attr2, attr3, attr4, txt1], [b2, b3, b4, b6, b8]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -83,11 +83,11 @@ exports[`misc global 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, getTemplate, zero, withKey } = helpers;
|
||||
const callTemplate_1 = getTemplate(\`_callee-uses-foo\`);
|
||||
const callTemplate_2 = getTemplate(\`_callee-uses-foo\`);
|
||||
const callTemplate_4 = getTemplate(\`_callee-uses-foo\`);
|
||||
const callTemplate_6 = getTemplate(\`_callee-uses-foo\`);
|
||||
const callTemplate_8 = getTemplate(\`_callee-asc\`);
|
||||
const callTemplate_10 = getTemplate(\`_callee-asc-toto\`);
|
||||
const callTemplate_3 = getTemplate(\`_callee-uses-foo\`);
|
||||
const callTemplate_4 = getTemplate(\`_callee-asc\`);
|
||||
const callTemplate_5 = getTemplate(\`_callee-asc-toto\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
let block4 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -111,20 +111,20 @@ exports[`misc global 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"foo\\", 'aaa');
|
||||
let b6 = callTemplate_2.call(this, ctx, node, key + \`__1__\${key1}\`);
|
||||
let b6 = callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}\`);
|
||||
ctx = ctx.__proto__;
|
||||
let b7 = callTemplate_4.call(this, ctx, node, key + \`__3__\${key1}\`);
|
||||
let b7 = callTemplate_2.call(this, ctx, node, key + \`__2__\${key1}\`);
|
||||
setContextValue(ctx, \\"foo\\", 'bbb');
|
||||
let b8 = callTemplate_6.call(this, ctx, node, key + \`__5__\${key1}\`);
|
||||
let b8 = callTemplate_3.call(this, ctx, node, key + \`__3__\${key1}\`);
|
||||
let b5 = multi([b6, b7, b8]);
|
||||
ctx[zero] = b5;
|
||||
let b9 = callTemplate_8.call(this, ctx, node, key + \`__7__\${key1}\`);
|
||||
let b9 = callTemplate_4.call(this, ctx, node, key + \`__4__\${key1}\`);
|
||||
ctx = ctx.__proto__;
|
||||
c_block2[i1] = withKey(multi([b4, b9]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b2 = list(c_block2);
|
||||
let b10 = callTemplate_10.call(this, ctx, node, key + \`__9\`);
|
||||
let b10 = callTemplate_5.call(this, ctx, node, key + \`__5\`);
|
||||
return block1([], [b2, b10]);
|
||||
}
|
||||
}"
|
||||
@@ -182,7 +182,7 @@ exports[`misc other complex template 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { prepareList, withKey, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`LOAD_INFOS_TEMPLATE\`);
|
||||
const callTemplate_1 = getTemplate(\`LOAD_INFOS_TEMPLATE\`);
|
||||
|
||||
let block1 = createBlock(\`<div><header><nav class=\\"navbar navbar-expand-md navbar-light bg-light\\"><a block-attribute-0=\\"href\\"><b style=\\"color:#777;\\"><block-text-1/></b></a><button type=\\"button\\" class=\\"navbar-toggler\\" data-toggle=\\"collapse\\" data-target=\\"#top_menu_collapse\\"><span class=\\"navbar-toggler-icon\\"/></button><div class=\\"collapse navbar-collapse\\" id=\\"top_menu_collapse\\" aria-expanded=\\"false\\"><ul class=\\"nav navbar-nav ml-auto text-right\\" id=\\"top_menu\\"><block-child-0/><li class=\\"nav-item divider\\"/><block-child-1/></ul><div><div class=\\"input-group input-group-sm\\"><div class=\\"input-group-prepend input-group-sm\\"><button class=\\"btn btn-default fa fa-cog\\" title=\\"Settings\\" block-handler-2=\\"click\\"/><button class=\\"btn btn-default\\" block-handler-3=\\"click\\"> More </button><block-child-2/></div><input class=\\"form-control\\" type=\\"text\\" placeholder=\\"Search\\" aria-label=\\"Search\\" name=\\"search\\" block-attribute-4=\\"value\\" block-handler-5=\\"keyup\\" block-handler-6=\\"change\\" block-ref=\\"7\\"/><div class=\\"input-group-append\\"><button class=\\"btn btn-default fa fa-eraser\\" block-handler-8=\\"click\\"/></div></div></div></div></nav></header><div class=\\"container-fluid\\" block-ref=\\"9\\"><div class=\\"row\\"><!--div class=\\"form-group col-md-6\\">
|
||||
<h5>Search options</h5>
|
||||
@@ -217,29 +217,29 @@ exports[`misc other complex template 1`] = `
|
||||
const refs = ctx.__owl__.refs;
|
||||
let b2,b4,b14,b17,b22,b23,b24,b25;
|
||||
let attr1 = \`/runbot/\${ctx['project'].slug}\`;
|
||||
let txt2 = ctx['project'].name;
|
||||
let txt1 = ctx['project'].name;
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['projects']);
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`project\`] = v_block2[i1];
|
||||
let key1 = ctx['project'].id;
|
||||
let hdlr3 = [ctx['selectProject'](ctx['project']), ctx];
|
||||
let txt4 = ctx['project'].name;
|
||||
c_block2[i1] = withKey(block3([hdlr3, txt4]), key1);
|
||||
let hdlr1 = [ctx['selectProject'](ctx['project']), ctx];
|
||||
let txt2 = ctx['project'].name;
|
||||
c_block2[i1] = withKey(block3([hdlr1, txt2]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
b2 = list(c_block2);
|
||||
if (ctx['user']) {
|
||||
let b5,b6;
|
||||
if (ctx['user'].public) {
|
||||
let attr5 = \`/web/login?redirect=/\`;
|
||||
b5 = block5([attr5]);
|
||||
let attr2 = \`/web/login?redirect=/\`;
|
||||
b5 = block5([attr2]);
|
||||
} else {
|
||||
let b7,b10,b13;
|
||||
if (ctx['nb_assigned_errors']&&ctx['nb_assigned_errors']>0) {
|
||||
let attr6 = \`You have \${ctx['nb_assigned_errors']} random bug assigned\`;
|
||||
let txt7 = ctx['nb_assigned_errors'];
|
||||
let b8 = block8([attr6, txt7]);
|
||||
let attr3 = \`You have \${ctx['nb_assigned_errors']} random bug assigned\`;
|
||||
let txt3 = ctx['nb_assigned_errors'];
|
||||
let b8 = block8([attr3, txt3]);
|
||||
let b9 = block9();
|
||||
b7 = multi([b8, b9]);
|
||||
} else if (ctx['nb_build_errors']&&ctx['nb_build_errors']>0) {
|
||||
@@ -247,37 +247,37 @@ exports[`misc other complex template 1`] = `
|
||||
let b12 = block12();
|
||||
b10 = multi([b11, b12]);
|
||||
}
|
||||
let txt8 = ctx['user'].name.length>25?ctx['user'].namesubstring(0,23)+'...':ctx['user'].name;
|
||||
let attr9 = \`/web/session/logout?redirect=/\`;
|
||||
let attr10 = \`/web\`;
|
||||
b13 = block13([txt8, attr9, attr10]);
|
||||
let txt4 = ctx['user'].name.length>25?ctx['user'].namesubstring(0,23)+'...':ctx['user'].name;
|
||||
let attr4 = \`/web/session/logout?redirect=/\`;
|
||||
let attr5 = \`/web\`;
|
||||
b13 = block13([txt4, attr4, attr5]);
|
||||
b6 = multi([b7, b10, b13]);
|
||||
}
|
||||
b4 = multi([b5, b6]);
|
||||
}
|
||||
let hdlr11 = [ctx['toggleSettingsMenu'], ctx];
|
||||
let hdlr12 = [ctx['toggleMore'], ctx];
|
||||
let hdlr2 = [ctx['toggleSettingsMenu'], ctx];
|
||||
let hdlr3 = [ctx['toggleMore'], ctx];
|
||||
if (ctx['categories']&&ctx['categories'].length>1) {
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block15, v_block15, l_block15, c_block15] = prepareList(ctx['categories']);
|
||||
for (let i1 = 0; i1 < l_block15; i1++) {
|
||||
ctx[\`category\`] = v_block15[i1];
|
||||
let key1 = ctx['category'].id;
|
||||
let attr13 = ctx['category'].id;
|
||||
let attr14 = ctx['category'].id==ctx['options'].active_category_id;
|
||||
let txt15 = ctx['category'].name;
|
||||
c_block15[i1] = withKey(block16([attr13, attr14, txt15]), key1);
|
||||
let attr6 = ctx['category'].id;
|
||||
let attr7 = ctx['category'].id==ctx['options'].active_category_id;
|
||||
let txt5 = ctx['category'].name;
|
||||
c_block15[i1] = withKey(block16([attr6, attr7, txt5]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b15 = list(c_block15);
|
||||
b14 = block14([], [b15]);
|
||||
}
|
||||
let attr16 = ctx['search'].value;
|
||||
let hdlr17 = [ctx['updateFilter'], ctx];
|
||||
let hdlr18 = [ctx['updateFilter'], ctx];
|
||||
let d19 = (el) => refs[\`search_input\`] = el;
|
||||
let hdlr20 = [ctx['clearSearch'], ctx];
|
||||
let d21 = (el) => refs[\`settings_menu\`] = el;
|
||||
let attr8 = ctx['search'].value;
|
||||
let hdlr4 = [ctx['updateFilter'], ctx];
|
||||
let hdlr5 = [ctx['updateFilter'], ctx];
|
||||
let d1 = (el) => refs[\`search_input\`] = el;
|
||||
let hdlr6 = [ctx['clearSearch'], ctx];
|
||||
let d2 = (el) => refs[\`settings_menu\`] = el;
|
||||
if (ctx['triggers']) {
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block18, v_block18, l_block18, c_block18] = prepareList(ctx['triggers']);
|
||||
@@ -286,41 +286,41 @@ exports[`misc other complex template 1`] = `
|
||||
let key1 = ctx['trigger'].id;
|
||||
let b20;
|
||||
if (!ctx['trigger'].manual&&ctx['trigger'].project_id===ctx['project'].id&&ctx['trigger'].category_id===ctx['options'].active_category_id) {
|
||||
let attr22 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let attr23 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let attr24 = ctx['options'].trigger_display[ctx['trigger'].id];
|
||||
let attr25 = ctx['trigger'].id;
|
||||
let hdlr26 = [ctx['updateTriggerDisplay'], ctx];
|
||||
let attr27 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let txt28 = ctx['trigger'].name;
|
||||
b20 = block20([attr22, attr23, attr24, attr25, hdlr26, attr27, txt28]);
|
||||
let attr9 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let attr10 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let attr11 = ctx['options'].trigger_display[ctx['trigger'].id];
|
||||
let attr12 = ctx['trigger'].id;
|
||||
let hdlr7 = [ctx['updateTriggerDisplay'], ctx];
|
||||
let attr13 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let txt6 = ctx['trigger'].name;
|
||||
b20 = block20([attr9, attr10, attr11, attr12, hdlr7, attr13, txt6]);
|
||||
}
|
||||
c_block18[i1] = withKey(multi([b20]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b18 = list(c_block18);
|
||||
let hdlr29 = [ctx['triggerAll'], ctx];
|
||||
let hdlr30 = [ctx['triggerNone'], ctx];
|
||||
let hdlr31 = [ctx['triggerDefault'], ctx];
|
||||
let hdlr32 = [ctx['toggleSettingsMenu'], ctx];
|
||||
let b21 = block21([hdlr29, hdlr30, hdlr31, hdlr32]);
|
||||
let hdlr8 = [ctx['triggerAll'], ctx];
|
||||
let hdlr9 = [ctx['triggerNone'], ctx];
|
||||
let hdlr10 = [ctx['triggerDefault'], ctx];
|
||||
let hdlr11 = [ctx['toggleSettingsMenu'], ctx];
|
||||
let b21 = block21([hdlr8, hdlr9, hdlr10, hdlr11]);
|
||||
b17 = multi([b18, b21]);
|
||||
}
|
||||
if (ctx['load_infos']) {
|
||||
b22 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
b22 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
if (ctx['message']) {
|
||||
let txt33 = ctx['message'];
|
||||
b23 = block23([txt33]);
|
||||
let txt7 = ctx['message'];
|
||||
b23 = block23([txt7]);
|
||||
}
|
||||
if (!ctx['project']) {
|
||||
b24 = block24();
|
||||
} else {
|
||||
let b26 = component(\`BundlesList\`, {bundles: ctx['bundles'].sticky,category_custom_views: ctx['category_custom_views'],search: ctx['search']}, key + \`__3\`, node, ctx);
|
||||
let b27 = component(\`BundlesList\`, {bundles: ctx['bundles'].dev,search: ctx['search']}, key + \`__4\`, node, ctx);
|
||||
let b26 = component(\`BundlesList\`, {bundles: ctx['bundles'].sticky,category_custom_views: ctx['category_custom_views'],search: ctx['search']}, key + \`__2\`, node, ctx);
|
||||
let b27 = component(\`BundlesList\`, {bundles: ctx['bundles'].dev,search: ctx['search']}, key + \`__3\`, node, ctx);
|
||||
b25 = block25([], [b26, b27]);
|
||||
}
|
||||
return block1([attr1, txt2, hdlr11, hdlr12, attr16, hdlr17, hdlr18, d19, hdlr20, d21], [b2, b4, b14, b17, b22, b23, b24, b25]);
|
||||
return block1([attr1, txt1, hdlr2, hdlr3, attr8, hdlr4, hdlr5, d1, hdlr6, d2], [b2, b4, b14, b17, b22, b23, b24, b25]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
}"
|
||||
|
||||
@@ -39,12 +39,12 @@ exports[`debugging t-debug on sub template 2`] = `
|
||||
) {
|
||||
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]);
|
||||
}
|
||||
}"
|
||||
|
||||
@@ -149,7 +149,7 @@ exports[`t-esc t-esc=0 is escaped 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 block2 = createBlock(\`<p>escaped</p>\`);
|
||||
@@ -159,7 +159,7 @@ exports[`t-esc t-esc=0 is escaped 1`] = `
|
||||
ctx[isBoundary] = 1;
|
||||
let b2 = block2();
|
||||
ctx[zero] = b2;
|
||||
let b3 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b3 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
|
||||
@@ -216,7 +216,7 @@ exports[`t-foreach t-call with body in t-foreach in t-foreach 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/><span>[<block-text-0/>][<block-text-1/>][<block-text-2/>]</span></div>\`);
|
||||
let block6 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -245,7 +245,7 @@ exports[`t-foreach t-call with body in t-foreach in t-foreach 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"c\\", 'x'+'_'+ctx['a']+'_'+ctx['b']);
|
||||
c_block4[i2] = withKey(callTemplate_2.call(this, ctx, node, key + \`__1__\${key1}__\${key2}\`), key2);
|
||||
c_block4[i2] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}__\${key2}\`), key2);
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
@@ -287,7 +287,7 @@ exports[`t-foreach t-call without body in t-foreach in t-foreach 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { prepareList, getTemplate, withKey } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`sub\`);
|
||||
const callTemplate_1 = getTemplate(\`sub\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><span>[<block-text-0/>][<block-text-1/>][<block-text-2/>]</span></div>\`);
|
||||
let block6 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -311,7 +311,7 @@ exports[`t-foreach t-call without body in t-foreach in t-foreach 1`] = `
|
||||
ctx[\`b_index\`] = i2;
|
||||
ctx[\`b_value\`] = k_block4[i2];
|
||||
let key2 = ctx['b'];
|
||||
c_block4[i2] = withKey(callTemplate_2.call(this, ctx, node, key + \`__1__\${key1}__\${key2}\`), key2);
|
||||
c_block4[i2] = withKey(callTemplate_1.call(this, ctx, node, key + \`__1__\${key1}__\${key2}\`), key2);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b4 = list(c_block4);
|
||||
|
||||
@@ -32,7 +32,7 @@ exports[`t-out multiple calls to t-out 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 block2 = createBlock(\`<span>coucou</span>\`);
|
||||
@@ -42,7 +42,7 @@ exports[`t-out multiple calls to t-out 1`] = `
|
||||
ctx[isBoundary] = 1;
|
||||
let b2 = block2();
|
||||
ctx[zero] = b2;
|
||||
let b3 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b3 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
@@ -84,7 +84,7 @@ exports[`t-out t-out 0 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { isBoundary, zero, getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`_basic-callee\`);
|
||||
const callTemplate_1 = getTemplate(\`_basic-callee\`);
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
let block2 = createBlock(\`<div>zero</div>\`);
|
||||
@@ -94,7 +94,7 @@ exports[`t-out t-out 0 1`] = `
|
||||
ctx[isBoundary] = 1;
|
||||
let b2 = block2();
|
||||
ctx[zero] = b2;
|
||||
let b3 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b3 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
}"
|
||||
|
||||
@@ -36,12 +36,12 @@ exports[`t-ref ref in a t-call 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]);
|
||||
}
|
||||
}"
|
||||
@@ -99,10 +99,10 @@ exports[`t-ref refs in a loop 1`] = `
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
let key1 = ctx['item'];
|
||||
const tKey_1 = ctx['item'];
|
||||
const v2 = ctx['item'];
|
||||
let ref1 = (el) => refs[\`\${v2}\`] = el;
|
||||
let txt2 = ctx['item'];
|
||||
c_block2[i1] = withKey(block3([ref1, txt2]), tKey_1 + key1);
|
||||
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);
|
||||
return block1([], [b2]);
|
||||
|
||||
@@ -188,7 +188,7 @@ exports[`t-set t-set can't alter from within callee 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><p><block-text-0/></p><block-child-0/><p><block-text-1/></p></div>\`);
|
||||
|
||||
@@ -197,7 +197,7 @@ exports[`t-set t-set can't alter from within callee 1`] = `
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let txt1 = ctx['iter'];
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
@@ -228,7 +228,7 @@ exports[`t-set t-set can't alter in t-call body 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><p><block-text-0/></p><block-child-0/><p><block-text-1/></p></div>\`);
|
||||
|
||||
@@ -240,7 +240,7 @@ exports[`t-set t-set can't alter in t-call body 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"iter\\", 'inCall');
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2], [b2]);
|
||||
|
||||
@@ -31,12 +31,12 @@ exports[`loading templates can load a few templates from a xml string 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`items\`);
|
||||
const callTemplate_1 = getTemplate(\`items\`);
|
||||
|
||||
let block1 = createBlock(\`<ul><block-child-0/></ul>\`);
|
||||
|
||||
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]);
|
||||
}
|
||||
}"
|
||||
@@ -63,12 +63,12 @@ exports[`loading templates can load a few templates from an XMLDocument 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`items\`);
|
||||
const callTemplate_1 = getTemplate(\`items\`);
|
||||
|
||||
let block1 = createBlock(\`<ul><block-child-0/></ul>\`);
|
||||
|
||||
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]);
|
||||
}
|
||||
}"
|
||||
|
||||
Reference in New Issue
Block a user