summaryrefslogtreecommitdiff
path: root/ext/broadcast_channel/01_broadcast_channel.js
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-01-12 13:43:36 +0100
committerGitHub <noreply@github.com>2023-01-12 13:43:36 +0100
commitcc806cdf2121878ae4c10b1fd0c4c03b14ba33c7 (patch)
tree337e1ea14662d58a860a32feb5a25006b9d95af4 /ext/broadcast_channel/01_broadcast_channel.js
parenta6b3910bdfe0183e458015d00a61295779e46eb1 (diff)
fix: check if BroadcastChannel is open before sending (#17366)
Fixes #16978
Diffstat (limited to 'ext/broadcast_channel/01_broadcast_channel.js')
-rw-r--r--ext/broadcast_channel/01_broadcast_channel.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/broadcast_channel/01_broadcast_channel.js b/ext/broadcast_channel/01_broadcast_channel.js
index cf3b17ac5..59c6b7cef 100644
--- a/ext/broadcast_channel/01_broadcast_channel.js
+++ b/ext/broadcast_channel/01_broadcast_channel.js
@@ -122,7 +122,11 @@
dispatch(this, this[_name], new Uint8Array(data));
// Send to listeners in other VMs.
- defer(() => core.opAsync("op_broadcast_send", rid, this[_name], data));
+ defer(() => {
+ if (!this[_closed]) {
+ core.opAsync("op_broadcast_send", rid, this[_name], data);
+ }
+ });
}
close() {