diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2020-03-19 07:45:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-19 10:45:28 -0400 |
commit | 2f3de4b4252b933ac1161ba099feaed9103ab149 (patch) | |
tree | 762b05bcfe9588897b157400b2723fadf43dc94c /cli/js/runtime.ts | |
parent | 8c1c929034d46101b6a51ec5cf5e2f307ed0c271 (diff) |
Simplify timer with macrotask callback (#4385)
Diffstat (limited to 'cli/js/runtime.ts')
-rw-r--r-- | cli/js/runtime.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/js/runtime.ts b/cli/js/runtime.ts index db755d954..d586503af 100644 --- a/cli/js/runtime.ts +++ b/cli/js/runtime.ts @@ -7,6 +7,7 @@ import { setBuildInfo } from "./build.ts"; import { setVersions } from "./version.ts"; import { setPrepareStackTrace } from "./error_stack.ts"; import { Start, start as startOp } from "./ops/runtime.ts"; +import { handleTimerMacrotask } from "./web/timers.ts"; export let OPS_CACHE: { [name: string]: number }; @@ -27,6 +28,7 @@ export function initOps(): void { for (const [name, opId] of Object.entries(OPS_CACHE)) { core.setAsyncHandler(opId, getAsyncHandler(name)); } + core.setMacrotaskCallback(handleTimerMacrotask); } export function start(source?: string): Start { |