2011/7/6 Andreas Rossberg <[email protected]>

> While putting together some test cases for Object.keys, I wondered: is
> it intended that property names are always passed to traps as strings?
>

That is indeed the intent.


> It seems like a reasonable assumption, but is not currently the case
> everywhere (e.g. the default implementation for `keys' can violate
> this assumption when passing names to this.getOwnPropertyDescriptor).
>

How so? The default implementation for the keys trap relies on the return
value of the getOwnPropertyNames() trap, whose return value is coerced to an
array of Strings.

Cheers,
Tom


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

Reply via email to