mirror of
https://github.com/circlecell/jsonlint-mod.git
synced 2026-01-21 05:07:49 +08:00
Throw error when Doug parser throws 'Unexpected'
This commit is contained in:
@@ -421,7 +421,8 @@ jsonlint.parse = function(input) {
|
||||
try {
|
||||
dougJSONParse(input);
|
||||
} catch(e) {
|
||||
if(/Duplicate key|Bad string/.test(e.message)) {
|
||||
console.error(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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user