Line number start from 1 after getToken.jumpTo()

This commit is contained in:
Jiaxing Wang
2013-07-10 17:17:23 +08:00
committed by Marijn Haverbeke
parent 16b54e0698
commit a84e21e0ff

View File

@@ -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;