diff options
author | kpdecker <kpdecker@gmail.com> | 2013-10-14 22:49:23 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-10-14 22:49:23 -0500 |
commit | 6f94fc0a3be36bd32babd70680bfcb1195dafc30 (patch) | |
tree | 818a3c5a5673b94b18011014cff76abc6a235511 /spec/env/node.js | |
parent | 84049bf0c5576727e9d6a0880abb123454d28861 (diff) | |
download | handlebars.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.js | 7 |
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 + ')'); +} |