module: implement Symbol.dispose in ModuleHooks - #63928
Merged
nodejs-github-bot merged 2 commits intoJul 26, 2026
Merged
Conversation
Collaborator
|
Review requested:
|
remcohaszing
force-pushed
the
module-register-hooks-disposable
branch
from
June 15, 2026 13:53
5dd9b5d to
73e5743
Compare
This change implements the `Symbol.dispose` key in the `ModuleHooks` class as an alias for deregister. This makes `registerHooks` work with the `using` keyword. Fixes: nodejs#63846 Signed-off-by: Remco Haszing <remcohaszing@gmail.com>
remcohaszing
force-pushed
the
module-register-hooks-disposable
branch
from
June 15, 2026 14:29
73e5743 to
c0c9ee7
Compare
jsumners-nr
approved these changes
Jun 15, 2026
Renegade334
approved these changes
Jun 17, 2026
Collaborator
JakobJingleheimer
approved these changes
Jun 21, 2026
aduh95
reviewed
Jun 21, 2026
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Renegade334
approved these changes
Jul 10, 2026
Comment on lines
244
to
+248
| * Returns: {Object} An object with the following property: | ||
| * `deregister()` {Function} Remove the registered hooks so that they are no | ||
| longer called. Hooks are otherwise retained for the lifetime of the running | ||
| process. | ||
| * `[Symbol.dispose]` {Function} The same as `deregister`. |
Member
There was a problem hiding this comment.
Nit: This is probably at the stage where it would be best to document a non-directly-constructable ModuleHooks class with proper instance methods. Can be a follow-up though.
Collaborator
Collaborator
|
Landed in 2c4ea73 |
aduh95
pushed a commit
that referenced
this pull request
Aug 3, 2026
This change implements the `Symbol.dispose` key in the `ModuleHooks` class as an alias for deregister. This makes `registerHooks` work with the `using` keyword. Fixes: #63846 Signed-off-by: Remco Haszing <remcohaszing@gmail.com> PR-URL: #63928 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Jacob Smith <jacob@frende.me>
aduh95
pushed a commit
that referenced
this pull request
Aug 4, 2026
This change implements the `Symbol.dispose` key in the `ModuleHooks` class as an alias for deregister. This makes `registerHooks` work with the `using` keyword. Fixes: #63846 Signed-off-by: Remco Haszing <remcohaszing@gmail.com> PR-URL: #63928 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Jacob Smith <jacob@frende.me>
nodejs-github-bot
added a commit
that referenced
this pull request
Aug 4, 2026
Notable changes: build: * (SEMVER-MINOR) perfetto-sdk (Chengzhong Wu) #64565 crypto: * (SEMVER-MINOR) support loading private keys through STORE loaders (Filip Skokan) #63949 * update root certificates to NSS 3.125 (Node.js GitHub Bot) #64746 doc: * (SEMVER-MINOR) formalize fn/name as part of TestOptions API (Christopher Hiller) #64946 lib: * (SEMVER-MINOR) add perfetto support (Chengzhong Wu) #64565 module: * (SEMVER-MINOR) implement Symbol.dispose in ModuleHooks (Remco Haszing) #63928 net: * (SEMVER-MINOR) add experimental net/promises API (Ethan Arrowood) #63965 src: * (SEMVER-MINOR) add perfetto trace agent (Chengzhong Wu) #64565 * (SEMVER-MINOR) rename legacy trace event headers (Chengzhong Wu) #64565 * (SEMVER-MINOR) fix trace macro compatibility (Chengzhong Wu) #64565 test_runner: * (SEMVER-MINOR) add support for --test-coverage-include-all (avivkeller) #64830 PR-URL: #65027
aduh95
pushed a commit
that referenced
this pull request
Aug 4, 2026
Notable changes: crypto: * (SEMVER-MINOR) support loading private keys through STORE loaders (Filip Skokan) #63949 * update root certificates to NSS 3.125 (Node.js GitHub Bot) #64746 lib: * (SEMVER-MINOR) add perfetto support (Chengzhong Wu) #64565 module: * (SEMVER-MINOR) implement `Symbol.dispose` in ModuleHooks (Remco Haszing) #63928 net: * (SEMVER-MINOR) add experimental `node:net/promises` API (Ethan Arrowood) #63965 test_runner: * (SEMVER-MINOR) add support for `--test-coverage-include-all` (avivkeller) #64830 PR-URL: #65027
aduh95
added a commit
that referenced
this pull request
Aug 5, 2026
Notable changes: crypto: * (SEMVER-MINOR) support loading private keys through STORE loaders (Filip Skokan) #63949 * update root certificates to NSS 3.125 (Node.js GitHub Bot) #64746 lib: * (SEMVER-MINOR) add perfetto support (Chengzhong Wu) #64565 module: * (SEMVER-MINOR) implement `Symbol.dispose` in ModuleHooks (Remco Haszing) #63928 test_runner: * (SEMVER-MINOR) add support for `--test-coverage-include-all` (avivkeller) #64830 PR-URL: #65027
aduh95
added a commit
that referenced
this pull request
Aug 5, 2026
Notable changes: crypto: * (SEMVER-MINOR) support loading private keys through STORE loaders (Filip Skokan) #63949 * update root certificates to NSS 3.125 (Node.js GitHub Bot) #64746 lib: * (SEMVER-MINOR) add perfetto support (Chengzhong Wu) #64565 module: * (SEMVER-MINOR) implement `Symbol.dispose` in ModuleHooks (Remco Haszing) #63928 test_runner: * (SEMVER-MINOR) add support for `--test-coverage-include-all` (avivkeller) #64830 PR-URL: #65027
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change implements the
Symbol.disposekey in theModuleHooksclass as an alias for deregister. This makesregisterHookswork with theusingkeyword.Fixes: #63846