From e5ca52a10982fd9e62853ddfb44ddb777340a5a9 Mon Sep 17 00:00:00 2001 From: oligamiq Date: Wed, 18 Sep 2024 13:36:02 +0900 Subject: [PATCH] about WebAssembly.Memory --- src/wasi_farm/farm.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wasi_farm/farm.ts b/src/wasi_farm/farm.ts index f022614..cca48fd 100644 --- a/src/wasi_farm/farm.ts +++ b/src/wasi_farm/farm.ts @@ -47,6 +47,10 @@ export class WASIFarm { this.fds = new_fds; + // WebAssembly.Memory can be used to create a SharedArrayBuffer, but it cannot be transferred by postMessage. + // Uncaught (in promise) DataCloneError: + // Failed to execute 'postMessage' on 'Worker': + // SharedArrayBuffer transfer requires self.crossOriginIsolated. try { new SharedArrayBuffer(4); this.can_array_buffer = true;