acorn-static-class-features
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -133,3 +133,3 @@ { | ||
"no-await-in-loop": "error", | ||
"no-bitwise": "error", | ||
"no-bitwise": "off", | ||
"no-buffer-constructor": "error", | ||
@@ -136,0 +136,0 @@ "no-caller": "error", |
@@ -0,1 +1,7 @@ | ||
## 0.2.4 (2020-08-13) | ||
* Mark as compatible with acorn@8 | ||
* Allow super in field initializer | ||
* Support keywords as field name | ||
## 0.2.3 (2020-06-11) | ||
@@ -2,0 +8,0 @@ |
@@ -29,3 +29,3 @@ "use strict" | ||
branch.next() | ||
if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateNameToken].indexOf(branch.type) == -1) { | ||
if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateNameToken].indexOf(branch.type) == -1 && !branch.type.keyword) { | ||
return super.parseClassElement.apply(this, arguments) | ||
@@ -60,3 +60,5 @@ } | ||
this.enterScope(64 | 2 | 1) // See acorn's scopeflags.js | ||
this._maybeParseFieldValue(node) | ||
this.exitScope() | ||
this.finishNode(node, "FieldDefinition") | ||
@@ -63,0 +65,0 @@ this.semicolon() |
@@ -22,16 +22,16 @@ { | ||
"peerDependencies": { | ||
"acorn": "^6.1.0 || ^7.0.0" | ||
"acorn": "^6.1.0 || ^7 || ^8" | ||
}, | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"devDependencies": { | ||
"acorn": "^7.0.0", | ||
"acorn": "^8", | ||
"eslint": "^7", | ||
"eslint-plugin-node": "^11", | ||
"mocha": "^8", | ||
"test262": "git+https://github.com/tc39/test262.git#adf2cf4204a748463cacb68f07d0d006b00c3821", | ||
"test262": "git+https://github.com/tc39/test262.git#e0758bbeacac7776dae2a69f88eb4742f0930d7c", | ||
"test262-parser-runner": "^0.5.0" | ||
}, | ||
"dependencies": { | ||
"acorn-private-class-elements": "^0.2.6" | ||
"acorn-private-class-elements": "^0.2.7" | ||
} | ||
} |
"use strict" | ||
const fs = require("fs") | ||
const path = require("path") | ||
@@ -5,0 +4,0 @@ const run = require("test262-parser-runner") |
@@ -39,3 +39,3 @@ "use strict" | ||
testFail("class A { static a = () => arguments }", "A static class field initializer may not contain arguments (1:27)") | ||
testFail("class A { static a = () => super() }", "'super' keyword outside a method (1:27)") | ||
testFail("class A { static a = () => super() }", "super() call outside constructor of a subclass (1:27)") | ||
testFail("class A { static # a }", "Unexpected token (1:19)") | ||
@@ -423,2 +423,6 @@ testFail("class A { static #a; a() { A.# a } }", "Unexpected token (1:31)") | ||
}`) | ||
test("class X{static delete}") | ||
test(`class Foo extends Bar { | ||
static field = super.field + 1; | ||
}`) | ||
}) |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
28843
811
0
+ Addedacorn@8.14.0(transitive)
- Removedacorn@7.4.1(transitive)