File tree Expand file tree Collapse file tree
oxc_ecmascript/src/constant_evaluation
oxc_minifier/src/ast_passes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -384,9 +384,10 @@ pub trait ConstantEvaluation<'a> {
384384 }
385385 UnaryOperator :: Void => ( expr. argument . is_literal ( ) || !expr. may_have_side_effects ( ) )
386386 . then_some ( ConstantValue :: Undefined ) ,
387- UnaryOperator :: LogicalNot => {
388- self . get_boolean_value ( & expr. argument ) . map ( |b| !b) . map ( ConstantValue :: Boolean )
389- }
387+ UnaryOperator :: LogicalNot => self
388+ . get_side_free_boolean_value ( & expr. argument )
389+ . map ( |b| !b)
390+ . map ( ConstantValue :: Boolean ) ,
390391 UnaryOperator :: UnaryPlus => {
391392 self . eval_to_number ( & expr. argument ) . map ( ConstantValue :: Number )
392393 }
Original file line number Diff line number Diff line change @@ -1113,6 +1113,7 @@ mod test {
11131113 test ( "a=!10" , "a=false" ) ;
11141114 test ( "a=!false" , "a=true" ) ;
11151115 test_same ( "a=!foo()" ) ;
1116+ test_same ( "a = !!void b" ) ;
11161117
11171118 test ( "a=-0" , "a=-0" ) ;
11181119 test ( "a=-(0)" , "a=-0" ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ Original | minified | minified | gzip | gzip | Fixture
2121
22223.20 MB | 1.01 MB | 1.01 MB | 332.02 kB | 331.56 kB | echarts .js
2323
24- 6.69 MB | 2.32 MB | 2.31 MB | 492.64 kB | 488.28 kB | antd .js
24+ 6.69 MB | 2.32 MB | 2.31 MB | 492.65 kB | 488.28 kB | antd .js
2525
262610.95 MB | 3.49 MB | 3.49 MB | 907.34 kB | 915.50 kB | typescript .js
2727
You can’t perform that action at this time.
0 commit comments