Skip to content

Commit

Permalink
Merge pull request #171 from Aquafina-water-bottle/126_noeval_handlebars
Browse files Browse the repository at this point in the history
Fix Handlebars not working on Firefox due to eval
  • Loading branch information
djahandarie committed Jun 10, 2023
2 parents 8bf8739 + 17b938a commit 145628c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 30 deletions.
3 changes: 2 additions & 1 deletion ext/js/templates/sandbox/template-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

/* global
* Handlebars
* handlebarsCompileFnName
*/

class TemplateRenderer {
Expand Down Expand Up @@ -83,7 +84,7 @@ class TemplateRenderer {
let instance = cache.get(template);
if (typeof instance === 'undefined') {
this._updateCacheSize(this._cacheMaxSize - 1);
instance = Handlebars.compile(template);
instance = Handlebars[handlebarsCompileFnName](template);
cache.set(template, instance);
}

Expand Down
Loading

0 comments on commit 145628c

Please sign in to comment.