diff options
Diffstat (limited to 'lib/handlebars/helpers/each.js')
-rw-r--r-- | lib/handlebars/helpers/each.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/handlebars/helpers/each.js b/lib/handlebars/helpers/each.js index 9b1629b..fb11903 100644 --- a/lib/handlebars/helpers/each.js +++ b/lib/handlebars/helpers/each.js @@ -25,12 +25,6 @@ export default function(instance) { } function execIteration(field, index, last) { - // Don't iterate over undefined values since we can't execute blocks against them - // in non-strict (js) mode. - if (context[field] == null) { - return; - } - if (data) { data.key = field; data.index = index; @@ -51,7 +45,9 @@ export default function(instance) { if (context && typeof context === 'object') { if (isArray(context)) { for (let j = context.length; i < j; i++) { - execIteration(i, i, i === context.length - 1); + if (i in context) { + execIteration(i, i, i === context.length - 1); + } } } else { let priorKey; |