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

@@ -562,8 +562,8 @@ export class MarkerSvg {
*/
private fireMarkerEvent_(oldNode: ASTNode, curNode: ASTNode) {
const curBlock = curNode.getSourceBlock();
const event = new (eventUtils.get(eventUtils.MARKER_MOVE))!
(curBlock, this.isCursor(), oldNode, curNode);
const event = new (eventUtils.get(eventUtils.MARKER_MOVE))(
curBlock, this.isCursor(), oldNode, curNode);
eventUtils.fire(event);
}