[FIX] app: t_call recursive template is bound to the correct this

This commit is contained in:
Lucas Perais (lpe)
2022-01-14 18:07:08 +01:00
committed by Aaron Bohy
parent cec451fd15
commit 281b32965e
3 changed files with 92 additions and 1 deletions
+4 -1
View File
@@ -96,7 +96,10 @@ export class TemplateSet {
const templateFn = this._compileTemplate(name, rawTemplate);
// first add a function to lazily get the template, in case there is a
// recursive call to the template name
this.templates[name] = (context, parent) => this.templates[name](context, parent);
const templates = this.templates;
this.templates[name] = function (context, parent) {
return templates[name].call(this, context, parent);
};
const template = templateFn(bdom, this.utils);
this.templates[name] = template;
}