module: implement Symbol.dispose in ModuleHooks#63928
Open
remcohaszing wants to merge 2 commits into
Open
Conversation
Collaborator
|
Review requested:
|
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>
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
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