aboutsummaryrefslogtreecommitdiff
path: root/test/compress/conditionals.js
AgeCommit message (Collapse)Author
2017-04-12convert `AST_Seq` from binary tree to array (#1460)Alex Lam S.L
- rename `AST_Seq` to `AST_Sequence` - raise default sequences_limit from 200 to 800
2017-04-08fix `delete` corner cases (#1799)Alex Lam S.L
- assignment - boolean - conditional - sequence
2017-04-01improve compression of undefined, NaN & Infinitiy (#1748)Alex Lam S.L
- 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
2017-03-29output optimal representations of NaN & Infinity (#1723)Alex Lam S.L
- move these optimisations out from `Compressor` to `OutputStream` - fixes behaviour inconsistency when running uglified code from global or module levels due to redefinition
2017-03-26optimize conditional when condition symbol matches consequent (#1684)kzc
2017-03-24fix assignment extraction from conditional (#1651)Alex Lam S.L
fixes #1645 fixes #1646
2017-03-19fix commit 88fb83a (#1622)Alex Lam S.L
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`
2017-02-28warn & drop `#__PURE__` iff IIFE is dropped (#1511)Alex Lam S.L
- consolidate `side-effects` optimisations - improve string `+` optimisation - enhance literal & `conditionals` optimisations
2017-01-26optimise binary operands with evaluate() (#1427)Alex Lam S.L
- 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`
2016-06-21Fix conditional expressions of form (x ? -1 : -1)kzc
Fixes #1154, #1153
2016-04-02Optimize ternaries with boolean consequent or alternative.kzc
Fixes #511
2016-02-22boolean_expression ? true : false --> boolean_expressionkzc
2015-11-24#873 Fix `conditionals` optimizations with default compress optionskzc
2015-06-14spacingkzc
2015-06-11optimizations for && and || where left side is constant expressionkzc
2015-05-18Fix compressing conditionalsMihai Bazon
Only transform foo() ? EXP(x) : EXP(y) into EXP(foo() ? x : y) if EXP has no side effects. Fix #710
2015-04-13Fix compression of conditionalsMihai Bazon
Don't move the condition on the right side of an assignment when the left side may have side effects. Fix #677
2015-02-11Clean up unit test breakageRichard van Velzen
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.
2015-01-13Optimize conditionals where the consequent and alternative are both booleans ↵Tal Ater
and not equivalent
2014-09-28Referencing a global is assumed to have side effects.Mihai Bazon
Close #550
2014-09-04Compress conditions that have side effects using sequencesTal Ater
2014-09-03Added a test for else ifTal Ater
2014-09-02Compress conditional assignments where all possible outcomes are equivalant ↵Tal Ater
and condition has no side effects
2014-02-06Simplify nested conditionals if possibleMatt Basta
2013-12-29Conditional/call optimizationMihai Bazon
foo ? bar(x) : bar(y) ==> bar(foo ? x : y)
2012-10-03added option for side-effect-free statements, fix testMihai Bazon
2012-10-03disable `hoist_vars` by default and change `comparations` to `comparisons`Mihai Bazon
2012-09-17minorMihai Bazon
2012-09-16rewrite handle_if_returnMihai Bazon
optimizations of if/return/continue seem to be even better now
2012-09-13few more optimizations:Mihai Bazon
- 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
2012-09-12minorMihai Bazon
2012-09-10more progress on the compressor (WIP)Mihai Bazon
2012-09-07always keep declarations found in unreachable codeMihai Bazon
a few more tests and some cleanups.