preset-modules
preset-modules copied to clipboard
Bug: super method call within async arrow within class method fails
The async-arrows-in-class transform uses Babel's arrowFunctionToExpression() helper, which doesn't patch calls to super methods:
| Input: | Output: |
|---|---|
|
|
Here's the bug reproduced in the Babel repl.
I'd consider this a bug in arrowFunctionToExpression itself rather than in this plugin.
EDIT: Ok no, the fix relies on injecting new sync arrow functions so if cannot be done in arrowFunctionToExpression. I think we have something like hoistFunctionEnvironment somewhere that will help.