You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement Symbol.dispose in registerHooks() #63846
This was also suggested in #55698 (comment), but that was over a year ago. Times have changed. I’d like to believe the using keyword will start to become more integrated.
What is the feature you are proposing to solve the problem?
I suggest to replace the module.registerHooks() return value with a disposable (object with a Symbol.dispose key).
What alternatives have you considered?
Alternatively the return deregister value can be kept as a function, but this function could be assigned the Symbol.dispose key, which would be a reference to itself.
Activity
bakkot commentedon Jun 13, 2026
It already returns an object, not a function, so you'd just need to add a
[Symbol.dispose]()method on that class as an alias forthis.deregister().module: implement Symbol.dispose in ModuleHooks
module: implement Symbol.dispose in ModuleHooks
module: implement Symbol.dispose in ModuleHooks