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
@@ -169,6 +169,11 @@ describe("expression evaluation", () => {
|
||||
expect(compileExpr("list.map((elem, index) => elem + index)")).toBe(
|
||||
"ctx['list'].map((elem,index)=>elem+index)"
|
||||
);
|
||||
expect(compileExpr("(ev => ev)(e)")).toBe("(ev=>ev)(ctx['e'])");
|
||||
});
|
||||
test.skip("arrow functions: not yet supported", () => {
|
||||
// e is added to localvars in inline_expression but not removed after the arrow func body
|
||||
expect(compileExpr("(e => e)(e)")).toBe("(e=>e)(ctx['e'])");
|
||||
});
|
||||
|
||||
test("assignation", () => {
|
||||
|
||||
Reference in New Issue
Block a user