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.js10
1 files changed, 1 insertions, 9 deletions
diff --git a/ext/broadcast_channel/01_broadcast_channel.js b/ext/broadcast_channel/01_broadcast_channel.js
index 6ee857474..0e95fe3cd 100644
--- a/ext/broadcast_channel/01_broadcast_channel.js
+++ b/ext/broadcast_channel/01_broadcast_channel.js
@@ -12,13 +12,13 @@ import {
setIsTrusted,
setTarget,
} from "ext:deno_web/02_event.js";
+import { defer } from "ext:deno_web/02_timers.js";
import DOMException from "ext:deno_web/01_dom_exception.js";
const {
ArrayPrototypeIndexOf,
ArrayPrototypePush,
ArrayPrototypeSplice,
ObjectPrototypeIsPrototypeOf,
- PromisePrototypeThen,
Symbol,
SymbolFor,
Uint8Array,
@@ -68,14 +68,6 @@ function dispatch(source, name, data) {
defer(go);
}
}
-
-// Defer to avoid starving the event loop. Not using queueMicrotask()
-// for that reason: it lets promises make forward progress but can
-// still starve other parts of the event loop.
-function defer(go) {
- PromisePrototypeThen(core.ops.op_void_async_deferred(), () => go());
-}
-
class BroadcastChannel extends EventTarget {
[_name];
[_closed] = false;