File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"]
77license = " Apache-2.0/MIT"
88name = " swc_ecma_codegen"
99repository = " https://github.com/swc-project/swc.git"
10- version = " 0.55.3 "
10+ version = " 0.55.4 "
1111
1212[dependencies ]
1313bitflags = " 1"
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ impl<'a> Emitter<'a> {
3737 space ! ( ) ;
3838 emit ! ( node. ident) ;
3939 emit ! ( node. class. type_params) ;
40- formatting_space ! ( ) ;
4140
4241 self . emit_class_trailing ( & node. class ) ?;
4342 }
@@ -117,6 +116,15 @@ mod tests {
117116 ) ;
118117 }
119118
119+ #[ test]
120+ fn issue_1764 ( ) {
121+ assert_min (
122+ "class Hoge {};
123+ class HogeFuga extends Hoge {};" ,
124+ "class Hoge{};class HogeFuga extends Hoge{};" ,
125+ ) ;
126+ }
127+
120128 #[ test]
121129 fn single_argument_arrow_expression ( ) {
122130 assert_min ( "function* f(){ yield x => x}" , "function*f(){yield x=>x}" ) ;
Original file line number Diff line number Diff line change @@ -823,10 +823,6 @@ impl<'a> Emitter<'a> {
823823 space ! ( ) ;
824824 emit ! ( i) ;
825825 emit ! ( node. class. type_params) ;
826-
827- formatting_space ! ( ) ;
828- } else {
829- space ! ( ) ;
830826 }
831827
832828 self . emit_class_trailing ( & node. class ) ?;
@@ -835,12 +831,13 @@ impl<'a> Emitter<'a> {
835831 #[ emitter]
836832 fn emit_class_trailing ( & mut self , node : & Class ) -> Result {
837833 if node. super_class . is_some ( ) {
834+ space ! ( ) ;
838835 keyword ! ( "extends" ) ;
839836 space ! ( ) ;
840837 emit ! ( node. super_class) ;
841- space ! ( ) ;
842838 }
843839
840+ formatting_space ! ( ) ;
844841 punct ! ( "{" ) ;
845842 self . emit_list ( node. span , Some ( & node. body ) , ListFormat :: ClassMembers ) ?;
846843 punct ! ( "}" ) ;
You can’t perform that action at this time.
0 commit comments