File tree Expand file tree Collapse file tree 2 files changed +62
-1
lines changed Expand file tree Collapse file tree 2 files changed +62
-1
lines changed Original file line number Diff line number Diff line change @@ -9957,8 +9957,10 @@ merge(Compressor.prototype, {
9957
9957
}));
9958
9958
9959
9959
function process(ref, name) {
9960
+ var def = name.definition();
9961
+ def.references.push(ref);
9960
9962
var symbol = make_node(AST_SymbolVar, name, name);
9961
- name.definition() .orig.push(symbol);
9963
+ def .orig.push(symbol);
9962
9964
append_var(decls, expressions, symbol);
9963
9965
}
9964
9966
}
Original file line number Diff line number Diff line change @@ -2998,3 +2998,62 @@ issue_5085_2: {
2998
2998
expect_stdout: "PASS"
2999
2999
node_version: ">=6"
3000
3000
}
3001
+
3002
+ issue_5087_1: {
3003
+ options = {
3004
+ collapse_vars : true ,
3005
+ inline : true ,
3006
+ properties : true ,
3007
+ sequences : true ,
3008
+ side_effects : true ,
3009
+ unused : true ,
3010
+ }
3011
+ input: {
3012
+ var a = "PASS" ;
3013
+ ( function ( ) {
3014
+ ( function ( ) {
3015
+ ( function ( [ b ] ) {
3016
+ b && console . log ( b ) ;
3017
+ } ) ( [ a ] ) ;
3018
+ } ) ( ) ;
3019
+ } ) ( ) ;
3020
+ }
3021
+ expect: {
3022
+ var a = "PASS" ;
3023
+ ( function ( ) {
3024
+ var b ;
3025
+ ( b = a ) && console . log ( b ) ;
3026
+ } ) ( ) ;
3027
+ }
3028
+ expect_stdout: "PASS"
3029
+ node_version: ">=6"
3030
+ }
3031
+
3032
+ issue_5087_2: {
3033
+ options = {
3034
+ collapse_vars : true ,
3035
+ inline : true ,
3036
+ passes : 2 ,
3037
+ properties : true ,
3038
+ reduce_vars : true ,
3039
+ sequences : true ,
3040
+ side_effects : true ,
3041
+ unused : true ,
3042
+ }
3043
+ input: {
3044
+ var a = "PASS" ;
3045
+ ( function ( ) {
3046
+ ( function ( ) {
3047
+ ( function ( [ b ] ) {
3048
+ b && console . log ( b ) ;
3049
+ } ) ( [ a ] ) ;
3050
+ } ) ( ) ;
3051
+ } ) ( ) ;
3052
+ }
3053
+ expect: {
3054
+ var a = "PASS" ;
3055
+ a && console . log ( a ) ;
3056
+ }
3057
+ expect_stdout: "PASS"
3058
+ node_version: ">=6"
3059
+ }
You can’t perform that action at this time.
0 commit comments