Feature request: Improved error `async arrow functions are unsupported`
- Dominant language
- JavaScript
- Stars
- 11.3k
- Forks
- 859
- Avg merge
- 1h 30m
- Merged PRs (30d)
- 3
Description
## Problem
async arrow functions (ignored by Babel) trigger Hermes error
https://github.com/facebook/hermes/blob/4ab9f178caf6f0d47df0e0778bec5d1bf394f5c6/lib/IRGen/ESTreeIRGen-func.cpp#L215
causing `./gradlew :app:installRelease` to fail
after Metro finishes bundling
## Solution
it would be great if Hermes would output instead
`async arrow functions are unsupported`
## Additional Context
- https://github.com/facebook/hermes/issues/1208
> The good news is that we will be releasing a beta version of Hermes supporting most ES6+ features in 2024 Q1, so at that time none of these plugins will be necessary.
- https://github.com/facebook/hermes/issues/1389
nb: i think Static Hermes will be supporting arrow functions too
Contributor guide
Research direction
Start in lib/IRGen/ESTreeIRGen-func.cpp at the linked line around the async arrow-function handling, and review the related context in issues 1208 and 1389. Reproduce the Hermes error through the failing release build, then verify that unsupported async arrow functions report exactly "async arrow functions are unsupported" instead of triggering the current error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100