prevent directives from polluting rendering context

This commit is contained in:
Géry Debongnie
2019-01-25 09:24:21 +01:00
parent 299a6b4977
commit 2894d74db9
2 changed files with 16 additions and 0 deletions
+3
View File
@@ -192,6 +192,9 @@ export class QWeb {
const doc = this.parsedTemplates[name];
const ctx = new Context();
// this is necessary to prevent some directives (t-forach for ex) to
// pollute the rendering context by adding some keys in it.
ctx.addLine("context = Object.create(context)");
const mainNode = doc.firstChild!;
this._compileNode(mainNode, ctx);