Update acorn (#11835)

* Update `acorn`

* Fix test, add changelog
This commit is contained in:
fisker Cheung authored and GitHub committed 2021-11-21 01:44:28 +09:00
1 parent ca97e4b4d2
commit 8a85ba4e18
4 files changed
+32 -15

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
#### Support ES2022 class-private-fields-in syntax in `espree` parser (#11835 by @fisker)
<!-- prettier-ignore -->
```jsx
// Input
class Foo {
#brand;
static isC(obj) {
return #brand in Foo;
}
}
// Prettier stable
SyntaxError: Unexpected token #brand (4:12)
2 | #brand;
3 | static isC(obj) {
> 4 | return #brand in Foo;
| ^
5 | }
6 | }
// Prettier main
class Foo {
#brand;
static isC(obj) {
return #brand in Foo;
}
}
```
@@ -1704,17 +1704,6 @@ result; //=> "Hello, hello!"
================================================================================
`;
exports[`private-fields-in-in.js [espree] format 1`] = `
"Unexpected token #brand (44:12)
42 |
43 | static isC(obj) {
> 44 | return #brand in obj && #method in obj && #getter in obj;
| ^
45 | }
46 | }
47 |"
`;
exports[`private-fields-in-in.js format 1`] = `
====================================options=====================================
parsers: ["babel", "babel-ts", "babel-flow"]
@@ -17,7 +17,6 @@ run_spec(__dirname, ["babel", "babel-ts", "babel-flow"], {
"pipeline-operator-fsharp.js",
"pipeline-operator-minimal.js",
"pipeline-operator-hack.js",
"private-fields-in-in.js",
"record-tuple-record.js",
"record-tuple-tuple.js",
"throw-expressions.js",
+3 -3
View File
@@ -1994,9 +1994,9 @@ acorn@^7.1.1:
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==
acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0:
version "8.5.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2"
integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==
version "8.6.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895"
integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==
agent-base@6:
version "6.0.2"