[Pkg-javascript-commits] [uglifyjs] 236/491: backport #2374 (#2376)
Jonas Smedegaard
dr at jones.dk
Wed Feb 14 19:51:40 UTC 2018
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/3.3.10-1
in repository uglifyjs.
commit 9f4b98f8e461dabf3a3c97c247d9c72f981aa28d
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date: Thu Oct 19 23:02:27 2017 +0800
backport #2374 (#2376)
---
README.md | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 64bbafc..f31486e 100644
--- a/README.md
+++ b/README.md
@@ -515,7 +515,6 @@ if (result.error) throw result.error;
```javascript
{
- warnings: false,
parse: {
// parse options
},
@@ -538,6 +537,7 @@ if (result.error) throw result.error;
nameCache: null, // or specify a name cache object
toplevel: false,
ie8: false,
+ warnings: false,
}
```
@@ -645,6 +645,10 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
compressor from discarding unused function arguments. You need this
for code which relies on `Function.length`.
+- `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 `keep_fnames` [mangle option](#mangle).
+
- `keep_infinity` (default: `false`) -- default `false`. Pass `true` to prevent `Infinity` from
being compressed into `1/0`, which may cause performance issues on Chrome.
@@ -709,6 +713,8 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
`foo === void 0`. Note: recommend to set this value to `false` for IE10 and
earlier versions due to known issues.
+- `unsafe` (default: `false`) -- apply "unsafe" transformations (discussion below)
+
- `unsafe_comps` (default: `false`) -- Reverse `<` and `<=` to `>` and `>=` to
allow improved compression. This might be unsafe when an at least one of two
operands is an object with computed values due the use of methods like `get`,
@@ -716,8 +722,6 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
comparison are switching. Compression only works if both `comparisons` and
`unsafe_comps` are both set to true.
-- `unsafe` (default: `false`) -- apply "unsafe" transformations (discussion below)
-
- `unsafe_Func` (default: `false`) -- compress and mangle `Function(args, code)`
when both `args` and `code` are string literals.
@@ -738,15 +742,19 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
## Mangle options
+- `eval` (default `false`). Pass `true` to mangle names visible in scopes
+ where `eval` or `with` are used.
+
+- `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](#compress-options).
+
- `reserved` (default `[]`). Pass an array of identifiers that should be
excluded from mangling. Example: `["foo", "bar"]`.
- `toplevel` (default `false`). Pass `true` to mangle names declared in the
top level scope.
-- `eval` (default `false`). Pass `true` to mangle names visible in scopes
- where `eval` or `with` are used.
-
Examples:
```javascript
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git
More information about the Pkg-javascript-commits
mailing list