-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Private properties are lowered when combine with static properties #2416
Comments
Reproduction Link, it only occurs when |
Yes, that's true. This is likely not a bug but a limitation of esbuild's single-pass design. See this comment for an example. |
Is there any workaround for this ? Maybe could we pass an option to instruct Esbuild we are not using static field with new ? |
I've just encountered this strange behaviour. Why doing |
I know it's a bummer but a workaround seems to be go old school export class Test {
#foo = 5;
}
Test.bar = 1; |
Hi,
I have initially reported that in #2158 but I thought it may be useful to report it as an individual issue as the original issue is a bit different.
As of today, even when setting esnext as a target, esbuild improperly lower private syntax when one class contains a static method and bundling is enabled.
For instance, this:
is properly transformed to:
However, as soon as a static property enter into the game, everything is lowered, although esnext should support both syntax natively:
Is transformed to:
The text was updated successfully, but these errors were encountered: