mirror of
https://github.com/denoland/deno.git
synced 2025-07-31 00:54:18 +00:00
feat(extensions/web): add structuredClone function (#11572)
Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit is contained in:
parent
02c74fb709
commit
16ae4a0d57
9 changed files with 107 additions and 36 deletions
|
@ -318,10 +318,13 @@
|
|||
);
|
||||
options = { transfer };
|
||||
} else {
|
||||
options = webidl.converters.PostMessageOptions(transferOrOptions, {
|
||||
prefix,
|
||||
context: "Argument 2",
|
||||
});
|
||||
options = webidl.converters.StructuredSerializeOptions(
|
||||
transferOrOptions,
|
||||
{
|
||||
prefix,
|
||||
context: "Argument 2",
|
||||
},
|
||||
);
|
||||
}
|
||||
const { transfer } = options;
|
||||
const data = serializeJsMessageData(message, transfer);
|
||||
|
|
|
@ -105,10 +105,13 @@ delete Object.prototype.__proto__;
|
|||
);
|
||||
options = { transfer };
|
||||
} else {
|
||||
options = webidl.converters.PostMessageOptions(transferOrOptions, {
|
||||
prefix,
|
||||
context: "Argument 2",
|
||||
});
|
||||
options = webidl.converters.StructuredSerializeOptions(
|
||||
transferOrOptions,
|
||||
{
|
||||
prefix,
|
||||
context: "Argument 2",
|
||||
},
|
||||
);
|
||||
}
|
||||
const { transfer } = options;
|
||||
const data = serializeJsMessageData(message, transfer);
|
||||
|
@ -373,6 +376,7 @@ delete Object.prototype.__proto__;
|
|||
performance: util.writable(performance.performance),
|
||||
setInterval: util.writable(timers.setInterval),
|
||||
setTimeout: util.writable(timers.setTimeout),
|
||||
structuredClone: util.writable(messagePort.structuredClone),
|
||||
|
||||
GPU: util.nonEnumerable(webgpu.GPU),
|
||||
GPUAdapter: util.nonEnumerable(webgpu.GPUAdapter),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue