checked static method

int checked(
  1. int value,
  2. String name
)

Validates and returns a canonical nonzero u32 handle value.

Implementation

static int checked(int value, String name) {
  if (value <= 0 || value > 0xFFFFFFFF) {
    throw RangeError.range(value, 1, 0xFFFFFFFF, name);
  }
  return value;
}