Rick Waldron (2015-01-03T21:38:17.000Z)
d at domenic.me (2015-01-12T17:53:37.432Z)
Right, but regardless of how the potential footgun is loaded, the exception is the divergence. That specifically is what I want us to look at—is this the right thing to do here? Currently, user code can do things like this: ```js var a = {}; //... sometime later... a[o + "_idfoobarwhatever"] = "my important stuff"; ``` And even if `o` isn't a what the author expected, execution proceeds. I still think that the exception is a good path forward, but I may not be right about that. The exception... A. Requires user code to be more thoroughly tested—which is a good thing, but inexperienced programmers won't think so. B. Diverges from the well known implicit coercion behaviors that the language has had for 20 years (@Brendan: sorry for the reminder ;). This is arguably both a good thing and a bad thing (C, D, E, F) C. Prevents user code from doing the wrong thing (assuming that A is adhered to). D. Produces a surprising behavior (in comparison to all other implicit coercion operations) 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") ...` F. Not directly related, but querySelectorAll(...) throws if the selector is invalid, which is widely considered a poor design choice for that API. This is something that _all_ DOM-centric libraries paper over, because authors would prefer that an invalid selector simply produce the equivalent of "no found elements", than throwing an exception. Subjectively: I think it's nice in theory, but bad in practice.