Skip to content

Commit d0801a1

Browse files
addaleaxtargos
authored andcommitted
src: deprecate AddPromiseHook()
This API was added to fill an use case that is served by `async_hooks`, since that has `Promise` support. Deprecate this, as the underlying `Isolate::SetPromiseHook()` may be removed in its current form in the future. Refs: https://docs.google.com/document/d/1g8OrG5lMIUhRn1zbkutgY83MiTSMx-0NHDs8Bf-nXxM/ PR-URL: #26529 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent a13f0a6 commit d0801a1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/node.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,10 @@ struct async_context {
597597

598598
/* Registers an additional v8::PromiseHook wrapper. This API exists because V8
599599
* itself supports only a single PromiseHook. */
600-
NODE_EXTERN void AddPromiseHook(v8::Isolate* isolate,
601-
promise_hook_func fn,
602-
void* arg);
600+
NODE_DEPRECATED("Use async_hooks directly instead",
601+
NODE_EXTERN void AddPromiseHook(v8::Isolate* isolate,
602+
promise_hook_func fn,
603+
void* arg));
603604

604605
/* This is a lot like node::AtExit, except that the hooks added via this
605606
* function are run before the AtExit ones and will always be registered

0 commit comments

Comments
 (0)