mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS: Allow async functions named "async" as function properties
For example, https://locals.com/site/discover has a script with an object of the form: var f = { parser: { sync() {}, async async() {}, } }; We were previously throwing a syntax error on the async function, as we specifically did not allow using "async" as a function name here.
This commit is contained in:
committed by
Andreas Kling
parent
a5455ac121
commit
ada36e5c0a
@@ -2019,7 +2019,6 @@ NonnullRefPtr<ObjectExpression const> Parser::parse_object_expression()
|
||||
|
||||
if (lookahead_token.type() != TokenType::ParenOpen && lookahead_token.type() != TokenType::Colon
|
||||
&& lookahead_token.type() != TokenType::Comma && lookahead_token.type() != TokenType::CurlyClose
|
||||
&& lookahead_token.type() != TokenType::Async
|
||||
&& !lookahead_token.trivia_contains_line_terminator()) {
|
||||
consume(TokenType::Async);
|
||||
function_kind = FunctionKind::Async;
|
||||
|
||||
Reference in New Issue
Block a user