summaryrefslogtreecommitdiffstats
path: root/spec/env/node.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-10-14 22:49:23 -0500
committerkpdecker <kpdecker@gmail.com>2013-10-14 22:49:23 -0500
commit6f94fc0a3be36bd32babd70680bfcb1195dafc30 (patch)
tree818a3c5a5673b94b18011014cff76abc6a235511 /spec/env/node.js
parent84049bf0c5576727e9d6a0880abb123454d28861 (diff)
downloadhandlebars.js-6f94fc0a3be36bd32babd70680bfcb1195dafc30.zip
handlebars.js-6f94fc0a3be36bd32babd70680bfcb1195dafc30.tar.gz
handlebars.js-6f94fc0a3be36bd32babd70680bfcb1195dafc30.tar.bz2
Reduce eval scope in test env
Diffstat (limited to 'spec/env/node.js')
-rw-r--r--spec/env/node.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/env/node.js b/spec/env/node.js
index aed2d54..808c07e 100644
--- a/spec/env/node.js
+++ b/spec/env/node.js
@@ -1,3 +1,4 @@
+/*global handlebarsEnv */
require('./common');
global.Handlebars = require('../../lib');
@@ -5,9 +6,13 @@ global.Handlebars = require('../../lib');
global.CompilerContext = {
compile: function(template, options) {
var templateSpec = handlebarsEnv.precompile(template, options);
- return handlebarsEnv.template(eval('(' + templateSpec + ')'));
+ return handlebarsEnv.template(safeEval(templateSpec));
},
compileWithPartial: function(template, options) {
return handlebarsEnv.compile(template, options);
}
};
+
+function safeEval(templateSpec) {
+ return eval('(' + templateSpec + ')');
+}