mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[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:
committed by
Géry Debongnie
parent
d60a5a414e
commit
e611c20ab4
@@ -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]);
|
||||
}
|
||||
}"
|
||||
|
||||
Reference in New Issue
Block a user