summaryrefslogtreecommitdiffstats
path: root/spec/env/node.js
diff options
context:
space:
mode:
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 + ')');
+}