From 20285ad17755187ece16b8a5effeaa87f5407da2 Mon Sep 17 00:00:00 2001 From: micnic Date: Thu, 15 Oct 2015 00:10:25 +0300 Subject: 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 --- lib/path.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/path.js') diff --git a/lib/path.js b/lib/path.js index 0c9c656e66..c78883bbd3 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 ); } -- cgit v1.2.3