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: dont access Object.prototype.type during TransformStream init · nodejs/node@406ff32

File tree

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

‎lib/internal/webstreams/transformstream.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/transformstream.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ function initializeTransformStream(
358358
readableSizeAlgorithm) {
359359

360360
const writable = new WritableStream({
361+
__proto__: null,
361362
start() { return startPromise.promise; },
362363
write(chunk) {
363364
return transformStreamDefaultSinkWriteAlgorithm(stream, chunk);
@@ -374,6 +375,7 @@ function initializeTransformStream(
374375
});
375376

376377
const readable = new ReadableStream({
378+
__proto__: null,
377379
start() { return startPromise.promise; },
378380
pull() {
379381
return transformStreamDefaultSourcePullAlgorithm(stream);
Collapse file

‎test/parallel/test-whatwg-transformstream.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-whatwg-transformstream.js
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,22 @@ class Source {
186186
inspect(controller, { depth: 0 }),
187187
/TransformStreamDefaultController \[/);
188188
}
189+
190+
{
191+
Object.defineProperty(Object.prototype, 'type', {
192+
get: common.mustNotCall('get %Object.prototype%.type'),
193+
set: common.mustNotCall('set %Object.prototype%.type'),
194+
configurable: true,
195+
});
196+
197+
new TransformStream({
198+
transform(chunk, controller) {
199+
controller.enqueue(chunk);
200+
},
201+
flush(controller) {
202+
controller.terminate();
203+
}
204+
});
205+
206+
delete Object.prototype.type;
207+
}

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.