File tree 6 files changed +9
-9
lines changed
6 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -26,16 +26,16 @@ pub struct CompressOptions {
26
26
#[ expect( clippy:: derivable_impls) ]
27
27
impl Default for CompressOptions {
28
28
fn default ( ) -> Self {
29
- Self { drop_console : false , ..Self :: all_true ( ) }
29
+ Self { drop_console : false , ..Self :: smallest ( ) }
30
30
}
31
31
}
32
32
33
33
impl CompressOptions {
34
- pub fn all_true ( ) -> Self {
34
+ pub fn smallest ( ) -> Self {
35
35
Self { target : ESTarget :: ESNext , drop_debugger : true , drop_console : true }
36
36
}
37
37
38
- pub fn all_false ( ) -> Self {
38
+ pub fn safest ( ) -> Self {
39
39
Self { target : ESTarget :: ESNext , drop_debugger : false , drop_console : false }
40
40
}
41
41
}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ pub fn test_same(source_text: &str) {
10
10
}
11
11
12
12
pub fn test ( source_text : & str , expected : & str ) {
13
- let result = run ( source_text, Some ( CompressOptions :: all_true ( ) ) ) ;
13
+ let result = run ( source_text, Some ( CompressOptions :: smallest ( ) ) ) ;
14
14
let expected = run ( expected, None ) ;
15
15
assert_eq ! ( result, expected, "\n for source\n {source_text}\n expect\n {expected}\n got\n {result}" ) ;
16
16
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ mod esbuild;
4
4
use oxc_minifier:: CompressOptions ;
5
5
6
6
fn test ( source_text : & str , expected : & str ) {
7
- let options = CompressOptions :: all_false ( ) ;
7
+ let options = CompressOptions :: safest ( ) ;
8
8
crate :: test ( source_text, expected, options) ;
9
9
}
10
10
Original file line number Diff line number Diff line change @@ -266,10 +266,10 @@ impl Oxc {
266
266
CompressOptions {
267
267
drop_console : compress_options. drop_console ,
268
268
drop_debugger : compress_options. drop_debugger ,
269
- ..CompressOptions :: all_false ( )
269
+ ..CompressOptions :: safest ( )
270
270
}
271
271
} else {
272
- CompressOptions :: all_false ( )
272
+ CompressOptions :: safest ( )
273
273
} ) ,
274
274
} ;
275
275
Minifier :: new ( options) . build ( & allocator, & mut program) . scoping
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ fn bench_minifier(criterion: &mut Criterion) {
28
28
let mut program = Parser :: new ( & allocator, source_text, source_type) . parse ( ) . program ;
29
29
let scoping = SemanticBuilder :: new ( ) . build ( & program) . semantic . into_scoping ( ) ;
30
30
31
- let options = CompressOptions :: all_true ( ) ;
31
+ let options = CompressOptions :: smallest ( ) ;
32
32
33
33
runner. run ( || {
34
34
Compressor :: new ( & allocator, options) . build_with_scoping ( scoping, & mut program) ;
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ impl CompilerInterface for Driver {
54
54
}
55
55
56
56
fn compress_options ( & self ) -> Option < CompressOptions > {
57
- self . compress . then ( CompressOptions :: all_true )
57
+ self . compress . then ( CompressOptions :: smallest )
58
58
}
59
59
60
60
fn codegen_options ( & self ) -> Option < CodegenOptions > {
You can’t perform that action at this time.
0 commit comments