From 0085164ad939ee052ff761822dba31fc5184ab2e Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Fri, 4 Nov 2016 08:14:48 -0700 Subject: [PATCH] node tests: Avoid re-compiling templates. This is a minor optimization to avoid re-compiling templates that have already encountered. --- frontend_tests/zjsunit/render.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend_tests/zjsunit/render.js b/frontend_tests/zjsunit/render.js index 2e43b85719..6fcd127553 100644 --- a/frontend_tests/zjsunit/render.js +++ b/frontend_tests/zjsunit/render.js @@ -40,6 +40,11 @@ exports.use_template = function (name) { Handlebars.templates = {}; } + if (_.has(Handlebars.template, name)) { + // we already compile the template + return; + } + var flag = false, counter = 0, data;