mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
refactor(core): validate promise id in refOp (#13905)
This commit is contained in:
parent
f9b4d262b3
commit
b198bfd795
5 changed files with 59 additions and 20 deletions
10
cli/tests/unit/ref_unref_test.ts
Normal file
10
cli/tests/unit/ref_unref_test.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { assertNotEquals, execCode } from "./test_util.ts";
|
||||
|
||||
Deno.test("[unrefOp] unref'ing invalid ops does not have effects", async () => {
|
||||
const [statusCode, _] = await execCode(`
|
||||
Deno.core.unrefOp(-1);
|
||||
setTimeout(() => { throw new Error() }, 10)
|
||||
`);
|
||||
// Invalid unrefOp call doesn't affect exit condition of event loop
|
||||
assertNotEquals(statusCode, 0);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue