summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/async_hooks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/async_hooks.ts')
-rw-r--r--ext/node/polyfills/async_hooks.ts11
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() {