1
0
mirror of synced 2025-11-06 04:05:36 +08:00

add updated web version

This commit is contained in:
Andrey Gubanov
2020-09-16 15:53:58 +03:00
parent 67f22e8ac3
commit 1810184186

View File

@@ -782,8 +782,12 @@ jsonlint.parse = function(input) {
dougJSONParse(input);
} catch(e) {
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);
var linesUntilError = input.substring(0, e.at).split('\n');
var line = linesUntilError.length;
var col = linesUntilError[line - 1].length - 1;
this.parseError(e.message, {line: line, col: col, message: e.message.replace(/./, function(l) { return l.toLowerCase(); })});
throw SyntaxError(e.message + ' on line ' + line);
}
}