-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Check module.exports #25732
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
Merged
Merged
Check module.exports #25732
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b7e466b
Revert "Revert "Explicitly typed special assignments are context sens…
sandersn 2ba6ecd
Revert "Revert "Explicitly typed prototype assignments are context se…
sandersn 3f3708a
Initial, wasteful, solution
sandersn 0488063
Update some baselines
sandersn cf373ee
module.exports= always uses lhs type
sandersn 29fb86a
Merge branch 'master' into js/check-module-exports
sandersn e17f98a
Fix lint and accept good user baselines
sandersn aba56b8
Add tests based on user tests.
sandersn bb225c5
Fix all but 1 of user test bugs found by typing module.exports
sandersn af8cc03
Merge branch 'master' into js/check-module-exports
sandersn a490b37
Follow merged symbols+allow any object type
sandersn 27dcb56
Update improved user baselines
sandersn 2360565
Fix infinite recursion when checking module.exports
sandersn 37a3a82
Fix bogus use-before-def error
sandersn 2714c10
Update user test baselines
sandersn 9f5d60b
Cleanup
sandersn 87c187e
More small cleanup
sandersn ee96f65
Bind `module` of `module.exports` as a special symbol
sandersn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 0 additions & 89 deletions
89
tests/baselines/reference/contextualTypedSpecialAssignment.errors.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why not set
links.type
in this case?This whole function might be neater if it just called
getTypeOfFuncClassEnumModuleUncached
which usedreturn x
instead oflinks.type = x
. Then we would be sure to be setting the value and not forgetting some control flow path.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.
The original reason is that getTypeOfVariableOrParameterOrProperty does. I think that's because you can call
getTypeOfSymbol
in situations that are speculative, and you may successfully be able to get the type at a later time.I tried this and nothing broke, even when I changed the equivalent line in
getTypeOfVariableOrParameterOrProperty
. So it looks like my guess is wrong. I think I will merge this for now and try that refactor separately, for both.