W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2014

RE: Promise<void> or Promise<undefined>?, was Re: RfC: pre-LC version of Screen Orientation; deadline August 18

From: Marcos Caceres <marcos@marcosc.com>
Date: Thu, 14 Aug 2014 17:00:31 -0400
To: Domenic Denicola <domenic@domenicdenicola.com>, public-script-coord <public-script-coord@w3.org>
Cc: Mounir Lamouri <mounir@lamouri.fr>, Dominique Hazael-Massieux <dom@w3.org>
Message-ID: <etPan.53ed236f.2ae8944a.e7a@Marcoss-MacBook-Pro.local>

On August 14, 2014 at 4:48:50 PM, Domenic Denicola (domenic@domenicdenicola.com) wrote:
> From: Domenic Denicola
> > I don't think it makes any difference. From the engine's perspective, resolve() and 
> resolve(undefined) are indistinguishable.
> More to your point, the question is, do you have to do "resolve p with `undefined`", or 
> should we just let "resolve p" be shorthand for that? I think I am in favor of explicitness, 
> but not strongly.

I don't feel strongly about it either. To me, it's probably more clear to just say "resolve p", because it doesn't imply that one is passing an actual thing to the resolver (where "resolve p" looks like, in a JS implementation of WebIDL: `resolver(undefined)` even if equivalent to just calling `resolver()`). I guess generally, unless one is resolving with something, maybe it's best to just exclude the "<void>" altogether, as it's should be implied to be void.
Received on Thursday, 14 August 2014 21:01:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC