Files
handlebars.js/spec/env/node.js
T
2013-10-01 21:41:09 -05:00

17 lines
480 B
JavaScript

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