diff --git a/lib/internal/webstreams/transformstream.js b/lib/internal/webstreams/transformstream.js index 6e119bde63bb2f..411099552941b0 100644 --- a/lib/internal/webstreams/transformstream.js +++ b/lib/internal/webstreams/transformstream.js @@ -358,6 +358,7 @@ function initializeTransformStream( readableSizeAlgorithm) { const writable = new WritableStream({ + __proto__: null, start() { return startPromise.promise; }, write(chunk) { return transformStreamDefaultSinkWriteAlgorithm(stream, chunk); @@ -374,6 +375,7 @@ function initializeTransformStream( }); const readable = new ReadableStream({ + __proto__: null, start() { return startPromise.promise; }, pull() { return transformStreamDefaultSourcePullAlgorithm(stream); diff --git a/test/parallel/test-whatwg-transformstream.js b/test/parallel/test-whatwg-transformstream.js index 0cbc76cc4ce8c0..3276b4dd54a4ec 100644 --- a/test/parallel/test-whatwg-transformstream.js +++ b/test/parallel/test-whatwg-transformstream.js @@ -186,3 +186,22 @@ class Source { inspect(controller, { depth: 0 }), /TransformStreamDefaultController \[/); } + +{ + Object.defineProperty(Object.prototype, 'type', { + get: common.mustNotCall('get %Object.prototype%.type'), + set: common.mustNotCall('set %Object.prototype%.type'), + configurable: true, + }); + + new TransformStream({ + transform(chunk, controller) { + controller.enqueue(chunk); + }, + flush(controller) { + controller.terminate(); + } + }); + + delete Object.prototype.type; +}