Added character set mangle options (#3436).

These currently do nothing, but will soon define which characters the mangler is
allowed to use when generating names.
This commit is contained in:
jameswilddev 2019-07-20 23:10:36 +01:00
parent a8fc48eea6
commit 7c3162b5e0
2 changed files with 14 additions and 5 deletions

View File

@ -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

View File

@ -375,6 +375,8 @@ function _default_mangler_options(options) {
keep_fnames : false,
reserved : [],
toplevel : false,
leading_character_set : "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",
trailing_character_set: "0123456789"
});
if (!Array.isArray(options.reserved)) options.reserved = [];
// Never mangle arguments