diff options
author | micnic <micnic90@gmail.com> | 2015-10-15 00:10:25 +0300 |
---|---|---|
committer | Roman Reiss <me@silverwind.io> | 2015-11-09 22:08:36 +0300 |
commit | 20285ad17755187ece16b8a5effeaa87f5407da2 (patch) | |
tree | fd383b337137f2ab9f1fe51042d29b076f687387 /lib/path.js | |
parent | af46112828cb28223050597f06b5e45a659e99d6 (diff) |
lib: Consistent error messages in all modules
This commit fixes some error messages that are not consistent with
some general rules which most of the error messages follow.
PR-URL: https://github.com/nodejs/node/pull/3374
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'lib/path.js')
-rw-r--r-- | lib/path.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/path.js b/lib/path.js index 0c9c656e66c..c78883bbd3b 100644 --- a/lib/path.js +++ b/lib/path.js @@ -338,7 +338,7 @@ win32.dirname = function(path) { win32.basename = function(path, ext) { if (ext !== undefined && typeof ext !== 'string') - throw new TypeError('ext must be a string'); + throw new TypeError('"ext" argument must be a string'); var f = win32SplitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? @@ -357,7 +357,7 @@ win32.extname = function(path) { win32.format = function(pathObject) { if (pathObject === null || typeof pathObject !== 'object') { throw new TypeError( - "Parameter 'pathObject' must be an object, not " + typeof pathObject + 'Parameter "pathObject" must be an object, not ' + typeof pathObject ); } @@ -365,7 +365,7 @@ win32.format = function(pathObject) { if (typeof root !== 'string') { throw new TypeError( - "'pathObject.root' must be a string or undefined, not " + + '"pathObject.root" must be a string or undefined, not ' + typeof pathObject.root ); } @@ -547,7 +547,7 @@ posix.dirname = function(path) { posix.basename = function(path, ext) { if (ext !== undefined && typeof ext !== 'string') - throw new TypeError('ext must be a string'); + throw new TypeError('"ext" argument must be a string'); var f = posixSplitPath(path)[2]; @@ -574,7 +574,7 @@ posix.format = function(pathObject) { if (typeof root !== 'string') { throw new TypeError( - "'pathObject.root' must be a string or undefined, not " + + '"pathObject.root" must be a string or undefined, not ' + typeof pathObject.root ); } |