From 6c8b401092a815fcb3e54f82766b2d309ddd150f Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Wed, 27 Nov 2019 15:13:24 +0100 Subject: [PATCH] [FIX] component: slots: multiple slots with components Closes #508 --- src/component/component.ts | 9 +- src/component/directive.ts | 5 +- src/component/fiber.ts | 5 + src/qweb/compilation_context.ts | 4 - tests/__snapshots__/animations.test.ts.snap | 14 +- .../__snapshots__/component.test.ts.snap | 204 ++++++------------ .../props_validation.test.ts.snap | 6 +- tests/component/component.test.ts | 22 ++ tests/qweb/__snapshots__/qweb.test.ts.snap | 129 ----------- tests/router/__snapshots__/link.test.ts.snap | 1 - .../route_component.test.ts.snap | 6 +- 11 files changed, 102 insertions(+), 303 deletions(-) diff --git a/src/component/component.ts b/src/component/component.ts index 77a38bd8..a84bb5b8 100644 --- a/src/component/component.ts +++ b/src/component/component.ts @@ -481,7 +481,6 @@ export class Component { parentFiber: Fiber, scope: any, vars: any, - previousSibling?: Fiber | null ): Promise { const shouldUpdate = parentFiber.force || this.shouldUpdate(nextProps); if (shouldUpdate) { @@ -490,8 +489,9 @@ export class Component { if (!parentFiber.child) { parentFiber.child = fiber; } else { - previousSibling!.sibling = fiber; + parentFiber.lastChild!.sibling = fiber; } + parentFiber.lastChild = fiber; const defaultProps = (this.constructor).defaultProps; if (defaultProps) { @@ -528,14 +528,15 @@ export class Component { * subcomponent is created. It gets its scope and vars, if any, from the * parent template. */ - __prepare(parentFiber: Fiber, scope: any, vars: any, previousSibling?: Fiber | null) { + __prepare(parentFiber: Fiber, scope: any, vars: any) { const fiber = new Fiber(parentFiber, this, scope, vars, parentFiber.force, null); fiber.shouldPatch = false; if (!parentFiber.child) { parentFiber.child = fiber; } else { - previousSibling!.sibling = fiber; + parentFiber.lastChild!.sibling = fiber; } + parentFiber.lastChild = fiber; return this.__prepareAndRender(fiber); } diff --git a/src/component/directive.ts b/src/component/directive.ts index a00ca646..f33d1d56 100644 --- a/src/component/directive.ts +++ b/src/component/directive.ts @@ -381,7 +381,7 @@ QWeb.addDirective({ } ctx.addLine( `w${componentID}.__updateProps(props${componentID}, extra.fiber${scopeVars && - ", " + scopeVars}, sibling)${styleCode};` + ", " + scopeVars})${styleCode};` ); ctx.addLine(`let pvnode = w${componentID}.__owl__.pvnode;`); if (registerCode) { @@ -436,7 +436,7 @@ QWeb.addDirective({ } } - ctx.addLine(`let def${defID} = w${componentID}.__prepare(extra.fiber, ${scopeVars}, sibling);`); + ctx.addLine(`let def${defID} = w${componentID}.__prepare(extra.fiber, ${scopeVars});`); // hack: specify empty remove hook to prevent the node from being removed from the DOM ctx.addLine( `let pvnode = h('dummy', {key: ${templateKey}, hook: {insert(vn) { let nvn=w${componentID}.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;${refExpr}${transitionsInsertCode}},remove() {},destroy(vn) {${finalizeComponentCode}}}});` @@ -460,7 +460,6 @@ QWeb.addDirective({ } ctx.addLine(`w${componentID}.__owl__.parentLastFiberId = extra.fiber.id;`); - ctx.addLine(`sibling = w${componentID}.__owl__.currentFiber || sibling;`); return true; } diff --git a/src/component/fiber.ts b/src/component/fiber.ts index e40ed43f..36d01dad 100644 --- a/src/component/fiber.ts +++ b/src/component/fiber.ts @@ -57,6 +57,7 @@ export class Fiber { root: Fiber; child: Fiber | null = null; sibling: Fiber | null = null; + lastChild: Fiber | null = null; parent: Fiber | null = null; error?: Error; @@ -103,6 +104,7 @@ export class Fiber { // remove relation to children oldFiber.child.parent = null; oldFiber.child = null; + oldFiber.lastChild = null; } oldFiber.counter = 1; // re-initialize counter oldFiber.id = Fiber.nextId++; @@ -124,6 +126,9 @@ export class Fiber { this.parent = oldFiber.parent; this.root = this.parent.root; this.sibling = oldFiber.sibling; + if (this.parent.lastChild === oldFiber) { + this.parent.lastChild = this; + } if (this.parent.child === oldFiber) { this.parent.child = this; } else { diff --git a/src/qweb/compilation_context.ts b/src/qweb/compilation_context.ts index 81e09706..45189cc3 100644 --- a/src/qweb/compilation_context.ts +++ b/src/qweb/compilation_context.ts @@ -22,7 +22,6 @@ export class CompilationContext { shouldDefineUtils: boolean = false; shouldDefineRefs: boolean = false; shouldDefineResult: boolean = true; - shouldDefineSibling: boolean = true; shouldProtectContext: boolean = false; shouldTrackScope: boolean = false; loopNumber: number = 0; @@ -86,9 +85,6 @@ export class CompilationContext { if (this.shouldDefineResult) { this.code.unshift(" let result;"); } - if (this.shouldDefineSibling) { - this.code.unshift(" let sibling = null;"); - } if (this.shouldDefineRefs) { this.code.unshift(" context.__owl__.refs = context.__owl__.refs || {};"); } diff --git a/tests/__snapshots__/animations.test.ts.snap b/tests/__snapshots__/animations.test.ts.snap index ba83ef2f..db65d34d 100644 --- a/tests/__snapshots__/animations.test.ts.snap +++ b/tests/__snapshots__/animations.test.ts.snap @@ -7,7 +7,6 @@ exports[`animations t-transition combined with component 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -20,7 +19,7 @@ exports[`animations t-transition combined with component 1`] = ` w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -29,7 +28,7 @@ exports[`animations t-transition combined with component 1`] = ` if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;utils.transitionInsert(vn, 'chimay');},remove() {},destroy(vn) {let finalize = () => { w3.destroy(); }; @@ -40,7 +39,6 @@ exports[`animations t-transition combined with component 1`] = ` w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -52,7 +50,6 @@ exports[`animations t-transition combined with t-component and t-if 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -66,7 +63,7 @@ exports[`animations t-transition combined with t-component and t-if 1`] = ` w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -75,7 +72,7 @@ exports[`animations t-transition combined with t-component and t-if 1`] = ` if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;utils.transitionInsert(vn, 'chimay');},remove() {},destroy(vn) {let finalize = () => { w3.destroy(); }; @@ -86,7 +83,6 @@ exports[`animations t-transition combined with t-component and t-if 1`] = ` w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; } return vn1; }" @@ -96,7 +92,6 @@ exports[`animations t-transition with no delay/duration 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -117,7 +112,6 @@ exports[`animations t-transition, on a simple node (insert) 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); diff --git a/tests/component/__snapshots__/component.test.ts.snap b/tests/component/__snapshots__/component.test.ts.snap index 54b8e0e1..eedf9e73 100644 --- a/tests/component/__snapshots__/component.test.ts.snap +++ b/tests/component/__snapshots__/component.test.ts.snap @@ -7,7 +7,6 @@ exports[`basic widget properties reconciliation alg works for t-foreach in t-for let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -49,7 +48,7 @@ exports[`basic widget properties reconciliation alg works for t-foreach in t-for w9 = false; } if (w9) { - w9.__updateProps(props9, extra.fiber, undefined, undefined, sibling); + w9.__updateProps(props9, extra.fiber, undefined, undefined); let pvnode = w9.__owl__.pvnode; c1.push(pvnode); } else { @@ -58,7 +57,7 @@ exports[`basic widget properties reconciliation alg works for t-foreach in t-for if (!W9) {throw new Error('Cannot find the definition of component \\"' + componentKey9 + '\\"')} w9 = new W9(parent, props9); parent.__owl__.cmap[k10] = w9.__owl__.id; - let def8 = w9.__prepare(extra.fiber, undefined, undefined, sibling); + let def8 = w9.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k10, hook: {insert(vn) { let nvn=w9.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w9.destroy();}}}); const fiber = w9.__owl__.currentFiber; def8.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -66,7 +65,6 @@ exports[`basic widget properties reconciliation alg works for t-foreach in t-for w9.__owl__.pvnode = pvnode; } w9.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w9.__owl__.currentFiber || sibling; } } return vn1; @@ -80,7 +78,6 @@ exports[`basic widget properties t-key on a component with t-if, and a sibling c let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -95,7 +92,7 @@ exports[`basic widget properties t-key on a component with t-if, and a sibling c w4 = false; } if (w4) { - w4.__updateProps(props4, extra.fiber, undefined, undefined, sibling); + w4.__updateProps(props4, extra.fiber, undefined, undefined); let pvnode = w4.__owl__.pvnode; c1.push(pvnode); } else { @@ -104,7 +101,7 @@ exports[`basic widget properties t-key on a component with t-if, and a sibling c if (!W4) {throw new Error('Cannot find the definition of component \\"' + componentKey4 + '\\"')} w4 = new W4(parent, props4); parent.__owl__.cmap[k5] = w4.__owl__.id; - let def3 = w4.__prepare(extra.fiber, undefined, undefined, sibling); + let def3 = w4.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k5, hook: {insert(vn) { let nvn=w4.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w4.destroy();}}}); const fiber = w4.__owl__.currentFiber; def3.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -112,7 +109,6 @@ exports[`basic widget properties t-key on a component with t-if, and a sibling c w4.__owl__.pvnode = pvnode; } w4.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w4.__owl__.currentFiber || sibling; } //COMPONENT let k9 = \`__10__\`; @@ -123,7 +119,7 @@ exports[`basic widget properties t-key on a component with t-if, and a sibling c w8 = false; } if (w8) { - w8.__updateProps(props8, extra.fiber, undefined, undefined, sibling); + w8.__updateProps(props8, extra.fiber, undefined, undefined); let pvnode = w8.__owl__.pvnode; c1.push(pvnode); } else { @@ -132,7 +128,7 @@ exports[`basic widget properties t-key on a component with t-if, and a sibling c if (!W8) {throw new Error('Cannot find the definition of component \\"' + componentKey8 + '\\"')} w8 = new W8(parent, props8); parent.__owl__.cmap[k9] = w8.__owl__.id; - let def7 = w8.__prepare(extra.fiber, undefined, undefined, sibling); + let def7 = w8.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k9, hook: {insert(vn) { let nvn=w8.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w8.destroy();}}}); const fiber = w8.__owl__.currentFiber; def7.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -140,7 +136,6 @@ exports[`basic widget properties t-key on a component with t-if, and a sibling c w8.__owl__.pvnode = pvnode; } w8.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w8.__owl__.currentFiber || sibling; return vn1; }" `; @@ -152,7 +147,6 @@ exports[`class and style attributes with t-component dynamic t-att-style is prop let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -166,7 +160,7 @@ exports[`class and style attributes with t-component dynamic t-att-style is prop w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling).then(()=>{if (w3.__owl__.isDestroyed) {return};w3.el.style=_6;});; + w3.__updateProps(props3, extra.fiber, undefined, undefined).then(()=>{if (w3.__owl__.isDestroyed) {return};w3.el.style=_6;});; let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -175,7 +169,7 @@ exports[`class and style attributes with t-component dynamic t-att-style is prop if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.style = _6;}};}); @@ -183,7 +177,6 @@ exports[`class and style attributes with t-component dynamic t-att-style is prop w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -196,7 +189,6 @@ exports[`class and style attributes with t-component t-att-class is properly add let parent = context; let owner = context; context.__owl__.refs = context.__owl__.refs || {}; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -212,7 +204,7 @@ exports[`class and style attributes with t-component t-att-class is properly add w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -221,7 +213,7 @@ exports[`class and style attributes with t-component t-att-class is properly add if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;context.__owl__.refs[ref6] = w3;},remove() {},destroy(vn) {w3.destroy();delete context.__owl__.refs[ref6];}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){}};}); @@ -230,7 +222,6 @@ exports[`class and style attributes with t-component t-att-class is properly add } w3.__owl__.classObj=_7; w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -239,7 +230,6 @@ exports[`class and style attributes with t-component t-att-class is properly add "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let _9 = {'c':true}; Object.assign(_9, utils.toObj({d:context['state'].d})) @@ -257,7 +247,6 @@ exports[`class and style attributes with t-component t-att-class is properly add let parent = context; let owner = context; context.__owl__.refs = context.__owl__.refs || {}; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -273,7 +262,7 @@ exports[`class and style attributes with t-component t-att-class is properly add w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -282,7 +271,7 @@ exports[`class and style attributes with t-component t-att-class is properly add if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;context.__owl__.refs[ref6] = w3;},remove() {},destroy(vn) {w3.destroy();delete context.__owl__.refs[ref6];}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){}};}); @@ -291,7 +280,6 @@ exports[`class and style attributes with t-component t-att-class is properly add } w3.__owl__.classObj=_7; w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -300,7 +288,6 @@ exports[`class and style attributes with t-component t-att-class is properly add "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let _9 = {'c':true}; Object.assign(_9, utils.toObj(context['state'].d?'d':'')) @@ -317,7 +304,6 @@ exports[`composition sub components with some state rendered in a loop 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -346,7 +332,7 @@ exports[`composition sub components with some state rendered in a loop 1`] = ` w7 = false; } if (w7) { - w7.__updateProps(props7, extra.fiber, undefined, undefined, sibling); + w7.__updateProps(props7, extra.fiber, undefined, undefined); let pvnode = w7.__owl__.pvnode; c1.push(pvnode); } else { @@ -355,7 +341,7 @@ exports[`composition sub components with some state rendered in a loop 1`] = ` if (!W7) {throw new Error('Cannot find the definition of component \\"' + componentKey7 + '\\"')} w7 = new W7(parent, props7); parent.__owl__.cmap[k8] = w7.__owl__.id; - let def6 = w7.__prepare(extra.fiber, undefined, undefined, sibling); + let def6 = w7.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k8, hook: {insert(vn) { let nvn=w7.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w7.destroy();}}}); const fiber = w7.__owl__.currentFiber; def6.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -363,7 +349,6 @@ exports[`composition sub components with some state rendered in a loop 1`] = ` w7.__owl__.pvnode = pvnode; } w7.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w7.__owl__.currentFiber || sibling; } return vn1; }" @@ -376,7 +361,6 @@ exports[`composition t-component with dynamic value 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -389,7 +373,7 @@ exports[`composition t-component with dynamic value 1`] = ` w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -398,7 +382,7 @@ exports[`composition t-component with dynamic value 1`] = ` if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -406,7 +390,6 @@ exports[`composition t-component with dynamic value 1`] = ` w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -418,7 +401,6 @@ exports[`composition t-component with dynamic value 2 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -431,7 +413,7 @@ exports[`composition t-component with dynamic value 2 1`] = ` w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -440,7 +422,7 @@ exports[`composition t-component with dynamic value 2 1`] = ` if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -448,7 +430,6 @@ exports[`composition t-component with dynamic value 2 1`] = ` w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -460,7 +441,6 @@ exports[`dynamic t-props basic use 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -473,7 +453,7 @@ exports[`dynamic t-props basic use 1`] = ` w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -482,7 +462,7 @@ exports[`dynamic t-props basic use 1`] = ` if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -490,7 +470,6 @@ exports[`dynamic t-props basic use 1`] = ` w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -502,7 +481,6 @@ exports[`other directives with t-component t-on with getter as handler 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -519,7 +497,7 @@ exports[`other directives with t-component t-on with getter as handler 1`] = ` w4 = false; } if (w4) { - w4.__updateProps(props4, extra.fiber, undefined, undefined, sibling); + w4.__updateProps(props4, extra.fiber, undefined, undefined); let pvnode = w4.__owl__.pvnode; c1.push(pvnode); } else { @@ -528,7 +506,7 @@ exports[`other directives with t-component t-on with getter as handler 1`] = ` if (!W4) {throw new Error('Cannot find the definition of component \\"' + componentKey4 + '\\"')} w4 = new W4(parent, props4); parent.__owl__.cmap[k5] = w4.__owl__.id; - let def3 = w4.__prepare(extra.fiber, undefined, undefined, sibling); + let def3 = w4.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k5, hook: {insert(vn) { let nvn=w4.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w4.destroy();}}}); const fiber = w4.__owl__.currentFiber; def3.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {const fn = owner['handler'];if (fn) { fn.call(owner, e); } else { owner.handler; }});}};}); @@ -536,7 +514,6 @@ exports[`other directives with t-component t-on with getter as handler 1`] = ` w4.__owl__.pvnode = pvnode; } w4.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w4.__owl__.currentFiber || sibling; return vn1; }" `; @@ -548,7 +525,6 @@ exports[`other directives with t-component t-on with handler bound to argument 1 let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -561,7 +537,7 @@ exports[`other directives with t-component t-on with handler bound to argument 1 w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -570,7 +546,7 @@ exports[`other directives with t-component t-on with handler bound to argument 1 if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {const fn = owner['onEv'];if (fn) { fn.call(owner, 3, e); } else { owner.onEv; }});}};}); @@ -578,7 +554,6 @@ exports[`other directives with t-component t-on with handler bound to argument 1 w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -590,7 +565,6 @@ exports[`other directives with t-component t-on with handler bound to empty obje let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -603,7 +577,7 @@ exports[`other directives with t-component t-on with handler bound to empty obje w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -612,7 +586,7 @@ exports[`other directives with t-component t-on with handler bound to empty obje if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {const fn = owner['onEv'];if (fn) { fn.call(owner, {}, e); } else { owner.onEv; }});}};}); @@ -620,7 +594,6 @@ exports[`other directives with t-component t-on with handler bound to empty obje w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -632,7 +605,6 @@ exports[`other directives with t-component t-on with handler bound to empty obje let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -645,7 +617,7 @@ exports[`other directives with t-component t-on with handler bound to empty obje w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -654,7 +626,7 @@ exports[`other directives with t-component t-on with handler bound to empty obje if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {const fn = owner['onEv'];if (fn) { fn.call(owner, {}, e); } else { owner.onEv; }});}};}); @@ -662,7 +634,6 @@ exports[`other directives with t-component t-on with handler bound to empty obje w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -674,7 +645,6 @@ exports[`other directives with t-component t-on with handler bound to object 1`] let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -687,7 +657,7 @@ exports[`other directives with t-component t-on with handler bound to object 1`] w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -696,7 +666,7 @@ exports[`other directives with t-component t-on with handler bound to object 1`] if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {const fn = owner['onEv'];if (fn) { fn.call(owner, {val:3}, e); } else { owner.onEv; }});}};}); @@ -704,7 +674,6 @@ exports[`other directives with t-component t-on with handler bound to object 1`] w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -716,7 +685,6 @@ exports[`other directives with t-component t-on with inline statement 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -733,7 +701,7 @@ exports[`other directives with t-component t-on with inline statement 1`] = ` w4 = false; } if (w4) { - w4.__updateProps(props4, extra.fiber, undefined, undefined, sibling); + w4.__updateProps(props4, extra.fiber, undefined, undefined); let pvnode = w4.__owl__.pvnode; c1.push(pvnode); } else { @@ -742,7 +710,7 @@ exports[`other directives with t-component t-on with inline statement 1`] = ` if (!W4) {throw new Error('Cannot find the definition of component \\"' + componentKey4 + '\\"')} w4 = new W4(parent, props4); parent.__owl__.cmap[k5] = w4.__owl__.id; - let def3 = w4.__prepare(extra.fiber, undefined, undefined, sibling); + let def3 = w4.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k5, hook: {insert(vn) { let nvn=w4.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w4.destroy();}}}); const fiber = w4.__owl__.currentFiber; def3.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {const fn = owner['state.counter++'];if (fn) { fn.call(owner, e); } else { owner.state.counter++; }});}};}); @@ -750,7 +718,6 @@ exports[`other directives with t-component t-on with inline statement 1`] = ` w4.__owl__.pvnode = pvnode; } w4.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w4.__owl__.currentFiber || sibling; return vn1; }" `; @@ -762,7 +729,6 @@ exports[`other directives with t-component t-on with no handler (only modifiers) let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -775,7 +741,7 @@ exports[`other directives with t-component t-on with no handler (only modifiers) w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -784,7 +750,7 @@ exports[`other directives with t-component t-on with no handler (only modifiers) if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {const fn = owner['onEv'];if (fn) { fn.call(owner, e); } else { owner.onEv; }});}};}); @@ -792,7 +758,6 @@ exports[`other directives with t-component t-on with no handler (only modifiers) w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -804,7 +769,6 @@ exports[`other directives with t-component t-on with prevent and self modifiers let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -817,7 +781,7 @@ exports[`other directives with t-component t-on with prevent and self modifiers w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -826,7 +790,7 @@ exports[`other directives with t-component t-on with prevent and self modifiers if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {e.preventDefault();if (e.target !== vn.elm) {return}const fn = owner['onEv'];if (fn) { fn.call(owner, e); } else { owner.onEv; }});}};}); @@ -834,7 +798,6 @@ exports[`other directives with t-component t-on with prevent and self modifiers w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -846,7 +809,6 @@ exports[`other directives with t-component t-on with self and prevent modifiers let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -859,7 +821,7 @@ exports[`other directives with t-component t-on with self and prevent modifiers w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -868,7 +830,7 @@ exports[`other directives with t-component t-on with self and prevent modifiers if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {if (e.target !== vn.elm) {return}e.preventDefault();const fn = owner['onEv'];if (fn) { fn.call(owner, e); } else { owner.onEv; }});}};}); @@ -876,7 +838,6 @@ exports[`other directives with t-component t-on with self and prevent modifiers w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -888,7 +849,6 @@ exports[`other directives with t-component t-on with self modifier 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -901,7 +861,7 @@ exports[`other directives with t-component t-on with self modifier 1`] = ` w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -910,7 +870,7 @@ exports[`other directives with t-component t-on with self modifier 1`] = ` if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev-1', function (e) {const fn = owner['onEv1'];if (fn) { fn.call(owner, e); } else { owner.onEv1; }});vn.elm.addEventListener('ev-2', function (e) {if (e.target !== vn.elm) {return}const fn = owner['onEv2'];if (fn) { fn.call(owner, e); } else { owner.onEv2; }});}};}); @@ -918,7 +878,6 @@ exports[`other directives with t-component t-on with self modifier 1`] = ` w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -930,7 +889,6 @@ exports[`other directives with t-component t-on with stop and/or prevent modifie let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -943,7 +901,7 @@ exports[`other directives with t-component t-on with stop and/or prevent modifie w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -952,7 +910,7 @@ exports[`other directives with t-component t-on with stop and/or prevent modifie if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev-1', function (e) {e.stopPropagation();const fn = owner['onEv1'];if (fn) { fn.call(owner, e); } else { owner.onEv1; }});vn.elm.addEventListener('ev-2', function (e) {e.preventDefault();const fn = owner['onEv2'];if (fn) { fn.call(owner, e); } else { owner.onEv2; }});vn.elm.addEventListener('ev-3', function (e) {e.stopPropagation();e.preventDefault();const fn = owner['onEv3'];if (fn) { fn.call(owner, e); } else { owner.onEv3; }});}};}); @@ -960,7 +918,6 @@ exports[`other directives with t-component t-on with stop and/or prevent modifie w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -968,7 +925,6 @@ exports[`other directives with t-component t-on with stop and/or prevent modifie exports[`random stuff/miscellaneous can inject values in tagged templates 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -990,7 +946,6 @@ exports[`random stuff/miscellaneous snapshotting compiled code 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1004,7 +959,7 @@ exports[`random stuff/miscellaneous snapshotting compiled code 1`] = ` w4 = false; } if (w4) { - w4.__updateProps(props4, extra.fiber, undefined, undefined, sibling); + w4.__updateProps(props4, extra.fiber, undefined, undefined); let pvnode = w4.__owl__.pvnode; c1.push(pvnode); } else { @@ -1013,7 +968,7 @@ exports[`random stuff/miscellaneous snapshotting compiled code 1`] = ` if (!W4) {throw new Error('Cannot find the definition of component \\"' + componentKey4 + '\\"')} w4 = new W4(parent, props4); parent.__owl__.cmap[k5] = w4.__owl__.id; - let def3 = w4.__prepare(extra.fiber, undefined, undefined, sibling); + let def3 = w4.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k5, hook: {insert(vn) { let nvn=w4.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w4.destroy();}}}); const fiber = w4.__owl__.currentFiber; def3.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -1021,7 +976,6 @@ exports[`random stuff/miscellaneous snapshotting compiled code 1`] = ` w4.__owl__.pvnode = pvnode; } w4.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w4.__owl__.currentFiber || sibling; return vn1; }" `; @@ -1033,7 +987,6 @@ exports[`random stuff/miscellaneous t-on with handler bound to dynamic argument let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -1063,7 +1016,7 @@ exports[`random stuff/miscellaneous t-on with handler bound to dynamic argument w7 = false; } if (w7) { - w7.__updateProps(props7, extra.fiber, undefined, undefined, sibling); + w7.__updateProps(props7, extra.fiber, undefined, undefined); let pvnode = w7.__owl__.pvnode; c1.push(pvnode); } else { @@ -1072,7 +1025,7 @@ exports[`random stuff/miscellaneous t-on with handler bound to dynamic argument if (!W7) {throw new Error('Cannot find the definition of component \\"' + componentKey7 + '\\"')} w7 = new W7(parent, props7); parent.__owl__.cmap[k8] = w7.__owl__.id; - let def6 = w7.__prepare(extra.fiber, undefined, undefined, sibling); + let def6 = w7.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k8, hook: {insert(vn) { let nvn=w7.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w7.destroy();}}}); const fiber = w7.__owl__.currentFiber; def6.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; vnode.data.hook = {create(_, vn){vn.elm.addEventListener('ev', function (e) {const fn = owner['onEv'];if (fn) { fn.call(owner, arg10, e); } else { owner.onEv; }});}};}); @@ -1080,7 +1033,6 @@ exports[`random stuff/miscellaneous t-on with handler bound to dynamic argument w7.__owl__.pvnode = pvnode; } w7.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w7.__owl__.currentFiber || sibling; } return vn1; }" @@ -1089,7 +1041,6 @@ exports[`random stuff/miscellaneous t-on with handler bound to dynamic argument exports[`t-model directive .lazy modifier 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1115,7 +1066,6 @@ exports[`t-model directive .lazy modifier 1`] = ` exports[`t-model directive basic use, on an input 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1141,7 +1091,6 @@ exports[`t-model directive basic use, on an input 1`] = ` exports[`t-model directive basic use, on another key in component 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1167,7 +1116,6 @@ exports[`t-model directive basic use, on another key in component 1`] = ` exports[`t-model directive in a t-foreach 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -1204,7 +1152,6 @@ exports[`t-model directive in a t-foreach 1`] = ` exports[`t-model directive on a select 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1251,7 +1198,6 @@ exports[`t-model directive on a select 1`] = ` exports[`t-model directive on a sub state key 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1277,7 +1223,6 @@ exports[`t-model directive on a sub state key 1`] = ` exports[`t-model directive on an input type=radio 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1318,7 +1263,6 @@ exports[`t-model directive on an input type=radio 1`] = ` exports[`t-model directive on an input, type=checkbox 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1351,7 +1295,6 @@ exports[`t-slot directive can define and call slots 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1364,7 +1307,7 @@ exports[`t-slot directive can define and call slots 1`] = ` w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, {}, undefined, sibling); + w3.__updateProps(props3, extra.fiber, {}, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -1374,7 +1317,7 @@ exports[`t-slot directive can define and call slots 1`] = ` w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; w3.__owl__.slotId = 1; - let def2 = w3.__prepare(extra.fiber, {}, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, {}, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -1382,7 +1325,6 @@ exports[`t-slot directive can define and call slots 1`] = ` w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; @@ -1391,7 +1333,6 @@ exports[`t-slot directive can define and call slots 2`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c8 = [], p8 = {key:8}; var vn8 = h('div', p8, c8); @@ -1416,7 +1357,6 @@ exports[`t-slot directive can define and call slots 2`] = ` exports[`t-slot directive can define and call slots 3`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1430,7 +1370,6 @@ exports[`t-slot directive can define and call slots 3`] = ` exports[`t-slot directive can define and call slots 4`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1444,7 +1383,6 @@ exports[`t-slot directive can define and call slots 4`] = ` exports[`t-slot directive content is the default slot 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1458,7 +1396,6 @@ exports[`t-slot directive content is the default slot 1`] = ` exports[`t-slot directive default slot work with text nodes 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1469,7 +1406,6 @@ exports[`t-slot directive default slot work with text nodes 1`] = ` exports[`t-slot directive multiple roots are allowed in a default slot 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1487,7 +1423,6 @@ exports[`t-slot directive multiple roots are allowed in a default slot 1`] = ` exports[`t-slot directive multiple roots are allowed in a named slot 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1507,7 +1442,6 @@ exports[`t-slot directive refs are properly bound in slots 1`] = ` ) { let owner = context; context.__owl__.refs = context.__owl__.refs || {}; - let sibling = null; var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1533,7 +1467,6 @@ exports[`t-slot directive slots are rendered with proper context 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1550,7 +1483,6 @@ exports[`t-slot directive slots are rendered with proper context, part 2 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; var _13 = context['props'].to; let c14 = [], p14 = {key:14,attrs:{href: _13}}; @@ -1570,7 +1502,6 @@ exports[`t-slot directive slots are rendered with proper context, part 2 2`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; context = Object.create(context); const scope = Object.create(null); var h = this.h; @@ -1611,7 +1542,7 @@ exports[`t-slot directive slots are rendered with proper context, part 2 2`] = ` w9 = false; } if (w9) { - w9.__updateProps(props9, extra.fiber, Object.assign({}, scope), undefined, sibling); + w9.__updateProps(props9, extra.fiber, Object.assign({}, scope), undefined); let pvnode = w9.__owl__.pvnode; c7.push(pvnode); } else { @@ -1621,7 +1552,7 @@ exports[`t-slot directive slots are rendered with proper context, part 2 2`] = ` w9 = new W9(parent, props9); parent.__owl__.cmap[k10] = w9.__owl__.id; w9.__owl__.slotId = 1; - let def8 = w9.__prepare(extra.fiber, Object.assign({}, scope), undefined, sibling); + let def8 = w9.__prepare(extra.fiber, Object.assign({}, scope), undefined); let pvnode = h('dummy', {key: k10, hook: {insert(vn) { let nvn=w9.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w9.destroy();}}}); const fiber = w9.__owl__.currentFiber; def8.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -1629,7 +1560,6 @@ exports[`t-slot directive slots are rendered with proper context, part 2 2`] = ` w9.__owl__.pvnode = pvnode; } w9.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w9.__owl__.currentFiber || sibling; } return vn1; }" @@ -1638,7 +1568,6 @@ exports[`t-slot directive slots are rendered with proper context, part 2 2`] = ` exports[`t-slot directive slots are rendered with proper context, part 2 3`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c7 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1654,7 +1583,6 @@ exports[`t-slot directive slots are rendered with proper context, part 3 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; var _13 = context['props'].to; let c14 = [], p14 = {key:14,attrs:{href: _13}}; @@ -1674,7 +1602,6 @@ exports[`t-slot directive slots are rendered with proper context, part 3 2`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; context = Object.create(context); const scope = Object.create(null); var h = this.h; @@ -1716,7 +1643,7 @@ exports[`t-slot directive slots are rendered with proper context, part 3 2`] = ` w10 = false; } if (w10) { - w10.__updateProps(props10, extra.fiber, Object.assign({}, scope), {_8}, sibling); + w10.__updateProps(props10, extra.fiber, Object.assign({}, scope), {_8}); let pvnode = w10.__owl__.pvnode; c7.push(pvnode); } else { @@ -1726,7 +1653,7 @@ exports[`t-slot directive slots are rendered with proper context, part 3 2`] = ` w10 = new W10(parent, props10); parent.__owl__.cmap[k11] = w10.__owl__.id; w10.__owl__.slotId = 1; - let def9 = w10.__prepare(extra.fiber, Object.assign({}, scope), {_8}, sibling); + let def9 = w10.__prepare(extra.fiber, Object.assign({}, scope), {_8}); let pvnode = h('dummy', {key: k11, hook: {insert(vn) { let nvn=w10.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w10.destroy();}}}); const fiber = w10.__owl__.currentFiber; def9.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -1734,7 +1661,6 @@ exports[`t-slot directive slots are rendered with proper context, part 3 2`] = ` w10.__owl__.pvnode = pvnode; } w10.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w10.__owl__.currentFiber || sibling; } return vn1; }" @@ -1743,7 +1669,6 @@ exports[`t-slot directive slots are rendered with proper context, part 3 2`] = ` exports[`t-slot directive slots are rendered with proper context, part 3 3`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c7 = extra.parentNode; let _8 = extra.fiber.vars._8 @@ -1761,7 +1686,6 @@ exports[`t-slot directive slots are rendered with proper context, part 4 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1775,7 +1699,7 @@ exports[`t-slot directive slots are rendered with proper context, part 4 1`] = ` w4 = false; } if (w4) { - w4.__updateProps(props4, extra.fiber, {}, {_2}, sibling); + w4.__updateProps(props4, extra.fiber, {}, {_2}); let pvnode = w4.__owl__.pvnode; c1.push(pvnode); } else { @@ -1785,7 +1709,7 @@ exports[`t-slot directive slots are rendered with proper context, part 4 1`] = ` w4 = new W4(parent, props4); parent.__owl__.cmap[k5] = w4.__owl__.id; w4.__owl__.slotId = 1; - let def3 = w4.__prepare(extra.fiber, {}, {_2}, sibling); + let def3 = w4.__prepare(extra.fiber, {}, {_2}); let pvnode = h('dummy', {key: k5, hook: {insert(vn) { let nvn=w4.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w4.destroy();}}}); const fiber = w4.__owl__.currentFiber; def3.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -1793,7 +1717,6 @@ exports[`t-slot directive slots are rendered with proper context, part 4 1`] = ` w4.__owl__.pvnode = pvnode; } w4.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w4.__owl__.currentFiber || sibling; return vn1; }" `; @@ -1801,7 +1724,6 @@ exports[`t-slot directive slots are rendered with proper context, part 4 1`] = ` exports[`t-slot directive slots are rendered with proper context, part 4 2`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = extra.parentNode; let _2 = extra.fiber.vars._2 @@ -1817,7 +1739,6 @@ exports[`t-slot directive template can just return a slot 1`] = ` ) { let utils = this.constructor.utils; let owner = context; - let sibling = null; let result; var h = this.h; const slot10 = this.constructor.slots[context.__owl__.slotId + '_' + 'default']; @@ -1838,7 +1759,6 @@ exports[`top level sub widgets basic use 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; let result; var h = this.h; //COMPONENT @@ -1852,7 +1772,7 @@ exports[`top level sub widgets basic use 1`] = ` w2 = false; } if (w2) { - w2.__updateProps(props2, extra.fiber, undefined, undefined, sibling); + w2.__updateProps(props2, extra.fiber, undefined, undefined); let pvnode = w2.__owl__.pvnode; utils.defineProxy(vn5, pvnode); } else { @@ -1861,7 +1781,7 @@ exports[`top level sub widgets basic use 1`] = ` if (!W2) {throw new Error('Cannot find the definition of component \\"' + componentKey2 + '\\"')} w2 = new W2(parent, props2); parent.__owl__.cmap[k3] = w2.__owl__.id; - let def1 = w2.__prepare(extra.fiber, undefined, undefined, sibling); + let def1 = w2.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k3, hook: {insert(vn) { let nvn=w2.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w2.destroy();}}}); const fiber = w2.__owl__.currentFiber; def1.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -1869,7 +1789,6 @@ exports[`top level sub widgets basic use 1`] = ` w2.__owl__.pvnode = pvnode; } w2.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w2.__owl__.currentFiber || sibling; return result; }" `; @@ -1881,7 +1800,6 @@ exports[`top level sub widgets can select a sub widget 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; let result; var h = this.h; if (context['env'].flag) { @@ -1896,7 +1814,7 @@ exports[`top level sub widgets can select a sub widget 1`] = ` w2 = false; } if (w2) { - w2.__updateProps(props2, extra.fiber, undefined, undefined, sibling); + w2.__updateProps(props2, extra.fiber, undefined, undefined); let pvnode = w2.__owl__.pvnode; utils.defineProxy(vn5, pvnode); } else { @@ -1905,7 +1823,7 @@ exports[`top level sub widgets can select a sub widget 1`] = ` if (!W2) {throw new Error('Cannot find the definition of component \\"' + componentKey2 + '\\"')} w2 = new W2(parent, props2); parent.__owl__.cmap[k3] = w2.__owl__.id; - let def1 = w2.__prepare(extra.fiber, undefined, undefined, sibling); + let def1 = w2.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k3, hook: {insert(vn) { let nvn=w2.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w2.destroy();}}}); const fiber = w2.__owl__.currentFiber; def1.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -1913,7 +1831,6 @@ exports[`top level sub widgets can select a sub widget 1`] = ` w2.__owl__.pvnode = pvnode; } w2.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w2.__owl__.currentFiber || sibling; } if (!context['env'].flag) { //COMPONENT @@ -1927,7 +1844,7 @@ exports[`top level sub widgets can select a sub widget 1`] = ` w7 = false; } if (w7) { - w7.__updateProps(props7, extra.fiber, undefined, undefined, sibling); + w7.__updateProps(props7, extra.fiber, undefined, undefined); let pvnode = w7.__owl__.pvnode; utils.defineProxy(vn10, pvnode); } else { @@ -1936,7 +1853,7 @@ exports[`top level sub widgets can select a sub widget 1`] = ` if (!W7) {throw new Error('Cannot find the definition of component \\"' + componentKey7 + '\\"')} w7 = new W7(parent, props7); parent.__owl__.cmap[k8] = w7.__owl__.id; - let def6 = w7.__prepare(extra.fiber, undefined, undefined, sibling); + let def6 = w7.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k8, hook: {insert(vn) { let nvn=w7.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w7.destroy();}}}); const fiber = w7.__owl__.currentFiber; def6.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -1944,7 +1861,6 @@ exports[`top level sub widgets can select a sub widget 1`] = ` w7.__owl__.pvnode = pvnode; } w7.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w7.__owl__.currentFiber || sibling; } return result; }" diff --git a/tests/component/__snapshots__/props_validation.test.ts.snap b/tests/component/__snapshots__/props_validation.test.ts.snap index d909abf4..5a30f5c0 100644 --- a/tests/component/__snapshots__/props_validation.test.ts.snap +++ b/tests/component/__snapshots__/props_validation.test.ts.snap @@ -7,7 +7,6 @@ exports[`props validation props are validated in dev mode (code snapshot) 1`] = let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -20,7 +19,7 @@ exports[`props validation props are validated in dev mode (code snapshot) 1`] = w3 = false; } if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); + w3.__updateProps(props3, extra.fiber, undefined, undefined); let pvnode = w3.__owl__.pvnode; c1.push(pvnode); } else { @@ -29,7 +28,7 @@ exports[`props validation props are validated in dev mode (code snapshot) 1`] = if (!W3) {throw new Error('Cannot find the definition of component \\"' + componentKey3 + '\\"')} w3 = new W3(parent, props3); parent.__owl__.cmap[k4] = w3.__owl__.id; - let def2 = w3.__prepare(extra.fiber, undefined, undefined, sibling); + let def2 = w3.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k4, hook: {insert(vn) { let nvn=w3.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w3.destroy();}}}); const fiber = w3.__owl__.currentFiber; def2.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -37,7 +36,6 @@ exports[`props validation props are validated in dev mode (code snapshot) 1`] = w3.__owl__.pvnode = pvnode; } w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; return vn1; }" `; diff --git a/tests/component/component.test.ts b/tests/component/component.test.ts index c937e03a..2a3d255a 100644 --- a/tests/component/component.test.ts +++ b/tests/component/component.test.ts @@ -4153,6 +4153,28 @@ describe("t-slot directive", () => { await nextTick(); expect(fixture.innerHTML).toBe("
5
"); }); + + test("multiple slots containing components", async () => { + class C extends Component { + static template = xml``; + } + class B extends Component { + static template = xml`
`; + } + class A extends Component { + static template = xml` + + + + `; + static components = { B, C }; + } + + const a = new A(); + await a.mount(fixture); + + expect(fixture.innerHTML).toBe(`
12
`); + }); }); describe("t-model directive", () => { diff --git a/tests/qweb/__snapshots__/qweb.test.ts.snap b/tests/qweb/__snapshots__/qweb.test.ts.snap index 982b9a51..409cc823 100644 --- a/tests/qweb/__snapshots__/qweb.test.ts.snap +++ b/tests/qweb/__snapshots__/qweb.test.ts.snap @@ -3,7 +3,6 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = 'hello ' + (context['value']?'world':''); let c2 = [], p2 = {key:2,attrs:{class: _1}}; @@ -15,7 +14,6 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = ` exports[`attributes dynamic attribute falsy variable 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = context['value']; let c2 = [], p2 = {key:2,attrs:{foo: _1}}; @@ -27,7 +25,6 @@ exports[`attributes dynamic attribute falsy variable 1`] = ` exports[`attributes dynamic attribute with a dash 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = context['id']; let c2 = [], p2 = {key:2,attrs:{\\"data-action-id\\": _1}}; @@ -39,7 +36,6 @@ exports[`attributes dynamic attribute with a dash 1`] = ` exports[`attributes dynamic attributes 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = 'bar'; let c2 = [], p2 = {key:2,attrs:{foo: _1}}; @@ -51,7 +47,6 @@ exports[`attributes dynamic attributes 1`] = ` exports[`attributes dynamic formatted attributes with a dash 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = \`Some text \${context['id']}\`; let c2 = [], p2 = {key:2,attrs:{\\"aria-label\\": _1}}; @@ -63,7 +58,6 @@ exports[`attributes dynamic formatted attributes with a dash 1`] = ` exports[`attributes fixed variable 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = context['value']; let c2 = [], p2 = {key:2,attrs:{foo: _1}}; @@ -75,7 +69,6 @@ exports[`attributes fixed variable 1`] = ` exports[`attributes format expression 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = (context['value']+37); let c2 = [], p2 = {key:2,attrs:{foo: _1}}; @@ -87,7 +80,6 @@ exports[`attributes format expression 1`] = ` exports[`attributes format expression, other format 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = (context['value']+37); let c2 = [], p2 = {key:2,attrs:{foo: _1}}; @@ -99,7 +91,6 @@ exports[`attributes format expression, other format 1`] = ` exports[`attributes format literal 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = \`bar\`; let c2 = [], p2 = {key:2,attrs:{foo: _1}}; @@ -111,7 +102,6 @@ exports[`attributes format literal 1`] = ` exports[`attributes format multiple 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = \`a \${context['value1']} is \${context['value2']} of \${context['value3']} ]\`; let c2 = [], p2 = {key:2,attrs:{foo: _1}}; @@ -123,7 +113,6 @@ exports[`attributes format multiple 1`] = ` exports[`attributes format value 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = \`b\${context['value']}r\`; let c2 = [], p2 = {key:2,attrs:{foo: _1}}; @@ -136,7 +125,6 @@ exports[`attributes from object variables set previously 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -153,7 +141,6 @@ exports[`attributes from variables set previously 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -169,7 +156,6 @@ exports[`attributes from variables set previously 1`] = ` exports[`attributes object 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = context['value']; let c2 = [], p2 = {key:2,attrs:{}}; @@ -188,7 +174,6 @@ exports[`attributes object 1`] = ` exports[`attributes static attributes 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = 'a'; var _2 = 'b'; @@ -202,7 +187,6 @@ exports[`attributes static attributes 1`] = ` exports[`attributes static attributes on void elements 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = '/test.jpg'; var _2 = 'Test'; @@ -215,7 +199,6 @@ exports[`attributes static attributes on void elements 1`] = ` exports[`attributes static attributes with dashes 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = 'Close'; let c2 = [], p2 = {key:2,attrs:{\\"aria-label\\": _1}}; @@ -228,7 +211,6 @@ exports[`attributes t-att-class and class should combine together 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let _2 = {'hello':true}; Object.assign(_2, utils.toObj(context['value'])) @@ -242,7 +224,6 @@ exports[`attributes t-att-class with object 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let _2 = {'static':true}; Object.assign(_2, utils.toObj({a:context['b'],c:context['d'],e:context['f']})) @@ -255,7 +236,6 @@ exports[`attributes t-att-class with object 1`] = ` exports[`attributes t-attf-class should combine with class 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = 'hello ' + \`world\`; let c2 = [], p2 = {key:2,attrs:{class: _1}}; @@ -267,7 +247,6 @@ exports[`attributes t-attf-class should combine with class 1`] = ` exports[`attributes tuple literal 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = ['foo','bar']; let c2 = [], p2 = {key:2,attrs:{}}; @@ -286,7 +265,6 @@ exports[`attributes tuple literal 1`] = ` exports[`attributes tuple variable 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = context['value']; let c2 = [], p2 = {key:2,attrs:{}}; @@ -305,7 +283,6 @@ exports[`attributes tuple variable 1`] = ` exports[`debugging t-debug 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; debugger; let c1 = [], p1 = {key:1}; @@ -324,7 +301,6 @@ exports[`debugging t-debug 1`] = ` exports[`debugging t-log 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -337,7 +313,6 @@ exports[`debugging t-log 1`] = ` exports[`foreach does not pollute the rendering context 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -368,7 +343,6 @@ exports[`foreach does not pollute the rendering context 1`] = ` exports[`foreach iterate on items (on a element node) 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -403,7 +377,6 @@ exports[`foreach iterate on items (on a element node) 1`] = ` exports[`foreach iterate on items 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -446,7 +419,6 @@ exports[`foreach iterate on items 1`] = ` exports[`foreach iterate, dict param 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -489,7 +461,6 @@ exports[`foreach iterate, dict param 1`] = ` exports[`foreach iterate, position 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -529,7 +500,6 @@ exports[`foreach iterate, position 1`] = ` exports[`foreach t-foreach in t-forach 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -581,7 +551,6 @@ exports[`foreach t-foreach in t-forach 1`] = ` exports[`foreach warn if no key in some case 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -615,7 +584,6 @@ exports[`foreach warn if no key in some case 1`] = ` exports[`loading templates can initialize qweb with a string 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -627,7 +595,6 @@ exports[`loading templates can initialize qweb with a string 1`] = ` exports[`loading templates can load a few templates from a xml string 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('ul', p1, c1); @@ -647,7 +614,6 @@ exports[`misc global 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -727,7 +693,6 @@ exports[`properly support svg add proper namespace to g tags 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('g', p1, c1); @@ -750,7 +715,6 @@ exports[`properly support svg add proper namespace to svg 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; var _1 = '100px'; var _2 = '90px'; @@ -774,7 +738,6 @@ exports[`properly support svg add proper namespace to svg 1`] = ` exports[`special cases for some boolean html attributes/properties input type= checkbox, with t-att-checked 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; var _1 = 'checkbox'; var _2 = context['flag']; @@ -787,7 +750,6 @@ exports[`special cases for some boolean html attributes/properties input type= c exports[`special cases for some boolean html attributes/properties various boolean html attributes 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -828,7 +790,6 @@ exports[`special cases for some boolean html attributes/properties various boole exports[`static templates div with a span child node 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -843,7 +804,6 @@ exports[`static templates div with a span child node 1`] = ` exports[`static templates div with a text node 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -855,7 +815,6 @@ exports[`static templates div with a text node 1`] = ` exports[`static templates empty div 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -866,7 +825,6 @@ exports[`static templates empty div 1`] = ` exports[`static templates properly handle comments 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -880,7 +838,6 @@ exports[`static templates properly handle comments 1`] = ` exports[`static templates simple dynamic value 1`] = ` "function anonymous(context,extra ) { - let sibling = null; let result; var h = this.h; var _1 = context['text']; @@ -895,7 +852,6 @@ exports[`static templates simple dynamic value 1`] = ` exports[`static templates simple string 1`] = ` "function anonymous(context,extra ) { - let sibling = null; let result; var h = this.h; var vn1 = {text: \`hello vdom\`}; @@ -907,7 +863,6 @@ exports[`static templates simple string 1`] = ` exports[`static templates simple string, with some dynamic value 1`] = ` "function anonymous(context,extra ) { - let sibling = null; let result; var h = this.h; var vn1 = {text: \`hello \`}; @@ -923,7 +878,6 @@ exports[`static templates simple string, with some dynamic value 1`] = ` exports[`t-call (template calling basic caller 1`] = ` "function anonymous(context,extra ) { - let sibling = null; let result; var h = this.h; let c1 = [], p1 = {key:1}; @@ -937,7 +891,6 @@ exports[`t-call (template calling basic caller 1`] = ` exports[`t-call (template calling call with several sub nodes on same line 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -960,7 +913,6 @@ exports[`t-call (template calling call with several sub nodes on same line 1`] = exports[`t-call (template calling inherit context 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -976,7 +928,6 @@ exports[`t-call (template calling recursive template, part 1 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -995,7 +946,6 @@ exports[`t-call (template calling recursive template, part 1 2`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); @@ -1016,7 +966,6 @@ exports[`t-call (template calling recursive template, part 2 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; context = Object.create(context); const scope = Object.create(null); var h = this.h; @@ -1064,7 +1013,6 @@ exports[`t-call (template calling recursive template, part 2 2`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; context = Object.create(context); const scope = Object.create(null); var h = this.h; @@ -1109,7 +1057,6 @@ exports[`t-call (template calling recursive template, part 3 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; context = Object.create(context); const scope = Object.create(null); var h = this.h; @@ -1157,7 +1104,6 @@ exports[`t-call (template calling recursive template, part 3 2`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; context = Object.create(context); const scope = Object.create(null); var h = this.h; @@ -1201,7 +1147,6 @@ exports[`t-call (template calling recursive template, part 3 2`] = ` exports[`t-call (template calling scoped parameters 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1220,7 +1165,6 @@ exports[`t-call (template calling scoped parameters 1`] = ` exports[`t-call (template calling t-call with t-if 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1237,7 +1181,6 @@ exports[`t-call (template calling t-call with t-if 1`] = ` exports[`t-call (template calling t-call, global templates 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1252,7 +1195,6 @@ exports[`t-call (template calling t-call, global templates 1`] = ` exports[`t-call (template calling with unused body 1`] = ` "function anonymous(context,extra ) { - let sibling = null; let result; var h = this.h; let c2 = [], p2 = {key:2}; @@ -1266,7 +1208,6 @@ exports[`t-call (template calling with unused body 1`] = ` exports[`t-call (template calling with unused setbody 1`] = ` "function anonymous(context,extra ) { - let sibling = null; let result; var h = this.h; { @@ -1283,7 +1224,6 @@ exports[`t-call (template calling with unused setbody 1`] = ` exports[`t-call (template calling with used body 1`] = ` "function anonymous(context,extra ) { - let sibling = null; let result; var h = this.h; let c2 = [], p2 = {key:2}; @@ -1297,7 +1237,6 @@ exports[`t-call (template calling with used body 1`] = ` exports[`t-call (template calling with used set body 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -1314,7 +1253,6 @@ exports[`t-call (template calling with used set body 1`] = ` exports[`t-esc escaping on a node 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -1329,7 +1267,6 @@ exports[`t-esc escaping on a node 1`] = ` exports[`t-esc escaping on a node with a body 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -1346,7 +1283,6 @@ exports[`t-esc escaping on a node with a body 1`] = ` exports[`t-esc escaping on a node with a body, as a default 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -1363,7 +1299,6 @@ exports[`t-esc escaping on a node with a body, as a default 1`] = ` exports[`t-esc literal 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -1378,7 +1313,6 @@ exports[`t-esc literal 1`] = ` exports[`t-esc variable 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -1393,7 +1327,6 @@ exports[`t-esc variable 1`] = ` exports[`t-if boolean value condition elif 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1416,7 +1349,6 @@ exports[`t-if boolean value condition elif 1`] = ` exports[`t-if boolean value condition else 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1441,7 +1373,6 @@ exports[`t-if boolean value condition else 1`] = ` exports[`t-if boolean value condition false else 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1466,7 +1397,6 @@ exports[`t-if boolean value condition false else 1`] = ` exports[`t-if boolean value condition missing 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -1480,7 +1410,6 @@ exports[`t-if boolean value condition missing 1`] = ` exports[`t-if boolean value false condition 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1494,7 +1423,6 @@ exports[`t-if boolean value false condition 1`] = ` exports[`t-if boolean value true condition 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1508,7 +1436,6 @@ exports[`t-if boolean value true condition 1`] = ` exports[`t-if can use some boolean operators in expressions 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1543,7 +1470,6 @@ exports[`t-if can use some boolean operators in expressions 1`] = ` exports[`t-if t-esc with t-elif 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1563,7 +1489,6 @@ exports[`t-if t-esc with t-elif 1`] = ` exports[`t-if t-esc with t-if 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1580,7 +1505,6 @@ exports[`t-if t-esc with t-if 1`] = ` exports[`t-if t-set, then t-elif, part 3 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1605,7 +1529,6 @@ exports[`t-if t-set, then t-elif, part 3 1`] = ` exports[`t-if t-set, then t-if 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1622,7 +1545,6 @@ exports[`t-if t-set, then t-if 1`] = ` exports[`t-if t-set, then t-if, part 2 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1641,7 +1563,6 @@ exports[`t-if t-set, then t-if, part 2 1`] = ` exports[`t-key can use t-key directive on a node 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; const nodeKey1 = context['beer'].id; let c2 = [], p2 = {key:nodeKey1}; @@ -1657,7 +1578,6 @@ exports[`t-key can use t-key directive on a node 1`] = ` exports[`t-key t-key directive in a list 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -1695,7 +1615,6 @@ exports[`t-on can bind event handler 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1,on:{}}; var vn1 = h('button', p1, c1); @@ -1710,7 +1629,6 @@ exports[`t-on can bind handlers with arguments 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1,on:{}}; var vn1 = h('button', p1, c1); @@ -1725,7 +1643,6 @@ exports[`t-on can bind handlers with empty object (with non empty inner string) "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1,on:{}}; var vn1 = h('button', p1, c1); @@ -1740,7 +1657,6 @@ exports[`t-on can bind handlers with empty object 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1,on:{}}; var vn1 = h('button', p1, c1); @@ -1755,7 +1671,6 @@ exports[`t-on can bind handlers with loop variable as argument 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -1793,7 +1708,6 @@ exports[`t-on can bind handlers with object arguments 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1,on:{}}; var vn1 = h('button', p1, c1); @@ -1808,7 +1722,6 @@ exports[`t-on can bind two event handlers 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1,on:{}}; var vn1 = h('button', p1, c1); @@ -1825,7 +1738,6 @@ exports[`t-on handler is bound to proper owner 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1,on:{}}; var vn1 = h('button', p1, c1); @@ -1840,7 +1752,6 @@ exports[`t-on t-on combined with t-esc 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1862,7 +1773,6 @@ exports[`t-on t-on combined with t-raw 1`] = ` ) { let utils = this.constructor.utils; let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1883,7 +1793,6 @@ exports[`t-on t-on with empty handler (only modifiers) 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1900,7 +1809,6 @@ exports[`t-on t-on with inline statement (function call) 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1,on:{}}; var vn1 = h('button', p1, c1); @@ -1915,7 +1823,6 @@ exports[`t-on t-on with inline statement 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1,on:{}}; var vn1 = h('button', p1, c1); @@ -1930,7 +1837,6 @@ exports[`t-on t-on with prevent and self modifiers (order matters) 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1951,7 +1857,6 @@ exports[`t-on t-on with prevent and/or stop modifiers 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -1981,7 +1886,6 @@ exports[`t-on t-on with prevent modifier in t-foreach 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -2021,7 +1925,6 @@ exports[`t-on t-on with self and prevent modifiers (order matters) 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2042,7 +1945,6 @@ exports[`t-on t-on with self modifier 1`] = ` "function anonymous(context,extra ) { let owner = context; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2072,7 +1974,6 @@ exports[`t-raw literal 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -2088,7 +1989,6 @@ exports[`t-raw not escaping 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2104,7 +2004,6 @@ exports[`t-raw t-raw and another sibling node 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -2124,7 +2023,6 @@ exports[`t-raw variable 1`] = ` "function anonymous(context,extra ) { let utils = this.constructor.utils; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); @@ -2140,7 +2038,6 @@ exports[`t-ref can get a dynamic ref on a node 1`] = ` "function anonymous(context,extra ) { context.__owl__.refs = context.__owl__.refs || {}; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2164,7 +2061,6 @@ exports[`t-ref can get a ref on a node 1`] = ` "function anonymous(context,extra ) { context.__owl__.refs = context.__owl__.refs || {}; - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2188,7 +2084,6 @@ exports[`t-ref refs in a loop 1`] = ` "function anonymous(context,extra ) { context.__owl__.refs = context.__owl__.refs || {}; - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -2232,7 +2127,6 @@ exports[`t-ref refs in a loop 1`] = ` exports[`t-set evaluate value expression 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2247,7 +2141,6 @@ exports[`t-set evaluate value expression 1`] = ` exports[`t-set evaluate value expression, part 2 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2262,7 +2155,6 @@ exports[`t-set evaluate value expression, part 2 1`] = ` exports[`t-set set from attribute literal 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2277,7 +2169,6 @@ exports[`t-set set from attribute literal 1`] = ` exports[`t-set set from attribute lookup 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2292,7 +2183,6 @@ exports[`t-set set from attribute lookup 1`] = ` exports[`t-set set from body literal 1`] = ` "function anonymous(context,extra ) { - let sibling = null; let result; var h = this.h; var vn1 = {text: \`ok\`}; @@ -2304,7 +2194,6 @@ exports[`t-set set from body literal 1`] = ` exports[`t-set set from body lookup 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2319,7 +2208,6 @@ exports[`t-set set from body lookup 1`] = ` exports[`t-set set from empty body 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2330,7 +2218,6 @@ exports[`t-set set from empty body 1`] = ` exports[`t-set t-set and t-if 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2345,7 +2232,6 @@ exports[`t-set t-set and t-if 1`] = ` exports[`t-set t-set evaluates an expression only once 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2363,7 +2249,6 @@ exports[`t-set t-set evaluates an expression only once 1`] = ` exports[`t-set t-set should reuse variable if possible 1`] = ` "function anonymous(context,extra ) { - let sibling = null; context = Object.create(context); var h = this.h; let c1 = [], p1 = {key:1}; @@ -2403,7 +2288,6 @@ exports[`t-set t-set should reuse variable if possible 1`] = ` exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2424,7 +2308,6 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 1`] = ` exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 2`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2445,7 +2328,6 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 2`] = ` exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2466,7 +2348,6 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 1`] = ` exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 2`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2487,7 +2368,6 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 2`] = ` exports[`t-set value priority 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2502,7 +2382,6 @@ exports[`t-set value priority 1`] = ` exports[`translation support can translate node content 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2514,7 +2393,6 @@ exports[`translation support can translate node content 1`] = ` exports[`translation support does not translate node content if disabled 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2533,7 +2411,6 @@ exports[`translation support does not translate node content if disabled 1`] = ` exports[`translation support some attributes are translated 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2569,7 +2446,6 @@ exports[`translation support some attributes are translated 1`] = ` exports[`whitespace handling consecutives whitespaces are condensed into a single space 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2581,7 +2457,6 @@ exports[`whitespace handling consecutives whitespaces are condensed into a singl exports[`whitespace handling nothing is done in pre tags 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('pre', p1, c1); @@ -2593,7 +2468,6 @@ exports[`whitespace handling nothing is done in pre tags 1`] = ` exports[`whitespace handling nothing is done in pre tags 2`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c2 = [], p2 = {key:2}; var vn2 = h('pre', p2, c2); @@ -2607,7 +2481,6 @@ exports[`whitespace handling nothing is done in pre tags 2`] = ` exports[`whitespace handling nothing is done in pre tags 3`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c3 = [], p3 = {key:3}; var vn3 = h('pre', p3, c3); @@ -2621,7 +2494,6 @@ exports[`whitespace handling nothing is done in pre tags 3`] = ` exports[`whitespace handling white space only text nodes are condensed into a single space 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); @@ -2633,7 +2505,6 @@ exports[`whitespace handling white space only text nodes are condensed into a si exports[`whitespace handling whitespace only text nodes with newlines are removed 1`] = ` "function anonymous(context,extra ) { - let sibling = null; var h = this.h; let c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); diff --git a/tests/router/__snapshots__/link.test.ts.snap b/tests/router/__snapshots__/link.test.ts.snap index 1739ee52..f184b404 100644 --- a/tests/router/__snapshots__/link.test.ts.snap +++ b/tests/router/__snapshots__/link.test.ts.snap @@ -5,7 +5,6 @@ exports[`Link component can render simple cases 1`] = ` ) { let utils = this.constructor.utils; let owner = context; - let sibling = null; var h = this.h; let _6 = utils.toObj({'router-link-active':context['isActive']}); var _7 = context['href']; diff --git a/tests/router/__snapshots__/route_component.test.ts.snap b/tests/router/__snapshots__/route_component.test.ts.snap index f5d61047..97ec99b2 100644 --- a/tests/router/__snapshots__/route_component.test.ts.snap +++ b/tests/router/__snapshots__/route_component.test.ts.snap @@ -7,7 +7,6 @@ exports[`RouteComponent can render simple cases 1`] = ` let QWeb = this.constructor; let parent = context; let owner = context; - let sibling = null; let result; var h = this.h; if (context['routeComponent']) { @@ -23,7 +22,7 @@ exports[`RouteComponent can render simple cases 1`] = ` w8 = false; } if (w8) { - w8.__updateProps(props8, extra.fiber, undefined, undefined, sibling); + w8.__updateProps(props8, extra.fiber, undefined, undefined); let pvnode = w8.__owl__.pvnode; utils.defineProxy(vn11, pvnode); } else { @@ -32,7 +31,7 @@ exports[`RouteComponent can render simple cases 1`] = ` if (!W8) {throw new Error('Cannot find the definition of component \\"' + componentKey8 + '\\"')} w8 = new W8(parent, props8); parent.__owl__.cmap[k9] = w8.__owl__.id; - let def7 = w8.__prepare(extra.fiber, undefined, undefined, sibling); + let def7 = w8.__prepare(extra.fiber, undefined, undefined); let pvnode = h('dummy', {key: k9, hook: {insert(vn) { let nvn=w8.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w8.destroy();}}}); const fiber = w8.__owl__.currentFiber; def7.then(function () { if (fiber.isCompleted) { return; } const vnode = fiber.vnode; pvnode.sel = vnode.sel; }); @@ -40,7 +39,6 @@ exports[`RouteComponent can render simple cases 1`] = ` w8.__owl__.pvnode = pvnode; } w8.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w8.__owl__.currentFiber || sibling; } return result; }"