On 11/22/13 9:40 AM, Benjamin Smedberg wrote:
Is for..of on live DOM nodelists supposed to correctly iterate even when
items are removed from the list?

I believe the current behavior is identical to what would happen with an array here. Consider http://jsfiddle.net/hpmHg/3/

The core issue here is that for..of iteration does NOT snapshot anything (unlike for..in iteration).

We could change the iterator to somehow adjust its position internally on DOM mutations, but defining exactly how that should work is not quite trivial.

Is there a simple way to do this correctly?

  for (var x of Array.from(list))

to explicitly snapshot? Cross-browser compat might not be great so far, but it's not for for..of either.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to