diff --git a/lib/handlebars/helpers/each.js b/lib/handlebars/helpers/each.js index c1fa20f39..3487e4d78 100644 --- a/lib/handlebars/helpers/each.js +++ b/lib/handlebars/helpers/each.js @@ -52,7 +52,8 @@ export default function(instance) { blockParams: blockParams( [context[field], field], [contextPath + field, null] - ) + ), + goDeeper: true }); } diff --git a/lib/handlebars/runtime.js b/lib/handlebars/runtime.js index 67a500d79..7fa10bd8e 100644 --- a/lib/handlebars/runtime.js +++ b/lib/handlebars/runtime.js @@ -323,9 +323,10 @@ export function wrapProgram( function prog(context, options = {}) { let currentDepths = depths; if ( - depths && - context != depths[0] && - !(context === container.nullContext && depths[0] === null) + (depths && + context != depths[0] && + !(context === container.nullContext && depths[0] === null)) || + options.goDeeper ) { currentDepths = [context].concat(depths); }