diff --git a/runtime/JavaScript/src/antlr4/error/ErrorStrategy.js b/runtime/JavaScript/src/antlr4/error/ErrorStrategy.js index 7af139952..94038e13a 100644 --- a/runtime/JavaScript/src/antlr4/error/ErrorStrategy.js +++ b/runtime/JavaScript/src/antlr4/error/ErrorStrategy.js @@ -267,7 +267,7 @@ DefaultErrorStrategy.prototype.reportNoViableAlternative = function(recognizer, if (e.startToken.type===Token.EOF) { input = ""; } else { - input = tokens.getText(new Interval(e.startToken, e.offendingToken)); + input = tokens.getText(new Interval(e.startToken.tokenIndex, e.offendingToken.tokenIndex)); } } else { input = ""; @@ -753,4 +753,4 @@ BailErrorStrategy.prototype.sync = function(recognizer) { }; exports.BailErrorStrategy = BailErrorStrategy; -exports.DefaultErrorStrategy = DefaultErrorStrategy; \ No newline at end of file +exports.DefaultErrorStrategy = DefaultErrorStrategy;