diff options
Diffstat (limited to 'ext/web/02_timers.js')
-rw-r--r-- | ext/web/02_timers.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/web/02_timers.js b/ext/web/02_timers.js index 78cf06e44..cfd85a055 100644 --- a/ext/web/02_timers.js +++ b/ext/web/02_timers.js @@ -1,5 +1,7 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. +// deno-lint-ignore-file camelcase + const core = globalThis.Deno.core; const ops = core.ops; const primordials = globalThis.__bootstrap.primordials; @@ -13,7 +15,6 @@ const { MapPrototypeSet, Uint8Array, Uint32Array, - // deno-lint-ignore camelcase NumberPOSITIVE_INFINITY, PromisePrototypeThen, SafeArrayIterator, @@ -26,6 +27,7 @@ const { import * as webidl from "ext:deno_webidl/00_webidl.js"; import { reportException } from "ext:deno_web/02_event.js"; import { assert } from "ext:deno_web/00_infra.js"; +const { op_sleep } = core.generateAsyncOpHandler("op_sleep"); const hrU8 = new Uint8Array(8); const hr = new Uint32Array(TypedArrayPrototypeGetBuffer(hrU8)); @@ -216,7 +218,7 @@ const scheduledTimers = { head: null, tail: null }; */ function runAfterTimeout(cb, millis, timerInfo) { const cancelRid = timerInfo.cancelRid; - const sleepPromise = core.opAsync2("op_sleep", millis, cancelRid); + const sleepPromise = op_sleep(millis, cancelRid); timerInfo.promiseId = sleepPromise[SymbolFor("Deno.core.internalPromiseId")]; if (!timerInfo.isRef) { core.unrefOp(timerInfo.promiseId); |