fixed parsing of function definition

This commit is contained in:
Fabrice Bellard
2025-05-24 12:47:35 +02:00
parent 3dc7ef1f7f
commit 02a2643142
2 changed files with 1 additions and 2 deletions

View File

@@ -35353,7 +35353,7 @@ static __exception int js_parse_function_decl2(JSParseState *s,
push_scope(s); /* enter body scope */
fd->body_scope = fd->scope_level;
if (s->token.val == TOK_ARROW) {
if (s->token.val == TOK_ARROW && func_type == JS_PARSE_FUNC_ARROW) {
if (next_token(s))
goto fail;