Age | Commit message (Collapse) | Author |
|
- rename `AST_Seq` to `AST_Sequence`
- raise default sequences_limit from 200 to 800
|
|
- assignment
- boolean
- conditional
- sequence
|
|
- migrate transformation logic from `OutputStream` to `Compressor`
- always turn `undefined` into `void 0` (unless `unsafe`)
- always keep `NaN` except when avoiding local variable redefinition
- introduce `keep_infinity` to suppress `1/0` transform, except when avoiding local variable redefinition
supersedes #1723
fixes #1730
|
|
- move these optimisations out from `Compressor` to `OutputStream`
- fixes behaviour inconsistency when running uglified code from global or module levels due to redefinition
|
|
|
|
fixes #1645
fixes #1646
|
|
The following is wrong:
`a == (b ? a : c)` => `b`
Because:
- `b` may not be boolean
- `a` might have side effects
- `a == a` is not always `true` (think `NaN`)
- `a == c` is not always `false`
|
|
- consolidate `side-effects` optimisations
- improve string `+` optimisation
- enhance literal & `conditionals` optimisations
|
|
- 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`
|
|
Fixes #1154, #1153
|
|
Fixes #511
|
|
|
|
|
|
|
|
|
|
Only transform foo() ? EXP(x) : EXP(y) into EXP(foo() ? x : y) if EXP has no
side effects.
Fix #710
|
|
Don't move the condition on the right side of an assignment when
the left side may have side effects.
Fix #677
|
|
In 992b6b9fcce47ca67ecb14675f10b172ce7a99b5 unit test broke (which I missed). This was due to undeclared variables not being side-effects free.
However, since they're really not side-effect free, just declare them in the test cases.
|
|
and not equivalent
|
|
Close #550
|
|
|
|
|
|
and condition has no side effects
|
|
|
|
foo ? bar(x) : bar(y) ==> bar(foo ? x : y)
|
|
|
|
|
|
|
|
optimizations of if/return/continue seem to be even better now
|
|
- do multiple passes in tighten_body if it was changed
- transform if (foo) return x; return y; ==> return foo?x:y
- don't optimize !0 as true (use best_of after evaluation of constant expr)
With hoist_vars off we now beat UglifyJS v1 on jQuery-1.8.1
|
|
|
|
|
|
a few more tests and some cleanups.
|