Minor enhancements

This commit is contained in:
Andrey Gubanov
2019-02-10 13:47:10 +02:00
parent ac1eae7734
commit d9057c2d39
4 changed files with 247 additions and 4 deletions

View File

@@ -781,8 +781,7 @@ jsonlint.parse = function(input) {
try {
dougJSONParse(input);
} catch(e) {
console.log(e.message);
if(/Duplicate key|Bad string/.test(e.message)) {
if(/Duplicate key|Bad string|Unexpected/.test(e.message)) {
var lineNumber = input.substring(0, e.at).split('\n').length;
throw SyntaxError(e.message + ' on line ' + lineNumber);
}