B2G/gecko/toolkit/addon-sdk/promise/core.js
/**
 * Internal utility: Decorates given `f` function, so that on exception promise
 * rejected with thrown error is returned.
 */
Internal utility: Decorates given `f` function, so that on exception promise
rejected with thrown error is returned.
Internal utility : Decorates given ` f ` function so that on exception promise rejected with thrown error is returned .
function attempt(f) {
  return function effort(input) {
    try {
      return f(input);
    }
    catch(error) {
      return rejected(error);
    }
  };
}
function attempt ( f ) { return function effort ( input ) { try { return f ( input ) ; } catch ( error ) { return rejected ( error ) ; } } ; }
Internal utility: Decorates given `f` function, so that on exception promise
 rejected with thrown error is returned.
Internal utility : Decorates given ` f ` function so that on exception promise rejected with thrown error is returned .