From 12be815342e4a31b828aa92c78352db91ca8adb6 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Wed, 27 Nov 2019 15:07:10 +0100 Subject: [PATCH] [REF] qweb: use global nextID and reset it to 1 before each test s.t. snapshots are deterministic. --- src/qweb/base_directives.ts | 2 - src/qweb/compilation_context.ts | 5 +- src/qweb/extensions.ts | 2 +- src/qweb/qweb.ts | 3 +- .../__snapshots__/component.test.ts.snap | 162 +++++++++--------- tests/helpers.ts | 2 + tests/qweb/__snapshots__/qweb.test.ts.snap | 110 ++++++------ tests/router/__snapshots__/link.test.ts.snap | 20 +-- .../route_component.test.ts.snap | 52 +++--- 9 files changed, 178 insertions(+), 180 deletions(-) diff --git a/src/qweb/base_directives.ts b/src/qweb/base_directives.ts index f791a116..463edcaa 100644 --- a/src/qweb/base_directives.ts +++ b/src/qweb/base_directives.ts @@ -192,11 +192,9 @@ QWeb.addDirective({ // extract variables from nodecopy const tempCtx = new CompilationContext(); - tempCtx.nextID = ctx.rootContext.nextID; tempCtx.allowMultipleRoots = true; qweb._compileNode(nodeCopy, tempCtx); const vars = Object.assign({}, ctx.variables, tempCtx.variables); - ctx.rootContext.nextID = tempCtx.nextID; const templateMap = Object.create(ctx.templates); // open new scope, if necessary diff --git a/src/qweb/compilation_context.ts b/src/qweb/compilation_context.ts index 080ca417..81e09706 100644 --- a/src/qweb/compilation_context.ts +++ b/src/qweb/compilation_context.ts @@ -6,7 +6,7 @@ export const INTERP_REGEXP = /\{\{.*?\}\}/g; //------------------------------------------------------------------------------ export class CompilationContext { - nextID: number = 1; + static nextID: number = 1; code: string[] = []; variables: { [key: string]: QWebVar } = {}; escaping: boolean = false; @@ -42,8 +42,7 @@ export class CompilationContext { } generateID(): number { - const id = this.rootContext.nextID++; - return id; + return CompilationContext.nextID++; } /** diff --git a/src/qweb/extensions.ts b/src/qweb/extensions.ts index b7cfe5b0..d3918a46 100644 --- a/src/qweb/extensions.ts +++ b/src/qweb/extensions.ts @@ -201,7 +201,7 @@ QWeb.addDirective({ if (!ctx.parentNode) { ctx.rootContext.shouldDefineResult = true; ctx.rootContext.shouldDefineUtils = true; - parentNode = `children${ctx.nextID++}`; + parentNode = `children${ctx.generateID()}`; ctx.addLine(`let ${parentNode}= []`); ctx.addLine(`result = {}`); } diff --git a/src/qweb/qweb.ts b/src/qweb/qweb.ts index 741ac52a..2189eb0e 100644 --- a/src/qweb/qweb.ts +++ b/src/qweb/qweb.ts @@ -362,8 +362,7 @@ export class QWeb extends EventBus { if (parentContext) { ctx.templates = Object.create(parentContext.templates); ctx.variables = Object.create(parentContext.variables); - ctx.nextID = parentContext.nextID + 1; - ctx.parentNode = parentContext.parentNode || ctx.nextID++; + ctx.parentNode = parentContext.parentNode || ctx.generateID(); ctx.allowMultipleRoots = true; ctx.hasParentWidget = true; ctx.shouldDefineResult = false; diff --git a/tests/component/__snapshots__/component.test.ts.snap b/tests/component/__snapshots__/component.test.ts.snap index ca35d828..54b8e0e1 100644 --- a/tests/component/__snapshots__/component.test.ts.snap +++ b/tests/component/__snapshots__/component.test.ts.snap @@ -241,11 +241,11 @@ exports[`class and style attributes with t-component t-att-class is properly add let utils = this.constructor.utils; let sibling = null; var h = this.h; - let _2 = {'c':true}; - Object.assign(_2, utils.toObj({d:context['state'].d})) - let c3 = [], p3 = {key:3,class:_2}; - var vn3 = h('span', p3, c3); - return vn3; + let _9 = {'c':true}; + Object.assign(_9, utils.toObj({d:context['state'].d})) + let c10 = [], p10 = {key:10,class:_9}; + var vn10 = h('span', p10, c10); + return vn10; }" `; @@ -302,11 +302,11 @@ exports[`class and style attributes with t-component t-att-class is properly add let utils = this.constructor.utils; let sibling = null; var h = this.h; - let _2 = {'c':true}; - Object.assign(_2, utils.toObj(context['state'].d?'d':'')) - let c3 = [], p3 = {key:3,class:_2}; - var vn3 = h('span', p3, c3); - return vn3; + let _9 = {'c':true}; + Object.assign(_9, utils.toObj(context['state'].d?'d':'')) + let c10 = [], p10 = {key:10,class:_9}; + var vn10 = h('span', p10, c10); + return vn10; }" `; @@ -1393,23 +1393,23 @@ exports[`t-slot directive can define and call slots 2`] = ` let owner = context; let sibling = null; var h = this.h; - let c1 = [], p1 = {key:1}; - var vn1 = h('div', p1, c1); - let c2 = [], p2 = {key:2}; - var vn2 = h('div', p2, c2); - c1.push(vn2); - const slot3 = this.constructor.slots[context.__owl__.slotId + '_' + 'header']; - if (slot3) { - slot3.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c2, vars: extra.vars, parent: owner})); + let c8 = [], p8 = {key:8}; + var vn8 = h('div', p8, c8); + let c9 = [], p9 = {key:9}; + var vn9 = h('div', p9, c9); + c8.push(vn9); + const slot10 = this.constructor.slots[context.__owl__.slotId + '_' + 'header']; + if (slot10) { + slot10.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c9, vars: extra.vars, parent: owner})); } - let c4 = [], p4 = {key:4}; - var vn4 = h('div', p4, c4); - c1.push(vn4); - const slot5 = this.constructor.slots[context.__owl__.slotId + '_' + 'footer']; - if (slot5) { - slot5.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c4, vars: extra.vars, parent: owner})); + let c11 = [], p11 = {key:11}; + var vn11 = h('div', p11, c11); + c8.push(vn11); + const slot12 = this.constructor.slots[context.__owl__.slotId + '_' + 'footer']; + if (slot12) { + slot12.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c11, vars: extra.vars, parent: owner})); } - return vn1; + return vn8; }" `; @@ -1420,10 +1420,10 @@ exports[`t-slot directive can define and call slots 3`] = ` var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); - let c7 = [], p7 = {key:7}; - var vn7 = h('span', p7, c7); - c1.push(vn7); - c7.push({text: \`header\`}); + let c6 = [], p6 = {key:6}; + var vn6 = h('span', p6, c6); + c1.push(vn6); + c6.push({text: \`header\`}); }" `; @@ -1448,10 +1448,10 @@ exports[`t-slot directive content is the default slot 1`] = ` var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); - let c7 = [], p7 = {key:7}; - var vn7 = h('span', p7, c7); - c1.push(vn7); - c7.push({text: \`sts rocks\`}); + let c6 = [], p6 = {key:6}; + var vn6 = h('span', p6, c6); + c1.push(vn6); + c6.push({text: \`sts rocks\`}); }" `; @@ -1473,14 +1473,14 @@ exports[`t-slot directive multiple roots are allowed in a default slot 1`] = ` var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); + let c6 = [], p6 = {key:6}; + var vn6 = h('span', p6, c6); + c1.push(vn6); + c6.push({text: \`sts\`}); let c7 = [], p7 = {key:7}; var vn7 = h('span', p7, c7); c1.push(vn7); - c7.push({text: \`sts\`}); - let c8 = [], p8 = {key:8}; - var vn8 = h('span', p8, c8); - c1.push(vn8); - c8.push({text: \`rocks\`}); + c7.push({text: \`rocks\`}); }" `; @@ -1491,14 +1491,14 @@ exports[`t-slot directive multiple roots are allowed in a named slot 1`] = ` var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); + let c6 = [], p6 = {key:6}; + var vn6 = h('span', p6, c6); + c1.push(vn6); + c6.push({text: \`sts\`}); let c7 = [], p7 = {key:7}; var vn7 = h('span', p7, c7); c1.push(vn7); - c7.push({text: \`sts\`}); - let c8 = [], p8 = {key:8}; - var vn8 = h('span', p8, c8); - c1.push(vn8); - c8.push({text: \`rocks\`}); + c7.push({text: \`rocks\`}); }" `; @@ -1511,21 +1511,21 @@ exports[`t-slot directive refs are properly bound in slots 1`] = ` var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); - let c11 = [], p11 = {key:11,on:{}}; - var vn11 = h('button', p11, c11); - c1.push(vn11); - extra.handlers['click' + 11] = extra.handlers['click' + 11] || function (e) {const fn = context['doSomething'];if (fn) { fn.call(owner, e); } else { context.doSomething; }}; - p11.on['click'] = extra.handlers['click' + 11]; - const ref12 = \`myButton\`; - p11.hook = { + let c10 = [], p10 = {key:10,on:{}}; + var vn10 = h('button', p10, c10); + c1.push(vn10); + extra.handlers['click' + 10] = extra.handlers['click' + 10] || function (e) {const fn = context['doSomething'];if (fn) { fn.call(owner, e); } else { context.doSomething; }}; + p10.on['click'] = extra.handlers['click' + 10]; + const ref11 = \`myButton\`; + p10.hook = { create: (_, n) => { - context.__owl__.refs[ref12] = n.elm; + context.__owl__.refs[ref11] = n.elm; }, destroy: () => { - delete context.__owl__.refs[ref12]; + delete context.__owl__.refs[ref11]; }, }; - c11.push({text: \`do something\`}); + c10.push({text: \`do something\`}); }" `; @@ -1537,12 +1537,12 @@ exports[`t-slot directive slots are rendered with proper context 1`] = ` var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); - let c11 = [], p11 = {key:11,on:{}}; - var vn11 = h('button', p11, c11); - c1.push(vn11); - extra.handlers['click' + 11] = extra.handlers['click' + 11] || function (e) {const fn = context['doSomething'];if (fn) { fn.call(owner, e); } else { context.doSomething; }}; - p11.on['click'] = extra.handlers['click' + 11]; - c11.push({text: \`do something\`}); + let c10 = [], p10 = {key:10,on:{}}; + var vn10 = h('button', p10, c10); + c1.push(vn10); + extra.handlers['click' + 10] = extra.handlers['click' + 10] || function (e) {const fn = context['doSomething'];if (fn) { fn.call(owner, e); } else { context.doSomething; }}; + p10.on['click'] = extra.handlers['click' + 10]; + c10.push({text: \`do something\`}); }" `; @@ -1552,14 +1552,14 @@ exports[`t-slot directive slots are rendered with proper context, part 2 1`] = ` let owner = context; let sibling = null; var h = this.h; - var _1 = context['props'].to; - let c2 = [], p2 = {key:2,attrs:{href: _1}}; - var vn2 = h('a', p2, c2); - const slot3 = this.constructor.slots[context.__owl__.slotId + '_' + 'default']; - if (slot3) { - slot3.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c2, vars: extra.vars, parent: owner})); + var _13 = context['props'].to; + let c14 = [], p14 = {key:14,attrs:{href: _13}}; + var vn14 = h('a', p14, c14); + const slot15 = this.constructor.slots[context.__owl__.slotId + '_' + 'default']; + if (slot15) { + slot15.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c14, vars: extra.vars, parent: owner})); } - return vn2; + return vn14; }" `; @@ -1643,9 +1643,9 @@ exports[`t-slot directive slots are rendered with proper context, part 2 3`] = ` let c7 = extra.parentNode; Object.assign(context, extra.fiber.scope); c7.push({text: \`User \`}); - var _13 = context['user'].name; - if (_13 || _13 === 0) { - c7.push({text: _13}); + var _12 = context['user'].name; + if (_12 || _12 === 0) { + c7.push({text: _12}); } }" `; @@ -1656,14 +1656,14 @@ exports[`t-slot directive slots are rendered with proper context, part 3 1`] = ` let owner = context; let sibling = null; var h = this.h; - var _1 = context['props'].to; - let c2 = [], p2 = {key:2,attrs:{href: _1}}; - var vn2 = h('a', p2, c2); - const slot3 = this.constructor.slots[context.__owl__.slotId + '_' + 'default']; - if (slot3) { - slot3.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c2, vars: extra.vars, parent: owner})); + var _13 = context['props'].to; + let c14 = [], p14 = {key:14,attrs:{href: _13}}; + var vn14 = h('a', p14, c14); + const slot15 = this.constructor.slots[context.__owl__.slotId + '_' + 'default']; + if (slot15) { + slot15.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c14, vars: extra.vars, parent: owner})); } - return vn2; + return vn14; }" `; @@ -1820,12 +1820,12 @@ exports[`t-slot directive template can just return a slot 1`] = ` let sibling = null; let result; var h = this.h; - const slot1 = this.constructor.slots[context.__owl__.slotId + '_' + 'default']; - if (slot1) { - let children2= [] + const slot10 = this.constructor.slots[context.__owl__.slotId + '_' + 'default']; + if (slot10) { + let children11= [] result = {} - slot1.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: children2, vars: extra.vars, parent: owner})); - utils.defineProxy(result, children2[0]); + slot10.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: children11, vars: extra.vars, parent: owner})); + utils.defineProxy(result, children11[0]); } return result; }" diff --git a/tests/helpers.ts b/tests/helpers.ts index cde909ab..c8f7bdbd 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -1,6 +1,7 @@ import { Env } from "../src/component/component"; import { scheduler } from "../src/component/scheduler"; import { EvalContext, QWeb } from "../src/qweb/qweb"; +import { CompilationContext } from "../src/qweb/compilation_context"; import { patch } from "../src/vdom"; import "../src/qweb/base_directives"; import "../src/qweb/extensions"; @@ -20,6 +21,7 @@ let TEMPLATES; beforeEach(() => { nextSlotId = QWeb.nextSlotId; + CompilationContext.nextID = 1; slots = Object.assign({}, QWeb.slots); nextId = QWeb.nextId; TEMPLATES = Object.assign({}, QWeb.TEMPLATES); diff --git a/tests/qweb/__snapshots__/qweb.test.ts.snap b/tests/qweb/__snapshots__/qweb.test.ts.snap index 003f3fe5..982b9a51 100644 --- a/tests/qweb/__snapshots__/qweb.test.ts.snap +++ b/tests/qweb/__snapshots__/qweb.test.ts.snap @@ -999,15 +999,15 @@ exports[`t-call (template calling recursive template, part 1 2`] = ` var h = this.h; let c1 = extra.parentNode; Object.assign(context, extra.fiber.scope); + let c4 = [], p4 = {key:4}; + var vn4 = h('div', p4, c4); + c1.push(vn4); let c5 = [], p5 = {key:5}; - var vn5 = h('div', p5, c5); - c1.push(vn5); - let c6 = [], p6 = {key:6}; - var vn6 = h('span', p6, c6); - c5.push(vn6); - c6.push({text: \`hey\`}); + var vn5 = h('span', p5, c5); + c4.push(vn5); + c5.push({text: \`hey\`}); if (false) { - this.recursiveFns['__3'].call(this, context, Object.assign({}, extra, {parentNode: c5, fiber: {vars: {}, scope}})); + this.recursiveFns['__3'].call(this, context, Object.assign({}, extra, {parentNode: c4, fiber: {vars: {}, scope}})); } }" `; @@ -1071,36 +1071,36 @@ exports[`t-call (template calling recursive template, part 2 2`] = ` let c3 = extra.parentNode; let _v0 = extra.fiber.vars._v0 Object.assign(context, extra.fiber.scope); + let c11 = [], p11 = {key:11}; + var vn11 = h('div', p11, c11); + c3.push(vn11); let c12 = [], p12 = {key:12}; - var vn12 = h('div', p12, c12); - c3.push(vn12); - let c13 = [], p13 = {key:13}; - var vn13 = h('p', p13, c13); - c12.push(vn13); - var _14 = _v0.val; - if (_14 || _14 === 0) { - c13.push({text: _14}); + var vn12 = h('p', p12, c12); + c11.push(vn12); + var _13 = _v0.val; + if (_13 || _13 === 0) { + c12.push({text: _13}); } - var _15 = _v0.children||[]; - if (!_15) { throw new Error('QWeb error: Invalid loop expression')} - var _16 = _17 = _15; - if (!(_15 instanceof Array)) { - _16 = Object.keys(_15); - _17 = Object.values(_15); + var _14 = _v0.children||[]; + if (!_14) { throw new Error('QWeb error: Invalid loop expression')} + var _15 = _16 = _14; + if (!(_14 instanceof Array)) { + _15 = Object.keys(_14); + _16 = Object.values(_14); } - var _length16 = _16.length; - for (let i1 = 0; i1 < _length16; i1++) { + var _length15 = _15.length; + for (let i1 = 0; i1 < _length15; i1++) { context.subtree_first = i1 === 0; scope.subtree_first = context.subtree_first; - context.subtree_last = i1 === _length16 - 1; + context.subtree_last = i1 === _length15 - 1; scope.subtree_last = context.subtree_last; context.subtree_index = i1; scope.subtree_index = context.subtree_index; - context.subtree = _16[i1]; + context.subtree = _15[i1]; scope.subtree = context.subtree; - context.subtree_value = _17[i1]; + context.subtree_value = _16[i1]; scope.subtree_value = context.subtree_value; - this.recursiveFns['__10'].call(this, context, Object.assign({}, extra, {parentNode: c12, fiber: {vars: {_v0: context['subtree']}, scope}})); + this.recursiveFns['__10'].call(this, context, Object.assign({}, extra, {parentNode: c11, fiber: {vars: {_v0: context['subtree']}, scope}})); } }" `; @@ -1164,36 +1164,36 @@ exports[`t-call (template calling recursive template, part 3 2`] = ` let c3 = extra.parentNode; let _v0 = extra.fiber.vars._v0 Object.assign(context, extra.fiber.scope); + let c11 = [], p11 = {key:11}; + var vn11 = h('div', p11, c11); + c3.push(vn11); let c12 = [], p12 = {key:12}; - var vn12 = h('div', p12, c12); - c3.push(vn12); - let c13 = [], p13 = {key:13}; - var vn13 = h('p', p13, c13); - c12.push(vn13); - var _14 = _v0.val; - if (_14 || _14 === 0) { - c13.push({text: _14}); + var vn12 = h('p', p12, c12); + c11.push(vn12); + var _13 = _v0.val; + if (_13 || _13 === 0) { + c12.push({text: _13}); } - var _15 = _v0.children||[]; - if (!_15) { throw new Error('QWeb error: Invalid loop expression')} - var _16 = _17 = _15; - if (!(_15 instanceof Array)) { - _16 = Object.keys(_15); - _17 = Object.values(_15); + var _14 = _v0.children||[]; + if (!_14) { throw new Error('QWeb error: Invalid loop expression')} + var _15 = _16 = _14; + if (!(_14 instanceof Array)) { + _15 = Object.keys(_14); + _16 = Object.values(_14); } - var _length16 = _16.length; - for (let i1 = 0; i1 < _length16; i1++) { + var _length15 = _15.length; + for (let i1 = 0; i1 < _length15; i1++) { context.subtree_first = i1 === 0; scope.subtree_first = context.subtree_first; - context.subtree_last = i1 === _length16 - 1; + context.subtree_last = i1 === _length15 - 1; scope.subtree_last = context.subtree_last; context.subtree_index = i1; scope.subtree_index = context.subtree_index; - context.subtree = _16[i1]; + context.subtree = _15[i1]; scope.subtree = context.subtree; - context.subtree_value = _17[i1]; + context.subtree_value = _16[i1]; scope.subtree_value = context.subtree_value; - this.recursiveFns['__10'].call(this, context, Object.assign({}, extra, {parentNode: c12, fiber: {vars: {_v0: context['subtree']}, scope}})); + this.recursiveFns['__10'].call(this, context, Object.assign({}, extra, {parentNode: c11, fiber: {vars: {_v0: context['subtree']}, scope}})); } }" `; @@ -2595,12 +2595,12 @@ exports[`whitespace handling nothing is done in pre tags 2`] = ` ) { let sibling = null; var h = this.h; - let c1 = [], p1 = {key:1}; - var vn1 = h('pre', p1, c1); - c1.push({text: \` + let c2 = [], p2 = {key:2}; + var vn2 = h('pre', p2, c2); + c2.push({text: \` some text \`}); - return vn1; + return vn2; }" `; @@ -2609,12 +2609,12 @@ exports[`whitespace handling nothing is done in pre tags 3`] = ` ) { let sibling = null; var h = this.h; - let c1 = [], p1 = {key:1}; - var vn1 = h('pre', p1, c1); - c1.push({text: \` + let c3 = [], p3 = {key:3}; + var vn3 = h('pre', p3, c3); + c3.push({text: \` \`}); - return vn1; + return vn3; }" `; diff --git a/tests/router/__snapshots__/link.test.ts.snap b/tests/router/__snapshots__/link.test.ts.snap index df3330d1..1739ee52 100644 --- a/tests/router/__snapshots__/link.test.ts.snap +++ b/tests/router/__snapshots__/link.test.ts.snap @@ -7,16 +7,16 @@ exports[`Link component can render simple cases 1`] = ` let owner = context; let sibling = null; var h = this.h; - let _1 = utils.toObj({'router-link-active':context['isActive']}); - var _2 = context['href']; - let c3 = [], p3 = {key:3,attrs:{href: _2},class:_1,on:{}}; - var vn3 = h('a', p3, c3); - extra.handlers['click' + 3] = extra.handlers['click' + 3] || function (e) {const fn = context['navigate'];if (fn) { fn.call(owner, e); } else { context.navigate; }}; - p3.on['click'] = extra.handlers['click' + 3]; - const slot4 = this.constructor.slots[context.__owl__.slotId + '_' + 'default']; - if (slot4) { - slot4.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c3, vars: extra.vars, parent: owner})); + let _6 = utils.toObj({'router-link-active':context['isActive']}); + var _7 = context['href']; + let c8 = [], p8 = {key:8,attrs:{href: _7},class:_6,on:{}}; + var vn8 = h('a', p8, c8); + extra.handlers['click' + 8] = extra.handlers['click' + 8] || function (e) {const fn = context['navigate'];if (fn) { fn.call(owner, e); } else { context.navigate; }}; + p8.on['click'] = extra.handlers['click' + 8]; + const slot9 = this.constructor.slots[context.__owl__.slotId + '_' + 'default']; + if (slot9) { + slot9.call(this, context.__owl__.parent, Object.assign({}, extra, {parentNode: c8, vars: extra.vars, parent: owner})); } - return vn3; + return vn8; }" `; diff --git a/tests/router/__snapshots__/route_component.test.ts.snap b/tests/router/__snapshots__/route_component.test.ts.snap index 120a999b..f5d61047 100644 --- a/tests/router/__snapshots__/route_component.test.ts.snap +++ b/tests/router/__snapshots__/route_component.test.ts.snap @@ -11,36 +11,36 @@ exports[`RouteComponent can render simple cases 1`] = ` let result; var h = this.h; if (context['routeComponent']) { - const nodeKey1 = context['env'].router.currentRouteName; + const nodeKey6 = context['env'].router.currentRouteName; //COMPONENT - let k4 = \`__5__\` + nodeKey1; - let w3 = k4 in parent.__owl__.cmap ? parent.__owl__.children[parent.__owl__.cmap[k4]] : false; - let vn6 = {}; - result = vn6; - let props3 = Object.assign({}, context['env'].router.currentParams); - if (w3 && w3.__owl__.currentFiber && !w3.__owl__.vnode) { - w3.destroy(); - w3 = false; + let k9 = \`__10__\` + nodeKey6; + let w8 = k9 in parent.__owl__.cmap ? parent.__owl__.children[parent.__owl__.cmap[k9]] : false; + let vn11 = {}; + result = vn11; + let props8 = Object.assign({}, context['env'].router.currentParams); + if (w8 && w8.__owl__.currentFiber && !w8.__owl__.vnode) { + w8.destroy(); + w8 = false; } - if (w3) { - w3.__updateProps(props3, extra.fiber, undefined, undefined, sibling); - let pvnode = w3.__owl__.pvnode; - utils.defineProxy(vn6, pvnode); + if (w8) { + w8.__updateProps(props8, extra.fiber, undefined, undefined, sibling); + let pvnode = w8.__owl__.pvnode; + utils.defineProxy(vn11, pvnode); } else { - let componentKey3 = \`routeComponent\`; - let W3 = context.constructor.components[componentKey3] || QWeb.components[componentKey3]|| context['routeComponent']; - 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 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; }); - utils.defineProxy(vn6, pvnode); - w3.__owl__.pvnode = pvnode; + let componentKey8 = \`routeComponent\`; + let W8 = context.constructor.components[componentKey8] || QWeb.components[componentKey8]|| context['routeComponent']; + 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 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; }); + utils.defineProxy(vn11, pvnode); + w8.__owl__.pvnode = pvnode; } - w3.__owl__.parentLastFiberId = extra.fiber.id; - sibling = w3.__owl__.currentFiber || sibling; + w8.__owl__.parentLastFiberId = extra.fiber.id; + sibling = w8.__owl__.currentFiber || sibling; } return result; }"