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

https://www.w3.org/Bugs/Public/show_bug.cgi?id=22806

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