mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
prevent directives from polluting rendering context
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user