Skip to content

Commit

Permalink
Fix for-in/of expression parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Apr 29, 2023
1 parent 04ddeeb commit 298dacd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions boa_parser/src/parser/statement/iteration/for_statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use crate::{
lexer::{Error as LexError, TokenKind},
parser::{
expression::Expression,
expression::{AssignmentExpression, Expression},
statement::declaration::LexicalDeclaration,
statement::{variable::VariableDeclarationList, Statement},
AllowAwait, AllowReturn, AllowYield, Cursor, OrAbrupt, ParseResult, TokenParser,
Expand Down Expand Up @@ -169,8 +169,9 @@ where
)?;

cursor.advance(interner);
let expr = Expression::new(None, true, self.allow_yield, self.allow_await)
.parse(cursor, interner)?;
let expr =
AssignmentExpression::new(None, true, self.allow_yield, self.allow_await)
.parse(cursor, interner)?;

cursor.expect(Punctuator::CloseParen, "for in/of statement", interner)?;

Expand Down

0 comments on commit 298dacd

Please sign in to comment.