mozilla/dryice — Issue #21: UglifyJS filter ast_mangle
Author: outaTiME
Created: 2011-12-01 13:00:38+00:00
State: open

Hi guys,

seeing the source code i found something not compatible with UglifyJS documentation ...

source code says ...

```javascript
copy.filter.uglifyjs = function(input) {
if (typeof input !== 'string') {
input = input.toString();
}

var opt = copy.filter.uglifyjs.options;
var ast = ujs.parser.parse(input, opt.parse_strict_semicolons);

if (opt.mangle) {
ast = ujs.uglify.ast_mangle(ast, opt.mangle_toplevel);
}

if (opt.squeeze) {
ast = ujs.uglify.ast_squeeze(ast, opt.squeeze_options);
if (opt.squeeze_more) {
ast = ujs.uglify.ast_squeeze_more(ast);
}
}

return ujs.uglify.gen_code(ast, opt.beautify);
};
```

but the "ast_mangle" method will be need this way (not boolean value):

```javascript
ast_mangle(ast, options)
```

where the options will be:

* toplevel – mangle toplevel names (by default we don’t touch them).
* except – an array of names to exclude from compression.
* defines – an object with properties named after symbols to replace.

checkout:

https://github.com/mishoo/UglifyJS/blob/master/README.org