Skip to content

Commit

Permalink
Auto merge of #156 - martndemus:inc-or-dec-by-zero, r=martndemus
Browse files Browse the repository at this point in the history
Be able to use {{inc}} or {{dec}} with 0

None
  • Loading branch information
homu committed May 12, 2016
2 parents 66ae946 + 02c5d4c commit bb214ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion addon/helpers/dec.js
Expand Up @@ -7,7 +7,10 @@ export function dec([step, val]) {
step = undefined;
}

step = step || 1;
if (step === undefined) {
step = 1;
}

return val - step;
}

Expand Down
5 changes: 4 additions & 1 deletion addon/helpers/inc.js
Expand Up @@ -7,7 +7,10 @@ export function inc([step, val]) {
step = undefined;
}

step = step || 1;
if (step === undefined) {
step = 1;
}

return val + step;
}

Expand Down

0 comments on commit bb214ff

Please sign in to comment.