This prints x, y, reached. It should only print x. It should not reach the step with y, since y has been deleted before it gets to that iteration of the loop. The spec is pretty loose here, but does not allow this behavior: in #sec-enumerate-object-properties, it says "A property that is deleted before it is processed by the iterator's next method is ignored." No other engine has this behavior, though see related spidermonkey bug - spidermonkey exhibits this behavior when iterating over proxy objects, even those which are totally transparent.
See also (and please comment on) this open spec bug about more precisely specifying the behavior of for-in, which prompted the investigation which lead me to discovering this: tc39/ecma262#1281
PS: @patrick-soquet, thanks for adding moddable support to eshost! It makes it much, much more likely I'll find and file bugs like this.
The text was updated successfully, but these errors were encountered: