setExtension method

void setExtension (Extension extension, dynamic value)

Sets the value of a non-repeated extension field to value.

Implementation

void setExtension(Extension extension, value) {
  if (value == null) throw new ArgumentError('value is null');
  if (_isRepeated(extension.type)) {
    throw new ArgumentError(_fieldSet._setFieldFailedMessage(
        extension, value, 'repeating field (use get + .add())'));
  }
  _fieldSet._ensureExtensions()._setFieldAndInfo(extension, value);
}