Automatic update from web-platform-tests
script: More resiliently handle out of order removal / access of `TreeOrderedIndexMap`
Sometimes script will multiple items from the tree, call JavaScript
code, and finally remove some of those removed-from-tree item's `id`s
from the `TreeOrderedIndexMap`. When this happens and a map entry is in
unresolved state, it will try to re-resolve entries accessed during
script execution. During re-resolution we were trying to remove newly
empty entries from the map (regardless of their count), meaning that
when removed-from-tree but not removed-from-map entries have their ids
removed, the map would be in an unexpected state.
This change removes the cleanup code, relying on script to always call
one remove for any addition in order to clean up old entries. This
prevents going into an unreachable code section because a map entry is
always expected when a remove happens.
In short, the previous implementation had a self-healing approach that
could put the `TreeOrderedIndexMap` in an unexpected state, so this
change removes that self-healing code. This shouldn't be an issue as
long as every addition comes with a removal. The failure mode is that
the map has too many entries, which isn't an error, just a little messy.
Some kinds of misuse are already guarded with assertions (the code that
was tripped by this bug).
Signed-off-by: Martin Robinson <martin@abandonedwig.info>
--
wpt-commits: 58c23566f39216a1b0d132dbd66773f40285bcc0
wpt-pr: 60721