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/>

--- 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);


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:

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.4.0 : Friday, 17 January 2020 17:14:07 UTC