summaryrefslogtreecommitdiff
path: root/ext/web/02_timers.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2024-01-11 07:37:25 +0900
committerGitHub <noreply@github.com>2024-01-10 15:37:25 -0700
commit515a34b4de222e35c7ade1b92614d746e73d4c2e (patch)
tree8284201fc826a33f12597959a8a8be14e0f524bd /ext/web/02_timers.js
parentd4893eb51a01c5a692d8ca74a3b8ff95c5fd1d9f (diff)
refactor: use `core.ensureFastOps()` (#21888)
Diffstat (limited to 'ext/web/02_timers.js')
-rw-r--r--ext/web/02_timers.js13
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".