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

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 16:36:03 -0400
To: Domenic Denicola <domenic@domenicdenicola.com>, public-script-coord <public-script-coord@w3.org>
Cc: Dominique Hazael-Massieux <dom@w3.org>, Mounir Lamouri <mounir@lamouri.fr>
Message-ID: <etPan.53ed1db3.74b0dc51.e7a@Marcoss-MacBook-Pro.local>
Quick IDL+Promises question. 

I have a method: 

interface ScreenOrientation {
    Promise<undefined> lock (OrientationLockType orientation);

Where in spec prose we eventually say:

"...resolve p with `undefined`." 

It was raised elsewhere that maybe this should be `Promise<void>` instead? What would be more idiomatic? Using void seems to make more sense then passing `undefined` to the resolver - as the arguments.length would be 0 instead of 1 (undefined).  
Received on Thursday, 14 August 2014 20:36:31 UTC

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