Skip to content

fix: improve for loop closure environment check - #18194

Merged
nicolo-ribaudo merged 1 commit into
babel:mainfrom
JLHwung:block-scoping-fn-parent-fix
Aug 25, 2026
Merged

nicolo-ribaudo merged 1 commit into
babel:mainfrom
JLHwung:block-scoping-fn-parent-fix

Conversation

@JLHwung

@JLHwung JLHwung commented Aug 19, 2026

Copy link
Copy Markdown
Contributor
Q 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 A
Fixed Issues? The block scoping transform might generate invalid code when transforming a for loop inside static block inside a generator function or an async function REPL
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Replaced the isFunction check with isFunctionParent check to ensure the check does not cross the static block boundary.

@JLHwung JLHwung added the PR: Bug Fix 馃悰 A type of pull request used for our changelog categories label Aug 19, 2026
@JLHwung
JLHwung force-pushed the block-scoping-fn-parent-fix branch from 294a07c to ebb36c1 Compare August 19, 2026 19:45
@babel-bot

Copy link
Copy Markdown
Collaborator

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

@pkg-pr-new

pkg-pr-new Bot commented Aug 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

commit: ebb36c1

@nicolo-ribaudo nicolo-ribaudo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@nicolo-ribaudo
nicolo-ribaudo merged commit a946b81 into babel:main Aug 25, 2026
61 of 62 checks passed
@nicolo-ribaudo
nicolo-ribaudo deleted the block-scoping-fn-parent-fix branch August 25, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants