💻
How are you using Babel?
Programmatic API (babel.transform, babel.parse)
Input code
(new class {
async foo(a, { b }) { }
})
.foo()
.catch(e => {
console.log("caught");
});
Configuration file name
No response
Configuration
{
"plugins": ["transform-async-to-generator"]
}
Current and expected behavior
Expected behavior:
caught should be printed.
Current behavior:
throw error:
Uncaught TypeError: Cannot destructure property 'b' of 'undefined' as it is undefined.
Environment
N/A
Possible solution
No response
Additional context
Babel Playground
💻
How are you using Babel?
Programmatic API (
babel.transform,babel.parse)Input code
Configuration file name
No response
Configuration
{ "plugins": ["transform-async-to-generator"] }Current and expected behavior
Expected behavior:
caughtshould be printed.Current behavior:
throw error:
Environment
N/A
Possible solution
No response
Additional context
Babel Playground