diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2020-05-01 06:28:03 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2020-05-01 06:28:06 +0300 |
commit | 07a4d8884448359bac485a49c05fd2d23d06834b (patch) | |
tree | f383fd6afc20f81ba2ee1a72ed79d5842ad16b58 /node_modules | |
parent | 5587ac01ffd0d2ea830a6bbb67bb34a611ffc409 (diff) |
graceful-fs@4.2.4
Diffstat (limited to 'node_modules')
-rw-r--r-- | node_modules/graceful-fs/graceful-fs.js | 30 | ||||
-rw-r--r-- | node_modules/graceful-fs/package.json | 22 |
2 files changed, 30 insertions, 22 deletions
diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js index 8c75ee259..de3df47fd 100644 --- a/node_modules/graceful-fs/graceful-fs.js +++ b/node_modules/graceful-fs/graceful-fs.js @@ -21,6 +21,14 @@ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { function noop () {} +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') @@ -32,14 +40,10 @@ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) } // Once time initialization -if (!global[gracefulQueue]) { +if (!fs[gracefulQueue]) { // This queue can be shared by multiple loaded instances - var queue = [] - Object.defineProperty(global, gracefulQueue, { - get: function() { - return queue - } - }) + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) // Patch fs.close/closeSync to shared queue version, because we need // to retry() whenever a close happens *anywhere* in the program. @@ -79,12 +83,16 @@ if (!global[gracefulQueue]) { if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { - debug(global[gracefulQueue]) - require('assert').equal(global[gracefulQueue].length, 0) + debug(fs[gracefulQueue]) + require('assert').equal(fs[gracefulQueue].length, 0) }) } } +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + module.exports = patch(clone(fs)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs) @@ -334,11 +342,11 @@ function patch (fs) { function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) - global[gracefulQueue].push(elem) + fs[gracefulQueue].push(elem) } function retry () { - var elem = global[gracefulQueue].shift() + var elem = fs[gracefulQueue].shift() if (elem) { debug('RETRY', elem[0].name, elem[1]) elem[0].apply(null, elem[1]) diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json index 788876e32..32518904d 100644 --- a/node_modules/graceful-fs/package.json +++ b/node_modules/graceful-fs/package.json @@ -1,19 +1,19 @@ { - "_from": "graceful-fs@4.2.3", - "_id": "graceful-fs@4.2.3", + "_from": "graceful-fs@4.2.4", + "_id": "graceful-fs@4.2.4", "_inBundle": false, - "_integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "_integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "_location": "/graceful-fs", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "graceful-fs@4.2.3", + "raw": "graceful-fs@4.2.4", "name": "graceful-fs", "escapedName": "graceful-fs", - "rawSpec": "4.2.3", + "rawSpec": "4.2.4", "saveSpec": null, - "fetchSpec": "4.2.3" + "fetchSpec": "4.2.4" }, "_requiredBy": [ "#USER", @@ -41,10 +41,10 @@ "/test-exclude/load-json-file", "/write-file-atomic" ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "_shasum": "4a12ff1b60376ef09862c2093edd908328be8423", - "_spec": "graceful-fs@4.2.3", - "_where": "/Users/mperrotte/npminc/cli", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "_shasum": "2256bde14d3632958c465ebc96dc467ca07a29fb", + "_spec": "graceful-fs@4.2.4", + "_where": "/Users/ruyadorno/Documents/workspace/cli", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, @@ -98,5 +98,5 @@ "preversion": "npm test", "test": "node test.js | tap -" }, - "version": "4.2.3" + "version": "4.2.4" } |