luwes / js-diff-benchmark

Simple benchmark for testing your DOM diffing algorithm.
66 stars 5 forks source link

Avoid Dommy throwing on same node #3

Closed WebReflection closed 4 years ago

WebReflection commented 4 years ago

The insertBefore operation doesn't throw on the real DOM, so it shouldn't here as well.

Basically, if the node is the same, for whatever reason, the Dommy throws an error, which shouldn't, but it also shouldn't remove the node from its index, as no change happens whatsoever, and it ends up in the broken path.

This might also solve the snabdom failing with shuffled nodes, but I haven't tested.