summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2012-07-30 21:40:25 -0500
committerkpdecker <kpdecker@gmail.com>2012-07-30 21:40:25 -0500
commit4ffe1b8e5a0871a9c3befe16825ddfad84d1f5c0 (patch)
tree13f9facef0a59939fd1298081c4ea513a9f07a9b /lib/handlebars/compiler/compiler.js
parentd8825b1961857834ee0c3cec8b663bc9185f3028 (diff)
downloadhandlebars.js-4ffe1b8e5a0871a9c3befe16825ddfad84d1f5c0.zip
handlebars.js-4ffe1b8e5a0871a9c3befe16825ddfad84d1f5c0.tar.gz
handlebars.js-4ffe1b8e5a0871a9c3befe16825ddfad84d1f5c0.tar.bz2
Fix handling of this parameters in helpers
Fixes issue introduced in 727eb26cb6a9e89ab08596dedbabcec0becb4d75
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index ca59725..108d055 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<l; i++) {
this.opcode('lookup', id.parts[i]);