[FIX] component: no crash if empty props

The expression parser properly format an empty string into an empty
string. But then, this empty string was injected in the props object of
a component, and the compiled code looked like this:

let props5 = { val: };

So, in this case, we simply put undefined, since there are no props
value.

closes #587
This commit is contained in:
Géry Debongnie
2019-12-19 14:20:16 +01:00
committed by aab-odoo
parent bc2c7edff4
commit 4f61d9f1e0
3 changed files with 54 additions and 1 deletions
+1 -1
View File
@@ -211,7 +211,7 @@ QWeb.addDirective({
} else if (!name.startsWith("t-")) {
if (name !== "class" && name !== "style") {
// this is a prop!
props[name] = ctx.formatExpression(value);
props[name] = ctx.formatExpression(value) || "undefined";
}
}
}