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

Rick Waldron waldron.rick at gmail.com
Sat Sep 29 19:26:39 PDT 2012


On Sat, Sep 29, 2012 at 6:19 PM, Brendan Eich <brendan at mozilla.org> wrote:

> Allen Wirfs-Brock wrote:
>
>> My intention, subject to feedback here and from TC39,  is to follow the
>> pattern I used for Map as much as possible.  However, TypedArray object are
>> all ready implemented by all major browsers to that may limit how we apply
>> it to them.
>>
>
> Implementations differ:
>
> javascript:alert(Object.**prototype.toString.call(**
> Uint8Array.prototype).slice(8,**-1))
>
> in Opera says "Uint8Array", while in Firefox and Safari it says
> "Uint8ArrayPrototype". Chrome says "Object". I can't test IE here.
>

How common is that? Generally the [[Class]] (NativeBrand?) is derived via

Object.**prototype.toString.call(**Uint8Array).slice(8,**-1)

(sans .prototype)

Rick



>
> The typed array (http://www.khronos.org/**registry/typedarray/specs/**
> latest/ <http://www.khronos.org/registry/typedarray/specs/latest/>) does
> not specify.
>
> /be
>
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120929/9ec610a5/attachment.html>


More information about the es-discuss mailing list