Set `in` to `true` when parsing AssignmentExpression in ConditionalExpression
This Pull Request fixes the following:
Set `in` to `true` when parsing AssignmentExpression in ConditionalExpression
@@ -80,12 +80,8 @@ 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,
- )
+ let then_clause =
+ AssignmentExpression::new(None, true, self.allow_yield, self.allow_await)
.parse(cursor, interner)?;
cursor.expect(Punctuator::Colon, "conditional expression", interner)?;
