assertCheckedMode function
Asserts that the current runtime has checked mode enabled.
Otherwise, throws StateError.
Implementation
void assertCheckedMode() {
if (_isCheckedMode == null) _isCheckedMode = _checkForCheckedMode();
if (!_isCheckedMode) {
throw new StateError('Not in checked mode.');
}
}