function doAssertFailure(defaultMessage, defaultArgs, givenMessage, givenArgs) {
  let message = 'Assertion failed';
  let args;
  if (givenMessage) {
    message += ': ' + givenMessage;
    args = givenArgs;
  } else if (defaultMessage) {
    message += ': ' + defaultMessage;
    args = defaultArgs;
  }
  // The '' + works around an Opera 10 bug in the unit tests. Without it,
  // a stack trace is added to var message above. With this, a stack trace is
  // not added until this line (it causes the extra garbage to be added after
  // the assertion message instead of in the middle of it).
  const e = new AssertionError('' + message, args || []);
  errorHandler_(e);
}
Throws an exception with the given message and "Assertion failed" prefixed
onto it.
@param {string} defaultMessage The message to use if givenMessage is empty.
@param {?Array<*>} defaultArgs The substitution arguments for defaultMessage.
@param {string|undefined} givenMessage Message supplied by the caller.
@param {!Array<*>} givenArgs The substitution arguments for givenMessage.
@throws {AssertionError} When the value is not a number.