[Pkg-javascript-commits] [node-acorn-jsx] 322/484: Avoid UnaryExpression-specific properties in SpreadElement (just in case).

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:50 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 b47696eecfa455d0c22b3161c1866106329236a3
Author: Ingvar Stepanyan <me at rreverser.com>
Date:   Sun Oct 26 21:03:35 2014 +0200

    Avoid UnaryExpression-specific properties in SpreadElement (just in case).
---
 acorn.js | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/acorn.js b/acorn.js
index e6a6e64..adf4675 100644
--- a/acorn.js
+++ b/acorn.js
@@ -1949,11 +1949,14 @@
 
   function parseMaybeUnary() {
     if (tokType.prefix) {
-      var node = startNode(), update = tokType.isUpdate;
-      var nodeType = tokType === _ellipsis ? "SpreadElement" :
-        (update ? "UpdateExpression" : "UnaryExpression");
-      node.operator = tokVal;
-      node.prefix = true;
+      var node = startNode(), update = tokType.isUpdate, nodeType;
+      if (tokType === _ellipsis) {
+        nodeType = "SpreadElement";
+      } else {
+        nodeType = update ? "UpdateExpression" : "UnaryExpression";
+        node.operator = tokVal;
+        node.prefix = true;
+      }
       tokRegexpAllowed = true;
       next();
       node.argument = parseMaybeUnary();

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