diff options
Diffstat (limited to 'ext/web/02_timers.js')
-rw-r--r-- | ext/web/02_timers.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/web/02_timers.js b/ext/web/02_timers.js index 6fc03dd10..0687c9a71 100644 --- a/ext/web/02_timers.js +++ b/ext/web/02_timers.js @@ -1,7 +1,12 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, primordials } from "ext:core/mod.js"; -const ops = core.ops; +const { + op_now, + op_sleep, + op_timer_handle, + op_void_async_deferred, +} = core.ensureFastOps(); const { ArrayPrototypePush, ArrayPrototypeShift, @@ -19,15 +24,15 @@ const { TypeError, indirectEval, } = primordials; + 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, op_void_async_deferred } = core.ensureFastOps(); const hrU8 = new Uint8Array(8); const hr = new Uint32Array(TypedArrayPrototypeGetBuffer(hrU8)); function opNow() { - ops.op_now(hrU8); + op_now(hrU8); return (hr[0] * 1000 + hr[1] / 1e6); } @@ -111,7 +116,7 @@ function initializeTimer( // TODO(@andreubotella): Deal with overflow. // https://github.com/whatwg/html/issues/7358 id = nextId++; - const cancelRid = ops.op_timer_handle(); + const cancelRid = op_timer_handle(); timerInfo = { cancelRid, isRef: true, promise: null }; // Step 4 in "run steps after a timeout". |