- From: Domenic Denicola <domenic@domenicdenicola.com>
- Date: Thu, 17 Apr 2014 01:59:21 +0000
- To: Dan Beam <dbeam@chromium.org>
- 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