W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2013

[Future] First arguments should not be optional

From: Mounir Lamouri <mounir@lamouri.fr>
Date: Wed, 08 May 2013 18:23:15 +0100
Message-ID: <518A8A03.9010208@lamouri.fr>
To: www-dom@w3.org
Hi,

This is an interface detail but there is no point in having the first
argument of then() catch() and done() optionals. The only benefit from
that is to be able to write code doing:

  doSomethingAsync().then().then().then().catch().done();

The only requirement I saw regarding having the first parameter optional
is in GitHub issue 22 [1] but it seems that doing .then(null) or
.then(undefined) should just work with current WebIDL.

It is kind of a detail because the worse thing that might happen is a
no-op but it seems useless to have a method being able to be called with
no argument at all on purpose.

[1] https://github.com/slightlyoff/DOMFuture/pull/22

Cheers,
--
Mounir
Received on Wednesday, 8 May 2013 17:23:39 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:20 UTC