From 074208192180563489b329946a6c91d693378567 Mon Sep 17 00:00:00 2001
From: Boshen <1430279+Boshen@users.noreply.github.com>
Date: Sat, 18 May 2024 16:39:51 +0000
Subject: [PATCH] refactor(parser): improve
is_parenthesized_arrow_function_expression (#3343)
---
crates/oxc_parser/src/js/arrow.rs | 265 ++++++++++---------
tasks/coverage/parser_test262.snap | 10 +-
tasks/coverage/parser_typescript.snap | 350 ++++++++++++++++++++++++--
3 files changed, 482 insertions(+), 143 deletions(-)
diff --git a/crates/oxc_parser/src/js/arrow.rs b/crates/oxc_parser/src/js/arrow.rs
index e7313c99f..487e82ce8 100644
--- a/crates/oxc_parser/src/js/arrow.rs
+++ b/crates/oxc_parser/src/js/arrow.rs
@@ -16,76 +16,164 @@ type ArrowFunctionHead<'a> = (
);
impl<'a> ParserImpl<'a> {
- pub(crate) fn is_parenthesized_arrow_function_expression(&mut self, r#async: bool) -> Tristate {
- let offset = u8::from(r#async);
+ pub(super) fn try_parse_parenthesized_arrow_function_expression(
+ &mut self,
+ ) -> Result