mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -05:00
9010b8df53
We can move all promise ID knowledge to deno_core, allowing us to better experiment with promise implementation in deno_core. `{un,}refOpPromise(promise)` is equivalent to `{un,}refOp(promise[promiseIdSymbol])`
12 lines
506 B
TypeScript
12 lines
506 B
TypeScript
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
|
|
import { assertNotEquals, execCode } from "./test_util.ts";
|
|
|
|
Deno.test("[unrefOpPromise] unref'ing invalid ops does not have effects", async () => {
|
|
const [statusCode, _] = await execCode(`
|
|
Deno[Deno.internal].core.unrefOpPromise(new Promise(r => null));
|
|
setTimeout(() => { throw new Error() }, 10)
|
|
`);
|
|
// Invalid unrefOpPromise call doesn't affect exit condition of event loop
|
|
assertNotEquals(statusCode, 0);
|
|
});
|