Implicit coercion of Symbols
Tab Atkins Jr.
jackalmage at gmail.com
Sat Jan 3 17:43:50 PST 2015
On Jan 3, 2015 3:38 PM, "Rick Waldron" <waldron.rick at gmail.com> wrote:
> E. W/r to A and C, most code will need some kind of guard, just to avoid
the exception, ie. either try/catch or `if (typeof s !== "symbol") ...`
This isn't a cost introduced by the throwing behavior, it's one that'll
have to happen in code regardless of what we decide, or else the code will
be incorrect. You can never construct modified keys from a Symbol by
concatenation, even if it stringifies.
So your code either needs to be sure it won't be passed a Symbol, or else
it needs to branch its behavior.
~TJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150103/3f1399b6/attachment.html>
More information about the es-discuss
mailing list