Skip to content
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

Fix the getCanonicalFileName in sys.ts and also check null value in f… #6509

Merged
merged 2 commits into from
Jan 16, 2016

Conversation

zhengbli
Copy link
Contributor

…ile watcher call back

This PR fixes the getCanonicalFileName function used in sys.ts for file systems using case sensitive file names. Also added checking for null for file watcher callbacks as node sometimes will pass null as a parameter value.

@@ -378,7 +378,11 @@ namespace ts {
*/
function fileEventHandler(eventName: string, relativefileName: string, baseDirPath: Path) {
// When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined"
const filePath = relativefileName === undefined ? undefined : toPath(relativefileName, baseDirPath, getCanonicalPath);
/* tslint:disable:no-null */
const filePath = relativefileName === undefined || relativefileName === null
Copy link
Contributor

Choose a reason for hiding this comment

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

typeof relativeFileName !== "string"?

Copy link
Member

Choose a reason for hiding this comment

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

👍

@mhegazy
Copy link
Contributor

mhegazy commented Jan 16, 2016

👍 with my minor comments.

zhengbli added a commit that referenced this pull request Jan 16, 2016
Fix the getCanonicalFileName in sys.ts and also check null value in f…
@zhengbli zhengbli merged commit a24900e into microsoft:master Jan 16, 2016
@zhengbli zhengbli deleted the fixPathForWatcher branch January 16, 2016 01:32
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants