From a84e21e0ffc415e2eb729aad88097a1c7ecdb568 Mon Sep 17 00:00:00 2001 From: Jiaxing Wang Date: Wed, 10 Jul 2013 17:17:23 +0800 Subject: [PATCH] Line number start from 1 after getToken.jumpTo() --- acorn.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/acorn.js b/acorn.js index 1ca1caee2f..43db6e9e03 100644 --- a/acorn.js +++ b/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;