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

Erik Arvidsson erik.arvidsson at gmail.com
Mon Oct 1 08:18:38 PDT 2012


On Sun, Sep 30, 2012 at 1:14 AM, Brendan Eich <brendan at mozilla.org> wrote:
> V8 and SpiderMonkey agree. This avoids making two paths for built-in
> constructor.prototype creation, one that makes a degenerate firstborn of the
> class at hand, the other than makes an Object-instance prototype.

V8 disagrees (like Andreas also pointed out):

> Object.prototype.toString.call(Map.prototype)
'[object Object]'
> Map.prototype.set(1, 2)
TypeError: Method Map.prototype.set called on incompatible receiver #<Map>

I'm with Allen, Andreas and others that the craziness needs to stop.


-- 
erik


More information about the es-discuss mailing list