Makes Handlebars work in contexts without a global object (node)
This commit is contained in:
@@ -345,7 +345,7 @@ Handlebars.JavaScriptCompiler = function() {};
|
|||||||
|
|
||||||
this.source.push("return buffer;");
|
this.source.push("return buffer;");
|
||||||
|
|
||||||
var params = ["context", "helpers", "partials"];
|
var params = ["Handlebars", "context", "helpers", "partials"];
|
||||||
|
|
||||||
for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
|
for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
|
||||||
params.push("depth" + this.environment.depths.list[i]);
|
params.push("depth" + this.environment.depths.list[i]);
|
||||||
@@ -366,7 +366,7 @@ Handlebars.JavaScriptCompiler = function() {};
|
|||||||
|
|
||||||
return function(context, helpers, partials, depth) {
|
return function(context, helpers, partials, depth) {
|
||||||
try {
|
try {
|
||||||
return container.render.apply(container, arguments);
|
return container.render.call(container, Handlebars, context, helpers, partials, depth);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user