GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support undecorated static accessor in anonymous classes by JLHwung · Pull Request #16485 · babel/babel

Conversation

@JLHwung

@JLHwung JLHwung commented May 9, 2024

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

Ensures that the class is named when Babel transforms an undecorated static accessor. The named evaluation is still preserved because Babel generates specific setFunctionName calls for those will-be-transformed classes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Decorators labels May 9, 2024
@JLHwung
JLHwung marked this pull request as draft May 9, 2024 20:38
@JLHwung
JLHwung force-pushed the support-anonymous-class-static-accessor branch from dd0139f to 7ff0a31 Compare May 9, 2024 20:50
@babel-bot

babel-bot commented May 9, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JLHwung
JLHwung force-pushed the support-anonymous-class-static-accessor branch from 7ff0a31 to c55226a Compare May 9, 2024 20:56
@JLHwung
JLHwung marked this pull request as ready for review May 9, 2024 20:56
JLHwung added 2 commits May 9, 2024 23:09
@JLHwung
fix: static accessor in anonymous class expression
4a66836
@JLHwung
add test cases
ab03576
@JLHwung
JLHwung force-pushed the support-anonymous-class-static-accessor branch from c55226a to ab03576 Compare May 10, 2024 03:09
liuxingbaoyu
liuxingbaoyu approved these changes May 10, 2024
View reviewed changes
@JLHwung
JLHwung requested a review from nicolo-ribaudo May 13, 2024 13:58
nicolo-ribaudo
nicolo-ribaudo reviewed May 13, 2024
View reviewed changes
Comment thread ...gin-proposal-decorators/test/fixtures/2023-11-accessors/undecorated-static-private/output.js Outdated
Foo.#B = v;
}
}
Foo = class _Class {

@nicolo-ribaudo nicolo-ribaudo May 13, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The named evaluation is still preserved because Babel generates specific setFunctionName calls for those will-be-transformed classes.

It doesn't seem to be the case here?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JLHwung reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@JLHwung JLHwung May 13, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Fixed in f45d9b3.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JLHwung
emit setFunctionName call for undecorated class with accessors
f45d9b3
nicolo-ribaudo
nicolo-ribaudo approved these changes May 13, 2024
View reviewed changes
@JLHwung
Add comments for transformClass
2706761
@nicolo-ribaudo

nicolo-ribaudo commented May 14, 2024

Copy link
Copy Markdown
Member

CI passed, I'm not sure about why it's still marked as yellow.

JLHwung reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nicolo-ribaudo
Add tes with export default anonymous class
7e379a2
@nicolo-ribaudo nicolo-ribaudo changed the title Support undecorated static accessor in anonymous class expression Support undecorated static accessor in anonymous classes May 14, 2024
@nicolo-ribaudo
nicolo-ribaudo merged commit 6e14020 into babel:main May 14, 2024
@nicolo-ribaudo
nicolo-ribaudo deleted the support-anonymous-class-static-accessor branch May 14, 2024 12:21
@teramotodaiki teramotodaiki mentioned this pull request Jun 10, 2024
[Snyk] Upgrade @babel/runtime from 7.24.6 to 7.24.7 hackforplay/common#225
Closed
Vylpes pushed a commit to Vylpes/random-bunny that referenced this pull request Jun 10, 2024
Renovate Bot @Vylpes
Update dependency @babel/traverse to v7.24.7 (#173)
b0ad50f
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@babel/traverse](https://babel.dev/docs/en/next/babel-traverse) ([source](https://github.com/babel/babel)) | resolutions | patch | [`7.24.1` -> `7.24.7`](https://renovatebot.com/diffs/npm/@babel%2ftraverse/7.24.1/7.24.7) |

---

### Release Notes

<details>
<summary>babel/babel (@&#8203;babel/traverse)</summary>

### [`v7.24.7`](https://github.com/babel/babel/blob/HEAD/CHANGELOG.md#v7247-2024-06-05)

[Compare Source](babel/babel@v7.24.6...v7.24.7)

##### 🐛 Bug Fix

-   `babel-node`
    -   [#&#8203;16554](babel/babel#16554) Allow extra flags in babel-node ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   `babel-traverse`
    -   [#&#8203;16522](babel/babel#16522) fix: incorrect `constantViolations` with destructuring ([@&#8203;liuxingbaoyu](https://github.com/liuxingbaoyu))
-   `babel-helper-transform-fixture-test-runner`, `babel-plugin-proposal-explicit-resource-management`
    -   [#&#8203;16524](babel/babel#16524) fix: Transform `using` in `switch` correctly ([@&#8203;liuxingbaoyu](https://github.com/liuxingbaoyu))

##### 🏠 Internal

-   `babel-helpers`, `babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime`
    -   [#&#8203;16525](babel/babel#16525) Delete unused array helpers ([@&#8203;blakewilson](https://github.com/blakewilson))

### [`v7.24.6`](https://github.com/babel/babel/blob/HEAD/CHANGELOG.md#v7246-2024-05-24)

[Compare Source](babel/babel@v7.24.5...v7.24.6)

##### 🐛 Bug Fix

-   `babel-helper-create-class-features-plugin`, `babel-plugin-transform-class-properties`
    -   [#&#8203;16514](babel/babel#16514) Fix source maps for private member expressions ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   `babel-core`, `babel-generator`, `babel-plugin-transform-modules-commonjs`
    -   [#&#8203;16515](babel/babel#16515) Fix source maps for template literals ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-decorators`
    -   [#&#8203;16485](babel/babel#16485) Support undecorated static accessor in anonymous classes ([@&#8203;JLHwung](https://github.com/JLHwung))
    -   [#&#8203;16484](babel/babel#16484) Fix decorator bare yield await ([@&#8203;JLHwung](https://github.com/JLHwung))
-   `babel-helpers`, `babel-plugin-proposal-decorators`, `babel-runtime-corejs3`
    -   [#&#8203;16483](babel/babel#16483) Fix: throw TypeError if addInitializer is called after finished ([@&#8203;JLHwung](https://github.com/JLHwung))
-   `babel-parser`, `babel-plugin-transform-typescript`
    -   [#&#8203;16476](babel/babel#16476) fix: Correctly parse `cls.fn<C> = x` ([@&#8203;liuxingbaoyu](https://github.com/liuxingbaoyu))

##### 🏠 Internal

-   `babel-core`, `babel-helpers`, `babel-plugin-transform-runtime`, `babel-preset-env`, `babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime`
    -   [#&#8203;16501](babel/babel#16501) Generate helper metadata at build time ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   `babel-helpers`
    -   [#&#8203;16499](babel/babel#16499) Add `tsconfig.json` for `@babel/helpers/src/helpers` ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   `babel-cli`, `babel-helpers`, `babel-plugin-external-helpers`, `babel-plugin-proposal-decorators`, `babel-plugin-transform-class-properties`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-modules-systemjs`, `babel-plugin-transform-runtime`, `babel-preset-env`, `babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime`
    -   [#&#8203;16495](babel/babel#16495) Move all runtime helpers to individual files ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   `babel-parser`, `babel-traverse`
    -   [#&#8203;16482](babel/babel#16482) Statically generate boilerplate for bitfield accessors ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   Other
    -   [#&#8203;16466](babel/babel#16466) Migrate import assertions syntax ([@&#8203;JLHwung](https://github.com/JLHwung))

### [`v7.24.5`](https://github.com/babel/babel/blob/HEAD/CHANGELOG.md#v7245-2024-04-29)

[Compare Source](babel/babel@v7.24.1...v7.24.5)

##### 🐛 Bug Fix

-   `babel-plugin-transform-classes`, `babel-traverse`
    -   [#&#8203;16377](babel/babel#16377) fix: TypeScript annotation affects output ([@&#8203;liuxingbaoyu](https://github.com/liuxingbaoyu))
-   `babel-helpers`, `babel-plugin-proposal-explicit-resource-management`, `babel-runtime-corejs3`
    -   [#&#8203;16440](babel/babel#16440) Fix suppressed error order ([@&#8203;sossost](https://github.com/sossost))
    -   [#&#8203;16408](babel/babel#16408) Await nullish async disposable ([@&#8203;JLHwung](https://github.com/JLHwung))

##### 💅 Polish

-   `babel-parser`
    -   [#&#8203;16407](babel/babel#16407) Recover from exported `using` declaration ([@&#8203;JLHwung](https://github.com/JLHwung))

##### 🏠 Internal

-   Other
    -   [#&#8203;16414](babel/babel#16414) Relax ESLint peerDependency constraint to allow v9 ([@&#8203;liuxingbaoyu](https://github.com/liuxingbaoyu))
-   `babel-parser`
    -   [#&#8203;16425](babel/babel#16425) Improve `@babel/parser` AST types ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
    -   [#&#8203;16417](babel/babel#16417) Always pass type argument to `.startNode` ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   `babel-helper-create-class-features-plugin`, `babel-helper-member-expression-to-functions`, `babel-helper-module-transforms`, `babel-helper-split-export-declaration`, `babel-helper-wrap-function`, `babel-helpers`, `babel-plugin-bugfix-firefox-class-in-computed-class-key`, `babel-plugin-proposal-explicit-resource-management`, `babel-plugin-transform-block-scoping`, `babel-plugin-transform-destructuring`, `babel-plugin-transform-object-rest-spread`, `babel-plugin-transform-optional-chaining`, `babel-plugin-transform-parameters`, `babel-plugin-transform-private-property-in-object`, `babel-plugin-transform-react-jsx-self`, `babel-plugin-transform-typeof-symbol`, `babel-plugin-transform-typescript`, `babel-traverse`
    -   [#&#8203;16439](babel/babel#16439) Make `NodePath<T | U>` distributive ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   `babel-plugin-proposal-partial-application`, `babel-types`
    -   [#&#8203;16421](babel/babel#16421) Remove `JSXNamespacedName` from valid `CallExpression` args ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))
-   `babel-plugin-transform-class-properties`, `babel-preset-env`
    -   [#&#8203;16406](babel/babel#16406) Do not load unnecessary Babel 7 syntax plugins in Babel 8 ([@&#8203;nicolo-ribaudo](https://github.com/nicolo-ribaudo))

##### 🏃‍♀️ Performance

-   `babel-helpers`, `babel-preset-env`, `babel-runtime-corejs3`
    -   [#&#8203;16357](babel/babel#16357) Performance: improve `objectWithoutPropertiesLoose` on V8 ([@&#8203;romgrk](https://github.com/romgrk))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: https://git.vylpes.xyz/RabbitLabs/random-bunny/pulls/173
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
@nejidevelops nejidevelops mentioned this pull request Jun 14, 2024
[Snyk] Upgrade: , nejidevelops/phase-1-destructuring-assignment#37
Open
@NOUIY NOUIY mentioned this pull request Jun 14, 2024
[Snyk] Upgrade @babel/core from 7.17.9 to 7.24.6 NOUIY/angular#756
Open
This was referenced Jun 14, 2024
[Snyk] Upgrade: , nejidevelops/phase-1-domcontentloaded#35
Open
[Snyk] Upgrade: , nejidevelops/phase-0-intro-to-js-2-looping-code-along#36
Open
@bee22193 bee22193 mentioned this pull request Jun 14, 2024
[Snyk] Upgrade: , bee22193/mnmlurl#1192
Open
@ReeceKidd ReeceKidd mentioned this pull request Jun 14, 2024
[Snyk] Upgrade @babel/preset-typescript from 7.16.7 to 7.24.6 ReeceKidd/cryptcommit#331
Open
@trabab trabab mentioned this pull request Jun 14, 2024
[Snyk] Upgrade @babel/core from 7.9.0 to 7.24.6 trabab/uppy#799
Open
@x-way x-way mentioned this pull request Aug 10, 2024
[Snyk] Upgrade @babel/preset-env from 7.24.0 to 7.24.8 x-way/cal-heatmap#542
Closed
@wjygit0428 wjygit0428 mentioned this pull request Aug 10, 2024
[Snyk] Upgrade @babel/helper-module-imports from 7.8.3 to 7.24.7 wjygit0428/wepy#11
Open
@keyasuda keyasuda mentioned this pull request Aug 10, 2024
[Snyk] Upgrade: , keyasuda/bormashino#161
Merged
@richyhoopd richyhoopd mentioned this pull request Aug 10, 2024
[Snyk] Upgrade: , , richyhoopd/RichyFlix#903
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Aug 10, 2024
[Snyk] Upgrade: , , , rawdaymohamed/Hot-Todo#351
Open
This was referenced Aug 10, 2024
[Snyk] Upgrade: , tiff-es/fewpjs-fns-as-first-class-data-do-behavior-dc-web-091619#199
Open
[Snyk] Upgrade: , tiff-es/fewpjs-fns-as-first-class-data-array-o-functions-dc-web-091619#207
Open
[Snyk] Upgrade: , tiff-es/fewpjs-acting-on-events-dc-web-091619#201
Open
This was referenced Aug 10, 2024
[Snyk] Upgrade: , nejidevelops/phase-0-intro-to-js-2-objects-lab#47
Open
[Snyk] Upgrade: , nejidevelops/phase-1-destructuring-assignment#47
Open
[Snyk] Upgrade: , nejidevelops/phase-1-domcontentloaded#44
Open
[Snyk] Upgrade: , nejidevelops/phase-0-intro-to-js-2-looping-code-along#45
Open
[Snyk] Upgrade: , nejidevelops/phase-0-javascript-events-acting-on-events-lab#44
Open
This was referenced Aug 11, 2024
[Snyk] Upgrade: , tiff-es/fewpjs-fns-as-first-class-data-array-o-functions-dc-web-091619#208
Open
[Snyk] Upgrade: , tiff-es/fewpjs-adding-behavior-with-methods-dc-web-091619#218
Open
[Snyk] Upgrade: , tiff-es/fewpjs-document-onload-dc-web-091619#206
Open
[Snyk] Upgrade: , tiff-es/fewpjs-class-extensions-super-lab-online-web-sp-000#204
Open
[Snyk] Upgrade @babel/preset-env from 7.10.4 to 7.24.8 tiff-es/tiffany-portfolio-responsive#475
Open
@bee22193 bee22193 mentioned this pull request Aug 11, 2024
[Snyk] Upgrade: , bee22193/mnmlurl#1235
Open
@mdfkbtc mdfkbtc mentioned this pull request Aug 11, 2024
[Snyk] Upgrade @babel/preset-env from 7.5.0 to 7.24.8 mdfkbtc/veles-mobile-wallet-mdfkbtc#1812
Open
@richyhoopd richyhoopd mentioned this pull request Aug 11, 2024
[Snyk] Upgrade: , , richyhoopd/Video-App#1194
Open
@tiff-es tiff-es mentioned this pull request Aug 12, 2024
[Snyk] Upgrade: , tiff-es/fewpjs-getter-and-setter-methods-dc-web-091619#220
Open
@rish2497 rish2497 mentioned this pull request Aug 12, 2024
[Snyk] Upgrade: , i3-Market-V3-Public-Repository/Support---Deployment-Tools#37
Open
@DanielTal87 DanielTal87 mentioned this pull request Aug 12, 2024
[Snyk] Upgrade: , , snyk/vscode-extension#509
Closed
@Playgirlkaybraz11 Playgirlkaybraz11 mentioned this pull request Aug 12, 2024
[Snyk] Upgrade @babel/runtime from 7.4.3 to 7.24.8 Playgirlkaybraz11/td#7
Open
@Sentini14 Sentini14 mentioned this pull request Aug 13, 2024
[Snyk] Upgrade: , Sentini14/tiny-secp256k1#1
Open
@Nanyte25 Nanyte25 mentioned this pull request Aug 13, 2024
[Snyk] Upgrade: , Nanyte25/penconnectorlab#1698
Open
@richyhoopd richyhoopd mentioned this pull request Aug 13, 2024
[Snyk] Upgrade: , , richyhoopd/RichyFlix#904
Open
@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 14, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@nicolo-ribaudo nicolo-ribaudo nicolo-ribaudo approved these changes
@liuxingbaoyu liuxingbaoyu liuxingbaoyu approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

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: Decorators

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Crash with decorators on anonymous class expression

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@JLHwung @babel-bot @nicolo-ribaudo @liuxingbaoyu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.