From 2192f95db8d643dce43b4c0d7572a2275793dd59 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 27 Mar 2022 16:11:48 -0700 Subject: [PATCH 1/2] doc: fix comment text in async_hooks example --- doc/api/async_hooks.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 9582db77da8803..3395c33b589691 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -59,23 +59,23 @@ asyncHook.disable(); // The following are the callbacks that can be passed to createHook(). // -// init is called during object construction. The resource may not have -// completed construction when this callback runs, therefore all fields of the +// init() is called during object construction. The resource may not have +// completed construction when this callback runs. Therefore, all fields of the // resource referenced by "asyncId" may not have been populated. function init(asyncId, type, triggerAsyncId, resource) { } -// Before is called just before the resource's callback is called. It can be +// before() is called just before the resource's callback is called. It can be // called 0-N times for handles (such as TCPWrap), and will be called exactly 1 // time for requests (such as FSReqCallback). function before(asyncId) { } -// After is called just after the resource's callback has finished. +// after() is called just after the resource's callback has finished. function after(asyncId) { } -// Destroy is called when the resource is destroyed. +// destroy() is called when the resource is destroyed. function destroy(asyncId) { } -// promiseResolve is called only for promise resources, when the +// promiseResolve() is called only for promise resources, when the // `resolve` function passed to the `Promise` constructor is invoked // (either directly or through other means of resolving a promise). function promiseResolve(asyncId) { } @@ -107,23 +107,23 @@ asyncHook.disable(); // The following are the callbacks that can be passed to createHook(). // -// init is called during object construction. The resource may not have -// completed construction when this callback runs, therefore all fields of the +// init() is called during object construction. The resource may not have +// completed construction when this callback runs. Therefore, all fields of the // resource referenced by "asyncId" may not have been populated. function init(asyncId, type, triggerAsyncId, resource) { } -// Before is called just before the resource's callback is called. It can be +// before() is called just before the resource's callback is called. It can be // called 0-N times for handles (such as TCPWrap), and will be called exactly 1 // time for requests (such as FSReqCallback). function before(asyncId) { } -// After is called just after the resource's callback has finished. +// after() is called just after the resource's callback has finished. function after(asyncId) { } -// Destroy is called when the resource is destroyed. +// destroy() is called when the resource is destroyed. function destroy(asyncId) { } -// promiseResolve is called only for promise resources, when the +// promiseResolve() is called only for promise resources, when the // `resolve` function passed to the `Promise` constructor is invoked // (either directly or through other means of resolving a promise). function promiseResolve(asyncId) { } From 364eaa653e8d1e0b337e0964c7371b7ad112568c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 29 Mar 2022 08:47:05 -0700 Subject: [PATCH 2/2] Update async_hooks.md --- doc/api/async_hooks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 3395c33b589691..4a6af435299a25 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -76,7 +76,7 @@ function after(asyncId) { } function destroy(asyncId) { } // promiseResolve() is called only for promise resources, when the -// `resolve` function passed to the `Promise` constructor is invoked +// resolve() function passed to the Promise constructor is invoked // (either directly or through other means of resolving a promise). function promiseResolve(asyncId) { } ``` @@ -124,7 +124,7 @@ function after(asyncId) { } function destroy(asyncId) { } // promiseResolve() is called only for promise resources, when the -// `resolve` function passed to the `Promise` constructor is invoked +// resolve() function passed to the Promise constructor is invoked // (either directly or through other means of resolving a promise). function promiseResolve(asyncId) { } ```