diff options
author | Kevin Decker <kpdecker@gmail.com> | 2014-02-09 19:16:47 -0600 |
---|---|---|
committer | Kevin Decker <kpdecker@gmail.com> | 2014-02-09 19:16:47 -0600 |
commit | db651e7ff42bc2db2ae04ea1f1a5631628c3e3b9 (patch) | |
tree | 0cffa9a14a7f33b04f2f3431aa829722a3b1a99d /lib/handlebars/compiler/javascript-compiler.js | |
parent | fcec69ae2c838a9df7a456557b57671a80d1732b (diff) | |
parent | 16f135835eb55dcbb7fa26dab63a9c20fd3981ac (diff) | |
download | handlebars.js-db651e7ff42bc2db2ae04ea1f1a5631628c3e3b9.zip handlebars.js-db651e7ff42bc2db2ae04ea1f1a5631628c3e3b9.tar.gz handlebars.js-db651e7ff42bc2db2ae04ea1f1a5631628c3e3b9.tar.bz2 |
Merge pull request #491 from wycats/data-depth
For nested helpers: get the @ variables of the outer helper from the inner one
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r-- | lib/handlebars/compiler/javascript-compiler.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index 8781819..769179b 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -403,8 +403,12 @@ JavaScriptCompiler.prototype = { // On stack, after: data, ... // // Push the data lookup operator - lookupData: function() { - this.pushStackLiteral('data'); + lookupData: function(depth) { + if (!depth) { + this.pushStackLiteral('data'); + } else { + this.pushStackLiteral('this.data(data, ' + depth + ')'); + } }, // [pushStringParam] |