[FIX] components: do not crash when binding anonymous function

It is not really useful, but it is possible to bind an anonymous
function prop. However, with the recent change on how the bind feature
works, it now crashes.

This commit makes sure that we properly apply the `bind` operation to
the function, and not to the last term of the function.
This commit is contained in:
Géry Debongnie
2023-03-09 15:21:12 +01:00
committed by Sam Degueldre
parent 532ab7fae0
commit 0024f33fa1
5 changed files with 56 additions and 7 deletions
@@ -556,7 +556,7 @@ exports[`t-call t-call-context: ComponentNode is not looked up in the context 2`
let ref1 = (el) => this.__owl__.setRef((\`myRef\`), el);
const b2 = block2([ref1]);
const ctx1 = capture(ctx);
const b6 = comp1({prop: ctx['method'].bind(this),slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__1\`, node, this, null);
const b6 = comp1({prop: (ctx['method']).bind(this),slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__1\`, node, this, null);
return multi([b2, b6]);
}
}"