From 4274542a392d23a2239ed468b5ad00605e63f478 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 cc25699b979956..79f19102b4b755 100644 --- a/src/node.h +++ b/src/node.h @@ -661,9 +661,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