Skip to content

Commit 8a56c7f

Browse files
committed
feat(ast): implement GetAddress for MemberExpressionKind
1 parent f9cbe84 commit 8a56c7f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/oxc_ast/src/ast_kind_impl.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![expect(missing_docs)] // FIXME
2+
3+
use oxc_allocator::{Address, GetAddress};
24
use oxc_span::{Atom, GetSpan};
35

46
use super::{AstKind, ast::*};
@@ -529,6 +531,16 @@ impl GetSpan for MemberExpressionKind<'_> {
529531
}
530532
}
531533

534+
impl GetAddress for MemberExpressionKind<'_> {
535+
fn address(&self) -> Address {
536+
match *self {
537+
Self::Computed(member_expr) => Address::from_ptr(member_expr),
538+
Self::Static(member_expr) => Address::from_ptr(member_expr),
539+
Self::PrivateField(member_expr) => Address::from_ptr(member_expr),
540+
}
541+
}
542+
}
543+
532544
pub enum ModuleDeclarationKind<'a> {
533545
Import(&'a ImportDeclaration<'a>),
534546
ExportAll(&'a ExportAllDeclaration<'a>),

0 commit comments

Comments
 (0)