diff --git a/src/js/form-model.js b/src/js/form-model.js index d7138772..e216e5a5 100644 --- a/src/js/form-model.js +++ b/src/js/form-model.js @@ -1424,8 +1424,9 @@ FormModel.prototype.evaluate = function ( cacheable = original === expr; // if no cached conversion exists - cached_expr = this.convertedExpressions.get(cacheKey) - if (cached_expr === undefined) { + const cachedExpr = this.convertedExpressions.get(cacheKey); + + if (cachedExpr === undefined) { expr = expr.trim(); expr = this.replaceInstanceFn(expr); expr = this.replaceVersionFn(expr); @@ -1440,11 +1441,12 @@ FormModel.prototype.evaluate = function ( expr = expr.replace(/</g, '<'); expr = expr.replace(/>/g, '>'); expr = expr.replace(/"/g, '"'); + if (cacheable) { - this.convertedExpressions.set(cacheKey,expr); + this.convertedExpressions.set(cacheKey, expr); } } else { - expr = cached_expr; + expr = cachedExpr; } resultTypes = {