From 6ea9ccf56fc66c4aa37679bca04256a4be1403b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 22 Mar 2019 14:46:47 +0100 Subject: [PATCH] fix: remove exprCache, as formatting is contextual Formatting expressions now depends on the currently defined variables, so it cannot be put in a cache. --- src/qweb.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qweb.ts b/src/qweb.ts index de3d7715..64d9c914 100644 --- a/src/qweb.ts +++ b/src/qweb.ts @@ -147,7 +147,6 @@ export class Context { export class QWeb { processedTemplates: { [name: string]: ProcessedTemplate } = {}; templates: { [name: string]: CompiledTemplate } = {}; - exprCache: { [key: string]: string } = {}; directives: Directive[] = []; constructor() { @@ -592,9 +591,6 @@ export class QWeb { _formatExpression(e: string, ctx?: Context): string { e = e.trim(); - if (e in this.exprCache) { - return this.exprCache[e]; - } if (e[0] === "{" && e[e.length - 1] === "}") { const innerExpr = e .slice(1, -1) @@ -649,7 +645,6 @@ export class QWeb { r += c; } const result = r.slice(0, -1); - this.exprCache[e] = result; return result; } }