Skip to content

Commit 7c45a8a

Browse files
committed
Merge pull request #6 from lathonez/master
Do not allow a negative indentLevel to throw RangeError: Invalid arra…
2 parents 851e832 + 2806b8e commit 7c45a8a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

js/jsonlint/jsl.format.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var jsl = typeof jsl === 'undefined' ? {} : jsl;
88
jsl.format = (function () {
99

1010
function repeat(s, count) {
11+
count = count < 0 ? 0 : count;
1112
return new Array(count + 1).join(s);
1213
}
1314

0 commit comments

Comments
 (0)