-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Programmatic API (babel.transform
, babel.parse
)
Input code
class Foo {
static {}
}
Configuration file name
No response
Configuration
const { parse } = require("@babel/parser");
const code = `class Foo {
static {}
}`;
parse(code, { plugins: ["typescript", "classStaticBlock" ]});
Current and expected behavior
Current:
{
"type": "Program",
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ClassDeclaration",
"id": {
"type": "Identifier",
"name": "Foo"
},
"superClass": null,
"body": {
"type": "ClassBody",
"body": [
{
"type": "StaticBlock",
"static": true,
"body": []
}
]
}
}
]
}
Expected:
{
"type": "Program",
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ClassDeclaration",
"id": {
"type": "Identifier",
"name": "Foo"
},
"superClass": null,
"body": {
"type": "ClassBody",
"body": [
{
"type": "StaticBlock",
- "static": true,
"body": []
}
]
}
}
]
}
Environment
- Babel version: current
main
Possible solution
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser