zlib: add ArrayBuffer support
PR-URL: https://github.com/nodejs/node/pull/16042 Refs: https://github.com/nodejs/node/issues/1826 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
d64b0a85e6
commit
284871862e
@ -286,6 +286,9 @@ Compression strategy.
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.11.1
|
added: v0.11.1
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `dictionary` option can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12001
|
pr-url: https://github.com/nodejs/node/pull/12001
|
||||||
description: The `dictionary` option can be an Uint8Array now.
|
description: The `dictionary` option can be an Uint8Array now.
|
||||||
@ -308,8 +311,8 @@ ignored by the decompression classes.
|
|||||||
* `level` {integer} (compression only)
|
* `level` {integer} (compression only)
|
||||||
* `memLevel` {integer} (compression only)
|
* `memLevel` {integer} (compression only)
|
||||||
* `strategy` {integer} (compression only)
|
* `strategy` {integer} (compression only)
|
||||||
* `dictionary` {Buffer|TypedArray|DataView} (deflate/inflate only, empty dictionary by
|
* `dictionary` {Buffer|TypedArray|DataView|ArrayBuffer} (deflate/inflate only,
|
||||||
default)
|
empty dictionary by default)
|
||||||
* `info` {boolean} (If `true`, returns an object with `buffer` and `engine`)
|
* `info` {boolean} (If `true`, returns an object with `buffer` and `engine`)
|
||||||
|
|
||||||
See the description of `deflateInit2` and `inflateInit2` at
|
See the description of `deflateInit2` and `inflateInit2` at
|
||||||
@ -511,9 +514,10 @@ Creates and returns a new [Unzip][] object with the given [options][].
|
|||||||
|
|
||||||
<!--type=misc-->
|
<!--type=misc-->
|
||||||
|
|
||||||
All of these take a [`Buffer`][], [`TypedArray`][], [`DataView`][], or string as
|
All of these take a [`Buffer`][], [`TypedArray`][], [`DataView`][],
|
||||||
the first argument, an optional second argument to supply options to the `zlib`
|
[`ArrayBuffer`][] or string as the first argument, an optional second argument
|
||||||
classes and will call the supplied callback with `callback(error, result)`.
|
to supply options to the `zlib` classes and will call the supplied callback
|
||||||
|
with `callback(error, result)`.
|
||||||
|
|
||||||
Every method has a `*Sync` counterpart, which accept the same arguments, but
|
Every method has a `*Sync` counterpart, which accept the same arguments, but
|
||||||
without a callback.
|
without a callback.
|
||||||
@ -522,6 +526,9 @@ without a callback.
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.6.0
|
added: v0.6.0
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -533,6 +540,9 @@ changes:
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.11.12
|
added: v0.11.12
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -541,7 +551,7 @@ changes:
|
|||||||
description: The `buffer` parameter can be an Uint8Array now.
|
description: The `buffer` parameter can be an Uint8Array now.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- `buffer` {Buffer|TypedArray|DataView|string}
|
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
|
||||||
|
|
||||||
Compress a chunk of data with [Deflate][].
|
Compress a chunk of data with [Deflate][].
|
||||||
|
|
||||||
@ -560,6 +570,9 @@ changes:
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.11.12
|
added: v0.11.12
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -568,7 +581,7 @@ changes:
|
|||||||
description: The `buffer` parameter can be an Uint8Array now.
|
description: The `buffer` parameter can be an Uint8Array now.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- `buffer` {Buffer|TypedArray|DataView|string}
|
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
|
||||||
|
|
||||||
Compress a chunk of data with [DeflateRaw][].
|
Compress a chunk of data with [DeflateRaw][].
|
||||||
|
|
||||||
@ -576,6 +589,9 @@ Compress a chunk of data with [DeflateRaw][].
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.6.0
|
added: v0.6.0
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -587,6 +603,9 @@ changes:
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.11.12
|
added: v0.11.12
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -595,7 +614,7 @@ changes:
|
|||||||
description: The `buffer` parameter can be an Uint8Array now.
|
description: The `buffer` parameter can be an Uint8Array now.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- `buffer` {Buffer|TypedArray|DataView|string}
|
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
|
||||||
|
|
||||||
Decompress a chunk of data with [Gunzip][].
|
Decompress a chunk of data with [Gunzip][].
|
||||||
|
|
||||||
@ -603,6 +622,9 @@ Decompress a chunk of data with [Gunzip][].
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.6.0
|
added: v0.6.0
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -614,6 +636,9 @@ changes:
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.11.12
|
added: v0.11.12
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -622,7 +647,7 @@ changes:
|
|||||||
description: The `buffer` parameter can be an Uint8Array now.
|
description: The `buffer` parameter can be an Uint8Array now.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- `buffer` {Buffer|TypedArray|DataView|string}
|
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
|
||||||
|
|
||||||
Compress a chunk of data with [Gzip][].
|
Compress a chunk of data with [Gzip][].
|
||||||
|
|
||||||
@ -630,6 +655,9 @@ Compress a chunk of data with [Gzip][].
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.6.0
|
added: v0.6.0
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -641,6 +669,9 @@ changes:
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.11.12
|
added: v0.11.12
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -649,7 +680,7 @@ changes:
|
|||||||
description: The `buffer` parameter can be an Uint8Array now.
|
description: The `buffer` parameter can be an Uint8Array now.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- `buffer` {Buffer|TypedArray|DataView|string}
|
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
|
||||||
|
|
||||||
Decompress a chunk of data with [Inflate][].
|
Decompress a chunk of data with [Inflate][].
|
||||||
|
|
||||||
@ -657,6 +688,9 @@ Decompress a chunk of data with [Inflate][].
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.6.0
|
added: v0.6.0
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -668,6 +702,9 @@ changes:
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.11.12
|
added: v0.11.12
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -676,7 +713,7 @@ changes:
|
|||||||
description: The `buffer` parameter can be an Uint8Array now.
|
description: The `buffer` parameter can be an Uint8Array now.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- `buffer` {Buffer|TypedArray|DataView|string}
|
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
|
||||||
|
|
||||||
Decompress a chunk of data with [InflateRaw][].
|
Decompress a chunk of data with [InflateRaw][].
|
||||||
|
|
||||||
@ -684,6 +721,9 @@ Decompress a chunk of data with [InflateRaw][].
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.6.0
|
added: v0.6.0
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -695,6 +735,9 @@ changes:
|
|||||||
<!-- YAML
|
<!-- YAML
|
||||||
added: v0.11.12
|
added: v0.11.12
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/16042
|
||||||
|
description: The `buffer` parameter can be an ArrayBuffer.
|
||||||
- version: v8.0.0
|
- version: v8.0.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/12223
|
pr-url: https://github.com/nodejs/node/pull/12223
|
||||||
description: The `buffer` parameter can be any TypedArray or DataView now.
|
description: The `buffer` parameter can be any TypedArray or DataView now.
|
||||||
@ -703,12 +746,13 @@ changes:
|
|||||||
description: The `buffer` parameter can be an Uint8Array now.
|
description: The `buffer` parameter can be an Uint8Array now.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- `buffer` {Buffer|TypedArray|DataView|string}
|
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
|
||||||
|
|
||||||
Decompress a chunk of data with [Unzip][].
|
Decompress a chunk of data with [Unzip][].
|
||||||
|
|
||||||
[`.flush()`]: #zlib_zlib_flush_kind_callback
|
[`.flush()`]: #zlib_zlib_flush_kind_callback
|
||||||
[`Accept-Encoding`]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
|
[`Accept-Encoding`]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
|
||||||
|
[`ArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
|
||||||
[`Buffer`]: buffer.html#buffer_class_buffer
|
[`Buffer`]: buffer.html#buffer_class_buffer
|
||||||
[`Content-Encoding`]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
|
[`Content-Encoding`]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
|
||||||
[`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
|
[`DataView`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView
|
||||||
|
14
lib/zlib.js
14
lib/zlib.js
@ -24,6 +24,7 @@
|
|||||||
const errors = require('internal/errors');
|
const errors = require('internal/errors');
|
||||||
const Transform = require('_stream_transform');
|
const Transform = require('_stream_transform');
|
||||||
const { _extend } = require('util');
|
const { _extend } = require('util');
|
||||||
|
const { isAnyArrayBuffer } = process.binding('util');
|
||||||
const { isArrayBufferView } = require('internal/util/types');
|
const { isArrayBufferView } = require('internal/util/types');
|
||||||
const binding = process.binding('zlib');
|
const binding = process.binding('zlib');
|
||||||
const assert = require('assert').ok;
|
const assert = require('assert').ok;
|
||||||
@ -67,6 +68,8 @@ function zlibBuffer(engine, buffer, callback) {
|
|||||||
if (isArrayBufferView(buffer) &&
|
if (isArrayBufferView(buffer) &&
|
||||||
Object.getPrototypeOf(buffer) !== Buffer.prototype) {
|
Object.getPrototypeOf(buffer) !== Buffer.prototype) {
|
||||||
buffer = Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
buffer = Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
||||||
|
} else if (isAnyArrayBuffer(buffer)) {
|
||||||
|
buffer = Buffer.from(buffer);
|
||||||
}
|
}
|
||||||
engine.buffers = null;
|
engine.buffers = null;
|
||||||
engine.nread = 0;
|
engine.nread = 0;
|
||||||
@ -114,9 +117,14 @@ function zlibBufferSync(engine, buffer) {
|
|||||||
if (typeof buffer === 'string') {
|
if (typeof buffer === 'string') {
|
||||||
buffer = Buffer.from(buffer);
|
buffer = Buffer.from(buffer);
|
||||||
} else if (!isArrayBufferView(buffer)) {
|
} else if (!isArrayBufferView(buffer)) {
|
||||||
|
if (isAnyArrayBuffer(buffer)) {
|
||||||
|
buffer = Buffer.from(buffer);
|
||||||
|
} else {
|
||||||
throw new errors.TypeError('ERR_INVALID_ARG_TYPE',
|
throw new errors.TypeError('ERR_INVALID_ARG_TYPE',
|
||||||
'buffer',
|
'buffer',
|
||||||
['string', 'Buffer', 'TypedArray', 'DataView']);
|
['string', 'Buffer', 'TypedArray', 'DataView',
|
||||||
|
'ArrayBuffer']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
buffer = processChunkSync(engine, buffer, engine._finishFlushFlag);
|
buffer = processChunkSync(engine, buffer, engine._finishFlushFlag);
|
||||||
if (engine._info)
|
if (engine._info)
|
||||||
@ -245,10 +253,14 @@ function Zlib(opts, mode) {
|
|||||||
|
|
||||||
dictionary = opts.dictionary;
|
dictionary = opts.dictionary;
|
||||||
if (dictionary !== undefined && !isArrayBufferView(dictionary)) {
|
if (dictionary !== undefined && !isArrayBufferView(dictionary)) {
|
||||||
|
if (isAnyArrayBuffer(dictionary)) {
|
||||||
|
dictionary = Buffer.from(dictionary);
|
||||||
|
} else {
|
||||||
throw new errors.TypeError('ERR_INVALID_OPT_VALUE',
|
throw new errors.TypeError('ERR_INVALID_OPT_VALUE',
|
||||||
'dictionary',
|
'dictionary',
|
||||||
dictionary);
|
dictionary);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (opts.encoding || opts.objectMode || opts.writableObjectMode) {
|
if (opts.encoding || opts.objectMode || opts.writableObjectMode) {
|
||||||
opts = _extend({}, opts);
|
opts = _extend({}, opts);
|
||||||
|
@ -124,6 +124,13 @@ Checks if `pathname` exists
|
|||||||
|
|
||||||
Returns an instance of all possible `ArrayBufferView`s of the provided Buffer.
|
Returns an instance of all possible `ArrayBufferView`s of the provided Buffer.
|
||||||
|
|
||||||
|
### getBufferSources(buf)
|
||||||
|
* `buf` [<Buffer>]
|
||||||
|
* return [<BufferSource[]>]
|
||||||
|
|
||||||
|
Returns an instance of all possible `BufferSource`s of the provided Buffer,
|
||||||
|
consisting of all `ArrayBufferView` and an `ArrayBuffer`.
|
||||||
|
|
||||||
### getCallSite(func)
|
### getCallSite(func)
|
||||||
* `func` [<Function>]
|
* `func` [<Function>]
|
||||||
* return [<String>]
|
* return [<String>]
|
||||||
|
@ -814,6 +814,10 @@ exports.getArrayBufferViews = function getArrayBufferViews(buf) {
|
|||||||
return out;
|
return out;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.getBufferSources = function getBufferSources(buf) {
|
||||||
|
return [...exports.getArrayBufferViews(buf), new Uint8Array(buf).buffer];
|
||||||
|
};
|
||||||
|
|
||||||
// Crash the process on unhandled rejections.
|
// Crash the process on unhandled rejections.
|
||||||
exports.crashOnUnhandledRejection = function() {
|
exports.crashOnUnhandledRejection = function() {
|
||||||
process.on('unhandledRejection',
|
process.on('unhandledRejection',
|
||||||
|
@ -43,7 +43,7 @@ const optsInfo = {
|
|||||||
for (const [type, expect] of [
|
for (const [type, expect] of [
|
||||||
['string', expectStr],
|
['string', expectStr],
|
||||||
['Buffer', expectBuf],
|
['Buffer', expectBuf],
|
||||||
...common.getArrayBufferViews(expectBuf).map((obj) =>
|
...common.getBufferSources(expectBuf).map((obj) =>
|
||||||
[obj[Symbol.toStringTag], obj]
|
[obj[Symbol.toStringTag], obj]
|
||||||
)
|
)
|
||||||
]) {
|
]) {
|
||||||
|
@ -167,7 +167,7 @@ function deflateRawResetDictionaryTest(spdyDict) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const dict of [spdyDict, ...common.getArrayBufferViews(spdyDict)]) {
|
for (const dict of [spdyDict, ...common.getBufferSources(spdyDict)]) {
|
||||||
basicDictionaryTest(dict);
|
basicDictionaryTest(dict);
|
||||||
deflateResetDictionaryTest(dict);
|
deflateResetDictionaryTest(dict);
|
||||||
rawDictionaryTest(dict);
|
rawDictionaryTest(dict);
|
||||||
|
@ -13,7 +13,7 @@ const zlib = require('zlib');
|
|||||||
code: 'ERR_INVALID_ARG_TYPE',
|
code: 'ERR_INVALID_ARG_TYPE',
|
||||||
type: TypeError,
|
type: TypeError,
|
||||||
message: 'The "buffer" argument must be one of type string, Buffer, ' +
|
message: 'The "buffer" argument must be one of type string, Buffer, ' +
|
||||||
'TypedArray, or DataView'
|
'TypedArray, DataView, or ArrayBuffer'
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user