diff options
author | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2023-02-26 17:34:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-26 17:34:57 +0200 |
commit | e047225620d870b3d29824fadadd952fb4848463 (patch) | |
tree | 9db665c15774baa539ad6b5d3172347795a1e687 /test_ffi/tests/event_loop_integration.ts | |
parent | 29a62e81dd1812dfe8c5f05d9154ab974b330bb9 (diff) |
chore(ext/ffi): Use queueMicrotask in tests (#17954)
Diffstat (limited to 'test_ffi/tests/event_loop_integration.ts')
-rw-r--r-- | test_ffi/tests/event_loop_integration.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test_ffi/tests/event_loop_integration.ts b/test_ffi/tests/event_loop_integration.ts index 28152dabf..55dc563bb 100644 --- a/test_ffi/tests/event_loop_integration.ts +++ b/test_ffi/tests/event_loop_integration.ts @@ -29,7 +29,7 @@ const dylib = Deno.dlopen( let retry = false; const tripleLogCallback = () => { console.log("Sync"); - Promise.resolve().then(() => { + queueMicrotask(() => { console.log("Async"); callback.unref(); }); @@ -66,7 +66,7 @@ console.log("STORED_FUNCTION called"); // Wait to make sure synch logging and async logging await new Promise((res) => setTimeout(res, 100)); -// Ref once to make sure both `Promise.resolve().then()` and `setTimeout()` +// Ref once to make sure both `queueMicrotask()` and `setTimeout()` // must resolve and unref before isolate exists. // One ref'ing has been done by `threadSafe` constructor. callback.ref(); |