diff options
Diffstat (limited to 'ext/node/polyfills/_next_tick.ts')
-rw-r--r-- | ext/node/polyfills/_next_tick.ts | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/ext/node/polyfills/_next_tick.ts b/ext/node/polyfills/_next_tick.ts index 5d895012e..5915c750e 100644 --- a/ext/node/polyfills/_next_tick.ts +++ b/ext/node/polyfills/_next_tick.ts @@ -5,10 +5,6 @@ // deno-lint-ignore-file prefer-primordials import { core } from "ext:core/mod.js"; -import { - getAsyncContext, - setAsyncContext, -} from "ext:runtime/01_async_context.js"; import { validateFunction } from "ext:deno_node/internal/validators.mjs"; import { _exiting } from "ext:deno_node/_process/exiting.ts"; @@ -17,7 +13,6 @@ import { FixedQueue } from "ext:deno_node/internal/fixed_queue.ts"; interface Tock { callback: (...args: Array<unknown>) => void; args: Array<unknown>; - snapshot: unknown; } let nextTickEnabled = false; @@ -28,7 +23,7 @@ export function enableNextTick() { const queue = new FixedQueue(); export function processTicksAndRejections() { - let tock: Tock; + let tock; do { // deno-lint-ignore no-cond-assign while (tock = queue.shift()) { @@ -36,11 +31,9 @@ export function processTicksAndRejections() { // const asyncId = tock[async_id_symbol]; // emitBefore(asyncId, tock[trigger_async_id_symbol], tock); - const oldContext = getAsyncContext(); try { - setAsyncContext(tock.snapshot); - const callback = tock.callback; - if (tock.args === undefined) { + const callback = (tock as Tock).callback; + if ((tock as Tock).args === undefined) { callback(); } else { const args = (tock as Tock).args; @@ -65,7 +58,6 @@ export function processTicksAndRejections() { // FIXME(bartlomieju): Deno currently doesn't support async hooks // if (destroyHooksExist()) // emitDestroy(asyncId); - setAsyncContext(oldContext); } // FIXME(bartlomieju): Deno currently doesn't support async hooks @@ -151,7 +143,6 @@ export function nextTick<T extends Array<unknown>>( // FIXME(bartlomieju): Deno currently doesn't support async hooks // [async_id_symbol]: asyncId, // [trigger_async_id_symbol]: triggerAsyncId, - snapshot: getAsyncContext(), callback, args: args_, }; |