Must built-in prototypes also be valid instances? (Was: Why DataView.prototype object's [[Class]] is "Object"?)

Brendan Eich brendan at mozilla.com
Mon Oct 1 22:37:57 PDT 2012


Brendan Eich wrote:
> But if we have a solid branding mechanism (like Domado's ideal in 
> latest browsers? ;-) then that should be used universally and this 
> becomes a don't-care. 

Just to be crystal clear:

* in pre-ES6 browsers, no @@toStringTag in the language to hack around with. 


* in ES6+ browsers, the better branding mechanism and @toStringTag (one 
@) as public symbol, no worries.

Yes, this makes a fork in JS code that wants to do tag testing. Old code 
must use O_p_toString_call (original value of, safe call binding) and 
string compare. New code wants the better and universal scheme.

/be


More information about the es-discuss mailing list