checkNotNegative method

void checkNotNegative (
  1. int value,
  2. [String name,
  3. String message]
)

Check that an integer value isn't negative.

Throws if the value is negative.

Implementation

static void checkNotNegative(int value, [String name, String message]) {
  if (value < 0) throw RangeError.range(value, 0, null, name, message);
}