- From: Domenic Denicola <domenic@domenicdenicola.com>
- Date: Thu, 14 Aug 2014 20:44:04 +0000
- To: Marcos Caceres <marcos@marcosc.com>, public-script-coord <public-script-coord@w3.org>
- CC: Dominique Hazael-Massieux <dom@w3.org>, Mounir Lamouri <mounir@lamouri.fr>
From: Marcos Caceres <marcos@marcosc.com> > It was raised elsewhere that maybe this should be `Promise<void>` instead? What would be more idiomatic? For JS? undefined. For WebIDL? void. > Using void seems to make more sense then passing `undefined` to the resolver - as the arguments.length would be 0 instead of 1 (undefined). I don't think it makes any difference. From the engine's perspective, resolve() and resolve(undefined) are indistinguishable. arguments.length of the onFulfilled callback is unaffected: ```js Promise.resolve(undefined).then(function () { assert(arguments.length === 0); }); Promise.resolve().then(function (value) { assert(arguments.length === 1); }); ```
Received on Thursday, 14 August 2014 20:44:49 UTC