[Pkg-javascript-commits] [node-acorn-jsx] 367/484: Provide better error on member expression in binding's left side.

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:57 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 adec9f4b8ee4cac6ba682330b83540a0e988e73b
Author: Ingvar Stepanyan <me at rreverser.com>
Date:   Wed Dec 17 20:37:00 2014 +0200

    Provide better error on member expression in binding's left side.
---
 acorn.js | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/acorn.js b/acorn.js
index 291f7b4..3f15583 100644
--- a/acorn.js
+++ b/acorn.js
@@ -1489,14 +1489,12 @@
     switch (expr.type) {
       case "Identifier":
         if (strict && (isStrictBadIdWord(expr.name) || isStrictReservedWord(expr.name)))
-          raise(expr.start, isBinding
-            ? "Binding " + expr.name + " in strict mode"
-            : "Assigning to " + expr.name + " in strict mode"
-          );
+          raise(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode");
         break;
 
       case "MemberExpression":
-        if (!isBinding) break;
+        if (isBinding) raise(expr.start, "Binding to member expression");
+        break;
 
       case "ObjectPattern":
         for (var i = 0; i < expr.properties.length; i++)

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