Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ast/estree): fix serializing PrivateFieldExpression #9025

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
1 change: 1 addition & 0 deletions crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ pub struct StaticMemberExpression<'a> {
pub struct PrivateFieldExpression<'a> {
pub span: Span,
pub object: Expression<'a>,
#[estree(rename = "property")]
pub field: PrivateIdentifier<'a>,
pub optional: bool, // for optional chaining
}
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_ast/src/generated/derive_estree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ impl Serialize for PrivateFieldExpression<'_> {
map.serialize_entry("start", &self.span.start)?;
map.serialize_entry("end", &self.span.end)?;
map.serialize_entry("object", &self.object)?;
map.serialize_entry("field", &self.field)?;
map.serialize_entry("property", &self.field)?;
map.serialize_entry("optional", &self.optional)?;
map.serialize_entry("computed", &false)?;
map.end()
Expand Down
2 changes: 1 addition & 1 deletion npm/oxc-types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export interface StaticMemberExpression extends Span {
export interface PrivateFieldExpression extends Span {
type: 'MemberExpression';
object: Expression;
field: PrivateIdentifier;
property: PrivateIdentifier;
optional: boolean;
computed: false;
}
Expand Down
Loading
Loading