diff options
-rw-r--r-- | ext/node/polyfills/async_hooks.ts | 2 | ||||
-rw-r--r-- | tests/unit_node/async_hooks_test.ts | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ext/node/polyfills/async_hooks.ts b/ext/node/polyfills/async_hooks.ts index e8960c4dc..f94b8d2c6 100644 --- a/ext/node/polyfills/async_hooks.ts +++ b/ext/node/polyfills/async_hooks.ts @@ -207,6 +207,8 @@ export class AsyncResource { } } + emitDestroy() {} + bind(fn: (...args: unknown[]) => unknown, thisArg = this) { validateFunction(fn, "fn"); const frame = AsyncContextFrame.current(); diff --git a/tests/unit_node/async_hooks_test.ts b/tests/unit_node/async_hooks_test.ts index 8d94180cf..46d7dd785 100644 --- a/tests/unit_node/async_hooks_test.ts +++ b/tests/unit_node/async_hooks_test.ts @@ -130,3 +130,8 @@ Deno.test(function asyncResourceStub() { const resource = new AsyncResource("dbquery"); assert(typeof resource.asyncId() === "number"); }); + +Deno.test(function emitDestroyStub() { + const resource = new AsyncResource("foo"); + assert(typeof resource.emitDestroy === "function"); +}); |