W3C home > Mailing lists > Public > public-device-apis-log@w3.org > January 2017

Re: [wake-lock] The spec is unnecessarily strict in regard to promise handling

From: Marcos Cáceres via GitHub <sysbot+gh@w3.org>
Date: Mon, 30 Jan 2017 04:00:22 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-275975815-1485748821-sysbot+gh@w3.org>
> So I suggest that the spec shouldn't dictate a particular promise 
management mechanism and only specify when the returned promise must 
be rejected or fulfilled, and with which object.

I agree, FWIW. It will be confusing for developers if they sometimes 
get a new promise and sometimes not, so we should explicitly annotate 
things appropriately with WebIDL `[NewObject]`. That way, it won't 
matter if the promise is a cache promise internally, as basically we 
can always just assume that basically this will happen:

// either cached, or even rejected, it doesn't matter... always new 
return Promise.resolve(promise);  

GitHub Notification of comment by marcoscaceres
Please view or discuss this issue at 
using your GitHub account
Received on Monday, 30 January 2017 04:00:29 UTC

This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:53 UTC