From 1432c4874581c8f71ddc420b1297a7e85faffeed Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 3 Aug 2020 17:36:42 -0700 Subject: [PATCH] fixup! async_hooks: add AsyncResource.bind utility --- doc/api/async_hooks.md | 6 ++++++ lib/async_hooks.js | 17 ++++++++++++++++- test/parallel/test-asyncresource-bind.js | 11 ++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 4efeee2f6a00c5..ebab01f6f79ed4 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -740,6 +740,9 @@ added: REPLACEME Binds the given function to the current execution context. +The returned function will have an `asyncResource` property referencing +the `AsyncResource` to which the function is bound. + #### `asyncResource.bind(fn)`