Line number start from 1 after getToken.jumpTo()
This commit is contained in:
committed by
Marijn Haverbeke
parent
16b54e0698
commit
a84e21e0ff
3
acorn.js
3
acorn.js
@@ -147,7 +147,8 @@
|
||||
getToken.jumpTo = function(pos, reAllowed) {
|
||||
tokPos = pos;
|
||||
if (options.locations) {
|
||||
tokCurLine = tokLineStart = lineBreak.lastIndex = 0;
|
||||
tokCurLine = 1;
|
||||
tokLineStart = lineBreak.lastIndex = 0;
|
||||
var match;
|
||||
while ((match = lineBreak.exec(input)) && match.index < pos) {
|
||||
++tokCurLine;
|
||||
|
||||
Reference in New Issue
Block a user