File tree 2 files changed +38
-2
lines changed
2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,15 @@ merge(Compressor.prototype, {
383
383
}
384
384
385
385
function mark_defun ( tw , def ) {
386
- if ( def . id in tw . defun_ids ) return def . fixed ;
386
+ if ( def . id in tw . defun_ids ) {
387
+ var marker = tw . defun_ids [ def . id ] ;
388
+ if ( ! marker ) return ;
389
+ if ( marker !== tw . safe_ids ) {
390
+ tw . defun_ids [ def . id ] = undefined ;
391
+ return ;
392
+ }
393
+ return def . fixed ;
394
+ }
387
395
if ( ! tw . in_loop ) {
388
396
tw . defun_ids [ def . id ] = tw . safe_ids ;
389
397
return def . fixed ;
Original file line number Diff line number Diff line change @@ -5999,7 +5999,7 @@ issue_3113_5: {
5999
5999
]
6000
6000
}
6001
6001
6002
- conditional_nested : {
6002
+ conditional_nested_1 : {
6003
6003
options = {
6004
6004
evaluate : true ,
6005
6005
reduce_vars : true ,
@@ -6030,3 +6030,31 @@ conditional_nested: {
6030
6030
}
6031
6031
expect_stdout: "2"
6032
6032
}
6033
+
6034
+ conditional_nested_2: {
6035
+ options = {
6036
+ evaluate : true ,
6037
+ reduce_vars : true ,
6038
+ }
6039
+ input: {
6040
+ var c = 0 ;
6041
+ ( function ( a ) {
6042
+ function f ( ) {
6043
+ a && c ++ ;
6044
+ }
6045
+ f ( ! c && f ( ) , a = 1 ) ;
6046
+ } ) ( ) ;
6047
+ console . log ( c ) ;
6048
+ }
6049
+ expect: {
6050
+ var c = 0 ;
6051
+ ( function ( a ) {
6052
+ function f ( ) {
6053
+ a && c ++ ;
6054
+ }
6055
+ f ( ! c && f ( ) , a = 1 ) ;
6056
+ } ) ( ) ;
6057
+ console . log ( c ) ;
6058
+ }
6059
+ expect_stdout: "1"
6060
+ }
You can’t perform that action at this time.
0 commit comments