New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

acorn-loose

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acorn-loose - npm Package Compare versions

Comparing version 8.1.0 to 8.2.0

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 8.2.0 (2021-09-06)
### New features
Add support for ES2022 class static blocks.
## 8.1.0 (2021-04-24)

@@ -2,0 +8,0 @@

34

dist/acorn-loose.js

@@ -600,8 +600,12 @@ (function (global, factory) {

var kind = "method";
var isStatic = false;
// Parse modifiers
node.static = false;
if (this.eatContextual("static")) {
// Parse static init block
if (ecmaVersion >= 13 && this.eat(acorn.tokTypes.braceL)) {
this.parseClassStaticBlock(node);
return node
}
if (this.isClassElementNameStart() || this.toks.type === acorn.tokTypes.star) {
node.static = true;
isStatic = true;
} else {

@@ -611,2 +615,3 @@ keyName = "static";

}
node.static = isStatic;
if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {

@@ -691,2 +696,14 @@ if ((this.isClassElementNameStart() || this.toks.type === acorn.tokTypes.star) && !this.canInsertSemicolon()) {

lp$1.parseClassStaticBlock = function(node) {
var blockIndent = this.curIndent, line = this.curLineStart;
node.body = [];
this.pushCx();
while (!this.closes(acorn.tokTypes.braceR, blockIndent, line, true))
{ node.body.push(this.parseStatement()); }
this.popCx();
this.eat(acorn.tokTypes.braceR);
return this.finishNode(node, "StaticBlock")
};
lp$1.isClassElementNameStart = function() {

@@ -958,4 +975,4 @@ return this.toks.isClassElementNameStart()

if (this.options.ecmaVersion >= 8 && this.toks.isContextual("await") &&
(this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))
) {
(this.inAsync || (this.toks.inModule && this.options.ecmaVersion >= 13) ||
(!this.inFunction && this.options.allowAwaitOutsideFunction))) {
expr = this.parseAwait();

@@ -1091,4 +1108,6 @@ sawUnary = true;

if (id.name === "async" && !this.canInsertSemicolon()) {
if (this.eat(acorn.tokTypes._function))
{ return this.parseFunction(this.startNodeAt(start), false, true) }
if (this.eat(acorn.tokTypes._function)) {
this.toks.overrideContext(acorn.tokContexts.f_expr);
return this.parseFunction(this.startNodeAt(start), false, true)
}
if (this.tok.type === acorn.tokTypes.name) {

@@ -1150,2 +1169,3 @@ id = this.parseIdent();

case acorn.tokTypes.braceL:
this.toks.overrideContext(acorn.tokContexts.b_expr);
return this.parseObj()

@@ -1152,0 +1172,0 @@

@@ -18,3 +18,3 @@ {

},
"version": "8.1.0",
"version": "8.2.0",
"engines": {"node": ">=0.4.0"},

@@ -21,0 +21,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

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