Files
handlebars.js/spec/env/node.js
T
2013-10-14 22:49:23 -05:00

19 lines
481 B
JavaScript

/*global handlebarsEnv */
require('./common');
global.Handlebars = require('../../lib');
global.CompilerContext = {
compile: function(template, options) {
var templateSpec = handlebarsEnv.precompile(template, options);
return handlebarsEnv.template(safeEval(templateSpec));
},
compileWithPartial: function(template, options) {
return handlebarsEnv.compile(template, options);
}
};
function safeEval(templateSpec) {
return eval('(' + templateSpec + ')');
}