File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
crates/oxc_ast/src/serialize Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -193,27 +193,25 @@ fn get_ts_start_span(program: &Program<'_>) -> u32 {
193193 return program. span . end ;
194194 } ;
195195
196+ let start = first_stmt. span ( ) . start ;
196197 match first_stmt {
197198 Statement :: ExportNamedDeclaration ( decl) => {
198- let start = decl. span . start ;
199- if let Some ( Declaration :: ClassDeclaration ( class) ) = & decl. declaration {
200- if let Some ( decorator) = class. decorators . first ( ) {
201- return cmp:: min ( start, decorator. span . start ) ;
202- }
199+ if let Some ( Declaration :: ClassDeclaration ( class) ) = & decl. declaration
200+ && let Some ( decorator) = class. decorators . first ( )
201+ {
202+ return cmp:: min ( start, decorator. span . start ) ;
203203 }
204- start
205204 }
206205 Statement :: ExportDefaultDeclaration ( decl) => {
207- let start = decl. span . start ;
208- if let ExportDefaultDeclarationKind :: ClassDeclaration ( class) = & decl. declaration {
209- if let Some ( decorator) = class. decorators . first ( ) {
210- return cmp:: min ( start, decorator. span . start ) ;
211- }
206+ if let ExportDefaultDeclarationKind :: ClassDeclaration ( class) = & decl. declaration
207+ && let Some ( decorator) = class. decorators . first ( )
208+ {
209+ return cmp:: min ( start, decorator. span . start ) ;
212210 }
213- start
214211 }
215- _ => first_stmt . span ( ) . start ,
212+ _ => { }
216213 }
214+ start
217215}
218216
219217/// Serialize `value` field of `Comment`.
You can’t perform that action at this time.
0 commit comments