Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions crates/oxc_parser/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1132,26 +1132,27 @@ 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.")
.with_label(span)
.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)
Expand Down
Loading