summaryrefslogtreecommitdiff
path: root/runtime/js/99_main.js
diff options
context:
space:
mode:
authorLeo K <crowlkats@toaxl.com>2021-08-09 10:39:00 +0200
committerGitHub <noreply@github.com>2021-08-09 10:39:00 +0200
commit16ae4a0d5799c9a4ed776f32929f73b1063ae4e8 (patch)
treeed5d0def5e0acbf67f2c64ac4664b1af46f4c468 /runtime/js/99_main.js
parent02c74fb70970fcadb7d1e6dab857eeb2cea20e09 (diff)
feat(extensions/web): add structuredClone function (#11572)
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r--runtime/js/99_main.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 16a444098..a85c40eb9 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -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),