Implement recursive field lookup in compat mode

Provides the mustache behavior of recursive lookup without the use of depthed paths.

Note that this does incur a fairly dramatic performance penalty for depthed queries.
This commit is contained in:
kpdecker
2014-08-13 20:46:07 -05:00
parent 625b00e1da
commit c98613b711
6 changed files with 62 additions and 9 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ global.compileWithPartials = function(string, hashOrArray, partials) {
if(Object.prototype.toString.call(hashOrArray) === "[object Array]") {
ary = [];
ary.push(hashOrArray[0]);
ary.push({ helpers: hashOrArray[1], partials: hashOrArray[2], compat: hashOrArray[3] });
ary.push({ helpers: hashOrArray[1], partials: hashOrArray[2] });
options = {compat: hashOrArray[3]};
} else {
ary = [hashOrArray];