diff --git a/crates/oxc_parser/src/js/expression.rs b/crates/oxc_parser/src/js/expression.rs index 78a2352250691..86e0d1eb07dd6 100644 --- a/crates/oxc_parser/src/js/expression.rs +++ b/crates/oxc_parser/src/js/expression.rs @@ -731,6 +731,9 @@ impl<'a> ParserImpl<'a> { ) -> Expression<'a> { let mut lhs = lhs; loop { + if self.fatal_error.is_some() { + return lhs; + } lhs = match self.cur_kind() { Kind::Dot => self.parse_static_member_expression(lhs_span, lhs, false), Kind::QuestionDot => { diff --git a/tasks/coverage/misc/fail/oxc-10639.js b/tasks/coverage/misc/fail/oxc-10639.js new file mode 100755 index 0000000000000..2bea060546820 --- /dev/null +++ b/tasks/coverage/misc/fail/oxc-10639.js @@ -0,0 +1 @@ +<<Ç \ No newline at end of file diff --git a/tasks/coverage/snapshots/parser_misc.snap b/tasks/coverage/snapshots/parser_misc.snap index 1c0117fb8d078..ff011afd69728 100644 --- a/tasks/coverage/snapshots/parser_misc.snap +++ b/tasks/coverage/snapshots/parser_misc.snap @@ -1,7 +1,7 @@ parser_misc Summary: AST Parsed : 35/35 (100.00%) Positive Passed: 35/35 (100.00%) -Negative Passed: 32/32 (100.00%) +Negative Passed: 33/33 (100.00%) × Identifier `b` has already been declared ╭─[misc/fail/oxc-10159.js:1:22] @@ -18,6 +18,12 @@ Negative Passed: 32/32 (100.00%) · ── ╰──── + × Unexpected token + ╭─[misc/fail/oxc-10639.js:1:1] + 1 │ <<Ç + · ── + ╰──── + × Unexpected token ╭─[misc/fail/oxc-169.js:2:1] 1 │ 1<(V=82< diff --git a/tasks/coverage/snapshots/parser_typescript.snap b/tasks/coverage/snapshots/parser_typescript.snap index 4cca9fa25bce1..e5e6a6e15ea38 100644 --- a/tasks/coverage/snapshots/parser_typescript.snap +++ b/tasks/coverage/snapshots/parser_typescript.snap @@ -21401,12 +21401,11 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/salsa/private · ─ ╰──── - × Expected a semicolon or an implicit semicolon after a statement, but found none - ╭─[typescript/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts:1:17] + × Unexpected token + ╭─[typescript/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts:1:11] 1 │ var v = { *() { } } - · ▲ + · ─ ╰──── - help: Try insert a semicolon here × Unexpected token ╭─[typescript/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration4_es6.ts:2:5]