diff --git a/README.md b/README.md index 270f20cb..d014e337 100644 --- a/README.md +++ b/README.md @@ -783,6 +783,13 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u - `toplevel` (default `false`) -- Pass `true` to mangle names declared in the top level scope. +- `leading_character_set` (default `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_`) -- Pass + a string of characters to be used at the start of, within, or at the end of + mangled names. + +- `trailing_character_set` (default `0123456789`) -- Pass a string of characters + only to be used within, or at the end of mangled names (never the start). + Examples: ```javascript diff --git a/lib/scope.js b/lib/scope.js index b15f9da3..a47ff1a4 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -370,11 +370,13 @@ AST_Symbol.DEFMETHOD("global", function() { function _default_mangler_options(options) { options = defaults(options, { - eval : false, - ie8 : false, - keep_fnames : false, - reserved : [], - toplevel : false, + eval : false, + ie8 : false, + keep_fnames : false, + reserved : [], + toplevel : false, + leading_character_set : "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", + trailing_character_set: "0123456789" }); if (!Array.isArray(options.reserved)) options.reserved = []; // Never mangle arguments