doc: path.resolve ignores zero-length strings#5928
doc: path.resolve ignores zero-length strings#5928igorklopov wants to merge 2 commits intonodejs:masterfrom igorklopov:patch-1
Conversation
|
I get cwd for zero length strings. What you're seeing is what happens when you have a See in https://github.com/nodejs/node/blob/master/lib/path.js#L1183 , it sets it to the cwd before that Thanks for coming by and wanting to make a contribution to the docs :) This one is by design though. |
|
Maybe it would be appropriate to change the text to "are all zero length strings" or something similar |
|
In the beginning of |
|
I'm +0 on this - not sure it helps clarify too much, but LGTM. I want to know what other docs members think about these sort of changes @nodejs/documentation |
|
LGTM though I am also not sure if clarifies it more, but largely because of the API itself. Maybe we could have an issue to rewrite this whole doc part. |
|
LGTM |
https://github.com/nodejs/node/blob/master/lib/path.js#L187 https://github.com/nodejs/node/blob/master/lib/path.js#L1189 PR-URL: #5928 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Jefe Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in 4c234df |
|
It looks like this change is not applicable to v5.x or v4.x There was originally copy that mentioned this that was removed in an edit |
https://github.com/nodejs/node/blob/master/lib/path.js#L187 https://github.com/nodejs/node/blob/master/lib/path.js#L1189 PR-URL: nodejs#5928 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Jefe Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
https://github.com/nodejs/node/blob/master/lib/path.js#L187 https://github.com/nodejs/node/blob/master/lib/path.js#L1189 PR-URL: #5928 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Jefe Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
path.resolvedoes not usecwdfor zero-length strings as written in docs. Instead it just skips them when iterating.https://github.com/nodejs/node/blob/master/lib/path.js#L187
https://github.com/nodejs/node/blob/master/lib/path.js#L1189