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

Decorators cannot work with private fields #9565

Open
mantou132 opened this issue Sep 18, 2024 · 1 comment
Open

Decorators cannot work with private fields #9565

mantou132 opened this issue Sep 18, 2024 · 1 comment
Labels
Milestone

Comments

@mantou132
Copy link

mantou132 commented Sep 18, 2024

Describe the bug

Transform's code cannot be executed

Input code

No response

Config

No response

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.7.26&code=H4sIAAAAAAAAA11P0QqDMAx8F%2FyHgC8tjILbozgm7GVfMUpNXaHUYSMbG%2F77WqyKCyFwyd0l0aNTZHoHqDUqYh3SFZ8cvnkGIQakcXCgFxa7H0D1jvBNKydG6gnZtjdnyEhrPjiwTbdjJ4XvLQrbd2xVK4Xei3ADo4fxfK58E068msGUZyHzTFnpPTSLeRHcoIYyjiK%2BpK%2BY5FCfQYpISH5Fmv3%2FsV5VHk98v83hCxrGqx%2Fig0OCNQEAAA%3D%3D&config=H4sIAAAAAAAAA2WQuwrDMAxF93xF0NxCSGmH%2FkPX7sZRgkv8QFKhIeTfa%2BfhJnSzdHR9hMaiLOHFGu7lGJ%2BxCIoYKdexw4MT9YkdkCEgazJB4LRR4YRa1TPmXoPakxJPHJHQG2cwLRyElOPWk91LcuSJxMa7pKuruj5XFzimFXUoCSNf1zWg957xuAZY40w77B3a20DI%2FLevVa7rc37RFasSrG%2FeM1wPlI6w6G%2FwG9pk%2BWMw%2FNiS8wmmL%2FLxwChsAQAA

SWC Info output

No response

Expected behavior

Transform's code can be executed

Actual behavior

Uncaught SyntaxError: reference to undeclared private field or method #log

Version

1.7.26

Additional context

No response

@mantou132 mantou132 changed the title The decoration cannot work with private fields Decorators cannot work with private fields Sep 18, 2024
@mantou132
Copy link
Author

The generated code will use private fields outside Class:

image

Firefox:

Uncaught SyntaxError: reference to undeclared private field or method #log

@kdy1 kdy1 added this to the Planned milestone Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants