fix: make eventUtils throw if event type not registered (#6381)

* chore: update lint rules

* fix: have eventUtils.get throw if event isn't found

* chore: remove nonnull assertion from eventUtils.get and format
This commit is contained in:
Maribeth Bottorff
2022-08-24 13:41:32 -07:00
committed by GitHub
parent 980fe138e7
commit 60bc01acc8
29 changed files with 98 additions and 94 deletions

View File

@@ -187,9 +187,9 @@ export class FieldTextInput extends Field {
// Revert value when the text becomes invalid.
this.value_ = this.htmlInput_!.getAttribute('data-untyped-default-value');
if (this.sourceBlock_ && eventUtils.isEnabled()) {
eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))!
(this.sourceBlock_, 'field', this.name || null,
oldValue, this.value_));
eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CHANGE))(
this.sourceBlock_, 'field', this.name || null, oldValue,
this.value_));
}
}
}