W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

[Bug 22806] Why special case Date and RegExp in #es-sequence

From: <bugzilla@jessica.w3.org>
Date: Tue, 30 Jul 2013 22:09:09 +0000
To: public-script-coord@w3.org
Message-ID: <bug-22806-3890-qRrnxlZnFs@http.www.w3.org/Bugs/Public/>

--- Comment #8 from Allen Wirfs-Brock <allen@wirfs-brock.com> ---
(In reply to comment #6)
> For functions, overloading of WebIDL callbacks (which is the WebIDL type for
> functions) and sequences is well-defined.  See comment 2, please.

Oh, I get it now, you have existing API's that are overloaded with X or
sequence<X> where X may only be Date or RegExp. Any object that isn't either a
Date or RegExp is treated as an array-like object.

Given how problematic is to make a scalar vs array-like determination for
general JS objects, I'll argue that it is very poor design for a JS facing API
to have such a overloading. You should forbid this in all new APIs.

You're stuck with the existing APIs that do this, but there is no reason you
need to enshrine the ability to make such overloads in WebIDL.  It would be
better to describe the existing APIs using prose and avoid expose a WebIDL that
future API designer might use.

You are receiving this mail because:
You are on the CC list for the bug.
Received on Tuesday, 30 July 2013 22:09:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:50 UTC