diff options
Diffstat (limited to 'ext/broadcast_channel/01_broadcast_channel.js')
-rw-r--r-- | ext/broadcast_channel/01_broadcast_channel.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/broadcast_channel/01_broadcast_channel.js b/ext/broadcast_channel/01_broadcast_channel.js index f3b091709..e14b59779 100644 --- a/ext/broadcast_channel/01_broadcast_channel.js +++ b/ext/broadcast_channel/01_broadcast_channel.js @@ -6,6 +6,7 @@ ((window) => { const core = window.Deno.core; + const ops = core.ops; const webidl = window.__bootstrap.webidl; const { defineEventHandler, setTarget } = window.__bootstrap.event; const { DOMException } = window.__bootstrap.domException; @@ -92,7 +93,7 @@ if (rid === null) { // Create the rid immediately, otherwise there is a time window (and a // race condition) where messages can get lost, because recv() is async. - rid = core.opSync("op_broadcast_subscribe"); + rid = ops.op_broadcast_subscribe(); recv(); } } @@ -128,7 +129,9 @@ if (index === -1) return; ArrayPrototypeSplice(channels, index, 1); - if (channels.length === 0) core.opSync("op_broadcast_unsubscribe", rid); + if (channels.length === 0) { + ops.op_broadcast_unsubscribe(rid); + } } } |