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 @@ -279,7 +279,10 @@ pub struct BindingIdentifier<'a> {
#[ast(visit)]
#[derive(Debug, Clone)]
#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
#[estree(rename = "Identifier")]
#[estree(
rename = "Identifier",
add_fields(decorators = TsEmptyArray, optional = TsFalse, typeAnnotation = TsNull),
)]
pub struct LabelIdentifier<'a> {
pub span: Span,
#[estree(json_safe)]
Expand Down
3 changes: 3 additions & 0 deletions crates/oxc_ast/src/generated/derive_estree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ impl ESTree for LabelIdentifier<'_> {
state.serialize_field("start", &self.span.start);
state.serialize_field("end", &self.span.end);
state.serialize_field("name", &JsonSafeString(self.name.as_str()));
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.end();
}
}
Expand Down
3 changes: 3 additions & 0 deletions napi/parser/deserialize-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ function deserializeLabelIdentifier(pos) {
start: deserializeU32(pos),
end: deserializeU32(pos + 4),
name: deserializeStr(pos + 8),
decorators: [],
optional: false,
typeAnnotation: null,
};
}

Expand Down
3 changes: 3 additions & 0 deletions npm/oxc-types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export interface BindingIdentifier extends Span {
export interface LabelIdentifier extends Span {
type: 'Identifier';
name: string;
decorators?: [];
optional?: false;
typeAnnotation?: null;
}

export interface ThisExpression extends Span {
Expand Down
Loading
Loading