[FIX] qweb: add support for typeof expression

closes #469
This commit is contained in:
Géry Debongnie
2019-11-15 15:44:36 +01:00
committed by aab-odoo
parent f83846e054
commit 94a595ef5b
2 changed files with 9 additions and 3 deletions
+4
View File
@@ -43,6 +43,9 @@ describe("tokenizer", () => {
{ type: "OPERATOR", value: "!==" },
{ type: "OPERATOR", value: "!=" }
]);
expect(tokenize("typeof a")).toEqual([
{"type": "OPERATOR", "value": "typeof "}, {"type": "SYMBOL", "value": "a"}
]);
});
test("strings", () => {
@@ -112,6 +115,7 @@ describe("expression evaluation", () => {
expect(compileExpr("!flag", {})).toBe("!context['flag']");
expect(compileExpr("-3", {})).toBe("-3");
expect(compileExpr("-a", {})).toBe("-context['a']");
expect(compileExpr("typeof a", {})).toBe("typeof context['a']");
});
test("various binary operators", () => {