Socket
Socket
Sign inDemoInstall

acorn-private-class-elements

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acorn-private-class-elements - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

4

CHANGELOG.md

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

## 0.2.6 (2020-06-11)
* Don't break acorn's optional chaining support
## 0.2.5 (2020-04-23)

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

@@ -115,5 +115,15 @@ "use strict"

// Parse private element access
parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow) {
parseSubscript(base, startPos, startLoc, _noCalls, _maybeAsyncArrow, _optionalChained) {
const optionalSupported = this.options.ecmaVersion >= 11 && acorn.tokTypes.questionDot
const branch = this._branch()
if (!(
(branch.eat(acorn.tokTypes.dot) || (optionalSupported && branch.eat(acorn.tokTypes.questionDot))) &&
branch.type == this.privateNameToken
)) {
return super.parseSubscript.apply(this, arguments)
}
let optional = false
if (!this.eat(acorn.tokTypes.dot)) {
return super.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow)
this.expect(acorn.tokTypes.questionDot)
optional = true
}

@@ -123,2 +133,5 @@ let node = this.startNodeAt(startPos, startLoc)

node.computed = false
if (optionalSupported) {
node.optional = optional
}
if (this.type == this.privateNameToken) {

@@ -125,0 +138,0 @@ if (base.type == "Super") {

6

package.json

@@ -23,9 +23,9 @@ {

},
"version": "0.2.5",
"version": "0.2.6",
"devDependencies": {
"acorn": "^7.0.0",
"eslint": "^6.8.0",
"eslint": "^7",
"eslint-plugin-node": "^11.0.0",
"mocha": "^7.1.0"
"mocha": "^8"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc