[FIX] qweb/component: fix scoping issue with list of widgets

In a t-foreach loop, there was a bad interaction between variables
defined with the `var` keyword and asynchronous code.

closes #108
This commit is contained in:
Géry Debongnie
2019-05-15 15:18:27 +02:00
parent 9556696fa8
commit 9c1d369e94
4 changed files with 161 additions and 132 deletions
+1 -1
View File
@@ -563,7 +563,7 @@ export class QWeb {
parts.push(`on:{}`);
}
ctx.addLine(`var c${nodeID} = [], p${nodeID} = {${parts.join(",")}};`);
ctx.addLine(`let c${nodeID} = [], p${nodeID} = {${parts.join(",")}};`);
for (let id of tattrs) {
ctx.addIf(`_${id} instanceof Array`);
ctx.addLine(`p${nodeID}.attrs[_${id}[0]] = _${id}[1];`);