diff options
Diffstat (limited to 'ext/node/polyfills/async_hooks.ts')
-rw-r--r-- | ext/node/polyfills/async_hooks.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/node/polyfills/async_hooks.ts b/ext/node/polyfills/async_hooks.ts index d60334346..ea0bfb944 100644 --- a/ext/node/polyfills/async_hooks.ts +++ b/ext/node/polyfills/async_hooks.ts @@ -316,6 +316,17 @@ export class AsyncLocalStorage { ); Scope.enter(frame); } + + static bind(fn: (...args: unknown[]) => unknown) { + return AsyncResource.bind(fn); + } + + static snapshot() { + return AsyncLocalStorage.bind(( + cb: (...args: unknown[]) => unknown, + ...args: unknown[] + ) => cb(...args)); + } } export function executionAsyncId() { |