Closed
Conversation
Member
Author
|
The motivation for this is:
|
f3d27aa to
cc5c8bb
Compare
Collaborator
Member
Author
jasnell
approved these changes
Dec 24, 2020
benjamingr
commented
Dec 24, 2020
aduh95
reviewed
Dec 26, 2020
Member
Author
|
I need to think about this more. |
Member
Author
|
Re-applied the changes with weak event handlers based on the comment (using an object as the retainer key) |
cc5c8bb to
512ea05
Compare
Member
Author
Collaborator
aduh95
reviewed
Feb 4, 2021
Contributor
|
Do you plan to add documentation for this feature? |
Member
Author
Not really since this feature is internal to core - users cannot create weak listeners. This is because that is a spec requirement (we cannot add things to the standard EventTarget). In the future - I'd like to use the mechanics of this in several utilities (and internally) namely:
|
512ea05 to
1814443
Compare
Collaborator
Member
Author
devsnek
approved these changes
Feb 6, 2021
benjamingr
added a commit
that referenced
this pull request
Feb 6, 2021
PR-URL: #36607 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Member
Author
|
Landed in 5ef4c64 🎉 |
danielleadams
pushed a commit
that referenced
this pull request
Feb 16, 2021
PR-URL: #36607 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
debadree25
added a commit
to debadree25/node
that referenced
this pull request
Feb 4, 2023
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 is a first attempt at "weak listeners".
Still a draft since I have no idea how to test this :] Do we have any idea how to test WeakRefs?EDIT: added a test.Also still playing with this - but I think this is generally very useful and I will move certain APIs to it.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes