Skip to content

Commit

Permalink
Line number start from 1 after getToken.jumpTo()
Browse files Browse the repository at this point in the history
  • Loading branch information
wjx authored and marijnh committed Jul 11, 2013
1 parent 16b54e0 commit a84e21e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion acorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a84e21e

Please sign in to comment.