mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibJS: Allow object properties called 'async'
This commit is contained in:
parent
450dedabd1
commit
32016d3924
2 changed files with 10 additions and 1 deletions
|
@ -1486,7 +1486,8 @@ NonnullRefPtr<ObjectExpression> Parser::parse_object_expression()
|
|||
if (match(TokenType::Async)) {
|
||||
auto lookahead_token = next_token();
|
||||
|
||||
if (lookahead_token.type() != TokenType::ParenOpen && !lookahead_token.trivia_contains_line_terminator()) {
|
||||
if (lookahead_token.type() != TokenType::ParenOpen && lookahead_token.type() != TokenType::Colon
|
||||
&& !lookahead_token.trivia_contains_line_terminator()) {
|
||||
consume(TokenType::Async);
|
||||
function_kind = FunctionKind::Async;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue