Age | Commit message (Collapse) | Author |
|
|
|
Also clarify documentation a bit more about using regexp as filter
|
|
|
|
For #1307.
|
|
Also removing more code within "loop" while at it.
|
|
Fix for #1256, partially reverts d854523783b4
|
|
|
|
|
|
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
|
|
* Do not mangle when no mangle is required
* Improve use_asm reset while printing code
|
|
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.
|
|
* Don't interpret strings with escaped content as directive
* Don't interpret strings after empty statement as directive
* Adapt output to prevent strings being represent as directive
* Introduce UGLIFY_DEBUG to allow internal testing like EXPECT_DIRECTIVE
|
|
|
|
|
|
|
|
|
|
|
|
Fixes #1017.
Tab characters within strings are now output as `\t` in all output modes.
|
|
|
|
Also never bother comment options to filter comment5/shebang comments
as they have their custom filter.
|
|
(will only work properly if the SM tree contains "raw" properties for
Literal number nodes)
|
|
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
|
|
Caught an error in #847 as well - `output` wasn't passed anywhere which led to an exception. `options` was available though.
|
|
|
|
|
|
read_escaped_char coverts them
|
|
|
|
|
|
within string literals.
|
|
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.
|
|
|
|
Fixes #755
|
|
The issue was more obvious when max_line_len has a small value, rather than
the default 32K characters. A blank line showed up after most statements.
|
|
`-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.
|
|
Fixes #583
|
|
`\uFEFF` (ZERO WIDTH NO-BREAK SPACE) is removed when parsing, but was
un-escaped for the output when `ascii_only` was false.
When using
UglifyJS multiple times (creating packages from minified sources, for
example), this would lead to problems because the byte was removed when
parsing for the second time.
|
|
Fix max_line_len not working for JSON files
|
|
NaN and Infinity were replaced in the output generation, instead of
during compression. This could lead to results where `1/0` was inserted
without parens leading to invalid output.
The nodes are replaced in the compression step now, and the output
generation returns their regular names. This should not be a problem,
since they're already only constructed from the original name.
|
|
As `maybe_newline()` is only called when `might_need_semicolon` is `true`, the `max_line_len` option has no effect for files without (or with very few) semicolons (like JSON files). A simple for this problem is to use `maybe_newline()` instead of `noop` as the `newline()` function in non-beautify mode.
|
|
Do the same as for AST_Unary, since we output undefined as `void 0`.
Reported at https://github.com/mishoo/UglifyJS2/issues/338#issuecomment-48858341
|
|
(lame fix for #503)
|
|
- also handle x = + ++y, x = - --y;
- don't use parens, a space suffices.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|