summaryrefslogtreecommitdiff
path: root/ext/broadcast_channel/01_broadcast_channel.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/broadcast_channel/01_broadcast_channel.js')
-rw-r--r--ext/broadcast_channel/01_broadcast_channel.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/broadcast_channel/01_broadcast_channel.js b/ext/broadcast_channel/01_broadcast_channel.js
index 0682a2d5a..afddf8bed 100644
--- a/ext/broadcast_channel/01_broadcast_channel.js
+++ b/ext/broadcast_channel/01_broadcast_channel.js
@@ -16,6 +16,7 @@
ArrayPrototypeIndexOf,
ArrayPrototypeSplice,
ArrayPrototypePush,
+ SafeArrayIterator,
Symbol,
Uint8Array,
} = window.__bootstrap.primordials;
@@ -43,7 +44,7 @@
}
function dispatch(source, name, data) {
- for (const channel of channels) {
+ for (const channel of new SafeArrayIterator(channels)) {
if (channel === source) continue; // Don't self-send.
if (channel[_name] !== name) continue;
if (channel[_closed]) continue;