toshok/echo-js — pull request #37 by carlosalberto (2014-07-08 00:00:03+00:00)
Title: Implement iterator support for Set.

Probably the funkiest part is this actual part in the Set_prototype_next method:

/* 10. Repeat while index is less than the total number of elements of entries. The number of elements must
* be redetermined each time this method is evaluated. */
uint32_t i = 0;
for (EJSSetValueEntry *entry = entries; entry; entry = entry->next_insert, i++) {
if (index > i)
continue;

Since we don't have a list/dictionary based one, we cannot do a simple lookup - and anyway, the spec mentions that "The number of elements must be redetermined each time this method is evaluated.".

Comments?