Question about [[Enumerate]] and property decision timing

Yusuke SUZUKI utatane.tea at
Sun Aug 9 21:34:00 UTC 2015

Hi forks,

Recently, we implemented Reflect.enumerate in WebKit JSC.
At that time, the question is raised "When are the enumerated keys

For example,

var object = ...;
var iterator = Reflect.enumerate(object);
object.newKey = "hello";
// At that time, is not called yet.
for (var key of iterator) {
    print(key);   // Here, "newKey" should be produced or not?

Seeing the spec, I think it's a little bit ambiguous. (correct?)
In the current WebKit implementation, keys are cached when the iterator is

Does this violate the spec behavior, "The iterator’s next method processes
object properties to determine whether the property key should be returned
as an iterator value. "?

Or, is it implementation dependent because "If new properties are added to
the target object during enumeration, the newly added properties are not
guaranteed to be processed in the active enumeration."?

And is the creation of the iterator by calling [[Enumerate]] included in
"active enumeration"?


Best regards,
Yusuke Suzuki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list