[FIX] qweb: correctly capture the scope of arrow functions in props

This commit is contained in:
Samuel Degueldre
2021-12-02 12:05:16 +01:00
committed by Géry Debongnie
parent 150d620b8e
commit 718c765e3b
5 changed files with 542 additions and 2 deletions
+5 -1
View File
@@ -234,7 +234,11 @@ QWeb.addDirective({
} else if (!name.startsWith("t-")) {
if (name !== "class" && name !== "style") {
// this is a prop!
props[name] = ctx.formatExpression(value) || "undefined";
if (value.includes("=>")) {
props[name] = ctx.captureExpression(value);
} else {
props[name] = ctx.formatExpression(value) || "undefined";
}
}
}
}