fix(parser): register function id in labeled function declaration #18375

Closed
babel-bot opened 8:39pm on October 20, 2026 wanted to merge 1 commit into babel/babel 7.x from
automation/backport-18327

Pull Request Overview

  • Opened on October 20, 2026
  • Status Closed
  • Commit count 1 with first commit October 14, 2026

Total Delta

0 Total Diff Delta

Open Days

Open 24 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
4 days Authoring 1 commit before pull request opened for review
 
0 days Awaiting first review

Total time for pull request 4 business days from first commit to closed PR

Author avatar

fix(parser): register function id in labeled function declaration

Backport of #18327 to 7.x

Cherry-picked commits:
- 0ca5fdaab734b2b755136ca12b79fc71d5f8e012 β†’ fix(parser): register function id in labeled function declaration (#18327)

Conflicts: Resolved.
- packages/babel-parser/src/parser/statement.ts: 7.x has an extra decorators argument on parseExpressionStatement (and node as Undone<...> casts). Kept those and added the new flags argument after decorators.
- packages/babel-parser/src/plugins/flow/index.ts: same signature change (decorators, then flags).
- packages/babel-parser/src/plugins/placeholders.ts: kept both imports (Position and ParseStatementFlag); parseExpressionStatement now takes decorators then flags.

Fix commits:
- Fix ParseStatementFlag import after backporting #18327: the TypeScript plugin imported ParseStatementFlag as type-only, but now uses its const enum value.
- Fix lint error after backporting #18327: flags is unused in the base parseExpressionStatement (only used by plugins), so the eslint no-unused-vars was disabled for those parameters.

Checks: Rebuild, lint (eslint on babel-parser, prettier) and the full test suite were run. After the fixes, all babel-parser tests pass. The full suite had 6 failures in packages/babel-code-frame/test/color-detection.js (terminal color detection, unrelated to this PR). A full make lint-ci run was not repeated after the final lint fix; eslint and prettier on babel-parser 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 #18327 Β· copilot Β· auto Β· 26.6 AIC Β· βŒ– 0.667 AIC Β· ⊞ 9.1K Β· β—·


Comments Threads Pending Resolution

Resolved Comment Threads

No resolved comments have been left on this PR.