hal/elemento

Foreach loop in body observer throws class cast exception in chrome

vegegoku opened this issue · 3 comments

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

3519d78 should fix the issue. @vegegoku could you please test if that works for you?

@hpehl this works now, thank you so much.

hpehl commented

Fixed by 3519d78