[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
+5
View File
@@ -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", () => {