Enable class static blocks by default (#13713)
* Remove classStaticBlock plugin * Update tests * Remove class static blocks from proposalPlugins * Update tests * Remove classStaticBlock from mapping for test262 * chore: update babel-types Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
This commit is contained in:
@@ -1619,7 +1619,6 @@ export default class StatementParser extends ExpressionParser {
|
||||
classBody: N.ClassBody,
|
||||
member: N.StaticBlock & { decorators?: Array<N.Decorator> },
|
||||
) {
|
||||
this.expectPlugin("classStaticBlock", member.start);
|
||||
// Start a new lexical scope
|
||||
this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER);
|
||||
// Start a new scope with regard to loop labels
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["classStaticBlock"]
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
class C {
|
||||
static foo() {}
|
||||
static {
|
||||
this.bar = this.foo;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'classStaticBlock' (3:2)"
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"plugins": [
|
||||
"classStaticBlock",
|
||||
"classProperties"
|
||||
]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["classStaticBlock", "classProperties"]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["classStaticBlock"]
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
{
|
||||
"plugins": [
|
||||
"classStaticBlock",
|
||||
["decorators", { "decoratorsBeforeExport": true }]
|
||||
]
|
||||
"plugins": [["decorators", { "decoratorsBeforeExport": true }]]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"plugins": ["classStaticBlock", "decorators-legacy"]
|
||||
"plugins": ["decorators-legacy"]
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"plugins": [
|
||||
"classStaticBlock"
|
||||
]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["classStaticBlock"]
|
||||
}
|
||||
@@ -1,12 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"classStaticBlock"
|
||||
],
|
||||
[
|
||||
"typescript"
|
||||
]
|
||||
],
|
||||
"plugins": ["typescript"],
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token (2:17)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"classStaticBlock"
|
||||
],
|
||||
[
|
||||
"typescript"
|
||||
]
|
||||
],
|
||||
"plugins": ["typescript"],
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token (2:19)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"classStaticBlock"
|
||||
],
|
||||
[
|
||||
"typescript"
|
||||
]
|
||||
],
|
||||
"plugins": ["typescript"],
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token (2:16)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"classStaticBlock"
|
||||
],
|
||||
[
|
||||
"typescript"
|
||||
]
|
||||
],
|
||||
"plugins": ["typescript"],
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token (2:18)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"classStaticBlock"
|
||||
],
|
||||
[
|
||||
"typescript"
|
||||
]
|
||||
],
|
||||
"plugins": ["typescript"],
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token (2:18)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"classStaticBlock"
|
||||
],
|
||||
[
|
||||
"typescript"
|
||||
]
|
||||
],
|
||||
"plugins": ["typescript"],
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token (2:17)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"classStaticBlock"
|
||||
],
|
||||
[
|
||||
"typescript"
|
||||
]
|
||||
],
|
||||
"plugins": ["typescript"],
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token (2:18)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"plugins": ["classStaticBlock", "typescript"],
|
||||
"plugins": ["typescript"],
|
||||
"sourceType": "module"
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ export type ParserPlugin =
|
||||
| "classPrivateMethods"
|
||||
| "classPrivateProperties"
|
||||
| "classProperties"
|
||||
| "classStaticBlock"
|
||||
| "classStaticBlock" // Enabled by default
|
||||
| "decimal"
|
||||
| "decorators"
|
||||
| "decorators-legacy"
|
||||
|
||||
Reference in New Issue
Block a user