Foreach loop in body observer throws class cast exception in chrome
vegegoku opened this issue · 3 comments
vegegoku commented
iterate over a node list received from mutation observer with foreach
for (Node node : nodes) {
}
it throws class cast exception
and this happens when the node is not an element, but a text or comment node
in firefox it works without errors
the solution for this is to use normal loops and do Js.uncheckedCast()
to node, then we check the type of the node if it is an element node.
hpehl commented