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: Thu, 17 Apr 2014 01:59:21 +0000
To: Dan Beam <dbeam@chromium.org>
Message-ID: <1fb95b4500944205baf2857a6525bc51@BN1PR05MB325.namprd05.prod.outlook.com>
Cc: WHATWG <whatwg@whatwg.org>, "bnicholson@mozilla.com" <bnicholson@mozilla.com>, Evan Stade <estade@chromium.org>
From: dbeam@google.com [mailto:dbeam@google.com] On Behalf Of Dan Beam

> So just pass no argument at all (i.e. arguments.length == 0)?  I was under the impression some type of value should always be returned (but I'm biased by blink/v8's current implementation).

It's equivalent, both for promises and for return values of functions. Both `new Promise(resolve => resolve())` and `new Promise(resolve => resolve(undefined))`  give a promise whose fulfillment value is `undefined`. In this sense `resolve` behaves like all non-evil JavaScript functions, where evil is defined as "checking `arguments.length`" ;)

Received on Thursday, 17 April 2014 01:59:47 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:28 UTC