mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] compiler: do not look up ComponentNode in the context
With the introduction of t-call-context, there is now no guarantee that the ComponentNode can be found in the rendering context, any attempt to do so can crash when combined with t-call-context. This commit fixes that by using `this` instead, which in compiled templates refers to the component that is being rendered.
This commit is contained in:
committed by
Géry Debongnie
parent
3d49daedcd
commit
9a5edb4590
@@ -175,8 +175,8 @@ exports[`list of components order is correct when slots are not of same type 1`]
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const ctx1 = capture(ctx);
|
||||
return comp1({slots: markRaw({'a': {__render: slot1, __ctx: ctx1, active: !ctx['state'].active}, 'b': {__render: slot2, __ctx: ctx1, active: true}, 'c': {__render: slot3, __ctx: ctx1, active: ctx['state'].active}})}, key + \`__1\`, node, this, null);
|
||||
const ctx1 = capture(ctx, this);
|
||||
return comp1({slots: markRaw({'a': {__render: slot1.bind(this), __ctx: ctx1, active: !ctx['state'].active}, 'b': {__render: slot2.bind(this), __ctx: ctx1, active: true}, 'c': {__render: slot3.bind(this), __ctx: ctx1, active: ctx['state'].active}})}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user