mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] t-call-context: fix capture making component available in ctx
Previously, when using a component with a slot within a t-call with t-call-context, the component would become available again inside the slot despite the t-call-context. This was caused by the fact that the capture helper function creates an object with the component as its prototype which is incorrect. It should just use the previous context as its prototype.
This commit is contained in:
committed by
Géry Debongnie
parent
39329f80b2
commit
3d40533de1
@@ -21,7 +21,7 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let txt1 = ctx['iter'];
|
||||
const ctx1 = capture(ctx, this);
|
||||
const ctx1 = capture(ctx);
|
||||
const b2 = comp1({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__1\`, node, this, null);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2], [b2]);
|
||||
@@ -70,7 +70,7 @@ exports[`t-set slots with a t-set with a component in body 1`] = `
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const ctx1 = capture(ctx, this);
|
||||
const ctx1 = capture(ctx);
|
||||
return comp2({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
@@ -127,7 +127,7 @@ exports[`t-set slots with an t-set with a component in body 1`] = `
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const ctx1 = capture(ctx, this);
|
||||
const ctx1 = capture(ctx);
|
||||
return comp2({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
@@ -178,7 +178,7 @@ exports[`t-set slots with an unused t-set with a component in body 1`] = `
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const ctx1 = capture(ctx, this);
|
||||
const ctx1 = capture(ctx);
|
||||
return comp2({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__2\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
|
||||
Reference in New Issue
Block a user