Skip to content

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented May 16, 2025

Q                       A
Fixed Issues? Fixes #17270
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Although adding name to class id generally works, in this PR we choose the setFunctionName approach because using ... = class {} is probably not very popular, I think it is acceptable to trade off output size for spec compliance here.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Explicit Resource Management labels May 16, 2025
@babel-bot
Copy link
Collaborator

babel-bot commented May 16, 2025

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

Comment on lines 5 to 10
var _usingCtx = babelHelpers.usingCtx();
const foo = _usingCtx.u((_m = class {
static [Symbol$dispose]() {
log.push(`${foo.name} is disposed`);
}
}, babelHelpers.setFunctionName(_m, "foo")));
Copy link
Member

Choose a reason for hiding this comment

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

_usingCtx.u(babelHelpers.setFunctionName(class {}, "foo")))
Is there any difference with this?

@JLHwung JLHwung merged commit 5addf13 into babel:main May 16, 2025
57 checks passed
@JLHwung JLHwung deleted the fix-17270 branch May 16, 2025 18:59
@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 Aug 16, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2025
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 Spec: Explicit Resource Management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

using declaration transform does not respect named evaluation
4 participants