Ticket #4695: 4695.patch
File 4695.patch, 1.1 KB (added by , 14 years ago) |
---|
-
test/test.js
267 267 268 268 [ "if(a){if(B)doB();}else if(c)doC();" ], 269 269 270 [ "if(a){for(;;){if(B){doB();}}}else{doC();}", 271 "if(a)for(;;){if(B)doB();}else doC();" 272 ], 270 273 ]; 271 274 272 275 var tests = -
_source/includes/scriptcompressor.js
623 623 624 624 var hasCurly = ( !block || !block.getFirstChild() || !!block.getFirstChild().getNext() ); 625 625 626 // Avoid single enclosed 'if...elseif' block combines with any 'else/elseif' 627 // statement following the loop. (#4695) 628 // E.g. if()for(){if()elseif()}else AND ..elseif()for(){if()}else 629 if( !hasCurly ) 630 { 631 try 632 { 633 block.getFirstChild().getFirstChild().getType() == Token.IFNE && ( hasCurly = 1 ); 634 } 635 catch( er ){} 636 } 637 626 638 if ( hasCurly ) 627 639 out( '{' ); 628 640