Skip to content

Commit 2ba8460

Browse files
phillipjsilverwind
authored andcommitted
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: #2159 Reviewed-By: Roman Reiss <[email protected]>
1 parent bd01603 commit 2ba8460

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/path.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,7 @@ posix.join = function() {
477477
var path = '';
478478
for (var i = 0; i < arguments.length; i++) {
479479
var segment = arguments[i];
480-
if (typeof segment !== 'string') {
481-
throw new TypeError('Arguments to path.join must be strings');
482-
}
480+
assertPath(segment);
483481
if (segment) {
484482
if (!path) {
485483
path += segment;

0 commit comments

Comments
 (0)