Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: dont access Object.prototype.type during TransformStream init #46389

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/internal/webstreams/transformstream.js
Expand Up @@ -368,6 +368,7 @@ function initializeTransformStream(
close() {
return transformStreamDefaultSinkCloseAlgorithm(stream);
},
__proto__: null
aduh95 marked this conversation as resolved.
Show resolved Hide resolved
}, {
highWaterMark: writableHighWaterMark,
size: writableSizeAlgorithm,
Expand All @@ -382,6 +383,7 @@ function initializeTransformStream(
transformStreamErrorWritableAndUnblockWrite(stream, reason);
return PromiseResolve();
},
__proto__: null,
}, {
highWaterMark: readableHighWaterMark,
size: readableSizeAlgorithm,
Expand Down
15 changes: 15 additions & 0 deletions test/parallel/test-whatwg-transformstream.js
Expand Up @@ -186,3 +186,18 @@ class Source {
inspect(controller, { depth: 0 }),
/TransformStreamDefaultController \[/);
}

{
Object.defineProperty(Object.prototype, 'type', {
get: common.mustNotCall()
debadree25 marked this conversation as resolved.
Show resolved Hide resolved
});

new TransformStream({
transform(chunk, controller) {
controller.enqueue(chunk);
},
flush(controller) {
controller.terminate();
}
});
aduh95 marked this conversation as resolved.
Show resolved Hide resolved
}