Skip to content

Commit

Permalink
Fix the custom-error-definition rule to support constructors withou…
Browse files Browse the repository at this point in the history
…t a body.
  • Loading branch information
pat841 committed Nov 26, 2019
1 parent 3554c17 commit be56292
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rules/custom-error-definition.js
Expand Up @@ -80,6 +80,12 @@ const customErrorDefinition = (context, node) => {
}

const constructorBodyNode = constructor.value.body;

// Verify the constructor has a body
if (!constructorBodyNode) {
return;
}

const constructorBody = constructorBodyNode.body;

const superExpression = constructorBody.find(isSuperExpression);
Expand Down

0 comments on commit be56292

Please sign in to comment.