@@ -409,6 +409,15 @@ drop_toplevel_retain: {
409409 a = 2 ;
410410 console . log ( 3 ) ;
411411 }
412+ expect_stdout: "3"
413+ expect_warnings: [
414+ "INFO: Retaining variable a" ,
415+ "INFO: Retaining variable f" ,
416+ "INFO: Dropping unused variable b [test/compress/drop-unused.js:1,15]" ,
417+ "INFO: Dropping unused variable c [test/compress/drop-unused.js:1,22]" ,
418+ "INFO: Dropping unused function g [test/compress/drop-unused.js:8,17]" ,
419+ "WARN: Dropping unused function h [test/compress/drop-unused.js:9,17]" ,
420+ ]
412421}
413422
414423drop_toplevel_retain_array: {
@@ -442,6 +451,15 @@ drop_toplevel_retain_array: {
442451 a = 2 ;
443452 console . log ( 3 ) ;
444453 }
454+ expect_stdout: "3"
455+ expect_warnings: [
456+ "INFO: Retaining variable a" ,
457+ "INFO: Retaining variable f" ,
458+ "INFO: Dropping unused variable b [test/compress/drop-unused.js:1,15]" ,
459+ "INFO: Dropping unused variable c [test/compress/drop-unused.js:1,22]" ,
460+ "INFO: Dropping unused function g [test/compress/drop-unused.js:8,17]" ,
461+ "WARN: Dropping unused function h [test/compress/drop-unused.js:9,17]" ,
462+ ]
445463}
446464
447465drop_toplevel_retain_regex: {
@@ -471,6 +489,15 @@ drop_toplevel_retain_regex: {
471489 a = 2 ;
472490 console . log ( 3 ) ;
473491 }
492+ expect_stdout: "3"
493+ expect_warnings: [
494+ "INFO: Retaining variable a" ,
495+ "INFO: Retaining variable f" ,
496+ "INFO: Dropping unused variable b [test/compress/drop-unused.js:1,15]" ,
497+ "INFO: Dropping unused variable c [test/compress/drop-unused.js:1,22]" ,
498+ "INFO: Dropping unused function g [test/compress/drop-unused.js:8,17]" ,
499+ "WARN: Dropping unused function h [test/compress/drop-unused.js:9,17]" ,
500+ ]
474501}
475502
476503drop_toplevel_all_retain: {
@@ -501,6 +528,15 @@ drop_toplevel_all_retain: {
501528 a = 2 ;
502529 console . log ( 3 ) ;
503530 }
531+ expect_stdout: "3"
532+ expect_warnings: [
533+ "INFO: Retaining variable a" ,
534+ "INFO: Retaining variable f" ,
535+ "INFO: Dropping unused variable b [test/compress/drop-unused.js:1,15]" ,
536+ "INFO: Dropping unused variable c [test/compress/drop-unused.js:1,22]" ,
537+ "INFO: Dropping unused function g [test/compress/drop-unused.js:8,17]" ,
538+ "WARN: Dropping unused function h [test/compress/drop-unused.js:9,17]" ,
539+ ]
504540}
505541
506542drop_toplevel_funcs_retain: {
@@ -532,6 +568,12 @@ drop_toplevel_funcs_retain: {
532568 function g ( ) { }
533569 console . log ( b = 3 ) ;
534570 }
571+ expect_stdout: "3"
572+ expect_warnings: [
573+ "INFO: Retaining variable a" ,
574+ "INFO: Retaining variable f" ,
575+ "WARN: Dropping unused function h [test/compress/drop-unused.js:9,17]" ,
576+ ]
535577}
536578
537579drop_toplevel_vars_retain: {
@@ -564,6 +606,13 @@ drop_toplevel_vars_retain: {
564606 function h ( ) { }
565607 console . log ( 3 ) ;
566608 }
609+ expect_stdout: "3"
610+ expect_warnings: [
611+ "INFO: Retaining variable a" ,
612+ "INFO: Retaining variable f" ,
613+ "INFO: Dropping unused variable b [test/compress/drop-unused.js:1,15]" ,
614+ "INFO: Dropping unused variable c [test/compress/drop-unused.js:1,22]" ,
615+ ]
567616}
568617
569618drop_toplevel_keep_assign: {
0 commit comments