Same question here.
AFAIK usually the `({}.toString.call(generic) === "[object Object]")` check
is the `default:` in a switch, the last `else` in a flow, etc etc ...
although I wouldn't be surprised if some code, somewhere, would do strict
comparison to know if it's a user defined object or not. In that case there
will be problems.
To be honest I also don't see much advantage in having this configurable
when `obj.constructor.displayName` or `obj.constructor.name` can be checked
instead and eventually fallback into `Object.prototype.toString.call(obj)`
This will work backward compatible too
br
On Tue, Dec 2, 2014 at 12:03 PM, Claude Pache <[email protected]>
wrote:
>
> Le 2 déc. 2014 à 09:04, Michał Wadas <[email protected]> a écrit :
>
> It probably would be backward incompatible change. Too much code depends
> on [Object Object].
>
> I'm curious to know what sort of code would be broken by
> `O.p.toString.call(x) === "[object Point]"` for instances `x` of some
> user-defined class? and whether it is not already broken by, say,
> `O.p.toString.call(new Set) === "[object Set]"`?
>
> —Claude
>
>
> _______________________________________________
> 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