From c9f7d08f297adb6f8e6674ea1c94cef336e434d2 Mon Sep 17 00:00:00 2001 From: homuler Date: Sat, 16 Jul 2016 22:03:36 +0900 Subject: [PATCH] Fix the document of keep_fnames option --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3245d404..6fab2886 100644 --- a/README.md +++ b/README.md @@ -135,11 +135,11 @@ The available options are: --reserved-file File containing reserved names --reserve-domprops Make (most?) DOM properties reserved for --mangle-props - --mangle-props Mangle property names (default `0`). Set to + --mangle-props Mangle property names (default `0`). Set to `true` or `1` to mangle all property names. Set - to `unquoted` or `2` to only mangle unquoted + to `unquoted` or `2` to only mangle unquoted property names. Mode `2` also enables the - `keep_quoted_props` beautifier option to + `keep_quoted_props` beautifier option to preserve the quotes around property names and disables the `properties` compressor option to prevent rewriting quoted properties with dot @@ -378,8 +378,9 @@ to set `true`; it's effectively a shortcut for `foo=true`). for code which relies on `Function.length`. - `keep_fnames` -- default `false`. Pass `true` to prevent the - compressor from mangling/discarding function names. Useful for code relying on - `Function.prototype.name`. + compressor from discarding function names. Useful for code relying on + `Function.prototype.name`. You may also would like to refer to + [the mangle option](#mangle). - `passes` -- default `1`. Number of times to run compress. Use an integer argument larger than 1 to further reduce code size in some cases. @@ -696,6 +697,9 @@ Other options: - `eval` — mangle names visible in scopes where eval or with are used (disabled by default). +- `keep_fnames` -- default `false`. Pass `true` when you'd not like to mangle + function names. Useful for code relying on `Function.prototype.name`. + Examples: ```javascript