[Pkg-javascript-commits] [node-acorn-jsx] 314/484: Loose: Added ParenthesizedExpression.

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:48 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 61d2067b2bf64862b09c7634057a2017fa352614
Author: Ingvar Stepanyan <me at rreverser.com>
Date:   Sun Oct 26 18:08:43 2014 +0200

    Loose: Added ParenthesizedExpression.
---
 acorn_loose.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/acorn_loose.js b/acorn_loose.js
index 09fbf21..6829f2f 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -664,9 +664,15 @@
       return finishNode(node, "Literal");
 
     case tt.parenL:
+      var start = storeCurrentPos();
       next();
       var val = parseExpression();
       expect(tt.parenR);
+      if (options.preserveParens) {
+        var par = startNodeAt(start);
+        par.expression = val;
+        val = finishNode(par, "ParenthesizedExpression");
+      }
       return val;
 
     case tt.bracketL:

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