diff --git a/web/static/src/ts/core/qweb_vdom.ts b/web/static/src/ts/core/qweb_vdom.ts index 97b54873..debdc94e 100644 --- a/web/static/src/ts/core/qweb_vdom.ts +++ b/web/static/src/ts/core/qweb_vdom.ts @@ -431,7 +431,9 @@ export class QWeb { } let nodeID = ctx.generateID(); let p = - attrs.length + tattrs.length > 0 ? `{attrs:{${attrs.join(",")}}}` : "{}"; + attrs.length + tattrs.length > 0 + ? `{key:${nodeID},attrs:{${attrs.join(",")}}}` + : `{key:${nodeID}}`; ctx.addLine(`let c${nodeID} = [], p${nodeID} = ${p};`); for (let id of tattrs) { ctx.addIf(`_${id} instanceof Array`); diff --git a/web/static/tests/core/__snapshots__/component.test.ts.snap b/web/static/tests/core/__snapshots__/component.test.ts.snap index 6ef1c5cb..2ccb9fca 100644 --- a/web/static/tests/core/__snapshots__/component.test.ts.snap +++ b/web/static/tests/core/__snapshots__/component.test.ts.snap @@ -5,7 +5,7 @@ exports[`random stuff/miscellaneous snapshotting compiled code 1`] = ` ) { let owner = context; let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); //WIDGET let _2_index = c1.length; diff --git a/web/static/tests/core/__snapshots__/qweb_vdom.test.ts.snap b/web/static/tests/core/__snapshots__/qweb_vdom.test.ts.snap index ecae79c3..7ac0c063 100644 --- a/web/static/tests/core/__snapshots__/qweb_vdom.test.ts.snap +++ b/web/static/tests/core/__snapshots__/qweb_vdom.test.ts.snap @@ -5,7 +5,7 @@ exports[`attributes dynamic attribute falsy variable 1`] = ` ) { let h = this.h; let _1 = context['value']; - let c2 = [], p2 = {attrs:{foo: _1}}; + let c2 = [], p2 = {key:2,attrs:{foo: _1}}; let vn2 = h('div', p2, c2); return vn2; }" @@ -16,7 +16,7 @@ exports[`attributes dynamic attribute with a dash 1`] = ` ) { let h = this.h; let _1 = context['id']; - let c2 = [], p2 = {attrs:{\\"data-action-id\\": _1}}; + let c2 = [], p2 = {key:2,attrs:{\\"data-action-id\\": _1}}; let vn2 = h('div', p2, c2); return vn2; }" @@ -27,7 +27,7 @@ exports[`attributes dynamic attributes 1`] = ` ) { let h = this.h; let _1 = 'bar'; - let c2 = [], p2 = {attrs:{foo: _1}}; + let c2 = [], p2 = {key:2,attrs:{foo: _1}}; let vn2 = h('div', p2, c2); return vn2; }" @@ -38,7 +38,7 @@ exports[`attributes fixed variable 1`] = ` ) { let h = this.h; let _1 = context['value']; - let c2 = [], p2 = {attrs:{foo: _1}}; + let c2 = [], p2 = {key:2,attrs:{foo: _1}}; let vn2 = h('div', p2, c2); return vn2; }" @@ -49,7 +49,7 @@ exports[`attributes format expression 1`] = ` ) { let h = this.h; let _1 = \`\${context['value'] + 37}\`; - let c2 = [], p2 = {attrs:{foo: _1}}; + let c2 = [], p2 = {key:2,attrs:{foo: _1}}; let vn2 = h('div', p2, c2); return vn2; }" @@ -60,7 +60,7 @@ exports[`attributes format literal 1`] = ` ) { let h = this.h; let _1 = \`bar\`; - let c2 = [], p2 = {attrs:{foo: _1}}; + let c2 = [], p2 = {key:2,attrs:{foo: _1}}; let vn2 = h('div', p2, c2); return vn2; }" @@ -71,7 +71,7 @@ exports[`attributes format multiple 1`] = ` ) { let h = this.h; let _1 = \`a \${context['value1']} is \${context['value2']} of \${context['value3']} ]\`; - let c2 = [], p2 = {attrs:{foo: _1}}; + let c2 = [], p2 = {key:2,attrs:{foo: _1}}; let vn2 = h('div', p2, c2); return vn2; }" @@ -82,7 +82,7 @@ exports[`attributes format value 1`] = ` ) { let h = this.h; let _1 = \`b\${context['value']}r\`; - let c2 = [], p2 = {attrs:{foo: _1}}; + let c2 = [], p2 = {key:2,attrs:{foo: _1}}; let vn2 = h('div', p2, c2); return vn2; }" @@ -92,10 +92,10 @@ exports[`attributes from variables set previously 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let _2 = 'def'; - let c3 = [], p3 = {attrs:{class: _2}}; + let c3 = [], p3 = {key:3,attrs:{class: _2}}; let vn3 = h('span', p3, c3); c1.push(vn3); return vn1; @@ -107,7 +107,7 @@ exports[`attributes object 1`] = ` ) { let h = this.h; let _1 = context['value']; - let c2 = [], p2 = {attrs:{}}; + let c2 = [], p2 = {key:2,attrs:{}}; if (_1 instanceof Array) { p2.attrs[_1[0]] = _1[1]; } else { @@ -127,7 +127,7 @@ exports[`attributes static attributes 1`] = ` let _1 = 'a'; let _2 = 'b'; let _3 = 'c'; - let c4 = [], p4 = {attrs:{foo: _1,bar: _2,baz: _3}}; + let c4 = [], p4 = {key:4,attrs:{foo: _1,bar: _2,baz: _3}}; let vn4 = h('div', p4, c4); return vn4; }" @@ -139,7 +139,7 @@ exports[`attributes static attributes on void elements 1`] = ` let h = this.h; let _1 = '/test.jpg'; let _2 = 'Test'; - let c3 = [], p3 = {attrs:{src: _1,alt: _2}}; + let c3 = [], p3 = {key:3,attrs:{src: _1,alt: _2}}; let vn3 = h('img', p3, c3); return vn3; }" @@ -150,7 +150,7 @@ exports[`attributes static attributes with dashes 1`] = ` ) { let h = this.h; let _1 = 'Close'; - let c2 = [], p2 = {attrs:{\\"aria-label\\": _1}}; + let c2 = [], p2 = {key:2,attrs:{\\"aria-label\\": _1}}; let vn2 = h('div', p2, c2); return vn2; }" @@ -161,7 +161,7 @@ exports[`attributes tuple literal 1`] = ` ) { let h = this.h; let _1 = ['foo', 'bar']; - let c2 = [], p2 = {attrs:{}}; + let c2 = [], p2 = {key:2,attrs:{}}; if (_1 instanceof Array) { p2.attrs[_1[0]] = _1[1]; } else { @@ -179,7 +179,7 @@ exports[`attributes tuple variable 1`] = ` ) { let h = this.h; let _1 = context['value']; - let c2 = [], p2 = {attrs:{}}; + let c2 = [], p2 = {key:2,attrs:{}}; if (_1 instanceof Array) { p2.attrs[_1[0]] = _1[1]; } else { @@ -197,7 +197,7 @@ exports[`foreach does not pollute the rendering context 1`] = ` ) { context = Object.create(context); let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \` \`}); @@ -229,7 +229,7 @@ exports[`foreach iterate on items (on a element node) 1`] = ` ) { context = Object.create(context); let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \` \`}); @@ -245,7 +245,7 @@ exports[`foreach iterate on items (on a element node) 1`] = ` context.item_index = i; context.item = _3[i]; context.item_value = _4[i]; - let c5 = [], p5 = {}; + let c5 = [], p5 = {key:5}; let vn5 = h('span', p5, c5); c1.push(vn5); let e6 = context['item']; @@ -264,7 +264,7 @@ exports[`foreach iterate on items 1`] = ` ) { context = Object.create(context); let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \` \`}); @@ -310,7 +310,7 @@ exports[`foreach iterate, dict param 1`] = ` ) { context = Object.create(context); let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \` \`}); @@ -361,7 +361,7 @@ exports[`foreach iterate, integer param 1`] = ` ) { context = Object.create(context); let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let _2 = 3; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} @@ -403,7 +403,7 @@ exports[`foreach iterate, position 1`] = ` ) { context = Object.create(context); let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \` \`}); @@ -445,13 +445,13 @@ exports[`loading templates can load a few templates from a xml string 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('ul', p1, c1); - let c2 = [], p2 = {}; + let c2 = [], p2 = {key:2}; let vn2 = h('li', p2, c2); c1.push(vn2); c2.push({text: \`ok\`}); - let c3 = [], p3 = {}; + let c3 = [], p3 = {key:3}; let vn3 = h('li', p3, c3); c1.push(vn3); c3.push({text: \`foo\`}); @@ -464,7 +464,7 @@ exports[`misc global 1`] = ` ) { context = Object.create(context); let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \` \`}); @@ -482,7 +482,7 @@ exports[`misc global 1`] = ` context.value_value = _4[i]; c1.push({text: \` \`}); - let c5 = [], p5 = {}; + let c5 = [], p5 = {key:5}; let vn5 = h('span', p5, c5); c1.push(vn5); let e6 = context['value']; @@ -492,12 +492,12 @@ exports[`misc global 1`] = ` c1.push({text: \` \`}); let _7 = 'agüero'; - let c8 = [], p8 = {attrs:{\\"falló\\": _7}}; + let c8 = [], p8 = {key:8,attrs:{\\"falló\\": _7}}; let vn8 = h('Año', p8, c8); c1.push(vn8); c8.push({text: \` \`}); - let c9 = [], p9 = {}; + let c9 = [], p9 = {key:9}; let vn9 = h('span', p9, c9); c8.push(vn9); let e10 = 'aaa'; @@ -508,7 +508,7 @@ exports[`misc global 1`] = ` } c8.push({text: \` \`}); - let c11 = [], p11 = {}; + let c11 = [], p11 = {key:11}; let vn11 = h('span', p11, c11); c8.push(vn11); let e12 = context['foo']; @@ -521,7 +521,7 @@ exports[`misc global 1`] = ` \`}); c8.push({text: \` \`}); - let c13 = [], p13 = {}; + let c13 = [], p13 = {key:13}; let vn13 = h('span', p13, c13); c8.push(vn13); let e14 = 'bbb'; @@ -537,7 +537,7 @@ exports[`misc global 1`] = ` } c1.push({text: \` \`}); - let c15 = [], p15 = {}; + let c15 = [], p15 = {key:15}; let vn15 = h('div', p15, c15); c1.push(vn15); let e16 = context['toto']; @@ -559,9 +559,9 @@ exports[`static templates div with a span child node 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); - let c2 = [], p2 = {}; + let c2 = [], p2 = {key:2}; let vn2 = h('span', p2, c2); c1.push(vn2); c2.push({text: \`word\`}); @@ -573,7 +573,7 @@ exports[`static templates div with a text node 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \`word\`}); return vn1; @@ -584,7 +584,7 @@ exports[`static templates empty div 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); return vn1; }" @@ -603,7 +603,7 @@ exports[`t-call (template calling basic caller 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \`ok\`}); return vn1; @@ -614,7 +614,7 @@ exports[`t-call (template calling inherit context 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let e2 = 1; if (e2 || e2 === 0) { @@ -628,7 +628,7 @@ exports[`t-call (template calling scoped parameters 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \` \`}); @@ -649,7 +649,7 @@ exports[`t-call (template calling with unused body 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \`ok\`}); return vn1; @@ -660,7 +660,7 @@ exports[`t-call (template calling with unused setbody 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \`ok\`}); return vn1; @@ -671,7 +671,7 @@ exports[`t-call (template calling with used body 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('h1', p1, c1); c1.push({text: \`ok\`}); return vn1; @@ -682,7 +682,7 @@ exports[`t-call (template calling with used set body 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('span', p1, c1); let e2 = 'ok'; if (e2 || e2 === 0) { @@ -696,7 +696,7 @@ exports[`t-esc escaping on a node 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('span', p1, c1); let e2 = 'ok'; if (e2 || e2 === 0) { @@ -710,7 +710,7 @@ exports[`t-esc escaping on a node with a body 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('span', p1, c1); let e2 = 'ok'; if (e2 || e2 === 0) { @@ -726,7 +726,7 @@ exports[`t-esc escaping on a node with a body, as a default 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('span', p1, c1); let e2 = context['var']; if (e2 || e2 === 0) { @@ -742,7 +742,7 @@ exports[`t-esc literal 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('span', p1, c1); let e2 = 'ok'; if (e2 || e2 === 0) { @@ -756,7 +756,7 @@ exports[`t-esc variable 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('span', p1, c1); let e2 = context['var']; if (e2 || e2 === 0) { @@ -770,7 +770,7 @@ exports[`t-if boolean value condition elif 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); if (context['color'] == 'black') { c1.push({text: \`black pearl\`}); @@ -792,11 +792,11 @@ exports[`t-if boolean value condition else 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); c1.push({text: \` \`}); - let c2 = [], p2 = {}; + let c2 = [], p2 = {key:2}; let vn2 = h('span', p2, c2); c1.push(vn2); c2.push({text: \`begin\`}); @@ -810,7 +810,7 @@ exports[`t-if boolean value condition else 1`] = ` } c1.push({text: \` \`}); - let c3 = [], p3 = {}; + let c3 = [], p3 = {key:3}; let vn3 = h('span', p3, c3); c1.push(vn3); c3.push({text: \`end\`}); @@ -824,9 +824,9 @@ exports[`t-if boolean value condition false else 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); - let c2 = [], p2 = {}; + let c2 = [], p2 = {key:2}; let vn2 = h('span', p2, c2); c1.push(vn2); c2.push({text: \`begin\`}); @@ -836,7 +836,7 @@ exports[`t-if boolean value condition false else 1`] = ` else { c1.push({text: \`fail-else\`}); } - let c3 = [], p3 = {}; + let c3 = [], p3 = {key:3}; let vn3 = h('span', p3, c3); c1.push(vn3); c3.push({text: \`end\`}); @@ -848,7 +848,7 @@ exports[`t-if boolean value condition missing 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('span', p1, c1); if (context['condition']) { c1.push({text: \`fail\`}); @@ -861,7 +861,7 @@ exports[`t-if boolean value false condition 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); if (context['condition']) { c1.push({text: \`ok\`}); @@ -874,7 +874,7 @@ exports[`t-if boolean value true condition 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); if (context['condition']) { c1.push({text: \`ok\`}); @@ -888,7 +888,7 @@ exports[`t-on can bind event handler 1`] = ` ) { let owner = context; let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('button', p1, c1); extra.handlers[1] = extra.handlers[1] || context['add'].bind(owner); p1.on = {click: extra.handlers[1]}; @@ -902,7 +902,7 @@ exports[`t-on can bind handlers with arguments 1`] = ` ) { let owner = context; let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('button', p1, c1); p1.on = {click: context['add'].bind(owner, 5)}; c1.push({text: \`Click\`}); @@ -916,7 +916,7 @@ exports[`t-on can bind handlers with loop variable as argument 1`] = ` let owner = context; context = Object.create(context); let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('ul', p1, c1); c1.push({text: \` \`}); @@ -932,10 +932,10 @@ exports[`t-on can bind handlers with loop variable as argument 1`] = ` context.action_index = i; context.action = _3[i]; context.action_value = _4[i]; - let c5 = [], p5 = {}; + let c5 = [], p5 = {key:5}; let vn5 = h('li', p5, c5); c1.push(vn5); - let c6 = [], p6 = {}; + let c6 = [], p6 = {key:6}; let vn6 = h('a', p6, c6); c5.push(vn6); p6.on = {click: context['activate'].bind(owner, context['action'])}; @@ -952,7 +952,7 @@ exports[`t-on handler is bound to proper owner 1`] = ` ) { let owner = context; let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('button', p1, c1); extra.handlers[1] = extra.handlers[1] || context['add'].bind(owner); p1.on = {click: extra.handlers[1]}; @@ -965,7 +965,7 @@ exports[`t-raw literal 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('span', p1, c1); let e2 = 'ok'; if (e2 || e2 === 0) { @@ -982,7 +982,7 @@ exports[`t-raw not escaping 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let e2 = context['var']; if (e2 || e2 === 0) { @@ -999,7 +999,7 @@ exports[`t-raw variable 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('span', p1, c1); let e2 = context['var']; if (e2 || e2 === 0) { @@ -1016,9 +1016,9 @@ exports[`t-ref can get a ref on a node 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); - let c2 = [], p2 = {}; + let c2 = [], p2 = {key:2}; let vn2 = h('span', p2, c2); c1.push(vn2); p2.hook = { @@ -1032,7 +1032,7 @@ exports[`t-set evaluate value expression 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let e2 = 1 + 2; if (e2 || e2 === 0) { @@ -1046,7 +1046,7 @@ exports[`t-set evaluate value expression, part 2 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let e2 = context['somevariable'] + 2; if (e2 || e2 === 0) { @@ -1060,7 +1060,7 @@ exports[`t-set set from attribute literal 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let e2 = 'ok'; if (e2 || e2 === 0) { @@ -1074,7 +1074,7 @@ exports[`t-set set from attribute lookup 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let e2 = context['value']; if (e2 || e2 === 0) { @@ -1097,7 +1097,7 @@ exports[`t-set set from body lookup 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let e2 = context['value']; if (e2 || e2 === 0) { @@ -1111,7 +1111,7 @@ exports[`t-set set from empty body 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); return vn1; }" @@ -1121,7 +1121,7 @@ exports[`t-set value priority 1`] = ` "function anonymous(context,extra ) { let h = this.h; - let c1 = [], p1 = {}; + let c1 = [], p1 = {key:1}; let vn1 = h('div', p1, c1); let e2 = 1; if (e2 || e2 === 0) { diff --git a/web/static/tests/core/component.test.ts b/web/static/tests/core/component.test.ts index a0f63480..19128de1 100644 --- a/web/static/tests/core/component.test.ts +++ b/web/static/tests/core/component.test.ts @@ -688,6 +688,39 @@ describe("composition", () => { `) ); }); + + test("sub widgets between t-ifs", async () => { + // this confuses the patching algorithm... + class ChildWidget extends Widget { + inlineTemplate = `child`; + } + + class Parent extends Widget { + inlineTemplate = `