diff --git a/node_modules/graceful-fs/clone.js b/node_modules/graceful-fs/clone.js index 028356c96ed5..dff3cc8c504b 100644 --- a/node_modules/graceful-fs/clone.js +++ b/node_modules/graceful-fs/clone.js @@ -2,12 +2,16 @@ module.exports = clone +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } + var copy = { __proto__: getPrototypeOf(obj) } else var copy = Object.create(null) diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js index de3df47fd555..8218b1478a00 100644 --- a/node_modules/graceful-fs/graceful-fs.js +++ b/node_modules/graceful-fs/graceful-fs.js @@ -170,6 +170,21 @@ function patch (fs) { } } + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, cb) { + return fs$copyFile(src, dest, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([fs$copyFile, [src, dest, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + var fs$readdir = fs.readdir fs.readdir = readdir function readdir (path, options, cb) { diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json index 0a56eb73f375..8eca6d66ff8d 100644 --- a/node_modules/graceful-fs/package.json +++ b/node_modules/graceful-fs/package.json @@ -1,7 +1,7 @@ { "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "4.2.4", + "version": "4.2.5", "repository": { "type": "git", "url": "https://github.com/isaacs/node-graceful-fs" @@ -14,7 +14,8 @@ "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", - "test": "node test.js | tap -" + "test": "nyc --silent node test.js | tap -", + "posttest": "nyc report" }, "keywords": [ "fs", diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js index a5808d23f132..56d08d180017 100644 --- a/node_modules/graceful-fs/polyfills.js +++ b/node_modules/graceful-fs/polyfills.js @@ -19,6 +19,7 @@ process.chdir = function(d) { cwd = null chdir.call(process, d) } +if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) module.exports = patch @@ -132,7 +133,7 @@ function patch (fs) { } // This ensures `util.promisify` works as it does for native `fs.read`. - read.__proto__ = fs$read + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) return read })(fs.read) diff --git a/package-lock.json b/package-lock.json index 4d56291112a1..93c93a51f01f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -374,7 +374,7 @@ "cli-table3": "^0.6.0", "columnify": "~1.5.4", "glob": "^7.1.4", - "graceful-fs": "^4.2.3", + "graceful-fs": "^4.2.5", "hosted-git-info": "^3.0.8", "ini": "^2.0.0", "init-package-json": "^2.0.2", @@ -3287,9 +3287,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.5.tgz", + "integrity": "sha512-kBBSQbz2K0Nyn+31j/w36fUfxkBW9/gfwRWdUY1ULReH3iokVJgddZAFcD1D0xlgTmFxJCbUkUclAlc6/IDJkw==", "inBundle": true }, "node_modules/har-schema": { @@ -11892,9 +11892,9 @@ } }, "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.5.tgz", + "integrity": "sha512-kBBSQbz2K0Nyn+31j/w36fUfxkBW9/gfwRWdUY1ULReH3iokVJgddZAFcD1D0xlgTmFxJCbUkUclAlc6/IDJkw==" }, "har-schema": { "version": "2.0.0", diff --git a/package.json b/package.json index 7db952421f4f..4cc113826236 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "cli-table3": "^0.6.0", "columnify": "~1.5.4", "glob": "^7.1.4", - "graceful-fs": "^4.2.3", + "graceful-fs": "^4.2.5", "hosted-git-info": "^3.0.8", "ini": "^2.0.0", "init-package-json": "^2.0.2",