-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Use control flow analysis to check 'super(...)' call before 'this' access #38612
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
Conversation
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.
I see you also removed some unused flow node types 👍
@typescript-bot test this |
Heya @ahejlsberg, I've started to run the parallelized community code test suite on this PR at 41baf41. You can monitor the build here. |
Heya @ahejlsberg, I've started to run the extended test suite on this PR at 41baf41. You can monitor the build here. |
Heya @ahejlsberg, I've started to run the perf test suite on this PR at 41baf41. You can monitor the build here. Update: The results are in! |
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
@ahejlsberg Here they are:Comparison Report - master..38612
System
Hosts
Scenarios
|
* upstream/master: Use control flow analysis to check 'super(...)' call before 'this' access (microsoft#38612) LEGO: check in for master to temporary branch. Make `processTaggedTemplateExpression` visit a returned node goToDefinition: find only the value if it's the RHS of an assignment Fix regression organize imports duplicates comments (microsoft#38599) Fix crash in JS declaration emit (microsoft#38508)
With this PR we use control flow analysis to check that a
super(...)
call precedes everythis
orsuper
access in the constructor of a derived class. Previously we only checked that athis
orsuper
access is lexically preceded by asuper(...)
call, but that isn't correct in code with branches:Our previous lexical check extended even to
super
property accesses within arrow functions, but, strangely, not tothis
property accesses. That was inconsistent and overly restrictive. We now permit such accesses (but it is beyond our capabilities to check that the arrow function isn't called before the call tosuper(...)
).Fixes #38512.