Commit 45affec1 45affec1798ebfba5a6c6afb700a1ab7feb003fd by Nicolas Perriault

fixed fs.dirname()

when dirname(path) === path, now it returns '.'
1 parent 1456d23e
......@@ -108,7 +108,8 @@ CasperError.prototype = Object.getPrototypeOf(new Error());
}
if (!fs.hasOwnProperty('dirname')) {
fs.dirname = function dirname(path) {
return path.replace(/\\/g, '/').replace(/\/[^\/]*$/, '');
var dir = path.replace(/\\/g, '/').replace(/\/[^\/]*$/, '');
return dir === path ? '.' : dir;
};
}
if (!fs.hasOwnProperty('isWindows')) {
......