Changing Array.from to iterators. (#145)

* added our package

* reverted back to old rrweb snapshot

* Array.from does not capture all elements added in the set, we have to manually iterate through the iterator

* package lock
This commit is contained in:
Filip Slatinac
2026-04-01 12:00:00 +08:00
committed by yz-yu
parent 84de337040
commit 39eacdece9

View File

@@ -211,9 +211,11 @@ function initMutationObserver(
});
};
Array.from(movedSet).forEach(pushAdd);
for (var it = movedSet.values(), n = null; (n = it.next().value); ) {
pushAdd(n);
}
Array.from(addedSet).forEach(n => {
for (var it = addedSet.values(), n = null; (n = it.next().value); ) {
if (!isAncestorInSet(droppedSet, n) && !isParentRemoved(removes, n)) {
pushAdd(n);
} else if (isAncestorInSet(movedSet, n)) {
@@ -221,7 +223,7 @@ function initMutationObserver(
} else {
droppedSet.add(n);
}
});
}
while (addQueue.length) {
if (