function retry() {
  var f = arguments[0];
  var maxTries = 3;
  var delay = 0.5;
  if (arguments.length > 1) {
    maxTries = arguments[1];
  }
  if (arguments.length > 2) {
    delay = arguments[2];
  }

  var tries = 0;
  var exception = null;
  while (tries < maxTries) {
    try {
      f();
      return;  // if we get here, our function must have passed (no exceptions)
    }
    catch(e) {
      exception = e;
      tries++;
      UIATarget.localTarget().delay(delay);
    }
  }
  throw exception;
}
/**
 * Perform an assertion several times. If the assertion passes before the
 * maximum number of iterations, the assertion passes. Otherwise the
 * assertion fails
 * @param f The function to perform (possibly) multiple times
 * @param maxTries (optional) The maximum number of attempts
 * @param delay (optional) The amount of time to pause between attempts
 */
Perform an assertion several times. If the assertion passes before the
maximum number of iterations, the assertion passes. Otherwise the
assertion fails
@param f The function to perform (possibly) multiple times
@param maxTries (optional) The maximum number of attempts
@param delay (optional) The amount of time to pause between attempts
Perform an assertion several times . If the assertion passes before the maximum number of iterations the assertion passes . Otherwise the assertion fails @param f The function to perform ( possibly ) multiple times @param maxTries ( optional ) The maximum number of attempts @param delay ( optional ) The amount of time to pause between attempts
function retry() {
  var f = arguments[0];
  var maxTries = 3;
  var delay = 0.5;
  if (arguments.length > 1) {
    maxTries = arguments[1];
  }
  if (arguments.length > 2) {
    delay = arguments[2];
  }
  var tries = 0;
  var exception = null;
  while (tries < maxTries) {
    try {
      f();
      return;  
    }
    catch(e) {
      exception = e;
      tries++;
      UIATarget.localTarget().delay(delay);
    }
  }
  throw exception;
}
function retry ( ) { var f = arguments [ 0 ] ; var maxTries = 3 ; var delay = 0.5 ; if ( arguments . length > 1 ) { maxTries = arguments [ 1 ] ; } if ( arguments . length > 2 ) { delay = arguments [ 2 ] ; } var tries = 0 ; var exception = null ; while ( tries < maxTries ) { try { f ( ) ; return ; } catch ( e ) { exception = e ; tries ++ ; UIATarget . localTarget ( ) . delay ( delay ) ; } } throw exception ; }
Perform an assertion several times.
Perform an assertion several times .
// if we get here, our function must have passed (no exceptions)