On Aug 26, 2015, at 11:03 AM, Raul-Sebastian Mihăilă wrote:

> In 9.1.11. it's specified that the iterator returned by the [[Enumerate]] 
> method iterates over String-valued keys. But the informative definition at 
> the end of 9.1.11. is based on whatever is returned by calling 
> Reflect.enumerate on the prototype of the current object, assuming that there 
> is such a prototype. 
> 
> If the prototype is a proxy and it's enumerate trap returns an iterator that 
> yields other kind of values than strings, then our original object's 
> [[Enumerate]] method will give us non-string keys as well. And they can be 
> any kind of values, not only symbols.

And the prototype [[Enumerate]] could return the same value multiple times, 
which would also be a violation of the normative requirments expressed in 9.1.11

The final if statement in the informative algorithm should probably be replaced 
by:

```js
if (!visited.has(protoName) && typeof protoName === "string") {
   visited.add(protoName);
   yield protoName;
}
```

I opened a bug for this: https://bugs.ecmascript.org/show_bug.cgi?id=4531 


_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to