File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -822,10 +822,13 @@ func (m *jsMinifier) optimizeCondExpr(expr *js.CondExpr, prec js.OpPrec) js.IExp
822
822
} else if isEqualExpr (expr .X , expr .Y ) {
823
823
// if true and false bodies are equal
824
824
return groupExpr (& js.CommaExpr {[]js.IExpr {expr .Cond , expr .X }}, prec )
825
- } else if nullishExpr , ok := toNullishExpr (expr ); ok && m .o .minVersion (2020 ) {
826
- // no need to check whether left/right need to add groups, as the space saving is always more
827
- return nullishExpr
828
825
} else {
826
+ if m .o .minVersion (2020 ) {
827
+ if nullishExpr , ok := toNullishExpr (expr ); ok {
828
+ // no need to check whether left/right need to add groups, as the space saving is always more
829
+ return nullishExpr
830
+ }
831
+ }
829
832
callX , isCallX := expr .X .(* js.CallExpr )
830
833
callY , isCallY := expr .Y .(* js.CallExpr )
831
834
if isCallX && isCallY && len (callX .Args .List ) == 1 && len (callY .Args .List ) == 1 && ! callX .Args .List [0 ].Rest && ! callY .Args .List [0 ].Rest && isEqualExpr (callX .X , callY .X ) {
You can’t perform that action at this time.
0 commit comments