From d0801a1c4a45946edccd9707e521b4b238750f6e Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 8 Mar 2019 18:15:49 +0100 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/26529 Reviewed-By: Matteo Collina Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- src/node.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/node.h b/src/node.h index dffeb2b9cd7fc7..06b8bd0ff58bea 100644 --- a/src/node.h +++ b/src/node.h @@ -597,9 +597,10 @@ struct async_context { /* Registers an additional v8::PromiseHook wrapper. This API exists because V8 * itself supports only a single PromiseHook. */ -NODE_EXTERN void AddPromiseHook(v8::Isolate* isolate, - promise_hook_func fn, - void* arg); +NODE_DEPRECATED("Use async_hooks directly instead", + NODE_EXTERN void AddPromiseHook(v8::Isolate* isolate, + promise_hook_func fn, + void* arg)); /* This is a lot like node::AtExit, except that the hooks added via this * function are run before the AtExit ones and will always be registered