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: Wed, 31 Jul 2013 01:33:21 +0000
To: public-script-coord@w3.org
Message-ID: <bug-22806-3890-X7lA989gP4@http.www.w3.org/Bugs/Public/>

--- Comment #9 from Boris Zbarsky <bzbarsky@mit.edu> ---
> you have existing API's that are overloaded with X or sequence<X> where X may
> only be Date or RegExp.

More precisely, WebIDL allows such APIs.  I rather hope no one in practice is
doing that so far with Date and RegExp, though people certainly do it with Node
and Touch and so forth from what I've seen...

> Given how problematic is to make a scalar vs array-like determination for
> general JS objects

For most of the things above, including Date and RegExp, it's not too bad: you
check whether the object is a Date or RegExp instance (or Node, whatever) and
if not, treat it as an arraylike.

But yes, I think the current API best practice for things like that is to use
variadics and assume that people who have an array will use spread operators or

> It would be better to describe the existing APIs using prose 

Given past history, I do not trust either spec authors or the average
implementor to get this approach right.  The nice thing with IDL is that it
needs to be implemented once per browser, by someone who knows what they're
doing, and then it just works.

I would much prefer having IDL features explicitly marked as deprecated or
legacy or whatnot than forcing people to write/implement prose, with all the
ensuing problems.

In any case, that's starting to get a bit afield from this bug.

You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 31 July 2013 01:33:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:17 UTC