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:
parent
a8fc48eea6
commit
7c3162b5e0
|
|
@ -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
|
- `toplevel` (default `false`) -- Pass `true` to mangle names declared in the
|
||||||
top level scope.
|
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:
|
Examples:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|
|
||||||
12
lib/scope.js
12
lib/scope.js
|
|
@ -370,11 +370,13 @@ AST_Symbol.DEFMETHOD("global", function() {
|
||||||
|
|
||||||
function _default_mangler_options(options) {
|
function _default_mangler_options(options) {
|
||||||
options = defaults(options, {
|
options = defaults(options, {
|
||||||
eval : false,
|
eval : false,
|
||||||
ie8 : false,
|
ie8 : false,
|
||||||
keep_fnames : false,
|
keep_fnames : false,
|
||||||
reserved : [],
|
reserved : [],
|
||||||
toplevel : false,
|
toplevel : false,
|
||||||
|
leading_character_set : "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",
|
||||||
|
trailing_character_set: "0123456789"
|
||||||
});
|
});
|
||||||
if (!Array.isArray(options.reserved)) options.reserved = [];
|
if (!Array.isArray(options.reserved)) options.reserved = [];
|
||||||
// Never mangle arguments
|
// Never mangle arguments
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user