A new ES6 draft is available

Brendan Eich brendan at mozilla.com
Tue Oct 1 10:33:15 PDT 2013


Allen Wirfs-Brock wrote:
>> Currently, that works for everything but null
>> >  and undefined, so I assume that this pattern is used quite a bit.
>
> Do you think it really is?

I don't. (That is, I don't see much x.toString() feeding into bracketed 
property lookup, if any.)

Explicit .toString() calling is rare because verbose, in addition to 
throwing on null and undefined. People use + ''. But that's covered, and 
I say if someone has a symbol named x (whether they know it's a symbol 
or "any") and they call .toString(), they should get what they're asking 
for: throw on null or undefined (or a misbehaving impl), otherwise a string.

/be


More information about the es-discuss mailing list