diff options
author | cjihrig <cjihrig@gmail.com> | 2015-03-20 03:55:31 +0300 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2015-03-20 04:11:12 +0300 |
commit | 8de78e470d2e291454e2184d7f206c70d4cb8c97 (patch) | |
tree | 7672a4f743615519cae499c089137460ccfdc0ed /lib/path.js | |
parent | 3b9eab9779262f496e22b205db5a7e1a257706e4 (diff) |
path: reduce type checking on some methods
a465840313f548b913eb2bd8ea3d26c2ab5dcebb added strict type
checking for the methods in the path module. However, dirname(),
basename(), and extname() actually had some undocumented uses
in the wild. This commit loosens the type checking on those
methods.
Fixes: https://github.com/iojs/io.js/issues/1215
PR-URL: https://github.com/iojs/io.js/pull/1216
Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'lib/path.js')
-rw-r--r-- | lib/path.js | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/lib/path.js b/lib/path.js index 5156e1f40fa..b7e28b22250 100644 --- a/lib/path.js +++ b/lib/path.js @@ -302,8 +302,6 @@ win32._makeLong = function(path) { win32.dirname = function(path) { - assertPath(path); - var result = win32SplitPath(path), root = result[0], dir = result[1]; @@ -323,8 +321,6 @@ win32.dirname = function(path) { win32.basename = function(path, ext) { - assertPath(path); - if (ext !== undefined && typeof ext !== 'string') throw new TypeError('ext must be a string'); @@ -338,7 +334,6 @@ win32.basename = function(path, ext) { win32.extname = function(path) { - assertPath(path); return win32SplitPath(path)[3]; }; @@ -536,8 +531,6 @@ posix._makeLong = function(path) { posix.dirname = function(path) { - assertPath(path); - var result = posixSplitPath(path), root = result[0], dir = result[1]; @@ -557,8 +550,6 @@ posix.dirname = function(path) { posix.basename = function(path, ext) { - assertPath(path); - if (ext !== undefined && typeof ext !== 'string') throw new TypeError('ext must be a string'); @@ -572,7 +563,6 @@ posix.basename = function(path, ext) { posix.extname = function(path) { - assertPath(path); return posixSplitPath(path)[3]; }; |