Comparing version 1.9.1 to 1.10.0
@@ -165,2 +165,43 @@ /** | ||
/** | ||
* Creates an ASTNode representation of a class body. | ||
* @param {ASTNode} body The node representing the body of the class. | ||
* @returns {ASTNode} An ASTNode representing the class body. | ||
*/ | ||
createClassBody: function (body) { | ||
return { | ||
type: astNodeTypes.ClassBody, | ||
body: body | ||
}; | ||
}, | ||
createClassExpression: function (name, superClass, body) { | ||
return { | ||
type: astNodeTypes.ClassExpression, | ||
name: name, | ||
superClass: superClass, | ||
body: body | ||
}; | ||
}, | ||
createClassDeclaration: function (name, superClass, body) { | ||
return { | ||
type: astNodeTypes.ClassDeclaration, | ||
name: name, | ||
superClass: superClass, | ||
body: body | ||
}; | ||
}, | ||
createMethodDefinition: function (propertyType, kind, key, value, computed) { | ||
return { | ||
type: astNodeTypes.MethodDefinition, | ||
key: key, | ||
value: value, | ||
kind: kind, | ||
"static": propertyType === "static", | ||
computed: computed | ||
}; | ||
}, | ||
/** | ||
* Create an ASTNode representation of a conditional expression | ||
@@ -321,3 +362,3 @@ * @param {ASTNode} test The conditional to evaluate | ||
id: id, | ||
params: params, | ||
params: params || [], | ||
defaults: defaults || [], | ||
@@ -346,3 +387,3 @@ body: body, | ||
id: id, | ||
params: params, | ||
params: params || [], | ||
defaults: defaults || [], | ||
@@ -349,0 +390,0 @@ body: body, |
@@ -50,2 +50,5 @@ /** | ||
CatchClause: "CatchClause", | ||
ClassBody: "ClassBody", | ||
ClassDeclaration: "ClassDeclaration", | ||
ClassExpression: "ClassExpression", | ||
ConditionalExpression: "ConditionalExpression", | ||
@@ -68,2 +71,3 @@ ContinueStatement: "ContinueStatement", | ||
MemberExpression: "MemberExpression", | ||
MethodDefinition: "MethodDefinition", | ||
NewExpression: "NewExpression", | ||
@@ -70,0 +74,0 @@ ObjectExpression: "ObjectExpression", |
@@ -100,2 +100,5 @@ /** | ||
// enable parsing of classes | ||
classes: false, | ||
// React JSX parsing | ||
@@ -102,0 +105,0 @@ jsx: false, |
@@ -81,2 +81,5 @@ /** | ||
DuplicatePrototypeProperty: "Duplicate '__proto__' property in object literal are not allowed", | ||
ConstructorSpecialMethod: "Class constructor may not be an accessor", | ||
DuplicateConstructor: "A class may only have one constructor", | ||
StaticPrototype: "Classes may not have static property named prototype", | ||
AccessorDataProperty: "Object literal may not have data and accessor property with the same name", | ||
@@ -83,0 +86,0 @@ AccessorGetSet: "Object literal may not have multiple get/set accessors with the same name", |
@@ -11,3 +11,3 @@ { | ||
}, | ||
"version": "1.9.1", | ||
"version": "1.10.0", | ||
"files": [ | ||
@@ -14,0 +14,0 @@ "bin", |
@@ -78,3 +78,3 @@ # Espree | ||
// enable parsing of template strings | ||
templateStrings: false, | ||
templateStrings: true, | ||
@@ -91,3 +91,3 @@ // enable parsing of binary literals | ||
// enable parsing of default parameters | ||
defaultParams: false, | ||
defaultParams: true, | ||
@@ -115,5 +115,8 @@ // enable parsing of rest parameters | ||
// support the spread operator | ||
// enable parsing spread operator | ||
spread: true, | ||
// enable parsing classes | ||
classes: true, | ||
// enable React JSX parsing | ||
@@ -120,0 +123,0 @@ jsx: true, |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
289445
7306
220