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
Herman Lee 2014-08-04 22:18:54 +08:00 committed by Trevor Norris
parent 962e651476
commit 20229d6896
1 changed files with 1 additions and 1 deletions

View File

@ -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;
};