diff --git a/doc/api/v8.md b/doc/api/v8.md index efa153d6fc7592..ab7e71bc97e459 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -625,6 +625,7 @@ stopHookSet(); ``` ### `promiseHooks.onInit(init)` + @@ -648,6 +649,7 @@ const stop = promiseHooks.onInit((promise, parent) => {}); ``` ### `promiseHooks.onSettled(settled)` + @@ -672,6 +674,7 @@ const stop = promiseHooks.onSettled((promise) => {}); ``` ### `promiseHooks.onBefore(before)` + @@ -696,6 +699,7 @@ const stop = promiseHooks.onBefore((promise) => {}); ``` ### `promiseHooks.onAfter(after)` + @@ -720,6 +724,7 @@ const stop = promiseHooks.onAfter((promise) => {}); ``` ### `promiseHooks.createHook(callbacks)` + @@ -776,7 +781,7 @@ not necessarily ever even be garbage collected. Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and -`settled()` callbacks *must not* be async functions as they create more +`settled()` callbacks _must not_ be async functions as they create more promises which would produce an infinite loop. While this API is used to feed promise events into [`async_hooks`][], the