2016-10-14 15:05 GMT+02:00 Brian Ninni <ninni.br...@gmail.com>:

> I did a quick search and didn't find any recent mentions of this topic.
>
> On more than one occasion I've had to determine whether something was a
> plain old Object, or some other class. This involves checking that the
> given object was NOT an instanceof any other acceptable class.
>

Does not ```({}).toString.call(o);```work for that?


> Array, RegExp, Function, and Class Literals all already create an Object
> sub-class, so why not Object Literals?
>
> It doesn't have to operate any differently than a standard Object does
> (though it allows room for deviation in the future), just have a different
> constructor so it can easily be determined whether it is a literal or not.
>
> This would break code that uses `obj.constructor === Object`, but that
> code is not always reliable since the 'constructor' property can be
> overwritten without any side-effects anyway.
>
> Are there any other major reasons why this is a bad idea?
>
> _______________________________________________
> 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

Reply via email to