diff --git a/crates/oxc_parser/src/diagnostics.rs b/crates/oxc_parser/src/diagnostics.rs index 017357ab00de6..2e19472e66e89 100644 --- a/crates/oxc_parser/src/diagnostics.rs +++ b/crates/oxc_parser/src/diagnostics.rs @@ -1132,14 +1132,20 @@ pub fn setter_with_parameters(span: Span, parameters_count: usize) -> OxcDiagnos } #[cold] -pub fn setter_with_rest_parameter(span: Span) -> OxcDiagnostic { - ts_error("1053", "A 'set' accessor cannot have rest parameter.").with_label(span) +pub fn setter_with_optional_parameter(span: Span) -> OxcDiagnostic { + ts_error("1051", "A 'set' accessor cannot have an optional parameter.").with_label(span) } + #[cold] pub fn setter_with_initializer(span: Span) -> OxcDiagnostic { ts_error("1052", "A 'set' accessor cannot have an initializer.").with_label(span) } +#[cold] +pub fn setter_with_rest_parameter(span: Span) -> OxcDiagnostic { + ts_error("1053", "A 'set' accessor cannot have rest parameter.").with_label(span) +} + #[cold] pub fn getter_parameters(span: Span) -> OxcDiagnostic { OxcDiagnostic::error("A 'get' accessor must not have any formal parameters.") @@ -1147,11 +1153,6 @@ pub fn getter_parameters(span: Span) -> OxcDiagnostic { .with_help("Remove these parameters here") } -#[cold] -pub fn setter_with_optional_parameter(span: Span) -> OxcDiagnostic { - ts_error("1051", "A 'set' accessor cannot have an optional parameter.").with_label(span) -} - #[cold] pub fn accessor_cannot_have_this_parameter(span: Span) -> OxcDiagnostic { ts_error("2784", "'get' and 'set' accessors cannot declare 'this' parameters.").with_label(span)