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

Brendan Eich brendan at
Sun Sep 30 10:08:08 PDT 2012

Rick Waldron wrote:
> Using the prototype object here:
> But it's really usecase dependent, sorry for the noise

It's a who-cares for sure -- typed arrays are rolling, even in IE10 
(could someone please test the above there). But implementors if not 
users, and of course the spec, must care.

js> var list = [Array, Boolean, Date, Error, Function, JSON, Math, 
Number, Object, RegExp, String]
js> for (cls of list) if ('prototype' in cls) print(, 
Boolean false
Date NaN
Error Error
Function function () {
Number 0
Object [object Object]
RegExp /(?:)/

If the way to reconcile things is to make it unobservable whether 
C.prototype is a firstborn instance of C (possibly degenerate/useless) 
or an Object with @@toStringTag and any other such symbol-named 
decorations to satisfy observable equivalence, then we should do so for 
new built-ins too, including the typed array constructors folded into 
binary data.


More information about the es-discuss mailing list