-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Transform decorators that reference private names into a 'static {}' block #50074
Conversation
@typescript-bot perf test |
Heya @rbuckton, I've started to run the perf test suite on this PR at ecaf38f. You can monitor the build here. Update: The results are in! |
@rbuckton Here they are:
CompilerComparison Report - main..50074
System
Hosts
Scenarios
TSServerComparison Report - main..50074
System
Hosts
Scenarios
Developer Information: |
ecaf38f
to
0c04351
Compare
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.
Looks good, but could probably use a test for the parameter decorator case, since that uses some differing checks if I've read it correctly.
method(@dec p) {} Is essentially the same as @__param(dec, 0)
method(p) {} Sorry, I spoke too soon. We do not report an error here, I just had a typo in my updated test. |
0c04351
to
4060783
Compare
This moves the downlevel emit for class element decorators into a
static {}
block when one of the decorators contains a PrivateIdentifier in an expression position (i.e.,x.#y
or#y in x
). This only moves the decorators to astatic {}
block for that specific case to avoid introducing an unnecessary IIFE during downlevel emit for existing, working code.Fixes #48515