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
6 changes: 5 additions & 1 deletion crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@ pub enum ObjectPropertyKind<'a> {
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
#[estree(rename = "Property", field_order(span, method, shorthand, computed, key, value, kind))]
#[estree(
rename = "Property",
add_fields(optional = TsFalse),
field_order(span, method, shorthand, computed, key, value, kind, optional),
)]
pub struct ObjectProperty<'a> {
pub span: Span,
pub kind: PropertyKind,
Expand Down
1 change: 1 addition & 0 deletions crates/oxc_ast/src/generated/derive_estree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ impl ESTree for ObjectProperty<'_> {
state.serialize_field("key", &self.key);
state.serialize_field("value", &self.value);
state.serialize_field("kind", &self.kind);
state.serialize_ts_field("optional", &crate::serialize::TsFalse(self));
state.end();
}
}
Expand Down
1 change: 1 addition & 0 deletions napi/parser/deserialize-ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ function deserializeObjectProperty(pos) {
key: deserializePropertyKey(pos + 16),
value: deserializeExpression(pos + 32),
kind: deserializePropertyKind(pos + 8),
optional: false,
};
}

Expand Down
1 change: 1 addition & 0 deletions npm/oxc-types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export interface ObjectProperty extends Span {
key: PropertyKey;
value: Expression;
kind: PropertyKind;
optional?: false;
}

export type PropertyKey = IdentifierName | PrivateIdentifier | Expression;
Expand Down
Loading
Loading