@@ -138,9 +138,6 @@ fn parse_yield_expr<'a, P: Parser<'a>>(p: &mut P) -> PResult<Box<Expr>> {
138138
139139 if p. is_general_semi ( ) || {
140140 let cur = p. input ( ) . cur ( ) ;
141- if cur. is_eof ( ) {
142- return parse_with_arg ( p) ;
143- }
144141 !cur. is_less ( )
145142 && !cur. is_star ( )
146143 && !cur. is_slash ( )
@@ -417,8 +414,6 @@ fn parse_assignment_expr_base<'a, P: Parser<'a>>(p: &mut P) -> PResult<Box<Expr>
417414 if cur. is_error ( ) {
418415 let err = p. input_mut ( ) . expect_error_token_and_bump ( ) ;
419416 return Err ( err) ;
420- } else if cur. is_eof ( ) {
421- return Err ( eof_error ( p) ) ;
422417 }
423418
424419 p. state_mut ( ) . potential_arrow_start =
@@ -1553,8 +1548,6 @@ pub(crate) fn parse_unary_expr<'a, P: Parser<'a>>(p: &mut P) -> PResult<Box<Expr
15531548 . into ( ) ) ;
15541549 } else if cur. is_await ( ) {
15551550 return parse_await_expr ( p, None ) ;
1556- } else if cur. is_eof ( ) {
1557- syntax_error ! ( p, p. input( ) . cur_span( ) , SyntaxError :: TS1109 ) ;
15581551 }
15591552
15601553 // UpdateExpression
@@ -1673,8 +1666,6 @@ pub fn parse_lhs_expr<'a, P: Parser<'a>, const PARSE_JSX: bool>(p: &mut P) -> PR
16731666 } else if cur. is_error ( ) {
16741667 let err = p. input_mut ( ) . expect_error_token_and_bump ( ) ;
16751668 return Err ( err) ;
1676- } else if cur. is_eof ( ) {
1677- return Err ( eof_error ( p) ) ;
16781669 }
16791670
16801671 if p. input ( ) . is ( & P :: Token :: LESS ) && !peek ! ( p) . is_some_and ( |peek| peek. is_bang ( ) ) {
@@ -1702,8 +1693,6 @@ pub fn parse_lhs_expr<'a, P: Parser<'a>, const PARSE_JSX: bool>(p: &mut P) -> PR
17021693 } else if cur. is_import ( ) {
17031694 p. bump ( ) ; // eat `import`
17041695 return parse_dynamic_import_or_import_meta ( p, start, false ) ;
1705- } else if cur. is_eof ( ) {
1706- return Err ( eof_error ( p) ) ;
17071696 }
17081697
17091698 let callee = parse_new_expr ( p) ?;
0 commit comments