You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would seem more intuitive that, for example, Intl.Collator[Symbol.toStringTag] would be "Intl.Collator". Is this done for compatibility reasons, where we're aware of a site that depends on toString() on Intl objects returning "[Object object]"? For new APIs, should we use "Object" or the name of the class, if we're not constrained by compatibility?
The text was updated successfully, but these errors were encountered:
When the first edition of ECMA-402 was done it was targeting ES5.1. Prior to ES6 we didn't have an extensibility mechanism (eg, Symbol.toStringTag) for userland extensions to Object.prototype.toString. So, the various Intl objects just inherited the default "[Object object]" behavior.
While it would technically be a breaking change, my guess is that we could get away with giving these objects a more meaningful toStringTag value as "[Object object]" is not a very useful discriminator.
It would seem more intuitive that, for example,
Intl.Collator[Symbol.toStringTag]
would be"Intl.Collator"
. Is this done for compatibility reasons, where we're aware of a site that depends ontoString()
on Intl objects returning"[Object object]"
? For new APIs, should we use"Object"
or the name of the class, if we're not constrained by compatibility?The text was updated successfully, but these errors were encountered: