Skip to content

Commit

Permalink
Makes Handlebars work in contexts without a global object (node)
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Feb 8, 2011
1 parent 4d501b6 commit aaaafb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/handlebars/vm.js
Expand Up @@ -345,7 +345,7 @@ Handlebars.JavaScriptCompiler = function() {};

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++) {
params.push("depth" + this.environment.depths.list[i]);
Expand All @@ -366,7 +366,7 @@ Handlebars.JavaScriptCompiler = function() {};

return function(context, helpers, partials, depth) {
try {
return container.render.apply(container, arguments);
return container.render.call(container, Handlebars, context, helpers, partials, depth);
} catch(e) {
throw e;
}
Expand Down

0 comments on commit aaaafb4

Please sign in to comment.