Bug 1466071: Part 1: Prevent orderedWindows from changing while iterating. r=mikedeboer

--HG--
extra : histedit_source : fb13804cd558861c9a483a10e8451c571c4325c4
This commit is contained in:
Adam Gashlin 2018-06-05 13:47:58 -07:00
Родитель 00974991a2
Коммит 54b423cf8e
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -211,7 +211,9 @@ this.BrowserWindowTracker = {
*/
orderedWindows: {
* [Symbol.iterator]() {
for (let window of _trackedWindows)
// Clone the windows array immediately as it may change during iteration,
// we'd rather have an outdated order than skip/revisit windows.
for (let window of [..._trackedWindows])
yield window;
}
},