Show
Ignore:
Timestamp:
2008-07-23 14:29:20 (6 months ago)
Author:
fredck
Message:

Fixed #1422 : Multiple variables declared in a single "var" statement are now properly renamed by the compressor.
This fix impacted also in the renaming of nested functions.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKpackager/trunk/_source/includes/fckjavascriptcompressor.inc

    r2241 r2268  
    140140                        $parameters = preg_split( '/\s*,\s*/', trim( $match[1] ) ) ; 
    141141 
    142                 $funcProcessor = new FCKFunctionProcessor( $match[0], $parameters, false ) ; 
     142                $hasfuncProcessor = isset( $GLOBALS['funcProcessor'] ) ; 
    143143 
    144                 return $funcProcessor->Process() ; 
     144                if ( $hasfuncProcessor != TRUE ) 
     145                        $GLOBALS['funcProcessor'] = new FCKFunctionProcessor( $match[0], $parameters, false ) ; 
     146                else 
     147                { 
     148                        $GLOBALS['funcProcessor']->_Function = $match[0]; 
     149                        $GLOBALS['funcProcessor']->_Parameters = $parameters; 
     150                } 
     151 
     152                $processed = $GLOBALS['funcProcessor']->Process() ; 
     153                 
     154                $processed = substr_replace( $processed, '', 0, 8 ) ; 
     155 
     156                $processed = FCKJavaScriptCompressor::_ProcessFunctions( $processed ) ; 
     157 
     158                if ( $hasfuncProcessor != TRUE ) 
     159                        unset( $GLOBALS['funcProcessor'] ) ; 
     160                 
     161                return 'function'. $processed ; 
    145162        } 
    146163}