Skip to content

Commit

Permalink
refactor(fe): replace confusing if(x) with asssert(x)
Browse files Browse the repository at this point in the history
this->options_.typescript is known to be true because of a prior early
return. Replace the 'if' check with an assertion.
  • Loading branch information
strager committed Dec 12, 2023
1 parent 874c386 commit b76c649
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/quick-lint-js/fe/parse-expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2158,8 +2158,8 @@ Expression* Parser::parse_expression_remainder(Parse_Visitor_Base& v,
// cond ? (param): RetType => body : f
// cond ? (t) : f

if (this->options_.typescript &&
this->peek().type == Token_Type::equal_greater) {
QLJS_ASSERT(this->options_.typescript);
if (this->peek().type == Token_Type::equal_greater) {
// cond ? (t) : param => body
// cond ? (param): RetType => body : f
// ^^
Expand Down

0 comments on commit b76c649

Please sign in to comment.