Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,10 @@ pub struct ArrayPattern<'a> {
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
#[estree(rename = "RestElement")]
#[estree(
rename = "RestElement",
add_fields(decorators = TsEmptyArray, optional = TsFalse, typeAnnotation = TsNull, value = TsNull),
)]
pub struct BindingRestElement<'a> {
pub span: Span,
pub argument: BindingPattern<'a>,
Expand Down
4 changes: 4 additions & 0 deletions crates/oxc_ast/src/generated/derive_estree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,10 @@ impl ESTree for BindingRestElement<'_> {
state.serialize_field("start", &self.span.start);
state.serialize_field("end", &self.span.end);
state.serialize_field("argument", &self.argument);
state.serialize_ts_field("decorators", &crate::serialize::TsEmptyArray(self));
state.serialize_ts_field("optional", &crate::serialize::TsFalse(self));
state.serialize_ts_field("typeAnnotation", &crate::serialize::TsNull(self));
state.serialize_ts_field("value", &crate::serialize::TsNull(self));
state.end();
}
}
Expand Down
4 changes: 4 additions & 0 deletions napi/parser/deserialize-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,10 @@ function deserializeBindingRestElement(pos) {
start: deserializeU32(pos),
end: deserializeU32(pos + 4),
argument: deserializeBindingPattern(pos + 8),
decorators: [],
optional: false,
typeAnnotation: null,
value: null,
};
}

Expand Down
4 changes: 4 additions & 0 deletions npm/oxc-types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,10 @@ export interface ArrayPattern extends Span {
export interface BindingRestElement extends Span {
type: 'RestElement';
argument: BindingPattern;
decorators?: [];
optional?: false;
typeAnnotation?: null;
value?: null;
}

export interface Function extends Span {
Expand Down
Loading
Loading