-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Path.normalize(undefined) throws on Mac but not on Windows #1139
Comments
Can't confirm as I don't run windows (OSX does throw), but I'd certainly like to see some input verification here. If you're interested, pull requests are welcome 😃 |
Confirmed. Windows:
OSX and Linux:
|
What's the expected result? |
Or empty string? |
(Most of the rest return |
Probably best to throw |
Note: I did not notice earlier, but |
I don't have an opinion on which behavior is better, but I'd certainly accept a patch that makes behavior consistent across platforms. |
Throwing a |
+1 for |
This commit adds type checking of path inputs to exported methods in the path module. The exception is _makeLong(), which seems to explicitly support any data type. Fixes: #1139 PR-URL: #1153 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Fixed in eb995d6 |
Passing in "undefined" into Path.normalize() throws on Mac but works just fine on Windows. I think the issue is that Path.isAbsolute() does not check if path is null or undefined in https://github.com/iojs/io.js/blob/v1.x/lib/path.js#L440
The text was updated successfully, but these errors were encountered: