Skip to content
This repository was archived by the owner on Jan 31, 2018. It is now read-only.
This repository was archived by the owner on Jan 31, 2018. It is now read-only.

UglifyJS filter ast_mangle #21

@outaTiME

Description

@outaTiME

Hi guys,

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

source code says ...

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):

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

thks, asssssssom ... lib!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions