Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15b5f70338 | ||
|
|
7f48d5b33c | ||
|
|
b6968b6bd2 | ||
|
|
08b80302eb | ||
|
|
645626ebe8 |
@@ -348,7 +348,7 @@ to set `true`; it's effectively a shortcut for `foo=true`).
|
|||||||
- `drop_console` -- default `false`. Pass `true` to discard calls to
|
- `drop_console` -- default `false`. Pass `true` to discard calls to
|
||||||
`console.*` functions.
|
`console.*` functions.
|
||||||
|
|
||||||
- `keep_fargs` -- default `false`. Pass `true` to prevent the
|
- `keep_fargs` -- default `true`. Prevents the
|
||||||
compressor from discarding unused function arguments. You need this
|
compressor from discarding unused function arguments. You need this
|
||||||
for code which relies on `Function.length`.
|
for code which relies on `Function.length`.
|
||||||
|
|
||||||
@@ -372,7 +372,6 @@ when this flag is on:
|
|||||||
- `void 0` → `undefined` (if there is a variable named "undefined" in
|
- `void 0` → `undefined` (if there is a variable named "undefined" in
|
||||||
scope; we do it because the variable name will be mangled, typically
|
scope; we do it because the variable name will be mangled, typically
|
||||||
reduced to a single character)
|
reduced to a single character)
|
||||||
- discards unused function arguments (affects `function.length`)
|
|
||||||
|
|
||||||
### Conditional compilation
|
### Conditional compilation
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ merge(Compressor.prototype, {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function tighten_body(statements, compressor) {
|
function tighten_body(statements, compressor) {
|
||||||
var CHANGED;
|
var CHANGED, max_iter = 10;
|
||||||
do {
|
do {
|
||||||
CHANGED = false;
|
CHANGED = false;
|
||||||
if (compressor.option("angular")) {
|
if (compressor.option("angular")) {
|
||||||
@@ -218,7 +218,7 @@ merge(Compressor.prototype, {
|
|||||||
if (compressor.option("join_vars")) {
|
if (compressor.option("join_vars")) {
|
||||||
statements = join_consecutive_vars(statements, compressor);
|
statements = join_consecutive_vars(statements, compressor);
|
||||||
}
|
}
|
||||||
} while (CHANGED);
|
} while (CHANGED && max_iter-- > 0);
|
||||||
|
|
||||||
if (compressor.option("negate_iife")) {
|
if (compressor.option("negate_iife")) {
|
||||||
negate_iifes(statements, compressor);
|
negate_iifes(statements, compressor);
|
||||||
@@ -384,7 +384,12 @@ merge(Compressor.prototype, {
|
|||||||
continue loop;
|
continue loop;
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
if (ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement
|
// XXX: what was the intention of this case?
|
||||||
|
// if sequences is not enabled, this can lead to an endless loop (issue #866).
|
||||||
|
// however, with sequences on this helps producing slightly better output for
|
||||||
|
// the example code.
|
||||||
|
if (compressor.option("sequences")
|
||||||
|
&& ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement
|
||||||
&& (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) {
|
&& (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) {
|
||||||
CHANGED = true;
|
CHANGED = true;
|
||||||
ret.push(make_node(AST_Return, ret[0], {
|
ret.push(make_node(AST_Return, ret[0], {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"homepage": "http://lisperator.net/uglifyjs",
|
"homepage": "http://lisperator.net/uglifyjs",
|
||||||
"author": "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)",
|
"author": "Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"version": "2.6.0",
|
"version": "2.6.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.8.0"
|
"node": ">=0.8.0"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user