String(symbol)

Erik Arvidsson erik.arvidsson at gmail.com
Tue Aug 12 13:35:51 PDT 2014


Right now String(symbol) throws because it uses ToString which is spec'ed
to throw.

I'm suggesting that we special case String(value) to do a type check for
Symbol and return the same string as Symbol.prototype.toString.call(value)
does.

https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string-constructor-string-value

The motivation for this is that String(value) is pretty explicit and was in
ES5 a safer way to stringify something than value.toString().

-- 
erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140812/f6d1fef7/attachment.html>


More information about the es-discuss mailing list