summaryrefslogtreecommitdiff
path: root/lib/path.js
diff options
context:
space:
mode:
authorPhillip Johnsen <johphi@gmail.com>2015-07-11 00:13:59 +0200
committerRoman Reiss <me@silverwind.io>2015-07-12 01:05:05 +0200
commit2ba84606a68954ff48cefc176f65b21264f64cc3 (patch)
treed97e727bca7d251e82fbd13e2142064c06184d48 /lib/path.js
parentbd0160320199451c93a9f318a9bd7c363f97bf0c (diff)
downloadandroid-node-v8-2ba84606a68954ff48cefc176f65b21264f64cc3.tar.gz
android-node-v8-2ba84606a68954ff48cefc176f65b21264f64cc3.tar.bz2
android-node-v8-2ba84606a68954ff48cefc176f65b21264f64cc3.zip
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>
Diffstat (limited to 'lib/path.js')
-rw-r--r--lib/path.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/path.js b/lib/path.js
index 69e7992c01..e0c5bcaa1c 100644
--- a/lib/path.js
+++ b/lib/path.js
@@ -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;