Skip to content

Commit d582fb6

Browse files
committed
refactor(transformer/decorator): re-order methods
1 parent 12ca898 commit d582fb6

File tree

1 file changed

+12
-12
lines changed
  • crates/oxc_transformer/src/decorator/legacy

1 file changed

+12
-12
lines changed

crates/oxc_transformer/src/decorator/legacy/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,18 @@ impl<'a, 'ctx> LegacyDecorator<'a, 'ctx> {
111111
}
112112

113113
impl<'a> Traverse<'a, TransformState<'a>> for LegacyDecorator<'a, '_> {
114+
#[inline]
115+
fn enter_class(&mut self, class: &mut Class<'a>, ctx: &mut TraverseCtx<'a>) {
116+
if self.emit_decorator_metadata {
117+
self.metadata.enter_class(class, ctx);
118+
}
119+
}
120+
121+
#[inline]
122+
fn exit_class(&mut self, class: &mut Class<'a>, ctx: &mut TraverseCtx<'a>) {
123+
self.transform_class(class, ctx);
124+
}
125+
114126
// `#[inline]` because this is a hot path
115127
#[inline]
116128
fn exit_statement(&mut self, stmt: &mut Statement<'a>, ctx: &mut TraverseCtx<'a>) {
@@ -126,18 +138,6 @@ impl<'a> Traverse<'a, TransformState<'a>> for LegacyDecorator<'a, '_> {
126138
}
127139
}
128140

129-
#[inline]
130-
fn exit_class(&mut self, class: &mut Class<'a>, ctx: &mut TraverseCtx<'a>) {
131-
self.transform_class(class, ctx);
132-
}
133-
134-
#[inline]
135-
fn enter_class(&mut self, class: &mut Class<'a>, ctx: &mut TraverseCtx<'a>) {
136-
if self.emit_decorator_metadata {
137-
self.metadata.enter_class(class, ctx);
138-
}
139-
}
140-
141141
#[inline]
142142
fn enter_method_definition(
143143
&mut self,

0 commit comments

Comments
 (0)