Foreach loop in body observer throws class cast exception in chrome
vegegoku opened this issue · comments
Ahmad K. Bawaneh 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.
Harald Pehl commented
Ahmad K. Bawaneh commented
@hpehl this works now, thank you so much.
Harald Pehl commented
Fixed by 3519d78