W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2014

Re: [whatwg] Proposal: HTMLFormElement#requestAutocomplete() should return a Promise

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Tue, 15 Apr 2014 04:44:59 +0000
To: Dan Beam <dbeam@chromium.org>, WHATWG <whatwg@whatwg.org>
Message-ID: <4f8a4799a402477a95ba08230c53c42c@BN1PR05MB325.namprd05.prod.outlook.com>
Cc: "bnicholson@mozilla.com" <bnicholson@mozilla.com>, Evan Stade <estade@chromium.org>
From: whatwg-bounces@lists.whatwg.org [mailto:whatwg-bounces@lists.whatwg.org] On Behalf Of Dan Beam

> I propose requestAutocomplete()[1] should return a Promise.  This has been requested since the creation of this API[2][3] and seems like a natural fit.  Web authors can then call requestAutocomplete() like this:

I strongly support this.

> Null would be passed on fulfillment* and

`undefined` would be better, as that is what normal JavaScript functions return when they have nothing to return.

>  {"reason": <matching AutocompleteErrorEvent#reason>} would be passed on rejection.

Rejection reasons should always be instanceof Error: https://github.com/w3ctag/promises-guide#rejection-reasons-should-be-errors

Received on Tuesday, 15 April 2014 04:45:28 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:19 UTC