yui/yuglify — pull request #17 by leik (2013-08-19 22:10:16+00:00)
Title: Use a minimal statement as the token string to replace preserved comment block 

When a preserved comment block is followed by an IIFE, the minified js doesn't pass syntax parsing, like closure compiler, because of missing brackets around the IIFE in minified js file.

For example:
```javascript
/*!(C) ORCHESTRAL */

/**
* @module Test
*/
(function() {
console.log('test');
}());
```
The snippet above is a minimal version of a yui 2 module, when wrapped as a yui2in3 module, including YUI2 variable and version information at the bottom, minified version could be:
```javascript
YUI.add("yui2-Test",function(e,t){var n=e.YUI2;
/*!(C) ORCHESTRAL */
function(){console.log("test")}()},"@VERSION@");
```
However, the minified result doesn't compile in closure compiler , neither does it in any browser.
Errors in closure compiler:
JSC_PARSE_ERROR: Parse error. syntax error at line 4 character 32
function(){console.log("test")}()},"@VERSION@");
^
JSC_PARSE_ERROR: Parse error. missing } after function body at line 4 character 47
function(){console.log("test")}()},"@VERSION@");
^
The missing brackets around the IIFE is the cause.

The deeper reason behind this is that yuglify uses a simple string ("yUglify: preserved comment block") as the token to replace the preserved comment. If preserved comment block is followed by an IIFE, after uglify minifies the js file, in which preserved comments has been replaced with tokens, it adds a comma between the token string and the IIFE and removes the surrounding brackets of the IIFE, because uglify __joins consecutive simple statements into sequences using the “comma operator”__. (if I understand correctly after a deep debugging.)

Therefore instead of using a simple string as the token and handles the inconsistency that sometimes it adds comma sometimes it doesn't, a minimal _switch_ could be a better alternative:
```javascript
switch("yUglify: preserved comment block"){}
```
and the uglify result is consistent for all the cases. And of course it fixes the IIFE after preserved comment block:
```javascript
YUI.add("yui2-Test",function(e,t){var n=e.YUI2;
/*!(C) ORCHESTRAL */
(function(){console.log("test")})()},"@VERSION@");
```

It requires a minor fix of shifter's tests. I will send another PR about the tests fix pretty soon.