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

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