The code will be incorrect if you pass any regular object in there. Why should symbol be any different?
 
For me, its throwing behavior is just another thing that could crash server-side node.js process for no good reason.
 
 
 
04.01.2015, 04:44, "Tab Atkins Jr." <[email protected]>:


On Jan 3, 2015 3:38 PM, "Rick Waldron" <[email protected]> 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

,

_______________________________________________
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