mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
stream: use structuredClone instead of v8
PR-URL: https://github.com/nodejs/node/pull/45611 Reviewed-By: Erick Wendel <erick.workspace@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
aabfdef861
commit
56eee72abb
1 file changed
+5
-7
@@ -55,11 +55,6 @@ const {
|
||||
kEnumerableProperty,
|
||||
} = require('internal/util');
|
||||
|
||||
const {
|
||||
serialize,
|
||||
deserialize,
|
||||
} = require('v8');
|
||||
|
||||
const {
|
||||
validateBuffer,
|
||||
validateObject,
|
||||
@@ -90,6 +85,10 @@ const {
|
||||
kIsReadable,
|
||||
} = require('internal/streams/utils');
|
||||
|
||||
const {
|
||||
structuredClone,
|
||||
} = require('internal/structured_clone');
|
||||
|
||||
const {
|
||||
ArrayBufferViewGetBuffer,
|
||||
ArrayBufferViewGetByteLength,
|
||||
@@ -1470,8 +1469,7 @@ function readableStreamDefaultTee(stream, cloneForBranch2) {
|
||||
const value1 = value;
|
||||
let value2 = value;
|
||||
if (!canceled2 && cloneForBranch2) {
|
||||
// Structured Clone
|
||||
value2 = deserialize(serialize(value2));
|
||||
value2 = structuredClone(value2);
|
||||
}
|
||||
if (!canceled1) {
|
||||
readableStreamDefaultControllerEnqueue(
|
||||
|
||||
Reference in new issue
Block a user