[Pkg-javascript-commits] [node-acorn-jsx] 169/484: [loose parser] Make sure VariableDeclaration nodes have at least one decl

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:21 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 d9732619404dfc02547f8fdeea597381a20d3c17
Author: Marijn Haverbeke <marijnh at gmail.com>
Date:   Mon Dec 9 17:55:16 2013 +0100

    [loose parser] Make sure VariableDeclaration nodes have at least one decl
    
    Closes marijnh/tern#255
---
 acorn_loose.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/acorn_loose.js b/acorn_loose.js
index 5ad7c91..fa0153f 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -484,6 +484,11 @@
       node.declarations.push(finishNode(decl, "VariableDeclarator"));
       if (!eat(tt.comma)) break;
     }
+    if (!node.declarations.length) {
+      var decl = startNode();
+      decl.id = dummyIdent();
+      node.declarations.push(finishNode(decl, "VariableDeclarator"));
+    }
     return finishNode(node, "VariableDeclaration");
   }
 

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