diff options
Diffstat (limited to 'deps/npm/node_modules/graceful-fs')
-rw-r--r-- | deps/npm/node_modules/graceful-fs/graceful-fs.js | 37 | ||||
-rw-r--r-- | deps/npm/node_modules/graceful-fs/package.json | 38 | ||||
-rw-r--r-- | deps/npm/node_modules/graceful-fs/polyfills.js | 35 |
3 files changed, 77 insertions, 33 deletions
diff --git a/deps/npm/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/graceful-fs/graceful-fs.js index 9bf803e686..33b30d2e98 100644 --- a/deps/npm/node_modules/graceful-fs/graceful-fs.js +++ b/deps/npm/node_modules/graceful-fs/graceful-fs.js @@ -127,25 +127,34 @@ function patch (fs) { var fs$readdir = fs.readdir fs.readdir = readdir - function readdir (path, cb) { - return go$readdir(path, cb) + function readdir (path, options, cb) { + var args = [path] + if (typeof options !== 'function') { + args.push(options) + } else { + cb = options + } + args.push(go$readdir$cb) - function go$readdir () { - return fs$readdir(path, function (err, files) { - if (files && files.sort) - files.sort(); // Backwards compatibility with graceful-fs. + return go$readdir(args) - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readdir, [path, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) + function go$readdir$cb (err, files) { + if (files && files.sort) + files.sort() + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [args]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } } } + function go$readdir (args) { + return fs$readdir.apply(fs, args) + } if (process.version.substr(0, 4) === 'v0.8') { var legStreams = legacy(fs) diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index df0cd9a110..c072f891e7 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -2,25 +2,25 @@ "_args": [ [ { - "raw": "graceful-fs@4.1.6", + "raw": "graceful-fs@4.1.9", "scope": null, "escapedName": "graceful-fs", "name": "graceful-fs", - "rawSpec": "4.1.6", - "spec": "4.1.6", + "rawSpec": "4.1.9", + "spec": "4.1.9", "type": "version" }, - "/Users/zkat/Documents/code/npm" + "/Users/rebecca/code/npm" ] ], - "_from": "graceful-fs@4.1.6", - "_id": "graceful-fs@4.1.6", + "_from": "graceful-fs@4.1.9", + "_id": "graceful-fs@4.1.9", "_inCache": true, "_location": "/graceful-fs", - "_nodeVersion": "4.4.4", + "_nodeVersion": "6.5.0", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/graceful-fs-4.1.6.tgz_1471616320359_0.39477095939219" + "tmp": "tmp/graceful-fs-4.1.9.tgz_1475103672016_0.7011275647673756" }, "_npmUser": { "name": "isaacs", @@ -29,12 +29,12 @@ "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "raw": "graceful-fs@4.1.6", + "raw": "graceful-fs@4.1.9", "scope": null, "escapedName": "graceful-fs", "name": "graceful-fs", - "rawSpec": "4.1.6", - "spec": "4.1.6", + "rawSpec": "4.1.9", + "spec": "4.1.9", "type": "version" }, "_requiredBy": [ @@ -55,11 +55,11 @@ "/tacks", "/write-file-atomic" ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz", - "_shasum": "514c38772b31bee2e08bedc21a0aeb3abf54c19e", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.9.tgz", + "_shasum": "baacba37d19d11f9d146d3578bc99958c3787e29", "_shrinkwrap": null, - "_spec": "graceful-fs@4.1.6", - "_where": "/Users/zkat/Documents/code/npm", + "_spec": "graceful-fs@4.1.9", + "_where": "/Users/rebecca/code/npm", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, @@ -74,8 +74,8 @@ "test": "test" }, "dist": { - "shasum": "514c38772b31bee2e08bedc21a0aeb3abf54c19e", - "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz" + "shasum": "baacba37d19d11f9d146d3578bc99958c3787e29", + "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.9.tgz" }, "engines": { "node": ">=0.4.0" @@ -86,7 +86,7 @@ "legacy-streams.js", "polyfills.js" ], - "gitHead": "cfe3ba80e37af542f02e445c89aa59482aa32a63", + "gitHead": "0798db3711e33de92de5a93979278bb89d629143", "homepage": "https://github.com/isaacs/node-graceful-fs#readme", "keywords": [ "fs", @@ -122,5 +122,5 @@ "scripts": { "test": "node test.js | tap -" }, - "version": "4.1.6" + "version": "4.1.9" } diff --git a/deps/npm/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/graceful-fs/polyfills.js index 2798050604..cf474df73f 100644 --- a/deps/npm/node_modules/graceful-fs/polyfills.js +++ b/deps/npm/node_modules/graceful-fs/polyfills.js @@ -56,6 +56,14 @@ function patch (fs) { fs.fchmodSync = chmodFixSync(fs.fchmodSync) fs.lchmodSync = chmodFixSync(fs.lchmodSync) + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + // if lchmod/lchown do not exist, then make them no-ops if (!fs.lchmod) { fs.lchmod = function (path, mode, cb) { @@ -246,6 +254,33 @@ function chownFixSync (orig) { } } + +function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, cb) { + return orig.call(fs, target, function (er, stats) { + if (!stats) return cb.apply(this, arguments) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + if (cb) cb.apply(this, arguments) + }) + } +} + +function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target) { + var stats = orig.call(fs, target) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + return stats; + } +} + // ENOSYS means that the fs doesn't support the op. Just ignore // that, because it doesn't matter. // |