Age | Commit message (Collapse) | Author |
|
- only drops side-effect-free arguments
- drop side-effect-free parts with discarded value from `AST_Seq` & `AST_SimpleStatement`
closes #1494
|
|
- never exceed specified limit
- otherwise warning is shown
- enabled only for final output
closes #1496
|
|
- `Array.prototype.slice` => `[].slice`
closes #1491
|
|
closes #1487
|
|
- support arrays, objects & AST_Node
- support `"a.b":1` on both cli & API
- emit warning if variable is modified
- override top-level variables
fixes #1416
closes #1198
closes #1469
|
|
fix invalid boolean conversion now exposed in `make_node_from_constant()`
closes #1477
|
|
- update modified flag between compress() passes
- support IIFE arguments
- fix corner case with multiple definitions
closes #1473
|
|
- utilise in_use_ids instead of unreferenced()
- drop_unused now up-to-date for subsequent passes
closes #1476
|
|
previously test cases with the same name would be skipped except for the last one
`test/run-test.js` will now report duplicated names as errors
closes #1461
|
|
closes #1459
|
|
- remove extra tree scanning phase for `negate_iife`
- `negate_iife` now only deals with the narrowest form, i.e. IIFE sitting directly under `AST_SimpleStatement`
- `booleans`, `conditionals` etc. will now take care the rest via more accurate accounting
- `a(); void b();` => `a(); b();`
fixes #1288
closes #1451
|
|
shuffle associative operations to minimise parentheses and aid other uglification efforts
closes #1454
|
|
N = 2:
a;
b;
c;
d;
was:
a, b;
c;
d;
now:
a, b;
c, d;
fixes #1455
closes #1457
|
|
- `do{...}while(false)` => `{...}`
- clean up `AST_While` logic
closes #1452
|
|
fixes
- [a].join() => "" + a
- ["a", , "b"].join() => "a,,b"
- ["a", null, "b"].join() => "a,,b"
- ["a", undefined, "b"].join() => "a,,b"
improvements
- ["a", "b"].join(null) => "anullb"
- ["a", "b"].join(undefined) => "a,b"
- [a + "b", c].join("") => a + "b" + c
closes #1453
|
|
- assign statement does not count towards variable usage by default
- only works with assignments on the same scope level as declaration
- can be disabled with `unused` set to "keep_assign"
- `toplevel` to drop unused top-level variables and/or functions
- `top_retain` to whitelist top-level exceptions
closes #1450
|
|
closes #1449
|
|
move out of unsafe, guard corner case with screw_id8 instead
closes #1446
|
|
happens when inner function:
- just below top level
- not referenced
- `unused` is disabled
closes #1445
|
|
remove extraneous call to AST_SymbolRef.reference()
closes #1443
|
|
closes #1437
|
|
improved reduce_vars & binary operands produce more optimal results
|
|
* fix mangling collision with keep_fnames
fixes #1423
* pass mangle options to figure_out_scope()
bring command-line in line with minify()
|
|
- remove call to evaluate() in is_constant() and let nested optimize() does its job instead
- reject RegExp in is_constant() and remove special case logic under collapse_vars
- operands to conditionals optimisation are now always evaluate()-ed
- throw error in constant_value() instead of returning undefined to catch possible bugs, similar to make_node_from_constant()
- optimise binary boolean operators under `evaluate` instead of `conditionals`
|
|
- gated by `unsafe`
- replaces previous optimisation specific to String.length
- "123"[0] => 1
- [1, 2, 3][0] => 1
- [1, 2, 3].length => 3
- does not apply to objects with overridden prototype functions
|
|
|
|
Clarify docs, help and tests for --support-ie8 and screw_ie8=false
|
|
|
|
Patch by @AshleyScirra
Based on: PR #1316
Renamed the CLI debug option to --mangle-props-debug
Fixes: #1321 name collision in --mangle-props=unquoted
|
|
|
|
|
|
For #1307.
|
|
Fixes #1289 with suggestion by @rvanvelzen
|
|
|
|
|
|
|
|
Fix for #1256, partially reverts d854523783b4
|
|
|
|
Fixes: #1247
Fix --mangle-props and --name-cache inconsistency.
AST_Dot and AST_Sub properties are now mangled by --mangle-props
without regard to being used in an assignment statement.
Note: if --mangle-props is used then *all* javascript files used must
be uglified with the same mangle options.
Fix the ignore_quoted=true mangle option, also known as
`--mangle-props=unquoted`. If a given property is quoted anywhere
it will not be mangled in any quoted or non-quoted context.
|
|
|
|
|
|
- Fixes #1205
- Fix provided by @kzc
|
|
Fixes: #1202
|
|
catch identifier is mangled correctly for ES5 standards-compliant JS engines by default.
Unconditionally use the ie8 if/do-while workaround whether or not --screw-ie8 is enabled.
To support non-standard ie8 javascript use: uglifyjs --support-ie8
|
|
This should simplify and improve implementation, make it easier to
implement template strings, and keep master a bit more in sync with
harmony.
Previous implementation wasn't broken, though the loop gave me the
impression it could read infinite numbers and annoyed me a bit. It was
also slightly unnecessary because the lookup involved only 3 characters.
|
|
Fixes #1154, #1153
|
|
|
|
The option added in fbbaa42ee55a7f753f7cab9b1a905ccf73cf26d5 wasn't
being respected inside object literals, so quoted property names would
still be stripped out with this option.
This is mostly a corner-case, but useful when the output is passed to
something like the Closure compiler, where quoted property names can be
used to prevent mangling.
|
|
Fixed-by: @kzc
|
|
|