mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibJS: Allow object properties called 'async'
This commit is contained in:
parent
450dedabd1
commit
32016d3924
Notes:
sideshowbarker
2024-07-17 23:19:00 +09:00
Author: https://github.com/davidot
Commit: 32016d3924
Pull-request: https://github.com/SerenityOS/serenity/pull/11088
Issue: https://github.com/SerenityOS/serenity/issues/11078
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/linusg ✅
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