Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/
  • Loading branch information
addaleax committed Mar 8, 2019
commit b54f0642418b5f191dab770885b7d5ee90a7f706
7 changes: 4 additions & 3 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,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
Expand Down