diff options
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 554a393..3a48c16 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -321,6 +321,7 @@ Handlebars.JavaScriptCompiler = function() {}; this.context = { aliases: {}, + aliases: { self: 'this' }, registers: {list: []} }; @@ -611,9 +612,9 @@ Handlebars.JavaScriptCompiler = function() {}; }, programExpression: function(guid) { - if(guid == null) { return "this.noop"; } var programParams = [guid, "helpers", "partials"]; + if(guid == null) { return "self.noop"; } var depths = this.environment.rawChildren[guid].depths.list; @@ -635,10 +636,10 @@ Handlebars.JavaScriptCompiler = function() {}; } if(depths.length === 0) { - return "this.program(" + programParams.join(", ") + ")"; + return "self.program(" + programParams.join(", ") + ")"; } else { programParams[0] = "this.children[" + guid + "]"; - return "this.programWithDepth(" + programParams.join(", ") + ")"; + return "self.programWithDepth(" + programParams.join(", ") + ")"; } }, |