Skip to content

Fix another infinite loop on paths on Windows. #199

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 2 commits into from
Apr 29, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion analysis/src/ModuleResolution.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let rec resolveNodeModulePath ~startPath name =
let path = Filename.concat (Filename.concat startPath "node_modules") name in
if Files.exists path then Some path
else if startPath = "/" then None
else if startPath = "/" || Filename.dirname startPath = startPath then None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first condition can be dropped right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it can be dropped.

else resolveNodeModulePath ~startPath:(Filename.dirname startPath) name