Re: Arrays in WebIDL aren't making sense to me so far

On 4/2/12 8:38 PM, Cameron McCormack wrote:
> Boris Zbarsky:
>>> var a1 = myB.range(1, 5);
>>> assert(a1[0] == 1);
>>> myB.incrementAll(a);
>>
>> This would create a copy of "a" and pass that to myB, as currently
>> specced.
>
> Ah, that is definitely a bug. The conversion steps in #es-array need to
> check if the ECMAScript value is a reference to a platform array object
> of the right type first, and just return that if it is.

That would make a lot more sense, yes.  You need an actual bug report, 
or is this thread, enough?

I think that works.  In practice, having different types for "array that 
you might have to hand back sometime" (which would require creation of 
an actual platform array object) and "array that you just need to hold 
on to" (which doesn't really) would be nice for my purposes, but I might 
be able to fake it with annotations in IDL.

-Boris

Received on Tuesday, 3 April 2012 15:19:10 UTC