💻
How are you using Babel?
@babel/cli
Input code
class envs {
constructor(param, obj) {
console.log(param)
}
}
function obj2() {
return 2;
}
function battlePlayer() {
return 1;
}
class doSomethingMore extends envs {
constructor() {
super(super(), obj2());
// super(obj2(), battlePlayer());
}
}
b = new doSomethingMore()
It's the transpiled one
It is the report error one
Configuration file name
babel.config.json
Configuration
{
"sourceType": "unambiguous",
"presets": ["@babel/preset-env"],
"plugins": [
"@babel/plugin-transform-runtime"
]
}
Current and expected behavior
In the poc.js, super() in the constructor is called more than once, it is the wrong syntax, but it transpiled by babel.
However, if I add code to constructor:
super(obj2(), battlePlayer());
it can report
Environment
- babel
-
-
- ├── @babel/generator@7.17.3
-
- ├── @babel/plugin-transform-runtime@7.17.0
-
- ├── @babel/preset-env@7.16.11
- Node: [v17.3.0]
- npm version [8.5.2]
- os [ubuntu 20.04]
Possible solution
No response
Additional context
No response
💻
How are you using Babel?
@babel/cli
Input code
It's the transpiled one
It is the report error one
Configuration file name
babel.config.json
Configuration
{ "sourceType": "unambiguous", "presets": ["@babel/preset-env"], "plugins": [ "@babel/plugin-transform-runtime" ] }Current and expected behavior
In the poc.js, super() in the constructor is called more than once, it is the wrong syntax, but it transpiled by babel.
However, if I add code to constructor:
it can report
Environment
Possible solution
No response
Additional context
No response