W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

[Bug 21422] Generic Promise type notation

From: <bugzilla@jessica.w3.org>
Date: Thu, 27 Jun 2013 09:49:42 +0000
To: public-script-coord@w3.org
Message-ID: <bug-21422-3890-utEgn4aCqp@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=21422

David Bruant <bruant.d@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bruant.d@gmail.com
            Summary|Futures                     |Generic Promise type
                   |                            |notation

--- Comment #2 from David Bruant <bruant.d@gmail.com> ---
It's with a smile of happiness in my face that I noticed the following this
morning [1]

interface SubtleCrypto {
  // ...

  Promise<any> generateKey(AlgorithmIdentifier algorithm,
                          bool extractable = false,
                          KeyUsage[] keyUsages = []);

  // ...
}

IMO the most complete version should be "Promise<resultT, errorT>" where both
the result and error type can be specified. Sweetened versions:
* Promise<resultT> => Promise<resultT, Error>
* Promise => Promise<any, Error>

(not sure whether that should be Error or DOMError)

Thoughts?

[1] http://www.w3.org/TR/2013/WD-WebCryptoAPI-20130625/#dfn-SubtleCrypto

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Thursday, 27 June 2013 09:49:43 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:49 UTC