From 4ffe1b8e5a0871a9c3befe16825ddfad84d1f5c0 Mon Sep 17 00:00:00 2001 From: kpdecker Date: Mon, 30 Jul 2012 21:40:25 -0500 Subject: [PATCH] Fix handling of this parameters in helpers Fixes issue introduced in 727eb26cb6a9e89ab08596dedbabcec0becb4d75 --- lib/handlebars/compiler/compiler.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index ca59725f..108d0551 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -240,7 +240,13 @@ Handlebars.JavaScriptCompiler = function() {}; ID: function(id) { this.addDepth(id.depth); this.opcode('getContext', id.depth); - this.opcode('lookupOnContext', id.parts[0]); + + var name = id.parts[0]; + if (!name) { + this.opcode('pushContext'); + } else { + this.opcode('lookupOnContext', id.parts[0]); + } for(var i=1, l=id.parts.length; i