Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed May 27, 2024
1 parent 05d0b92 commit 8cf5930
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/keyword-missing-initializer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ export default function keywordMissingInitializer(Parser) {
const decl = this.startNode();
this.parseVarId(decl, kind);

if (this.eat(tt.eq)) {
if (this.eat(tt.eq))
decl.init = this.parseMaybeAssign(isFor);
} else if (!allowMissingInitializer && kind === 'const' && !(this.type === tt._in || this.options.ecmaVersion >= 6 && this.isContextual('of'))) {
decl.init = this.parseMaybeAssign(isFor); /* c8 ignore start */
} else if (!allowMissingInitializer && decl.id.type !== 'Identifier' && !(isFor && (this.type === tt._in || this.isContextual('of'))))
else if (!allowMissingInitializer && kind === 'const' && !(this.type === tt._in || this.options.ecmaVersion >= 6 && this.isContextual('of')))
decl.init = this.parseMaybeAssign(isFor);
/* c8 ignore start */
else if (!allowMissingInitializer && decl.id.type !== 'Identifier' && !(isFor && (this.type === tt._in || this.isContextual('of'))))
this.raise(this.lastTokEnd, 'Complex binding patterns require an initialization value');
else
decl.init = null;
Expand Down

0 comments on commit 8cf5930

Please sign in to comment.