diff options
author | davidot <david.tuin@gmail.com> | 2021-07-28 17:11:33 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-08-16 23:20:04 +0100 |
commit | 05444103e391bff9efb35be2c0e218fdbb9ab67e (patch) | |
tree | c9fb07d290f5e38352ffa8b2eea8eb1003b1eb21 | |
parent | e31b715808fff36d7b4f1788503a603adac0b56f (diff) | |
download | serenity-05444103e391bff9efb35be2c0e218fdbb9ab67e.zip |
LibJS: Treat arrow expression as function and stop parsing after
-rw-r--r-- | Userland/Libraries/LibJS/Parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index e5d6724eca..2c99568c9e 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -820,7 +820,7 @@ Parser::PrimaryExpressionParseResult Parser::parse_primary_expression() auto arrow_function_result = try_parse_arrow_function_expression(true); if (!arrow_function_result.is_null()) - return { arrow_function_result.release_nonnull() }; + return { arrow_function_result.release_nonnull(), false }; set_try_parse_arrow_function_expression_failed_at_position(paren_position, true); } @@ -846,7 +846,7 @@ Parser::PrimaryExpressionParseResult Parser::parse_primary_expression() if (!try_parse_arrow_function_expression_failed_at_position(position())) { auto arrow_function_result = try_parse_arrow_function_expression(false); if (!arrow_function_result.is_null()) - return { arrow_function_result.release_nonnull() }; + return { arrow_function_result.release_nonnull(), false }; set_try_parse_arrow_function_expression_failed_at_position(position(), true); } |