File tree 2 files changed +35
-0
lines changed
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -11160,6 +11160,7 @@ Compressor.prototype.compress = function(node) {
11160
11160
function append_var(decls, expressions, name, value) {
11161
11161
var def = name.definition();
11162
11162
if (!scope.var_names().has(name.name)) {
11163
+ if (def.first_decl === name) def.first_decl = null;
11163
11164
scope.var_names().set(name.name, true);
11164
11165
decls.push(make_node(AST_VarDef, name, {
11165
11166
name: name,
Original file line number Diff line number Diff line change @@ -2294,3 +2294,37 @@ issue_5591: {
2294
2294
]
2295
2295
node_version: ">=4"
2296
2296
}
2297
+
2298
+ issue_5741: {
2299
+ options = {
2300
+ inline : true ,
2301
+ join_vars : true ,
2302
+ reduce_vars : true ,
2303
+ }
2304
+ input: {
2305
+ "use strict" ;
2306
+ ( function ( a ) {
2307
+ let b = function ( ) {
2308
+ var c = a ;
2309
+ console . log ( c ) ;
2310
+ } ( ) ;
2311
+ function g ( ) {
2312
+ a ++ ;
2313
+ b ;
2314
+ }
2315
+ } ) ( "PASS" ) ;
2316
+ }
2317
+ expect: {
2318
+ "use strict" ;
2319
+ ( function ( a ) {
2320
+ let b = ( c = a , void console . log ( c ) ) ;
2321
+ var c ;
2322
+ function g ( ) {
2323
+ a ++ ;
2324
+ b ;
2325
+ }
2326
+ } ) ( "PASS" ) ;
2327
+ }
2328
+ expect_stdout: "PASS"
2329
+ node_version: ">=4"
2330
+ }
You can’t perform that action at this time.
0 commit comments