mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
stream: add Symbol.toStringTag to Compression Streams
PR-URL: https://github.com/nodejs/node/pull/50712 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
committed by
Node.js GitHub Bot
parent
bae7e3831d
commit
61b7846431
@@ -2,6 +2,7 @@
|
||||
|
||||
const {
|
||||
ObjectDefineProperties,
|
||||
SymbolToStringTag,
|
||||
} = primordials;
|
||||
|
||||
const {
|
||||
@@ -137,11 +138,21 @@ class DecompressionStream {
|
||||
ObjectDefineProperties(CompressionStream.prototype, {
|
||||
readable: kEnumerableProperty,
|
||||
writable: kEnumerableProperty,
|
||||
[SymbolToStringTag]: {
|
||||
__proto__: null,
|
||||
configurable: true,
|
||||
value: 'CompressionStream',
|
||||
},
|
||||
});
|
||||
|
||||
ObjectDefineProperties(DecompressionStream.prototype, {
|
||||
readable: kEnumerableProperty,
|
||||
writable: kEnumerableProperty,
|
||||
[SymbolToStringTag]: {
|
||||
__proto__: null,
|
||||
configurable: true,
|
||||
value: 'DecompressionStream',
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -15,6 +15,9 @@ async function test(format) {
|
||||
const gzip = new CompressionStream(format);
|
||||
const gunzip = new DecompressionStream(format);
|
||||
|
||||
assert.strictEqual(gzip[Symbol.toStringTag], 'CompressionStream');
|
||||
assert.strictEqual(gunzip[Symbol.toStringTag], 'DecompressionStream');
|
||||
|
||||
gzip.readable.pipeTo(gunzip.writable).then(common.mustCall());
|
||||
|
||||
const reader = gunzip.readable.getReader();
|
||||
|
||||
Reference in New Issue
Block a user