[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Do Typed Array need an isArray method?



On Fri, Jun 29, 2012 at 3:20 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 6/29/12 3:12 PM, Kenneth Russell wrote:
>>
>> How does this work for DOM nodes?
>
>
> Which "this"?  If I have a HTML <body> element, then its proto chain is
> HTMLBodyElement.prototype -> HTMLElement.prototype -> Element.prototype ->
> Node.prototype (and then possibly to EventTarget.prototype, depending on
> which version of which spec you read).  And all those interface objects
> exist and can be used as the RHS of instanceof.

Thanks, that's what I was asking.

> For what it's worth, at least some of the SpiderMonkey people I just talked
> to about don't want to do this for typed arrays at all.  They were proposing
> something more like this IDL:
>
>   [NoInterfaceObject]
>   interface ArrayBufferView {
>     // stuff
>   };
>
>   interface Int32Array {
>     // stuff
>   };
>
>   Int32Array implements ArrayBufferView;
>
> That would, of course, keep "instanceof ArrayBufferView" not working....
>
> Personally, I'm planning to stay out of this whole discussion as much as I
> can; I don't actually care which way we go here as long as the end state
> involves the spec and the implementations actually agreeing and a test
> suite.  ;)

I agree that the typed array spec at least has to match the current
reality. Firefox, Opera, Safari and Chrome all agree that
ArrayBufferView is not currently exposed as an interface object, so
http://www.khronos.org/registry/typedarray/specs/latest/ and
http://www.khronos.org/registry/typedarray/specs/latest/typedarray.idl
have been updated making ArrayBufferView [NoInterfaceObject].
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/typedarrays/array-unit-tests.html
now verifies this, as well as the Uint8ClampedArray -> Uint8Array
inheritance.

Please send any feedback to the list.

-Ken

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------