From 786357919f7d5818648d5ce2fcf508eaff1229f8 Mon Sep 17 00:00:00 2001 From: raskad <32105367+raskad@users.noreply.github.com> Date: Wed, 26 Oct 2022 18:54:06 +0000 Subject: [PATCH] Set `in` to `true` when parsing AssignmentExpression in ConditionalExpression (#2386) This Pull Request fixes the following: - Set `in` to `true` when parsing AssignmentExpression in ConditionalExpression --- .../syntax/parser/expression/assignment/conditional.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/boa_engine/src/syntax/parser/expression/assignment/conditional.rs b/boa_engine/src/syntax/parser/expression/assignment/conditional.rs index eff99da0b0..064b79b283 100644 --- a/boa_engine/src/syntax/parser/expression/assignment/conditional.rs +++ b/boa_engine/src/syntax/parser/expression/assignment/conditional.rs @@ -80,13 +80,9 @@ where if let Some(tok) = cursor.peek(0, interner)? { if tok.kind() == &TokenKind::Punctuator(Punctuator::Question) { cursor.next(interner)?.expect("? character vanished"); // Consume the token. - let then_clause = AssignmentExpression::new( - None, - self.allow_in, - self.allow_yield, - self.allow_await, - ) - .parse(cursor, interner)?; + let then_clause = + AssignmentExpression::new(None, true, self.allow_yield, self.allow_await) + .parse(cursor, interner)?; cursor.expect(Punctuator::Colon, "conditional expression", interner)?; let else_clause = AssignmentExpression::new(