B2G/gaia/apps/communications/dialer/js/call_log_db.js
/**
   * Delete a list of groups of calls and all its belonging calls.
   *
   * param groupList
   *        Array of group objects to be deleted.
   * param deletedCount
   *        Accumulator of the number of deleted groups of calls.
   *
   * return (via callback) count of deleted calls or an error message if
   *                       needed.
   */
Delete a list of groups of calls and all its belonging calls.
param groupList
Array of group objects to be deleted.
param deletedCount
Accumulator of the number of deleted groups of calls.

return (via callback) count of deleted calls or an error message if
needed.
Delete a list of groups of calls and all its belonging calls . param groupList Array of group objects to be deleted . param deletedCount Accumulator of the number of deleted groups of calls . return ( via callback ) count of deleted calls or an error message if needed .
function deleteGroupList(groupList, callback,
                                            deletedCount) {
    if (!deletedCount) {
      deletedCount = 0;
    }
    var self = this;
    if (groupList.length > 0) {
      var itemToDelete = groupList.pop();
      if (typeof itemToDelete !== 'object') {
        self._asyncReturn(callback, 'INVALID_GROUP_IN_LIST');
        return;
      }
      var ondeleted = function ondeleted(result) {
        if (typeof result !== 'number') {
          self._asyncReturn(callback, result);
          return;
        }
        deletedCount += result;
        self.deleteGroupList(groupList, callback, deletedCount);
      };
      self.deleteGroup(itemToDelete, null, ondeleted);
    } else {
      self._asyncReturn(callback, deletedCount);
    }
  }
function deleteGroupList ( groupList , callback , deletedCount ) { if ( ! deletedCount ) { deletedCount = 0 ; } var self = this ; if ( groupList . length > 0 ) { var itemToDelete = groupList . pop ( ) ; if ( typeof itemToDelete !== 'object' ) { self . _asyncReturn ( callback , 'INVALID_GROUP_IN_LIST' ) ; return ; } var ondeleted = function ondeleted ( result ) { if ( typeof result !== 'number' ) { self . _asyncReturn ( callback , result ) ; return ; } deletedCount += result ; self . deleteGroupList ( groupList , callback , deletedCount ) ; } ; self . deleteGroup ( itemToDelete , null , ondeleted ) ; } else { self . _asyncReturn ( callback , deletedCount ) ; } }
Delete a list of groups of calls and all its belonging calls.
Delete a list of groups of calls and all its belonging calls .
// We expect a number. Otherwise that means that we got an error // message.