File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -1514,6 +1514,7 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for ObjectPropertyKind<'a> {
15141514 }
15151515}
15161516
1517+ // TODO: only print shorthand if key value are the same.
15171518impl < ' a , const MINIFY : bool > Gen < MINIFY > for ObjectProperty < ' a > {
15181519 fn gen ( & self , p : & mut Codegen < { MINIFY } > , ctx : Context ) {
15191520 if let Expression :: FunctionExpression ( func) = & self . value {
@@ -1561,16 +1562,12 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for ObjectProperty<'a> {
15611562 if self . computed {
15621563 p. print_char ( b'[' ) ;
15631564 }
1564- if !self . shorthand {
1565- self . key . gen ( p, ctx) ;
1566- }
1565+ self . key . gen ( p, ctx) ;
15671566 if self . computed {
15681567 p. print_char ( b']' ) ;
15691568 }
1570- if !self . shorthand {
1571- p. print_colon ( ) ;
1572- p. print_soft_space ( ) ;
1573- }
1569+ p. print_colon ( ) ;
1570+ p. print_soft_space ( ) ;
15741571 self . value . gen_expr ( p, Precedence :: Assign , Context :: default ( ) ) ;
15751572 }
15761573}
@@ -2538,7 +2535,7 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for ObjectPattern<'a> {
25382535 }
25392536}
25402537
2541- // NOTE: ` shorthand` is not printed
2538+ // TODO: only print shorthand if key value are the same.
25422539impl < ' a , const MINIFY : bool > Gen < MINIFY > for BindingProperty < ' a > {
25432540 fn gen ( & self , p : & mut Codegen < { MINIFY } > , ctx : Context ) {
25442541 p. add_source_mapping ( self . span . start ) ;
You can’t perform that action at this time.
0 commit comments