diff options
author | Kevin Decker <kpdecker@gmail.com> | 2014-08-14 00:48:01 -0500 |
---|---|---|
committer | Kevin Decker <kpdecker@gmail.com> | 2014-08-14 00:48:01 -0500 |
commit | 48263be204811d94ff476a07e7931e13e57a7dfd (patch) | |
tree | 92688c262694323f91c9045deea71d635ad71b90 /lib/handlebars/compiler/javascript-compiler.js | |
parent | d95725d5fd57636078583791705cfa814bdf2258 (diff) | |
parent | 9f8110fe1505c6398aaebb1fff9a2ea2a8f99010 (diff) | |
download | handlebars.js-48263be204811d94ff476a07e7931e13e57a7dfd.zip handlebars.js-48263be204811d94ff476a07e7931e13e57a7dfd.tar.gz handlebars.js-48263be204811d94ff476a07e7931e13e57a7dfd.tar.bz2 |
Merge pull request #848 from wycats/recursive-partial
Implement partial recursive lookup
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r-- | lib/handlebars/compiler/javascript-compiler.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index b9b858d..ef02cc7 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -123,7 +123,10 @@ JavaScriptCompiler.prototype = { ret.useData = true; } if (this.useDepths) { - ret.depths = true; + ret.useDepths = true; + } + if (this.options.compat) { + ret.compat = true; } if (!asObject) { @@ -366,7 +369,7 @@ JavaScriptCompiler.prototype = { var i = 0, len = parts.length; - if (!scoped && this.isChild && this.options.compat && !this.lastContext) { + if (!scoped && this.options.compat && !this.lastContext) { // The depthed query is expected to handle the undefined logic for the root level that // is implemented below, so we evaluate that directly in compat mode this.pushStackLiteral(this.depthedLookup(parts[i++])); @@ -616,6 +619,9 @@ JavaScriptCompiler.prototype = { if (this.options.data) { params.push("data"); } + if (this.options.compat) { + params.push('depths'); + } this.push("this.invokePartial(" + params.join(", ") + ")"); }, |