checkNotNegative method
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 new RangeError.range(value, 0, null, name, message);
}