From 9bb3bea4ca9d6ebece65c1946f6411214dee91cd Mon Sep 17 00:00:00 2001 From: raskad <32105367+raskad@users.noreply.github.com> Date: Mon, 16 Oct 2023 05:31:34 +0200 Subject: [PATCH] Fix await flag in class constructor (#3388) --- .../statement/declaration/hoistable/class_decl/mod.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/boa_parser/src/parser/statement/declaration/hoistable/class_decl/mod.rs b/boa_parser/src/parser/statement/declaration/hoistable/class_decl/mod.rs index 1e1f868fc1..a4c4e773f6 100644 --- a/boa_parser/src/parser/statement/declaration/hoistable/class_decl/mod.rs +++ b/boa_parser/src/parser/statement/declaration/hoistable/class_decl/mod.rs @@ -8,7 +8,7 @@ use crate::{ AssignmentExpression, AsyncGeneratorMethod, AsyncMethod, BindingIdentifier, GeneratorMethod, LeftHandSideExpression, PropertyName, }, - function::{FormalParameters, FunctionBody, UniqueFormalParameters, FUNCTION_BREAK_TOKENS}, + function::{FunctionBody, UniqueFormalParameters, FUNCTION_BREAK_TOKENS}, statement::StatementList, AllowAwait, AllowDefault, AllowYield, Cursor, OrAbrupt, ParseResult, TokenParser, }, @@ -628,17 +628,14 @@ where let strict = cursor.strict(); cursor.set_strict(true); - cursor.expect(Punctuator::OpenParen, "class constructor", interner)?; - let parameters = FormalParameters::new(self.allow_yield, self.allow_await) - .parse(cursor, interner)?; - cursor.expect(Punctuator::CloseParen, "class constructor", interner)?; + let parameters = + UniqueFormalParameters::new(false, false).parse(cursor, interner)?; cursor.expect( TokenKind::Punctuator(Punctuator::OpenBlock), "class constructor", interner, )?; - let body = FunctionBody::new(self.allow_yield, self.allow_await) - .parse(cursor, interner)?; + let body = FunctionBody::new(false, false).parse(cursor, interner)?; cursor.expect( TokenKind::Punctuator(Punctuator::CloseBlock), "class constructor",