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

[Bug 16767] Allow user objects for Array[] types

From: <bugzilla@jessica.w3.org>
Date: Mon, 10 Dec 2012 23:47:38 +0000
To: public-script-coord@w3.org
Message-ID: <bug-16767-3890-LOC0AMxhiw@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16767

--- Comment #19 from Cameron McCormack <cam@mcc.id.au> ---
(In reply to comment #18)
> But passing in a platform object that _does_ support indexed properties is
> OK.  And those are still distinguishable from sequence types.  In fact there
> are specs out there that use this (e.g. WebGL overloads on sequence vs typed
> array).

Hmm, it is a bit of an oddity then that we make them distinguishable so that
they can be overloaded, but we still allow a typed array object to be converted
to a sequence<> type successfully in other (non-overloading) contexts.

For example take:

    void uniform1fv(WebGLUniformLocation? location, Float32Array v);
    void uniform1fv(WebGLUniformLocation? location, sequence<GLfloat> v);

What is the desired behaviour here if you pass in a say Int32Array?  Should it
select the sequence<> overload, and run a bit slower?  Or should it throw?

My thought in allowing platform objects that support indexed properties to
things expecting a sequence is so that e.g.

  interface A {
    void f(sequence<Node> x);
  };

  a.f(aNodeList);

would just work.

Is it maybe not worth supporting this automatically, and instead requiring the
spec author to have an explicit overload to take a NodeList?

> > Because the overload resolution algorithm and the type conversion algorithms
> > aren't in sync?
> 
> Yes.

I've fixed that bit:
http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.584;r2=1.585;f=h

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Monday, 10 December 2012 23:47:41 UTC

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