JS libs/frameworks (jQuery, Dojo, Lo-Dash, Ember, Angular, ...) have settled on using Object.prototype.toString.call as a way to determine the kind of a value and don't expect that to throw. This is edge case but it seems like an unnecessary gotcha to throw at devs.
- JDD On Fri, Aug 29, 2014 at 11:57 AM, Jason Orendorff <jason.orendo...@gmail.com > wrote: > On Fri, Aug 29, 2014 at 5:09 AM, Andrea Giammarchi > <andrea.giammar...@gmail.com> wrote: > > Wouldn't that be inconsistent with `{}.toString.call(String.prototype)` > and > > all others ? > > It is inconsistent, but it's a change TC39 deliberately chose to take. > > It's a good change. The fact that Date.prototype is a real Date > object, for example, has been a common source of bugs and general > weirdness. > > -j > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss