diff --git a/crates/oxc_parser/src/ts/statement.rs b/crates/oxc_parser/src/ts/statement.rs index 3f6cef01dfb3e..867ddccfe44b4 100644 --- a/crates/oxc_parser/src/ts/statement.rs +++ b/crates/oxc_parser/src/ts/statement.rs @@ -201,6 +201,9 @@ impl<'a> ParserImpl<'a> { self.error(diagnostics::interface_implements(implements_kw_span)); } for extend in &extends { + if self.fatal_error.is_some() { + break; + } if !extend.expression.is_entity_name_expression() { self.error(diagnostics::interface_extend(extend.span)); } diff --git a/tasks/coverage/misc/fail/oxc-12546-1.ts b/tasks/coverage/misc/fail/oxc-12546-1.ts new file mode 100644 index 0000000000000..10b0082fc84e1 --- /dev/null +++ b/tasks/coverage/misc/fail/oxc-12546-1.ts @@ -0,0 +1,4 @@ +interface Props extends /MenuProps { + collapse?: boolean; + menus: MenuRecordRaw[]; +} \ No newline at end of file diff --git a/tasks/coverage/misc/fail/oxc-12546-2.ts b/tasks/coverage/misc/fail/oxc-12546-2.ts new file mode 100644 index 0000000000000..f2ce880c92395 --- /dev/null +++ b/tasks/coverage/misc/fail/oxc-12546-2.ts @@ -0,0 +1,2 @@ +class Props extends /MenuProps { +} \ No newline at end of file diff --git a/tasks/coverage/snapshots/parser_misc.snap b/tasks/coverage/snapshots/parser_misc.snap index aa96b9f6ca7f5..70baa4039fcf4 100644 --- a/tasks/coverage/snapshots/parser_misc.snap +++ b/tasks/coverage/snapshots/parser_misc.snap @@ -1,7 +1,7 @@ parser_misc Summary: AST Parsed : 45/45 (100.00%) Positive Passed: 45/45 (100.00%) -Negative Passed: 52/52 (100.00%) +Negative Passed: 54/54 (100.00%) × Cannot assign to 'arguments' in strict mode ╭─[misc/fail/arguments-eval.ts:1:10] @@ -188,6 +188,21 @@ Negative Passed: 52/52 (100.00%) · ────────── ╰──── + × Unterminated regular expression + ╭─[misc/fail/oxc-12546-1.ts:1:25] + 1 │ interface Props extends /MenuProps { + · ───────────── + 2 │ collapse?: boolean; + 3 │ menus: MenuRecordRaw[]; + ╰──── + + × Unterminated regular expression + ╭─[misc/fail/oxc-12546-2.ts:1:21] + 1 │ class Props extends /MenuProps { + · ───────────── + 2 │ } + ╰──── + × Cannot assign to this expression ╭─[misc/fail/oxc-12612-1.ts:1:2] 1 │ (foo() as bar) = 123;