[IMP] qweb: turn handlers into function expressions only

For the sake of consistency with vanilla JS, and to allow some things
that were previously not possible.
This commit is contained in:
Samuel Degueldre
2021-11-12 12:56:07 +01:00
committed by Géry Debongnie
parent d60a5a414e
commit e611c20ab4
33 changed files with 280 additions and 227 deletions
@@ -98,7 +98,7 @@ exports[`basics can be clicked on and updated 1`] = `
return function template(ctx, node, key = \\"\\") {
let d1 = ctx['state'].counter;
const v1 = ctx['state'];
let d2 = [(e) => {const res = (() => { return v1.counter++ })(); if (typeof res === 'function') { res(e) }}];
let d2 = [()=>v1.counter++, ctx];
return block1([d1, d2]);
}
}"
@@ -157,7 +157,7 @@ exports[`basics can inject values in tagged templates 2`] = `
const callTemplate_2 = getTemplate(\`__template__9\`);
return function template(ctx, node, key = \\"\\") {
return callTemplate_2(ctx, node, key + \`__1\`);
return callTemplate_2.call(this, ctx, node, key + \`__1\`);
}
}"
`;
@@ -599,7 +599,7 @@ exports[`basics rerendering a widget with a sub widget 1`] = `
return function template(ctx, node, key = \\"\\") {
let d1 = ctx['state'].counter;
const v1 = ctx['state'];
let d2 = [(e) => {const res = (() => { return v1.counter++ })(); if (typeof res === 'function') { res(e) }}];
let d2 = [()=>v1.counter++, ctx];
return block1([d1, d2]);
}
}"