GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: add Symbol.toStringTag to Compression Streams · nodejs/node@a275155

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/webstreams
    • compression.js
  • test/parallel
    • test-whatwg-webstreams-compression.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/webstreams/compression.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/compression.js
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
ObjectDefineProperties,
5+
SymbolToStringTag,
56
} = primordials;
67

78
const {
@@ -137,11 +138,21 @@ class DecompressionStream {
137138
ObjectDefineProperties(CompressionStream.prototype, {
138139
readable: kEnumerableProperty,
139140
writable: kEnumerableProperty,
141+
[SymbolToStringTag]: {
142+
__proto__: null,
143+
configurable: true,
144+
value: 'CompressionStream',
145+
},
140146
});
141147

142148
ObjectDefineProperties(DecompressionStream.prototype, {
143149
readable: kEnumerableProperty,
144150
writable: kEnumerableProperty,
151+
[SymbolToStringTag]: {
152+
__proto__: null,
153+
configurable: true,
154+
value: 'DecompressionStream',
155+
},
145156
});
146157

147158
module.exports = {
Collapse file

‎test/parallel/test-whatwg-webstreams-compression.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-whatwg-webstreams-compression.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ async function test(format) {
1515
const gzip = new CompressionStream(format);
1616
const gunzip = new DecompressionStream(format);
1717

18+
assert.strictEqual(gzip[Symbol.toStringTag], 'CompressionStream');
19+
assert.strictEqual(gunzip[Symbol.toStringTag], 'DecompressionStream');
20+
1821
gzip.readable.pipeTo(gunzip.writable).then(common.mustCall());
1922

2023
const reader = gunzip.readable.getReader();

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.