Age | Commit message (Collapse) | Author |
|
For #1307.
|
|
Also removing more code within "loop" while at it.
|
|
|
|
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
|
|
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.
|
|
|
|
Fixes #974 and #972
|
|
Fix for #963. This allows stuff like `--define a=1 --define b=1` besides only `--define a=1,b=1`
|
|
It's now available during tree walking, i.e. walker.has_directive("use
asm"), rather than as part of the scope. It's thus no longer necessary
to call `figure_out_scope` before codegen. Added special bits in the
code generator to overcome the fact that it doesn't inherit from
TreeWalker.
Fix #861
|
|
--dump-spidermonkey-ast flag
|
|
it has the same effect as specifying `pure_funcs` in `--compressor`
option, however it's much easier to use
instead of:
--compressor 'pure_func=["Math.floor","debug","console.logTime"]'
it's now possible:
--compressor --pure-funcs Math.floor debug console.logTime
fixes #684
|
|
|
|
SCOPE_IS_NEEDED is unconditionally true now. Refactored floating point literal parsing to be more in keeping with the AST class design.
|
|
"use asm"; sections and preserve floating point literals in their original form. Non-asm.js sections are optimized as before. Asm.js sections can still be mangled and minified of whitespace. No special command line flags are required.
|
|
Improves performance 2x on node > 0.10.
Ref #636
|
|
|
|
|
|
|
|
Close #542, #641, #647
|
|
(even if --mangle-props is not there)
|
|
Close #670
|
|
|
|
|
|
|
|
tools/domprops.json
|
|
|
|
|
|
... and support storing there variable names as well, to help with multiple
invocations when mangling toplevel.
|
|
|
|
We only touch properties that are present in an object literal, or which are
assigned to. Example:
x = { foo: 1 };
x.bar = 2;
x["baz"] = 3;
x[cond ? "qwe" : "asd"] = 4;
console.log(x.stuff);
The names "foo", "bar", "baz", "qwe" and "asd" will be mangled, and the
resulting mangled names will be used for the same properties throughout the
code. The "stuff" will not be, since it's just referenced but never
assigned to.
This *will* break most of the code out there, but could work on carefully
written code: do not use eval, do not define methods or properties by
walking an array of names, etc. Also, a comprehensive list of exclusions
needs to be passed, to avoid mangling properties that are standard in
JavaScript, DOM, used in external libraries etc.
|
|
|
|
`-q 0` (default) use single or double quotes such as to minimize the number of
bytes (prefers double quotes when both will do); this is the previous
behavior.
`-q 1` -- always use single quotes
`-q 2` -- always use double quotes
`-q 3` or just `-q` -- always use the original quotes.
Related codegen option: `quote_style`.
Close #495
Close #460
Some `yargs` guru please tell me why `uglifyjs --help` doesn't display the
help string for `-q` / `--quotes`, and why it doesn't output the expected
argument types anymore, like good old `optimist` did.
|
|
|
|
Passing `--keep-fnames` will enable it both for compressor/mangler, so that
function names will not be dropped (when unused) nor mangled.
|
|
|
|
|
|
Close #288
|
|
|
|
|
|
for now only used for keys passed to `-c` or `-b`.
|
|
i.e. read `-c unsafe,unsafe-comps` as `-c unsafe=true,unsafe_comps=true`
|
|
Close #335
|
|
Fix #333
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
The spec was updated on May 16th since `//@` was causing some issues with IE.
|