diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-03-01 11:15:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 11:15:18 -0700 |
commit | 736b91edd002ae34082c473b37249f9256a6ba32 (patch) | |
tree | d08c1dfde5777fef622750b166bcf4dc947d22ba /ext/node/polyfills/timers.ts | |
parent | 7ac040833025bf234dec485ddaa6c459b25d2196 (diff) |
perf(cli): use new deno_core timers (#22569)
Improves #19100
Fixes #20356
Replaces #20428
Changes made in deno_core to support this:
- [x] Errors must be handled in setTimeout callbacks
- [x] Microtask ordering is not-quite-right
- [x] Timer cancellation must be checked right before dispatch
- [x] Timer sanitizer
- [x] Move high-res timer to deno_core
- [x] Timers need opcall tracing
Diffstat (limited to 'ext/node/polyfills/timers.ts')
-rw-r--r-- | ext/node/polyfills/timers.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/node/polyfills/timers.ts b/ext/node/polyfills/timers.ts index d87a8b048..9a7d59ab2 100644 --- a/ext/node/polyfills/timers.ts +++ b/ext/node/polyfills/timers.ts @@ -21,7 +21,7 @@ import * as timers from "ext:deno_web/02_timers.js"; const clearTimeout_ = timers.clearTimeout; const clearInterval_ = timers.clearInterval; -const setTimeoutUnclamped = timers.setTimeoutUnclamped; +const setImmediate_ = timers.setImmediate; export function setTimeout( callback: (...args: unknown[]) => void, @@ -76,7 +76,7 @@ export function setImmediate( cb: (...args: unknown[]) => void, ...args: unknown[] ): Timeout { - return setTimeoutUnclamped(cb, 0, ...args); + return setImmediate_(cb, ...args); } export const clearImmediate = clearTimeout; |