diff options
author | Peter Wagenet <peter.wagenet@gmail.com> | 2012-07-30 21:43:13 -0700 |
---|---|---|
committer | Peter Wagenet <peter.wagenet@gmail.com> | 2012-07-30 21:43:13 -0700 |
commit | 2b3e7773409b9fba68e275d49c0c0969e0294a7e (patch) | |
tree | 13f9facef0a59939fd1298081c4ea513a9f07a9b /lib/handlebars/compiler/compiler.js | |
parent | 8be16c64f9e8a8b75cd01de02e53f7a3d9842e07 (diff) | |
parent | 4ffe1b8e5a0871a9c3befe16825ddfad84d1f5c0 (diff) | |
download | handlebars.js-2b3e7773409b9fba68e275d49c0c0969e0294a7e.zip handlebars.js-2b3e7773409b9fba68e275d49c0c0969e0294a7e.tar.gz handlebars.js-2b3e7773409b9fba68e275d49c0c0969e0294a7e.tar.bz2 |
Merge pull request #282 from kpdecker/this-param
This param
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 8 |
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]); |