Changeset 2370
- Timestamp:
- 2008-08-20 09:56:39 (5 months ago)
- Location:
- CKEditor/branches/prototype/_dev/packager/ckpackager
- Files:
-
- 3 modified
-
_dev/dump.bat (modified) (1 diff)
-
includes/scriptcompressor.js (modified) (5 diffs)
-
test/test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/prototype/_dev/packager/ckpackager/_dev/dump.bat
r2366 r2370 7 7 8 8 java -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 85 85 { 86 86 var first = String( arguments[ 0 ] ); 87 first = first.substr( 0, 1 ); 87 88 88 89 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 ] ) ) 94 93 { 95 94 output.push( ' ' ); … … 98 97 } 99 98 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 ] ); 102 102 103 103 for ( var i = 0 ; i < arguments.length ; i++ ) … … 484 484 485 485 if ( expression.getFirstChild().getType() != Token.TRUE ) 486 writeNode( expression );486 writeNode( expression, { noSemiColon : true } ); 487 487 488 488 out( ';' ); 489 489 490 writeNode( incrementExpression ); 491 492 // Removes the ";" sent by EXPR_VOID. 493 output.pop(); 494 outputSize--; 490 writeNode( incrementExpression, { noSemiColon : true } ); 495 491 496 492 out( ')' ); … … 545 541 { 546 542 out( ';' ); 547 writeNode( child.target.getNext() );543 writeNode( child.target.getNext(), { noSemiColon : true } ); 548 544 out( ';' ); 549 545 … … 555 551 if ( incrementExpression.getType() == Token.EXPR_VOID ) 556 552 { 557 writeNode( incrementExpression ); 558 559 // Removes the ";" sent by EXPR_VOID. 560 output.pop(); 561 outputSize--; 553 writeNode( incrementExpression, { noSemiColon : true } ); 562 554 } 563 555 } -
CKEditor/branches/prototype/_dev/packager/ckpackager/test/test.js
r2369 r2370 249 249 [ "o={'\\b':'\\\\b','\\t':'\\\\t','\\n':'\\\\n','\\f':'\\\\f','\\r':'\\\\r','\"':'\\\\\"','\\\\':'\\\\\\\\'};" ], 250 250 251 [ "if(a){}else{}" ] 251 [ "if(a){}else{}" ], 252 253 [ "a=b+c*1;", 254 "a=b+ +c;" ] 252 255 ]; 253 256