From e4fcc1309a95a9019f9ae512e4c24b393289f124 Mon Sep 17 00:00:00 2001 From: Dan Youberg Date: Tue, 19 Jul 2022 11:13:57 -0400 Subject: [PATCH] Adds line number to unexpectedToken syntax error --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index dbf5860..a6083d4 100644 --- a/index.js +++ b/index.js @@ -221,7 +221,7 @@ exports.parse = function (source, _, options) { } function unexpectedToken() { - throw new SyntaxError('Unexpected token ' + source[pos] + ' in JSON at position ' + pos); + throw new SyntaxError('Unexpected token ' + source[pos] + ' in JSON at position ' + pos + ' on line ' +line); } function wasUnexpectedToken() {