Skip to content

fix(parser): rework ts arrow param tracking - #18588

Merged
JLHwung merged 2 commits into
7.xfrom
automation/backport-18268
Nov 11, 2026
Merged

JLHwung merged 2 commits into
7.xfrom
automation/backport-18268

Conversation

@babel-bot

Copy link
Copy Markdown
Collaborator

Backport of #18268 to 7.x

Cherry-picked commits:

Conflicts: Resolved.

  • eslint/babel-eslint-parser/test/typescript-estree.test.js: the surrounding test code differs on main (URL-based fixture paths). Kept the 7.x code and only added the options.startIndex skip.
  • packages/babel-parser/src/parser/expression.ts: parseCoverCallAndAsyncArrowHead on 7.x restores maybeInArrowParameters and uses toReferencedArguments. Applied the new parseAsyncArrowHead logic while keeping both.
  • packages/babel-parser/src/plugins/flow/index.ts: noArrowAt moved to a parser-level Set, adapted to the 7.x code. 7.x still uses canBeArrow, and still reassigns failed after the second consequent parse.
  • packages/babel-parser/src/plugins/typescript/index.ts: kept the 7.x afterLeftParse signature of parseMaybeAssign (instead of isParenItem), TsTypeCastExpression/ParseError<any> types, and typeParameters naming. Dropped the inConditionalConsequent override and the old parseAsyncArrowFromCallExpression override, which the PR replaces.
  • packages/babel-parser/src/tokenizer/state.ts: kept potentialArrowAt and topicContext from 7.x, and applied the PR's state changes.

Fix commit: "Fix lint and parser fixtures after backporting #18268".

  • It removes an unused import and unnecessary non-null assertions flagged by lint, and applies prettier.
  • It regenerates the 11 parser fixture outputs, since 7.x token and AST output differs from main (updateContext/binop token fields, and 7.x typeParameters/typeArguments and identifier-name shapes).

Checks: rebuild and lint pass. In the full test run, 2 suites fail:

  • packages/babel-code-frame/test/color-detection.js also fails on unmodified origin/7.x, so it is unrelated.
  • packages/babel-core/test/errors-stacks.js failed in the full run but passes when run alone. It looks flaky and is unrelated to the parser.

All babel-parser tests pass.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by 🔙 Backport to 7.x for #18268 · copilot · auto · 67.6 AIC · ⌖ 0.685 AIC · ⊞ 9.4K · ◷

@babel-bot babel-bot added 7.x: backport PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: parser labels Nov 11, 2026
@babel-bot

Copy link
Copy Markdown
Collaborator Author

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/63190

@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

commit: 0eb0146

@JLHwung
JLHwung added this pull request to the merge queue Nov 11, 2026
Merged via the queue into 7.x with commit c630a14 Nov 11, 2026
77 of 78 checks passed
@JLHwung
JLHwung deleted the automation/backport-18268 branch November 11, 2026 18:08
markharding pushed a commit to futo-org/Harbor that referenced this pull request Nov 17, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [@babel/runtime](https://babel.dev/docs/en/next/babel-runtime) ([source](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime)) | [`7.29.13` → `7.29.14`](https://renovatebot.com/diffs/npm/@babel%2fruntime/7.29.13/7.29.14) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@babel%2fruntime/7.29.14?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@babel%2fruntime/7.29.13/7.29.14?slim=true) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/2097) for more information.

---

### Release Notes

<details>
<summary>babel/babel (@&#8203;babel/runtime)</summary>

### [`v7.29.14`](https://github.com/babel/babel/releases/tag/v7.29.14)

[Compare Source](babel/babel@v7.29.13...v7.29.14)

#### v7.29.14 (2026-11-11)

##### 👓 Spec Compliance

- `babel-parser`
  - [#&#8203;18543](babel/babel#18543) fix(parser): require `(` after `import.{source,defer,sync}` ([@&#8203;babel-bot](https://github.com/babel-bot))

##### 🐛 Bug Fix

- `babel-helper-module-transforms`, `babel-plugin-transform-dynamic-import`, `babel-plugin-transform-modules-amd`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-modules-umd`
  - [#&#8203;18597](babel/babel#18597) Respect `importInterop: none` for dynamic import ([@&#8203;babel-bot](https://github.com/babel-bot))
- `babel-helper-member-expression-to-functions`, `babel-plugin-transform-classes`, `babel-plugin-transform-object-super`, `babel-plugin-transform-private-methods`
  - [#&#8203;18595](babel/babel#18595) Keep the receiver of TS-wrapped `super` and private member calls ([@&#8203;babel-bot](https://github.com/babel-bot))
- `babel-parser`
  - [#&#8203;18596](babel/babel#18596) fix(parser): allow ASI between modifier-like field and [@&#8203;dec](https://github.com/dec) ([@&#8203;babel-bot](https://github.com/babel-bot))
  - [#&#8203;18588](babel/babel#18588) fix(parser): rework ts arrow param tracking ([@&#8203;babel-bot](https://github.com/babel-bot))
  - [#&#8203;18542](babel/babel#18542) fix(parser): handle async do await in parameters ([@&#8203;babel-bot](https://github.com/babel-bot))
- `babel-helper-string-parser`, `babel-parser`
  - [#&#8203;18591](babel/babel#18591) fix(parser): recover from out-of-range `\u{...}` code points ([@&#8203;babel-bot](https://github.com/babel-bot))
- `babel-generator`
  - [#&#8203;18585](babel/babel#18585) fix(generator): keep parens that end an optional chain before ([@&#8203;babel-bot](https://github.com/babel-bot))
- `babel-plugin-transform-class-static-block`
  - [#&#8203;18579](babel/babel#18579) fix(class-static-block): skip class body path with stale ancestry ([@&#8203;babel-bot](https://github.com/babel-bot))
- `babel-helper-module-transforms`, `babel-parser`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-react-pure-annotations`, `babel-plugin-transform-typescript`, `babel-traverse`, `babel-types`
  - [#&#8203;18574](babel/babel#18574) fix: improve string module specifiers support ([@&#8203;babel-bot](https://github.com/babel-bot))
- `babel-plugin-transform-flow-comments`
  - [#&#8203;18573](babel/babel#18573) fix(flow-comments): support anonymous classes ([@&#8203;babel-bot](https://github.com/babel-bot))
- `babel-plugin-transform-block-scoping`, `babel-traverse`
  - [#&#8203;18571](babel/babel#18571) fix: rename assignment targets in forXStatement ([@&#8203;babel-bot](https://github.com/babel-bot))
- `babel-helpers`, `babel-plugin-transform-async-generator-functions`, `babel-plugin-transform-regenerator`, `babel-preset-env`, `babel-runtime-corejs3`
  - [#&#8203;18569](babel/babel#18569) fix(regenerator): dispatch pending jump after finally to outer finally blocks ([@&#8203;babel-bot](https://github.com/babel-bot))

##### 🏠 Internal

- [#&#8203;18575](babel/babel#18575) ci: do not run hooks of skipped describe blocks on Jest 24 ([@&#8203;JLHwung](https://github.com/JLHwung))

##### Committers: 2

- Babel Bot ([@&#8203;babel-bot](https://github.com/babel-bot))
- Huáng Jùnliàng ([@&#8203;JLHwung](https://github.com/JLHwung))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjcuNCIsInVwZGF0ZWRJblZlciI6IjQ0LjIyNy40IiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2332
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.x: backport pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants