19 lines
481 B
JavaScript
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 + ')');
|
|
}
|