index.js
function doCallback(callback, reason, value) {
  // Note:  Could delay callback call until later, as When.js does, but this
  // loses the stack (particularly for bluebird long traces) and causes
  // unnecessary delay in the non-exception (common) case.
  try {
    // Match argument length to resolve/reject in case callback cares.
    // Note:  bluebird has argument length 1 if value === undefined due to
    // https://github.com/petkaantonov/bluebird/issues/170
    // If you are reading this and want similar behavior, I'll consider it.
    if (reason) {
      callback(reason);
    } else {
      callback(null, value);
    }
  } catch (err) {
    later(() => { throw err; });
  }
}
function doCallback(callback, reason, value) {
  // Note:  Could delay callback call until later, as When.js does, but this
  // loses the stack (particularly for bluebird long traces) and causes
  // unnecessary delay in the non-exception (common) case.
  try {
    // Match argument length to resolve/reject in case callback cares.
    // Note:  bluebird has argument length 1 if value === undefined due to
    // https://github.com/petkaantonov/bluebird/issues/170
    // If you are reading this and want similar behavior, I'll consider it.
    if (reason) {
      callback(reason);
    } else {
      callback(null, value);
    }
  } catch (err) {
    later(() => { throw err; });
  }
}
function doCallback ( callback , reason , value ) { // Note:  Could delay callback call until later, as When.js does, but this // loses the stack (particularly for bluebird long traces) and causes // unnecessary delay in the non-exception (common) case. try { // Match argument length to resolve/reject in case callback cares. // Note:  bluebird has argument length 1 if value === undefined due to // https://github.com/petkaantonov/bluebird/issues/170 // If you are reading this and want similar behavior, I'll consider it. if ( reason ) { callback ( reason ) ; } else { callback ( null , value ) ; } } catch ( err ) { later ( ( ) => { throw err ; } ) ; } }
Invokes callback and ensures any exceptions thrown are uncaught.
@private
Invokes callback and ensures any exceptions thrown are uncaught .