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

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions