[Pkg-javascript-commits] [node-acorn-jsx] 95/484: [loose parser] Improve closing heuristic in parseExprList

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:10 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 76c41d3a718e5d6291f3a7e8d6aaa862dde11a7b
Author: Marijn Haverbeke <marijnh at gmail.com>
Date:   Wed Feb 6 13:47:05 2013 +0100

    [loose parser] Improve closing heuristic in parseExprList
---
 acorn_loose.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/acorn_loose.js b/acorn_loose.js
index 94eb76d..97a4dd0 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -567,7 +567,6 @@
         base = finishNode(node, "MemberExpression");
       } else if (!noCalls && token.type == tt.parenL) {
         pushCx();
-        next();
         var node = startNodeFrom(base);
         node.callee = base;
         node.arguments = parseExprList(tt.parenR);
@@ -612,7 +611,6 @@
     case tt.bracketL:
       var node = startNode();
       pushCx();
-      next();
       node.elements = parseExprList(tt.bracketR);
       return finishNode(node, "ArrayExpression");
 
@@ -708,7 +706,8 @@
   }
 
   function parseExprList(close) {
-    var elts = [], indent = curIndent + 1, line = curLineStart;
+    var indent = curIndent + 1, line = curLineStart, elts = [];
+    next(); // Opening bracket
     while (!closesBlock(close, indent, line)) {
       var elt = parseExpression(true);
       if (isDummy(elt)) {

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