Closed
Bug 1642685
Opened 4 years ago
Closed 4 years ago
WeakRef and FinalizationRegistry should preserve DOM wrappers
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
mozilla79
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(2 files)
As pointed out by smaug:
does use of WeakRef force preserving wrappers?
since if not, what happens if one does:
document.body.appendChild(document.createElement("div"));
var w = new WeakRef(document.body.lastChild);
document.body.lastChild certainly stays alive there, but its wrapper may die
when GC runs
A user may observe that the wrapper to the DOM object dies, even though the DOM object itself is still alive.
The same issue applies to objects registered with FinalizationRegistry. The solution is to preserve DOM wrappers in this case, the same as we do for WeakMap keys.
Assignee | ||
Comment 1•4 years ago
|
||
Depends on D77267
Assignee | ||
Comment 2•4 years ago
|
||
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7d6899087a54
WeakRef and FinalizationRegistry should preserve DOM wrappers r=sfink
https://hg.mozilla.org/integration/autoland/rev/8b90826d7abe
Add WeakRef and FinalizationRegistry tests involving DOM objects r=smaug
Comment 4•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7d6899087a54
https://hg.mozilla.org/mozilla-central/rev/8b90826d7abe
Status: NEW → RESOLVED
Closed: 4 years ago
status-firefox79:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in
before you can comment on or make changes to this bug.
Description
•