[Pkg-javascript-commits] [node-acorn-jsx] 136/484: Line number start from 1 after getToken.jumpTo()

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-acorn-jsx.

commit a84e21e0ffc415e2eb729aad88097a1c7ecdb568
Author: Jiaxing Wang <hello.wjx at gmail.com>
Date:   Wed Jul 10 17:17:23 2013 +0800

    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 1ca1cae..43db6e9 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git



More information about the Pkg-javascript-commits mailing list