Skip to content

Make getFunctionParent skip decorators/keys - #18633

Merged
JLHwung merged 1 commit into
babel:mainfrom
nicolo-ribaudo:get-function-parent
Nov 24, 2026
Merged

JLHwung merged 1 commit into
babel:mainfrom
nicolo-ribaudo:get-function-parent

Conversation

@nicolo-ribaudo

Copy link
Copy Markdown
Member
Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
Need backport? No
License MIT

#18488 works around the fact that getFunctionParent sometimes doesn't return the actual function parent, when used in a computed method key or in a decorator. This PR fixes that problem, aligning it with how we do scope attachment.

@nicolo-ribaudo nicolo-ribaudo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Nov 16, 2026
@babel-bot

Copy link
Copy Markdown
Collaborator

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

@pkg-pr-new

pkg-pr-new Bot commented Nov 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

commit: 56ec692

@JLHwung
JLHwung added this pull request to the merge queue Nov 24, 2026
Merged via the queue into babel:main with commit 9386c66 Nov 24, 2026
89 of 91 checks passed
@babel-bot

Copy link
Copy Markdown
Collaborator

Backported to 7.x in #18715.

JLHwung added a commit to JLHwung/babel that referenced this pull request Nov 24, 2026
Since babel#18633, `getFunctionParent` skips methods from their computed keys
and decorators, so the local helper is no longer needed.

Assisted-by: Claude Opus 5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: traverse 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