diff options
author | Myles Borins <myles.borins@gmail.com> | 2017-10-26 22:44:44 -0400 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2017-10-29 21:32:40 -0400 |
commit | 9f33a248b37ed5acb31cffe2483d5dfc3db89521 (patch) | |
tree | 6a909195e71040e7bb9062af555acf0b060f267c /deps | |
parent | ace4fe566fc3af4876c7458f983feeb5eae3df26 (diff) | |
download | node-new-9f33a248b37ed5acb31cffe2483d5dfc3db89521.tar.gz |
deps: backport 4ca695819 from npm upstream
Original commit message:
minizlib@1.0.4
Fixes Node 9 compatibility.
Credit: @isaacs
PR-URL: https://github.com/nodejs/node/pull/16509
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/npm/node_modules/tar/node_modules/minizlib/index.js | 35 | ||||
-rw-r--r-- | deps/npm/node_modules/tar/node_modules/minizlib/package.json | 28 |
2 files changed, 42 insertions, 21 deletions
diff --git a/deps/npm/node_modules/tar/node_modules/minizlib/index.js b/deps/npm/node_modules/tar/node_modules/minizlib/index.js index 7d595dec4f..8c0df2ac43 100644 --- a/deps/npm/node_modules/tar/node_modules/minizlib/index.js +++ b/deps/npm/node_modules/tar/node_modules/minizlib/index.js @@ -52,6 +52,7 @@ const _offset = Symbol('offset') const _level = Symbol('level') const _strategy = Symbol('strategy') const _ended = Symbol('ended') +const _writeState = Symbol('writeState') class Zlib extends MiniPass { constructor (opts, mode) { @@ -127,11 +128,27 @@ class Zlib extends MiniPass { var strategy = typeof opts.strategy === 'number' ? opts.strategy : constants.Z_DEFAULT_STRATEGY - this[_handle].init(opts.windowBits || constants.Z_DEFAULT_WINDOWBITS, - level, - opts.memLevel || constants.Z_DEFAULT_MEMLEVEL, - strategy, - opts.dictionary) + this[_writeState] = new Uint32Array(2); + const window = opts.windowBits || constants.Z_DEFAULT_WINDOWBITS + const memLevel = opts.memLevel || constants.Z_DEFAULT_MEMLEVEL + + // API changed in node v9 + /* istanbul ignore next */ + if (/^v[0-8]\./.test(process.version)) { + this[_handle].init(window, + level, + memLevel, + strategy, + opts.dictionary) + } else { + this[_handle].init(window, + level, + memLevel, + strategy, + this[_writeState], + () => {}, + opts.dictionary) + } this[_buffer] = Buffer.allocUnsafe(this[_chunkSize]) this[_offset] = 0 @@ -234,11 +251,15 @@ class Zlib extends MiniPass { this[_offset], //out_off availOutBefore // out_len ) + if (this[_hadError]) break - let availInAfter = res[0] - let availOutAfter = res[1] + // API changed in v9 + /* istanbul ignore next */ + let availInAfter = res ? res[0] : this[_writeState][1] + /* istanbul ignore next */ + let availOutAfter = res ? res[1] : this[_writeState][0] const have = availOutBefore - availOutAfter assert(have >= 0, 'have should not go down') diff --git a/deps/npm/node_modules/tar/node_modules/minizlib/package.json b/deps/npm/node_modules/tar/node_modules/minizlib/package.json index ae7fb898d4..0a41e31c82 100644 --- a/deps/npm/node_modules/tar/node_modules/minizlib/package.json +++ b/deps/npm/node_modules/tar/node_modules/minizlib/package.json @@ -1,27 +1,27 @@ { - "_from": "minizlib@^1.0.3", - "_id": "minizlib@1.0.3", + "_from": "minizlib@1.0.4", + "_id": "minizlib@1.0.4", "_inBundle": false, - "_integrity": "sha1-1cGr93vhVGGZUuJTM27Mq5sqMvU=", + "_integrity": "sha512-sN4U9tIJtBRwKbwgFh9qJfrPIQ/GGTRr1MGqkgOeMTLy8/lM0FcWU//FqlnZ3Vb7gJ+Mxh3FOg1EklibdajbaQ==", "_location": "/tar/minizlib", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "version", "registry": true, - "raw": "minizlib@^1.0.3", + "raw": "minizlib@1.0.4", "name": "minizlib", "escapedName": "minizlib", - "rawSpec": "^1.0.3", + "rawSpec": "1.0.4", "saveSpec": null, - "fetchSpec": "^1.0.3" + "fetchSpec": "1.0.4" }, "_requiredBy": [ "/tar" ], - "_resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.0.3.tgz", - "_shasum": "d5c1abf77be154619952e253336eccab9b2a32f5", - "_spec": "minizlib@^1.0.3", - "_where": "/Users/rebecca/code/npm/node_modules/tar", + "_resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.0.4.tgz", + "_shasum": "8ebb51dd8bbe40b0126b5633dbb36b284a2f523c", + "_spec": "minizlib@1.0.4", + "_where": "/Users/rebecca/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -32,12 +32,12 @@ }, "bundleDependencies": false, "dependencies": { - "minipass": "^2.0.0" + "minipass": "^2.2.1" }, "deprecated": false, "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.", "devDependencies": { - "tap": "^10.3.0" + "tap": "^10.7.2" }, "files": [ "index.js", @@ -67,5 +67,5 @@ "preversion": "npm test", "test": "tap test/*.js --100 -J" }, - "version": "1.0.3" + "version": "1.0.4" } |