[Pkg-javascript-commits] [node-acorn-jsx] 373/484: Revert "Require superclass expressions to be lvals"

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:58 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 045d8c02f5f5be5d1796edd4b00de80baa0ef945
Author: Marijn Haverbeke <marijnh at gmail.com>
Date:   Sun Jan 4 22:28:16 2015 +0100

    Revert "Require superclass expressions to be lvals"
    
    This reverts commit 0b59fc198baf2cd970091ee96fe5dd0f90034692.
    
    Issue #187
---
 acorn.js              |  1 -
 test/tests-harmony.js | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/acorn.js b/acorn.js
index 1fec391..4212ac3 100644
--- a/acorn.js
+++ b/acorn.js
@@ -2413,7 +2413,6 @@
     next();
     node.id = tokType === _name ? parseIdent() : isStatement ? unexpected() : null;
     node.superClass = eat(_extends) ? parseExpression() : null;
-    if (node.superClass) checkLVal(node.superClass);
     var classBody = startNode();
     classBody.body = [];
     expect(_braceL);
diff --git a/test/tests-harmony.js b/test/tests-harmony.js
index f59838c..74a927f 100644
--- a/test/tests-harmony.js
+++ b/test/tests-harmony.js
@@ -6465,6 +6465,72 @@ test("var A = class extends B {}", {
   locations: true
 });
 
+test("class A extends class B extends C {} {}", {
+  type: "Program",
+  body: [{
+    type: "ClassDeclaration",
+    id: {
+      type: "Identifier",
+      name: "A",
+      loc: {
+        start: {line: 1, column: 6},
+        end: {line: 1, column: 7}
+      }
+    },
+    superClass: {
+      type: "ClassExpression",
+      id: {
+        type: "Identifier",
+        name: "B",
+        loc: {
+          start: {line: 1, column: 22},
+          end: {line: 1, column: 23}
+        }
+      },
+      superClass: {
+        type: "Identifier",
+        name: "C",
+        loc: {
+          start: {line: 1, column: 32},
+          end: {line: 1, column: 33}
+        }
+      },
+      body: {
+        type: "ClassBody",
+        body: [],
+        loc: {
+          start: {line: 1, column: 34},
+          end: {line: 1, column: 36}
+        }
+      },
+      loc: {
+        start: {line: 1, column: 16},
+        end: {line: 1, column: 36}
+      }
+    },
+    body: {
+      type: "ClassBody",
+      body: [],
+      loc: {
+        start: {line: 1, column: 37},
+        end: {line: 1, column: 39}
+      }
+    },
+    loc: {
+      start: {line: 1, column: 0},
+      end: {line: 1, column: 39}
+    }
+  }],
+  loc: {
+    start: {line: 1, column: 0},
+    end: {line: 1, column: 39}
+  }
+}, {
+  ecmaVersion: 6,
+  ranges: true,
+  locations: true
+});
+
 test("class A {get() {}}", {
   type: "Program",
   body: [{

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