-
Notifications
You must be signed in to change notification settings - Fork 12.8k
fix(42678): detect access to uninitialized variable in IIFE #42776
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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Heya @jakebailey, I've started to run the extended test suite on this PR at cce614e. You can monitor the build here. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I've gone and merged main into this and fixed the one coding style thing to move this forward. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@typescript-bot perf test this |
Heya @jakebailey, I've started to run the perf test suite on this PR at cce614e. You can monitor the build here. Update: The results are in! |
@jakebailey Here they are:Comparison Report - main..42776
System
Hosts
Scenarios
Developer Information: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@typescript-bot user test this |
Heya @jakebailey, I've started to run the parallelized community code test suite on this PR at 02123f7. You can monitor the build here. |
Sorry about the noise on this; lots of build issues. 🙂 |
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
* Return false if 'stopAt' node is reached or isFunctionLike(current) === true. | ||
*/ | ||
function isSameScopeDescendentOf(initial: Node, parent: Node | undefined, stopAt: Node): boolean { | ||
return !!parent && !!findAncestor(initial, n => n === stopAt || isFunctionLike(n) ? "quit" : n === parent); | ||
return !!parent && !!findAncestor(initial, n => { |
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.
Isn't this equivalent? I think I like it better simply because it's so much shorter, although I'm not 100% sure.
return !!parent && !!findAncestor(initial, n => { | |
return !!parent && !!findAncestor(initial, n => n === stopAt || isFunctionLike(n) && !getImmediatelyInvokedFunctionExpression() : n === parent); |
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.
Yeah, it works. But I wonder if we should have n === parent
before isFunctionLike(n) && !getImmediatelyInvokedFunctionExpression()
because parent
might be a function.
…t#42776) * fix(42678): detect access to uninitialized variable in IIFE * improve performance * Add missing space to match coding guidelines * simplify the implementation Co-authored-by: Jake Bailey <[email protected]>
Fixes #42678