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: use structuredClone instead of v8 #45611

Merged
merged 3 commits into from
Nov 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ const {
kEnumerableProperty,
} = require('internal/util');

const {
serialize,
deserialize,
} = require('v8');

const {
validateBuffer,
validateObject,
Expand Down Expand Up @@ -90,6 +85,10 @@ const {
kIsReadable,
} = require('internal/streams/utils');

const {
structuredClone,
} = require('internal/structured_clone');

const {
ArrayBufferViewGetBuffer,
ArrayBufferViewGetByteLength,
Expand Down Expand Up @@ -1471,7 +1470,7 @@ function readableStreamDefaultTee(stream, cloneForBranch2) {
let value2 = value;
if (!canceled2 && cloneForBranch2) {
// Structured Clone
anonrig marked this conversation as resolved.
Show resolved Hide resolved
value2 = deserialize(serialize(value2));
value2 = structuredClone((value2));
anonrig marked this conversation as resolved.
Show resolved Hide resolved
}
if (!canceled1) {
readableStreamDefaultControllerEnqueue(
Expand Down