-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
Spec: DecoratorsoutdatedA 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 issue
Description
💻
- Would you like to work on a fix?
How are you using Babel?
@babel/register or @babel/node
Input code
Throws the following error
/repl.ts: Cannot read properties of undefined (reading 'name')
function decorate() {
return function (target, context) {}
}
class Test {
@decorate()
accessor foo = 42;
constructor() {
console.log('hello');
}
}
new Test()
class TestChild extends Test {
@decorate()
accessor bar = 1;
constructor() {
super();
}
}
const r = new TestChild();Configuration file name
babel.config.json
Configuration
{
"$schema": "https://json.schemastore.org/babelrc.json",
"plugins": [["@babel/plugin-proposal-decorators", { "version": "2023-11" }]],
"presets": [
["@babel/preset-env", { "targets": { "node": "current" } }],
"@babel/preset-typescript"
]
}
Current and expected behavior
Expected Behavior: Code compiles without issue
Actual Behavior: Error
Environment
- Babel Version
7.24.1 - Environment: REPL & Node v20.10
Possible solution
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Spec: DecoratorsoutdatedA 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 issue