diff options
author | Gerhard Stöbich <deb2001-github@yahoo.de> | 2022-03-21 23:35:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-21 23:35:05 +0300 |
commit | da399a6c8e6ed60313ba0d5dae24d55a1a7c2c37 (patch) | |
tree | e2dc164943b0fa76ad5d47ea92ba91c215e36240 /lib | |
parent | 87089bf8c63db4696090b52bd8b2d9794ffe83c2 (diff) |
async_hooks: remove destroyed symbol on Promises
Promises are never destroyed manually therefore it's not needed to
attach an object to track if destroy hook was called already.
PR-URL: https://github.com/nodejs/node/pull/42402
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/async_hooks.js | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index f15fe5cc99b..ebc9254d5c5 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -326,14 +326,10 @@ function promiseInitHookWithDestroyTracking(promise, parent) { destroyTracking(promise, parent); } -const destroyedSymbol = Symbol('destroyed'); - function destroyTracking(promise, parent) { trackPromise(promise, parent); const asyncId = promise[async_id_symbol]; - const destroyed = { destroyed: false }; - promise[destroyedSymbol] = destroyed; - registerDestroyHook(promise, asyncId, destroyed); + registerDestroyHook(promise, asyncId); } function promiseBeforeHook(promise) { |