Skip to content

fix(traverse,transform-regenerator): resolve var binding scope on removal - #18748

Merged
JLHwung merged 1 commit into
7.xfrom
automation/backport-18617
Nov 26, 2026
Merged

JLHwung merged 1 commit into
7.xfrom
automation/backport-18617

Conversation

@babel-bot

Copy link
Copy Markdown
Collaborator

Backport of #18617 to 7.x

Cherry-picked commits:

Conflicts: Resolved.

  • packages/babel-plugin-transform-regenerator/src/regenerator/hoist.ts: on main the loop iterates Object.keys(vars); kept that (7.x behavior) and added the scope selection (funPath.scope for var) from the PR.
  • packages/babel-traverse/src/path/removal.ts: remove() was refactored on main into helpers (_removeFromScope, etc.) not present on 7.x. Kept the 7.x structure and applied the var-scope resolution inside the inline scope-removal code.
  • packages/babel-traverse/test/removal.js: main has many extra tests not on 7.x. Kept only the three tests added by the PR.

Checks: build, lint passed. Full test suite: all pass except 6 tests in packages/babel-code-frame/test/color-detection.js (terminal color detection in the CI environment), unrelated to this change.

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 #18617 · copilot · auto · 16.3 AIC · ⌖ 0.656 AIC · ⊞ 9.4K · ◷

@babel-bot

Copy link
Copy Markdown
Collaborator Author

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

@JLHwung
JLHwung enabled auto-merge November 26, 2026 18:14
@pkg-pr-new

pkg-pr-new Bot commented Nov 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

commit: 474178b

@JLHwung
JLHwung added this pull request to the merge queue Nov 26, 2026
Merged via the queue into 7.x with commit 738bdc5 Nov 26, 2026
44 checks passed
@JLHwung
JLHwung deleted the automation/backport-18617 branch November 26, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.x: backport 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.

3 participants