summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/helpers.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-08-03 17:28:05 -0500
committerkpdecker <kpdecker@gmail.com>2015-08-03 17:49:47 -0500
commit324d61572655e251ad2b06032a04cfab09bb0076 (patch)
treebb9a92f45c6b383f05700ce840f1119eb51e2334 /lib/handlebars/compiler/helpers.js
parentc3cbaa25a48d1a0c52ead31bfab28cb803cace1f (diff)
downloadhandlebars.js-324d61572655e251ad2b06032a04cfab09bb0076.zip
handlebars.js-324d61572655e251ad2b06032a04cfab09bb0076.tar.gz
handlebars.js-324d61572655e251ad2b06032a04cfab09bb0076.tar.bz2
Enforce 100% code coverage
Diffstat (limited to 'lib/handlebars/compiler/helpers.js')
-rw-r--r--lib/handlebars/compiler/helpers.js17
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
}
};
}