Changeset 2370

Show
Ignore:
Timestamp:
2008-08-20 09:56:39 (5 months ago)
Author:
fredck
Message:

CKCKPackager now passes the YUI code compression.

Location:
CKEditor/branches/prototype/_dev/packager/ckpackager
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • CKEditor/branches/prototype/_dev/packager/ckpackager/_dev/dump.bat

    r2366 r2370  
    77 
    88java -jar ../js.jar -opt -1 ../ckpackager.js -dump script.js 
     9 
     10:: To save the output to file 
     11:: java -jar ../js.jar -opt -1 ../ckpackager.js -dump script.js > dump.txt 
  • CKEditor/branches/prototype/_dev/packager/ckpackager/includes/scriptcompressor.js

    r2369 r2370  
    8585                { 
    8686                        var first = String( arguments[ 0 ] ); 
     87                        first = first.substr( 0, 1 ); 
    8788 
    8889                        if ( 
    89                                 ( first == '++' && out.last == '+' ) || 
    90                                 ( first == '--' && out.last == '-' ) || 
    91                                 ( out.last == '++' && first == '+' ) || 
    92                                 ( out.last == '--' && first == '-' ) || 
    93                                 ( out.mayNeedSpace && !noSpaceChars[ first.substr( 0, 1 ) ] ) ) 
     90                                ( first == '+' && out.last == '+' ) || 
     91                                ( first == '-' && out.last == '-' ) || 
     92                                ( out.mayNeedSpace && !noSpaceChars[ first ] && !noSpaceChars[ out.last ] ) ) 
    9493                        { 
    9594                                output.push( ' ' ); 
     
    9897                } 
    9998 
    100                 var last = out.last = String( arguments[ arguments.length - 1 ] ); 
    101                 out.mayNeedSpace = ( last == '++' || last == '--' || !noSpaceChars[ last.substr( last.length - 1 ) ] ); 
     99                var last = String( arguments[ arguments.length - 1 ] ); 
     100                last = out.last = last.substr( last.length - 1 ); 
     101                out.mayNeedSpace = ( last == '+' || last == '-' || !noSpaceChars[ last ] ); 
    102102 
    103103                for ( var i = 0 ; i < arguments.length ; i++ ) 
     
    484484 
    485485                                                if ( expression.getFirstChild().getType() != Token.TRUE ) 
    486                                                         writeNode( expression ); 
     486                                                        writeNode( expression, { noSemiColon : true } ); 
    487487 
    488488                                                out( ';' ); 
    489489 
    490                                                 writeNode( incrementExpression ); 
    491  
    492                                                 // Removes the ";" sent by EXPR_VOID. 
    493                                                 output.pop(); 
    494                                                 outputSize--; 
     490                                                writeNode( incrementExpression, { noSemiColon : true } ); 
    495491 
    496492                                                out( ')' ); 
     
    545541                                        { 
    546542                                                out( ';' ); 
    547                                                 writeNode( child.target.getNext() ); 
     543                                                writeNode( child.target.getNext(), { noSemiColon : true } ); 
    548544                                                out( ';' ); 
    549545 
     
    555551                                                if ( incrementExpression.getType() == Token.EXPR_VOID ) 
    556552                                                { 
    557                                                         writeNode( incrementExpression ); 
    558  
    559                                                         // Removes the ";" sent by EXPR_VOID. 
    560                                                         output.pop(); 
    561                                                         outputSize--; 
     553                                                        writeNode( incrementExpression, { noSemiColon : true } ); 
    562554                                                } 
    563555                                        } 
  • CKEditor/branches/prototype/_dev/packager/ckpackager/test/test.js

    r2369 r2370  
    249249                [       "o={'\\b':'\\\\b','\\t':'\\\\t','\\n':'\\\\n','\\f':'\\\\f','\\r':'\\\\r','\"':'\\\\\"','\\\\':'\\\\\\\\'};" ], 
    250250 
    251                 [       "if(a){}else{}" ] 
     251                [       "if(a){}else{}" ], 
     252                 
     253                [       "a=b+c*1;", 
     254                        "a=b+ +c;" ] 
    252255        ]; 
    253256