diff options
Diffstat (limited to 'lib/handlebars/compiler/helpers.js')
-rw-r--r-- | lib/handlebars/compiler/helpers.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/handlebars/compiler/helpers.js b/lib/handlebars/compiler/helpers.js index 1c8ab0d..f2edfa1 100644 --- a/lib/handlebars/compiler/helpers.js +++ b/lib/handlebars/compiler/helpers.js @@ -124,19 +124,20 @@ export function prepareBlock(openBlock, program, inverseAndProgram, close, inver export function prepareProgram(statements, loc) { if (!loc && statements.length) { - const first = statements[0].loc, - last = statements[statements.length - 1].loc; + const firstLoc = statements[0].loc, + lastLoc = statements[statements.length - 1].loc; - if (first && last) { + /* istanbul ignore else */ + if (firstLoc && lastLoc) { loc = { - source: first.source, + source: firstLoc.source, start: { - line: first.start.line, - column: first.start.column + line: firstLoc.start.line, + column: firstLoc.start.column }, end: { - line: last.end.line, - column: last.end.column + line: lastLoc.end.line, + column: lastLoc.end.column } }; } |