[Pkg-javascript-commits] [node-acorn-jsx] 451/484: Update Acorn version and fix incompatibilities.

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:21:10 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 0025436924c8fa32840d39c1694a2c74a83cc165
Author: Ingvar Stepanyan <me at rreverser.com>
Date:   Thu Jun 18 16:07:45 2015 +0300

    Update Acorn version and fix incompatibilities.
---
 inject.js    | 35 ++++++++++++++++++-----------------
 package.json |  8 ++++----
 2 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/inject.js b/inject.js
index 98a1880..eba511e 100644
--- a/inject.js
+++ b/inject.js
@@ -196,10 +196,10 @@ module.exports = function(acorn) {
   // Parse namespaced identifier.
 
   pp.jsx_parseNamespacedName = function() {
-    var start = this.markPosition();
+    var startPos = this.start, startLoc = this.startLoc;
     var name = this.jsx_parseIdentifier();
     if (!this.eat(tt.colon)) return name;
-    var node = this.startNodeAt(start);
+    var node = this.startNodeAt(startPos, startLoc);
     node.namespace = name;
     node.name = this.jsx_parseIdentifier();
     return this.finishNode(node, 'JSXNamespacedName');
@@ -209,10 +209,10 @@ module.exports = function(acorn) {
   // or single identifier.
 
   pp.jsx_parseElementName = function() {
-    var start = this.markPosition();
+    var startPos = this.start, startLoc = this.startLoc;
     var node = this.jsx_parseNamespacedName();
     while (this.eat(tt.dot)) {
-      var newNode = this.startNodeAt(start);
+      var newNode = this.startNodeAt(startPos, startLoc);
       newNode.object = node;
       newNode.property = this.jsx_parseIdentifier();
       node = this.finishNode(newNode, 'JSXMemberExpression');
@@ -285,8 +285,8 @@ module.exports = function(acorn) {
 
   // Parses JSX opening tag starting after '<'.
 
-  pp.jsx_parseOpeningElementAt = function(start) {
-    var node = this.startNodeAt(start);
+  pp.jsx_parseOpeningElementAt = function(startPos, startLoc) {
+    var node = this.startNodeAt(startPos, startLoc);
     node.attributes = [];
     node.name = this.jsx_parseElementName();
     while (this.type !== tt.slash && this.type !== tt.jsxTagEnd)
@@ -298,8 +298,8 @@ module.exports = function(acorn) {
 
   // Parses JSX closing tag starting after '</'.
 
-  pp.jsx_parseClosingElementAt = function(start) {
-    var node = this.startNodeAt(start);
+  pp.jsx_parseClosingElementAt = function(startPos, startLoc) {
+    var node = this.startNodeAt(startPos, startLoc);
     node.name = this.jsx_parseElementName();
     this.expect(tt.jsxTagEnd);
     return this.finishNode(node, 'JSXClosingElement');
@@ -308,23 +308,23 @@ module.exports = function(acorn) {
   // Parses entire JSX element, including it's opening tag
   // (starting after '<'), attributes, contents and closing tag.
 
-  pp.jsx_parseElementAt = function(start) {
-    var node = this.startNodeAt(start);
+  pp.jsx_parseElementAt = function(startPos, startLoc) {
+    var node = this.startNodeAt(startPos, startLoc);
     var children = [];
-    var openingElement = this.jsx_parseOpeningElementAt(start);
+    var openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc);
     var closingElement = null;
 
     if (!openingElement.selfClosing) {
       contents: for (;;) {
         switch (this.type) {
         case tt.jsxTagStart:
-          start = this.markPosition();
+          startPos = this.start; startLoc = this.startLoc;
           this.next();
           if (this.eat(tt.slash)) {
-            closingElement = this.jsx_parseClosingElementAt(start);
+            closingElement = this.jsx_parseClosingElementAt(startPos, startLoc);
             break contents;
           }
-          children.push(this.jsx_parseElementAt(start));
+          children.push(this.jsx_parseElementAt(startPos, startLoc));
           break;
 
         case tt.jsxText:
@@ -339,10 +339,11 @@ module.exports = function(acorn) {
           this.unexpected();
         }
       }
-      if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name))
+      if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
         this.raise(
           closingElement.start,
           'Expected corresponding JSX closing tag for <' + getQualifiedJSXName(openingElement.name) + '>');
+      }
     }
 
     node.openingElement = openingElement;
@@ -357,9 +358,9 @@ module.exports = function(acorn) {
   // Parses entire JSX element from current position.
 
   pp.jsx_parseElement = function() {
-    var start = this.markPosition();
+    var startPos = this.start, startLoc = this.startLoc;
     this.next();
-    return this.jsx_parseElementAt(start);
+    return this.jsx_parseElementAt(startPos, startLoc);
   };
 
   acorn.plugins.jsx = function(instance) {
diff --git a/package.json b/package.json
index fc32dbd..e08005f 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
   "description": "Alternative, faster React.js JSX parser",
   "homepage": "https://github.com/RReverser/acorn-jsx",
   "main": "acorn.js",
-  "version": "1.0.3",
+  "version": "1.1.0",
   "maintainers": [
     {
       "name": "Ingvar Stepanyan",
@@ -25,10 +25,10 @@
     "test": "node test/run.js"
   },
   "dependencies": {
-    "acorn": "^1.0.3"
+    "acorn": "^1.2.2"
   },
   "devDependencies": {
-    "chai": "^2.2.0",
-    "mocha": "^2.2.4"
+    "chai": "^3.0.0",
+    "mocha": "^2.2.5"
   }
 }

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