rowSortFn = function (rowA, rowB) {
      var tem = 0,
          idx = 0,
          sortFn;

      while (tem === 0 && idx < sortCols.length) {
        // grab the metadata for the rest of the logic
        col = sortCols[idx].col;
        direction = sortCols[idx].sort.direction;

        sortFn = rowSorter.getSortFn(col);

        // Webpack's compress will hoist and combine propA, propB into one var and break sorting functionality
        // Wrapping in function prevents that unexpected behavior
        var props = getCellValues(grid, rowA, rowB, col);
        tem = sortFn(props[0], props[1], rowA, rowB, direction, col);

        idx++;
      }

      // Chrome doesn't implement a stable sort function.  If our sort returns 0
      // (i.e. the items are equal), and we're at the last sort column in the list,
      // then return the previous order using our custom
      // index variable
      if (tem === 0 ) {
        return rowA.entity.$$uiGridIndex - rowB.entity.$$uiGridIndex;
      }

      // Made it this far, we don't have to worry about null & undefined
      return (direction === uiGridConstants.ASC) ? tem : 0 - tem;
    }
@ngdoc method
@methodOf ui.grid.class:rowSorter
@name sort
@description sorts the grid
@param {Object} grid the grid itself
@param {array} rows the rows to be sorted
@param {array} columns the columns in which to look
for sort criteria
@returns {array} sorted rows