Socket
Socket
Sign inDemoInstall

acorn-class-fields

Package Overview
Dependencies
2
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.7 to 1.0.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 1.0.0 (2021-02-08)
* Update AST node names to match [ESTree](https://github.com/estree/estree/blob/master/experimental/class-features.md)
## 0.3.7 (2020-08-13)

@@ -2,0 +6,0 @@

6

index.js

@@ -24,3 +24,3 @@ "use strict"

parseClassElement(_constructorAllowsSuper) {
if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateNameToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) {
if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateIdentifierToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) {
const branch = this._branch()

@@ -41,3 +41,3 @@ if (branch.type == tt.bracketL) {

const node = this.startNode()
if (this.type == this.privateNameToken) {
if (this.type == this.privateIdentifierToken) {
this.parsePrivateClassElementName(node)

@@ -54,3 +54,3 @@ } else {

this.exitScope()
this.finishNode(node, "FieldDefinition")
this.finishNode(node, "PropertyDefinition")
this.semicolon()

@@ -57,0 +57,0 @@ return node

@@ -24,3 +24,3 @@ {

},
"version": "0.3.7",
"version": "1.0.0",
"devDependencies": {

@@ -31,8 +31,8 @@ "acorn": "^8",

"mocha": "^8",
"test262": "git+https://github.com/tc39/test262.git#e0758bbeacac7776dae2a69f88eb4742f0930d7c",
"test262": "git+https://github.com/tc39/test262.git#fd27d1f5d00dcccc5f763252fc11b575ee0bdd2f",
"test262-parser-runner": "^0.5.0"
},
"dependencies": {
"acorn-private-class-elements": "^0.2.7"
"acorn-private-class-elements": "^1.0.0"
}
}

@@ -7,3 +7,3 @@ # Class fields support for Acorn

It implements support for class fields as defined in the stage 3 proposal [Class field declarations for JavaScript](https://github.com/tc39/proposal-class-fields). The emitted AST follows [an ESTree proposal](https://github.com/estree/estree/pull/180).
It implements support for class fields as defined in the stage 3 proposal [Class field declarations for JavaScript](https://github.com/tc39/proposal-class-fields). The emitted AST follows the [ESTree experimental Class Features design](https://github.com/estree/estree/blob/master/experimental/class-features.md).

@@ -10,0 +10,0 @@ ## Usage

@@ -146,6 +146,6 @@ "use strict"

body: [body, newNode(body.end + 2, {
type: "FieldDefinition",
type: "PropertyDefinition",
end: body.end + 4,
key: newNode(body.end + 2, {
type: "PrivateName",
type: "PrivateIdentifier",
end: body.end + 4,

@@ -253,3 +253,3 @@ name: "y"

{ body: "x", passes: true, ast: start => newNode(start, {
type: "FieldDefinition",
type: "PropertyDefinition",
end: start + 1,

@@ -265,3 +265,3 @@ key: newNode(start, {

{ body: "x = 0", passes: true, ast: start => newNode(start, {
type: "FieldDefinition",
type: "PropertyDefinition",
end: start + 5,

@@ -282,3 +282,3 @@ key: newNode(start, {

{ body: "[x]", passes: true, ast: start => newNode(start, {
type: "FieldDefinition",
type: "PropertyDefinition",
end: start + 3,

@@ -294,3 +294,3 @@ computed: true,

{ body: "[x] = 0", passes: true, ast: start => newNode(start, {
type: "FieldDefinition",
type: "PropertyDefinition",
end: start + 7,

@@ -311,7 +311,7 @@ computed: true,

{ body: "#x", passes: true, ast: start => newNode(start, {
type: "FieldDefinition",
type: "PropertyDefinition",
end: start + 2,
computed: false,
key: newNode(start, {
type: "PrivateName",
type: "PrivateIdentifier",
end: start + 2,

@@ -323,7 +323,7 @@ name: "x"

{ body: "#x = 0", passes: true, ast: start => newNode(start, {
type: "FieldDefinition",
type: "PropertyDefinition",
end: start + 6,
computed: false,
key: newNode(start, {
type: "PrivateName",
type: "PrivateIdentifier",
end: start + 2,

@@ -341,3 +341,3 @@ name: "x"

{ body: "async", passes: true, ast: start => newNode(start, {
type: "FieldDefinition",
type: "PropertyDefinition",
end: start + 5,

@@ -354,3 +354,3 @@ key: newNode(start, {

{ body: "async = 5", passes: true, ast: start => newNode(start, {
type: "FieldDefinition",
type: "PropertyDefinition",
end: start + 9,

@@ -357,0 +357,0 @@ key: newNode(start, {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc