validateEditionInRange function

void validateEditionInRange(
  1. int edition
)

Validates that edition is within the supported [minimumEdition, maximumEdition] range (the test-only editionUnstable is allowed above the max). Throws ArgumentError otherwise.

Implementation

void validateEditionInRange(int edition) {
  if (edition == editionUnstable) return;
  if (edition < minimumEdition || edition > maximumEdition) {
    throw ArgumentError(
      'Edition ${editionToName(edition)} ($edition) is outside the supported '
      'range [${editionToName(minimumEdition)}, ${editionToName(maximumEdition)}]',
    );
  }
}