Why is https://searchfox.org/mozilla-central/rev/4bb2401ecbfce89af06fb2b4d0ea3557682bd8ff/dom/base/nsGlobalWindowInner.cpp#6698 safe? Can't something something modify the array while it is being iterated because https://searchfox.org/mozilla-central/rev/4bb2401ecbfce89af06fb2b4d0ea3557682bd8ff/dom/base/nsGlobalWindowInner.cpp#806 calls random JS ?
Bug 1643874 Comment 7 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Why is https://searchfox.org/mozilla-central/rev/4bb2401ecbfce89af06fb2b4d0ea3557682bd8ff/dom/base/nsGlobalWindowInner.cpp#6698 safe? Can't something something modify the array while it is being iterated because https://searchfox.org/mozilla-central/rev/4bb2401ecbfce89af06fb2b4d0ea3557682bd8ff/dom/base/nsGlobalWindowInner.cpp#806 calls random JS ? Or perhaps the whole nsGlobalWindowInner dies. Nothing seems to guarantee it stays alive if somehow unlink happens while JS is called.