W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2012

Re: Omissions in IDL sequence and IDL array conversion to ES array

From: James Graham <jgraham@opera.com>
Date: Tue, 03 Jan 2012 16:39:56 +0100
Message-ID: <4F03214C.3060005@opera.com>
To: public-script-coord@w3.org
On 01/03/2012 02:12 PM, João Eiras wrote:
>
> Hi.
>
> I have some questions about the following two sections
> * http://dev.w3.org/2006/webapi/WebIDL/#es-sequence
> * http://dev.w3.org/2006/webapi/WebIDL/#es-array
>
> For the sake of the examples, exampleFunction is a function which
> converts the first argument to an ES Array.

My reading of the specification is that your examples would throw
TypeError because given an operation like

void foo(array);

the overload resolution algorithm will return no matches unless the
passed type is "is a platform array object, a native Array object, or a
platform object that supports indexed properties", which I think your
examples are not.

However this depends critically on an interpretation of "platform
object" that means a DOM object is a "platform object" whilst an object
like {0:1, 1:2, length:2} is not. I can't work out what the definition
of "platform object" in the spec is supposed to imply. In particular I
can't tell how one can determine mechanically if a given object is a
platform object or not. Could the spec be clarified here please?
Received on Tuesday, 3 January 2012 15:43:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:05 UTC