Changes between Version 12 and Version 13 of WebInspectorCodingStyleGuide


Ignore:
Timestamp:
Aug 11, 2014 5:15:09 PM (7 years ago)
Author:
Brian Burg
Comment:

How to document promise fulfillment values

Legend:

Unmodified
Added
Removed
Modified
  • WebInspectorCodingStyleGuide

    v12 v13  
    6262* A `.catch()` block is considered resolved if it does not re-throw an `Error` instance. Re-throw if you want to log an error message and allow other parts of a chain (i.e, an API client) to handle an error condition.
    6363* Don't directly pass a promise's `resolve` function to `Object.addEventListener`, as it will leak the promise if the event never fires. Instead, use a single-fire `WebInspector.EventListener` object defined outside of the promise chain and connect it inside a `.then()` body. Inside the `.catch` block, disconnect the `EventListener` if necessary.
     64* For APIs that return promises, document what the fulfilled value will be, if any. Example: `createSession() // --> (sessionId)`
    6465
    6566== New class skeleton