Repository navigation
Conversation
The BindingIdentifier of a FunctionExpression (and GeneratorExpression)
is parsed with [~Await], and the async arrow head restrictions do not
look into nested functions, so `async (x = function await() {}) => {}`
is valid in scripts. The function name was parsed in the enclosing
expression scope, so the `await` error was recorded on the possible
async arrow head and raised once `=>` was seen. Parse the name in its
own expression scope, like the function's params and body.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/62269 |
|
commit: |
| "type": "File", | ||
| "start":0,"end":33,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":33,"index":33}}, | ||
| "errors": [ | ||
| "SyntaxError: Can not use 'await' as identifier inside an async function. (1:17)" |
Member
There was a problem hiding this comment.
Is it intended that this behaves differently?
Contributor
Author
There was a problem hiding this comment.
Yes, it is intended. ClassExpression inherits [?Await] while FunctionExpression is explicitly parsed with [~Await].
nicolo-ribaudo
approved these changes
Oct 5, 2026
liuxingbaoyu
approved these changes
Oct 5, 2026
JLHwung
deleted the
fix-parser-await-function-name-in-async-arrow-params
branch
October 5, 2026 18:58
brandhaug
added a commit
to brandhaug/b2b-saas-starter
that referenced
this pull request
Oct 10, 2026
## pnpm-workspace.yaml (default) ## Dependency Updates | Package | From | To | Type | | --- | --- | --- | --- | | `@babel/core` | 8.0.6 | 8.0.7 | patch | | `@react-email/ui` | 6.11.0 | 6.11.1 | patch | | `ai` | 7.0.128 | 7.0.130 | patch | | `react-email` | 6.11.0 | 6.11.1 | patch | | `shadcn` | 4.21.3 | 4.21.4 | patch | ## Release Notes <details> <summary><b>@<!---->babel/core</b> (8.0.6 → 8.0.7)</summary> ## v8.0.7 (2026-10-07) Thanks @<!---->brunoborta, @<!---->CINC0S, @<!---->hoobnn, and @<!---->jpradelle for your first PRs! #### 🐛 Bug Fix * `babel-helper-create-regexp-features-plugin`, `babel-plugin-transform-dotall-regex`, `babel-plugin-transform-unicode-sets-regex`, `babel-preset-env` * [#18295](babel/babel#18295) Bump regexpu-core to 6.5.3 ([@<!---->JLHwung](https://github.com/JLHwung)) * `babel-plugin-transform-for-of` * [#18292](babel/babel#18292) Skip `for await` in `transform-for-of` ([@<!---->brunoborta](https://github.com/brunoborta)) * `babel-helpers`, `babel-plugin-transform-async-generator-functions`, `babel-runtime-corejs3` * [#18283](babel/babel#18283) Fix `asyncIterator` helper forwarding `.throw()` to `.return()` ([@<!---->brunoborta](https://github.com/brunoborta)) * `babel-parser` * [#18288](babel/babel#18288) fix(parser): allow await as a function expression name inside async arrow ([@<!---->JLHwung](https://github.com/JLHwung)) * `babel-helpers`, `babel-plugin-transform-class-properties`, `babel-plugin-transform-modules-systemjs`, `babel-runtime-corejs3` * [#18284](babel/babel#18284) Guard `@@toPrimitive` usage in toPrimitive helper ([@<!---->nicolo-ribaudo](https://github.com/nicolo-ribaudo)) * `babel-plugin-transform-block-scoping` * [#18195](babel/babel#18195) fix: closures in for-loop init capture wrong binding ([@<!---->joelle-a-dev](https://github.com/joelle-a-dev)) * `babel-helper-create-class-features-plugin`, `babel-plugin-transform-private-property-in-object` * [#18265](babel/babel#18265) Return false for `#x in` on static private fields before initialization ([@<!---->hoobnn](https://github.com/hoobnn)) * `babel-traverse` * [#18151](babel/babel#18151) Evaluate TypeScript expression wrappers in `NodePath#evaluate` ([@<!---->CINC0S](https://github.com/CINC0S)) * [#18250](https://github …[full notes](https://github.com/babel/babel/releases/tag/v8.0.7) </details> <details> <summary><b>react-email</b> (6.11.0 → 6.11.1)</summary> ### Patch Changes * 54769fc: Prevent `email export` from deleting the project, the home directory, the email templates or the static assets when `--outDir` points at them. * 6926bac: `<Markdown>` now applies `markdownCustomStyles.th` to table header cells. Header cells were previously styled with `td`, so any `th` styles were ignored. </details> <details> <summary><b>shadcn</b> (4.21.3 → 4.21.4)</summary> ### Patch Changes - [#12189](shadcn-ui/ui#12189) [`76fd499595ba7cc01f49d159bd7ac82d7aca8e63`](shadcn-ui/ui@76fd499) Thanks [@<!---->shadcn](https://github.com/shadcn)! - Drop the ts-morph dependency from @<!---->shadcn/registry. - [#12184](shadcn-ui/ui#12184) [`995c2cfff44c373bd210d451089726ec097ab917`](shadcn-ui/ui@995c2cf) Thanks [@<!---->shadcn](https://github.com/shadcn)! - Run the icons and asChild transformers without ts-morph. - [#12160](shadcn-ui/ui#12160) [`6efecd8fe9aa167886fe2cc0c05c5623a5bb5670`](shadcn-ui/ui@6efecd8) Thanks [@<!---->shadcn](https://github.com/shadcn)! - Edit the Next.js layout for font items without ts-morph, and skip it with a warning instead of writing a broken layout. - [#12188](shadcn-ui/ui#12188) [`efa11781f756c86debb0392fbea4fe468250b41b`](shadcn-ui/ui@efa1178) Thanks [@<!---->shadcn](https://github.com/shadcn)! - Rewrite imports and crawl file imports without ts-morph. - [#12177](shadcn-ui/ui#12177) [`e8c3143b1cd191280befcd6c9538284bb43399a8`](shadcn-ui/ui@e8c3143) Thanks [@<!---->shadcn](https://github.com/shadcn)! - Edit tailwind.config without ts-morph, and skip it with a warning instead of writing a broken config. - [#12183](shadcn-ui/ui#12183) [`f56bbd7282f0116a925a601cb6d7e0c3fede448b`](shadcn-ui/ui@f56bbd7) Thanks [@<!---->shadcn](https://github.com/shadcn)! - Run the rsc, import, CSS variable, cleanup, font and menu transformers without ts-morph. - [#12185](shadcn-ui/ui#12185) [`4a90344c42dc9ae47494179065219377ff5f2a8f`](https://github.com/shadcn-ui/u …[full notes](https://github.com/shadcn-ui/ui/releases/tag/shadcn%404.21.4) </details> --- *This PR was auto-generated by [catalog-update-action](https://github.com/brandhaug/catalog-update-action).* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Collaborator
|
Backported to 7.x in #18449. |
nicolo-ribaudo
pushed a commit
that referenced
this pull request
Oct 30, 2026
nicolo-ribaudo
pushed a commit
that referenced
this pull request
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
async (x = function await() {}) => {}In this PR we fix a parser bug detected by Claude Opus 5.5: The BindingIdentifier of a FunctionExpression (and GeneratorExpression) is parsed with
[~Await], and the async arrow head do not pass through[Await]to the nested function, soasync (x = function await() {}) => {}is valid in scripts.FF, JSC and V8 all accept this production.