mirror of https://github.com/nodejs/node.git
path: isAbsolute() should always return boolean
On Windows, path.isAbsolute() returns an empty string on failed cases. This forces the return value to always be boolean. Reviewed-by: Trevor Norris <trev.norris@gmail.com>archived-io.js-v0.10
parent
962e651476
commit
20229d6896
|
@ -206,7 +206,7 @@ if (isWindows) {
|
|||
exports.isAbsolute = function(path) {
|
||||
var result = splitDeviceRe.exec(path),
|
||||
device = result[1] || '',
|
||||
isUnc = device && device.charAt(1) !== ':';
|
||||
isUnc = !!device && device.charAt(1) !== ':';
|
||||
// UNC paths are always absolute
|
||||
return !!result[2] || isUnc;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue