function clearRuntimeErrors(dismissOverlay) {
  if (!root || currentMode !== 'runtimeError') {
    return;
  }

  currentRuntimeErrorIndex = 0;
  currentRuntimeErrors = [];

  if (typeof dismissOverlay === 'undefined' || dismissOverlay) {
    currentMode = null;
    cleanup();
  }
}
Clears runtime error records and dismisses the runtime error overlay.
@param {boolean} [dismissOverlay] Whether to dismiss the overlay or not.
@returns {void}