On Mon, Apr 2, 2012 at 4:36 PM, Cameron McCormack <cam@mcc.id.au> wrote:
>
> Boris Zbarsky:
>
>> The current IDL is:
>>
>> Â DOMString[ ] getSupportedExtensions();
>>
>> It's not quite obvious to me where the IDL array comes from in this
>> case. Â In particular, I believe that needs to be defined so that the
>> steps in http://dev.w3.org/2006/webapi/WebIDL/#es-array for converting
>> to an ECMAScript value can work:
>>
>> Â Â 1) If V is already represented by a platform array object, then the
>> Â Â Â ECMAScript value is that platform array object.
>> Â Â 2) Otherwise, the ECMAScript value is a newly created platform array
>> Â Â Â object that represents V.
>>
>> Without knowing whether the IDL array value is reused across invocations
>> or created anew every time, it's impossible to make the decision step 1
>> requires to be made. Â Unless I'm missing something?
>
>
> You are right that that would need to be defined.
>
>
>> It seems to me that all the questions here would be sidestepped if this
>> function returned sequence<DOMString>, but if it needs to keep returning
>> an array there's a lot more behavior-defining that needs to happen.
>> Again, unless I'm missing something.
>
>
> I agree, I think it should just return a sequence<DOMString>, then you'll
> get a JS Array object back.
Thanks for the feedback. Changed to return sequence<DOMString>. The
reason it returned DOMString[] was due to a global change throughout
the WebGL spec at one point from sequence<T> to T[]. Looks like this
particular conversion was wrong. If you find others please do post.
Cameron, I'd like to add you to the acknowledgments of the spec.
What's your affiliation? Mozilla, other, none?
-Ken