diff options
Diffstat (limited to 'lib/async_hooks.js')
-rw-r--r-- | lib/async_hooks.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/async_hooks.js b/lib/async_hooks.js index d676f6dfcb4..cb017222a9b 100644 --- a/lib/async_hooks.js +++ b/lib/async_hooks.js @@ -36,6 +36,7 @@ const { emitDestroy, enabledHooksExist, initHooksExist, + destroyHooksExist, } = internal_async_hooks; // Get symbols @@ -168,7 +169,7 @@ class AsyncResource { emitInit(asyncId, type, triggerAsyncId, this); } - if (!requireManualDestroy) { + if (!requireManualDestroy && destroyHooksExist()) { // This prop name (destroyed) has to be synchronized with C++ const destroyed = { destroyed: false }; this[destroyedSymbol] = destroyed; |