diff options
| author | Matt Mastracci <matthew@mastracci.com> | 2023-12-24 06:04:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-24 13:04:32 +0000 |
| commit | 92b2e28c6491f339124ec5851173ac0aaef93908 (patch) | |
| tree | 3910827b2772379054c15c4c3f133175138baf36 /ext/broadcast_channel | |
| parent | 1297c9a8f379d89691522c5cc0c6071c479e95a1 (diff) | |
chore: ensure that each op provided to ensureFastOps is only used once (#21689)
When we migrate to op-import-per-extension, we will want to ensure that
ops have one and only one place where they are imported. This tackles
the ops that are imported via `ensureFastOps`, but does not yet tackle
direct `ops` imports.
Landing ahead of https://github.com/denoland/deno_core/pull/393
Diffstat (limited to 'ext/broadcast_channel')
| -rw-r--r-- | ext/broadcast_channel/01_broadcast_channel.js | 10 |
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; |
