-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Open
Labels
Description
💻
- Would you like to work on a fix?
How are you using Babel?
@babel/cli
Input code
(async function () {
function v0(v1 = () => null) {
}
await null;
});
const v0 = { alpha: { beta: { charlie: { delta: 'hello' } } } };
for (let v0 = 0; v0 < [].length; ++v0) {
if (v0 > 8) {
break;
}
}
const v3 = new Proxy(v0, {
has: function (v3, v4) {
return v4 === 'value' ? false : Reflect.has(v3, v4);
}
});Here is the PERL
Configuration file name
babel.config.json
Configuration
{
"sourceType": "unambiguous",
"presets": ["@babel/preset-env"],
"plugins": [
"@babel/plugin-transform-runtime"
]
}Current and expected behavior
The transpiler code run by node report an error:
var v3 = new Proxy(v0, {
^
TypeError: Cannot create proxy with a non-object as target or handlerThis may be caused by Babel converting let variable to var. in the following new proxy, there is a bug caused by scope change
Environment
- babel
-
- ├── @babel/cli@7.17.0=6
-
- ├── @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
Reactions are currently unavailable