From c9f7d08f297adb6f8e6674ea1c94cef336e434d2 Mon Sep 17 00:00:00 2001 From: homuler Date: Sat, 16 Jul 2016 22:03:36 +0900 Subject: [PATCH 1/5] 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 From 11228fae2c00368f6d315e81d1fa3c98f7fea679 Mon Sep 17 00:00:00 2001 From: homuler Date: Sat, 16 Jul 2016 22:57:39 +0900 Subject: [PATCH 2/5] modify a sentence --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 6fab2886..62455e90 100644 --- a/README.md +++ b/README.md @@ -379,8 +379,7 @@ to set `true`; it's effectively a shortcut for `foo=true`). - `keep_fnames` -- default `false`. Pass `true` to prevent the 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). + `Function.prototype.name`. See also [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. From 4569eaf9987aa80cdb7b2cf7559c31b1c9c48f06 Mon Sep 17 00:00:00 2001 From: homuler Date: Sat, 16 Jul 2016 23:22:28 +0900 Subject: [PATCH 3/5] Fix some document links --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 62455e90..461c1ad6 100644 --- a/README.md +++ b/README.md @@ -379,7 +379,7 @@ to set `true`; it's effectively a shortcut for `foo=true`). - `keep_fnames` -- default `false`. Pass `true` to prevent the compressor from discarding function names. Useful for code relying on - `Function.prototype.name`. See also [the mangle option](#mangle). + `Function.prototype.name`. See also: the `keep_fnames` [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. @@ -698,6 +698,7 @@ Other options: - `keep_fnames` -- default `false`. Pass `true` when you'd not like to mangle function names. Useful for code relying on `Function.prototype.name`. + See also: the `keep_fnames` [compress option](#compressor-options). Examples: From 30f718fe0d01b10a92e2f43ccf6b68b19aa55186 Mon Sep 17 00:00:00 2001 From: homuler Date: Sun, 17 Jul 2016 00:22:18 +0900 Subject: [PATCH 4/5] Fix the document format --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 461c1ad6..e4937e5b 100644 --- a/README.md +++ b/README.md @@ -693,10 +693,10 @@ Other options: - `toplevel` — mangle names declared in the toplevel scope (disabled by default). - - `eval` — mangle names visible in scopes where eval or with are used + - `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 + - `keep_fnames` -- default `false`. Pass `true` to not mangle function names. Useful for code relying on `Function.prototype.name`. See also: the `keep_fnames` [compress option](#compressor-options). From d76f5c8cf9133bde97d4c4cdaf706f5bef28c146 Mon Sep 17 00:00:00 2001 From: homuler Date: Sun, 17 Jul 2016 08:02:42 +0900 Subject: [PATCH 5/5] Not to indent the description of eval option --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4937e5b..5220a405 100644 --- a/README.md +++ b/README.md @@ -693,7 +693,7 @@ Other options: - `toplevel` — mangle names declared in the toplevel scope (disabled by default). - - `eval` — mangle names visible in scopes where eval or with are used + - `eval` — mangle names visible in scopes where eval or with are used (disabled by default). - `keep_fnames` -- default `false`. Pass `true` to not mangle