mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: properly parse short object description
Before this commit, using an expression such as "{machin}" was compiled
in qweb into "{scope['machin']}" which is not valid.
With this commit, we instead transform it into "{machin:
scope['machin']}".
closes #885
This commit is contained in:
@@ -200,4 +200,10 @@ describe("expression evaluation", () => {
|
||||
test("works with builtin properties", () => {
|
||||
expect(compileExpr("state.constructor.name", {})).toBe("scope['state'].constructor.name");
|
||||
});
|
||||
|
||||
test("works with shortcut object key description", () => {
|
||||
expect(compileExpr("{a}", {})).toBe("{a:scope['a']}");
|
||||
expect(compileExpr("{a,b}", {})).toBe("{a:scope['a'],b:scope['b']}");
|
||||
expect(compileExpr("{a,b:3,c}", {})).toBe("{a:scope['a'],b:3,c:scope['c']}");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user