[Pkg-javascript-commits] [node-ast-types] 01/04: New upstream version 0.9.2
Julien Puydt
julien.puydt at laposte.net
Wed Nov 9 06:42:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
jpuydt-guest pushed a commit to branch master
in repository node-ast-types.
commit 4321e4651628dad44afc6e965f9872ba26d522d7
Author: Julien Puydt <julien.puydt at laposte.net>
Date: Wed Nov 9 07:39:59 2016 +0100
New upstream version 0.9.2
---
def/babel6.js | 34 ++++++++++++++++++++++++++++++----
package.json | 2 +-
2 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/def/babel6.js b/def/babel6.js
index dbca165..502a91b 100644
--- a/def/babel6.js
+++ b/def/babel6.js
@@ -57,11 +57,18 @@ module.exports = function (fork) {
.field("pattern", String)
.field("flags", String);
+ var ObjectExpressionProperty = or(
+ def("Property"),
+ def("ObjectMethod"),
+ def("ObjectProperty"),
+ def("SpreadProperty")
+ );
+
// Split Property -> ObjectProperty and ObjectMethod
def("ObjectExpression")
.bases("Expression")
.build("properties")
- .field("properties", [or(def("Property"), def("ObjectMethod"), def("ObjectProperty"), def("SpreadProperty"))]);
+ .field("properties", [ObjectExpressionProperty]);
// ObjectMethod hoist .value properties to own properties
def("ObjectMethod")
@@ -85,11 +92,19 @@ module.exports = function (fork) {
.field("value", or(def("Expression"), def("Pattern")))
.field("computed", Boolean, defaults["false"]);
+ var ClassBodyElement = or(
+ def("MethodDefinition"),
+ def("VariableDeclarator"),
+ def("ClassPropertyDefinition"),
+ def("ClassProperty"),
+ def("ClassMethod")
+ );
+
// MethodDefinition -> ClassMethod
def("ClassBody")
.bases("Declaration")
.build("body")
- .field("body", [or(def("ClassMethod"), def("ClassProperty"))]);
+ .field("body", [ClassBodyElement]);
def("ClassMethod")
.bases("Declaration", "Function")
@@ -106,12 +121,23 @@ module.exports = function (fork) {
or([def("Decorator")], null),
defaults["null"]);
+ var ObjectPatternProperty = or(
+ def("Property"),
+ def("PropertyPattern"),
+ def("SpreadPropertyPattern"),
+ def("SpreadProperty"), // Used by Esprima
+ def("ObjectProperty"), // Babel 6
+ def("RestProperty") // Babel 6
+ );
+
// Split into RestProperty and SpreadProperty
def("ObjectPattern")
.bases("Pattern")
.build("properties")
- .field("properties", [or(def("Property"), def("RestProperty"), def("ObjectProperty"))])
- .field("decorators", [def("Decorator")]);
+ .field("properties", [ObjectPatternProperty])
+ .field("decorators",
+ or([def("Decorator")], null),
+ defaults["null"]);
def("SpreadProperty")
.bases("Node")
diff --git a/package.json b/package.json
index a557fce..f4dbe98 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"transformation",
"syntax"
],
- "version": "0.9.1",
+ "version": "0.9.2",
"homepage": "http://github.com/benjamn/ast-types",
"repository": {
"type": "git",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-ast-types.git
More information about the Pkg-javascript-commits
mailing list