[Pkg-javascript-commits] [node-acorn-jsx] 65/484: line_loc type for v8 perf

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:06 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 3d0f85d6165cc276eccff7262befb412d810d496
Author: Alistair Braidwood <alistair_braidwood at yahoo.co.uk>
Date:   Fri Dec 21 08:29:44 2012 +0000

    line_loc type for v8 perf
---
 acorn.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/acorn.js b/acorn.js
index 1ccd4d5..1769204 100644
--- a/acorn.js
+++ b/acorn.js
@@ -394,13 +394,18 @@
     return match ? match.index + match[0].length : input.length + 1;
   }
 
+  var line_loc_t = function() {
+    this.line = tokCurLine;
+    this.column = tokPos - tokLineStart;
+  }
+
   function curLineLoc() {
     while (tokLineStartNext <= tokPos) {
       ++tokCurLine;
       tokLineStart = tokLineStartNext;
       tokLineStartNext = nextLineStart();
     }
-    return {line: tokCurLine, column: tokPos - tokLineStart};
+    return new line_loc_t();
   }
 
   // Reset the token state. Used at the start of a parse.
@@ -920,7 +925,7 @@
     }
     if (options.locations) {
       node.loc = new node_loc_t();
-      node.loc.start = other.loc.start;//{start: other.loc.start, end: null, source: other.loc.source};
+      node.loc.start = other.loc.start;
     }
     if (options.ranges)
       node.range = [other.range[0], 0];

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