mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
path: assert path.join() arguments equally
Re-use `assertPath()` when asserting path argument types in `join()` as throughout the rest of the `path` module. This also ensures the same error message generated for posix as for win32. PR-URL: https://github.com/nodejs/io.js/pull/2159 Reviewed-By: Roman Reiss <me@silverwind.io>
This commit is contained in:
1 parent
bd01603201
commit
2ba84606a6
1 file changed
+1
-3
+1
-3
@@ -477,9 +477,7 @@ posix.join = function() {
|
||||
var path = '';
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var segment = arguments[i];
|
||||
if (typeof segment !== 'string') {
|
||||
throw new TypeError('Arguments to path.join must be strings');
|
||||
}
|
||||
assertPath(segment);
|
||||
if (segment) {
|
||||
if (!path) {
|
||||
path += segment;
|
||||
|
||||
Reference in new issue
Block a user