Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not add function name when parent's operator is not = #11361

Merged
merged 1 commit into from Apr 2, 2020

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Apr 1, 2020

Q                       A
Patch: Bug Fix? Yes
Tests Added + Pass? Yes
License MIT

Per https://tc39.es/ecma262/#sec-assignment-operators-runtime-semantics-evaluation, when operator is not =, the anonymous function expression will not be applied with NamedEvaluation.

@JLHwung JLHwung added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Apr 1, 2020
@nicolo-ribaudo
Copy link
Member

Does this fix #11362?

@JLHwung
Copy link
Contributor Author

JLHwung commented Apr 2, 2020

@nicolo-ribaudo Not really. The issue 11362 refers to the transform plugin, which converts f ??= function() {} into f ?? (f = function() {}) so the .name is not preserved.

Theoretically this PR fixes cases of transform-function-name + syntax-logical-assignment-operators.

@JLHwung JLHwung merged commit c3042cf into babel:master Apr 2, 2020
@JLHwung JLHwung deleted the fix-function-name-inference branch April 3, 2020 00:29
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 3, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue 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.

None yet

3 participants