diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-13 16:48:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-13 16:48:12 +0200 |
commit | 5105c6839904f35351481137160459fdc2edadd2 (patch) | |
tree | dca1cdc4587d8b7d1f856e9b991d5f4883c8c1d1 /cli/js/web/workers.ts | |
parent | a5f7ff7200016f8a337dd6c61e516195c12c274b (diff) |
workers: update postMessage and location types (#4734)
Diffstat (limited to 'cli/js/web/workers.ts')
-rw-r--r-- | cli/js/web/workers.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/js/web/workers.ts b/cli/js/web/workers.ts index 054c26193..421b82fbc 100644 --- a/cli/js/web/workers.ts +++ b/cli/js/web/workers.ts @@ -160,12 +160,18 @@ export class WorkerImpl extends EventTarget implements Worker { } }; - postMessage(data: any): void { + postMessage(message: any, transferOrOptions?: any): void { + if (transferOrOptions) { + throw new Error( + "Not yet implemented: `transfer` and `options` are not supported." + ); + } + if (this.#terminated) { return; } - hostPostMessage(this.#id, encodeMessage(data)); + hostPostMessage(this.#id, encodeMessage(message)); } terminate(): void { |