kzc
bd0ae6569f
return undefined optimization no longer uses return_void_0 option
2015-10-29 08:19:12 +01:00
kzc
7491d07666
optimize return undefined and return void 0
2015-10-29 08:19:12 +01:00
Fábio Santos
b31918bbf0
computed properties
2015-10-12 21:38:20 +01:00
Richard van Velzen
b14496c742
Merge branch 'master' into harmony
...
Conflicts:
lib/compress.js
2015-10-12 08:54:44 +02:00
kzc
593677d2ff
Add proper support for "use asm"; blocks. Disable -c optimization within "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.
2015-10-07 10:00:28 +02:00
Ville Lautanala
5fd12451f9
Control keeping function arguments with a single option
2015-09-14 19:38:45 +02:00
Richard van Velzen
991fa99655
Merge branch 'master' into harmony
2015-09-13 14:17:45 +02:00
Richard van Velzen
e3bd223dac
Don't change sequences that influence lexical binding in calls
...
Fixes #782
2015-08-25 10:53:35 +02:00
Fábio Santos
c44c2d6c21
Parse and compress destructuring VarDefs
2015-08-21 12:04:26 +02:00
Richard van Velzen
35b31bdd4e
Merge branch 'master' into harmony
2015-08-21 11:58:35 +02:00
Richard van Velzen
c8b82583d2
Merge pull request #773 from fabiosantoscode/harmony-typeof-arrows
...
Fix evaluating the typeof an arrow function.
2015-08-21 11:51:42 +02:00
Fábio Santos
4c12cccff9
remove Symbol's argument when we're unsafe and it's undeclared
2015-08-14 22:44:16 +01:00
Fábio Santos
dcce4e5c66
Fix evaluating the typeof an arrow function. Using evaluate on used to cause a crash.
2015-08-14 22:05:42 +01:00
Christopher Chedeau
3ff0b9e0c9
[Fix] --define replaces SymbolRefs in LHS of assignments
...
See #208 for context
2015-08-10 11:22:36 -07:00
Fábio Santos
9863f0efa3
expand parameters
...
Conflicts:
test/compress/harmony.js
2015-08-05 21:15:23 +02:00
Fábio Santos
fa5c4f2d03
Adding arrow functions
2015-08-04 00:57:53 +01:00
Fábio Santos
ad344c5be3
Add a test to verify that destructuring arguments work with #203 code
2015-07-29 14:54:45 +02:00
Fábio Santos
96b89e34a3
test that names used in destructurings don't get hoisted
2015-07-29 14:54:45 +02:00
Fábio Santos
4644becb9b
do not support destructuring arguments and ngInject
2015-07-29 14:54:45 +02:00
Fábio Santos
32f76f7ff8
Starting destructuring.
2015-07-29 14:54:45 +02:00
thorn0
252fc65558
Advanced way to specify if a function call might have side effects. #400
2015-07-29 14:36:42 +02:00
Mihai Bazon
905b601178
Don't attempt to negate non-boolean AST_Binary
...
Fix #751
2015-07-22 16:55:55 +03:00
Mihai Bazon
63fb2d5a44
Merge pull request #735 from kzc/master
...
optimizations for && and || where left side is constant expression
2015-07-20 09:58:01 +03:00
Mihai Bazon
85a5fc0aeb
Don't drop parens in a * (b * c). Close #744
2015-06-30 10:10:29 +03:00
kzc
f47b2b52a5
operator && and || optimization: add "else" before "if" as intended
2015-06-14 17:44:26 -04:00
kzc
fedb6191a1
optimizations for && and || where left side is constant expression
2015-06-11 23:22:38 -04:00
Mihai Bazon
a5b60217ce
Fix compressing conditionals
...
Only transform foo() ? EXP(x) : EXP(y) into EXP(foo() ? x : y) if EXP has no
side effects.
Fix #710
2015-05-18 13:56:04 +03:00
Mihai Bazon
c3a10c135e
Avoid spurious brackets when dropping unused vars
...
Fix #702
2015-05-04 14:49:17 +03:00
Mihai Bazon
274e1b3dc7
Drop NaN -> 0/0 transformation.
...
Fix #687
2015-04-17 11:26:36 +03:00
Mihai Bazon
18c63ff3d8
Fix compression of conditionals
...
Don't move the condition on the right side of an assignment when
the left side may have side effects.
Fix #677
2015-04-13 17:29:48 +03:00
Mihai Bazon
276b9a31cd
Fix compressing ![foo()]; as a statement
...
need to check whether the literal has any side effects before replacing that
with `false`.
2015-03-23 23:27:00 +02:00
Mihai Bazon
5801fa39e9
[sequencesize] Actually even better:
...
do create the sequence even if the stat list is bigger than 2000 statements,
but limit the sequence itself to 2000 expressions.
Ref #414
2015-03-22 13:02:45 +02:00
Mihai Bazon
f0ab1b02e6
Avoid sequencesize for more than 2000 statements.
...
It hardly saves any bytes for a sequence so long, and it risks blowing the
stack with the recursive Seq functions.
Ref #414
2015-03-22 12:51:15 +02:00
Mihai Bazon
36c28e02fd
Add start/end nodes for NaN/Infinity transformations
2015-03-22 12:50:36 +02:00
Mihai Bazon
ecfd881ac6
Keep unused function arguments by default
...
Discarding unused function arguments affects function.length, which can lead
to some hard to debug issues. This optimization is now done only in "unsafe
mode".
Fix #121
2015-03-20 10:28:51 +02:00
Richard van Velzen
992b6b9fcc
Fix invalid removal of left side in && and || compression
...
See #637 . This does not produce the optimal result, but it does prevent the removal of non-side-effect-free code.
2015-02-11 21:08:41 +01:00
Richard van Velzen
605362f89d
Drop all console statements properly
...
Because the base reference can be an member expression as well, we have to dig a bit deeper to find the leftmost base reference.
Fixes #451
2015-01-31 13:24:44 +01:00
Tal Ater
a1a4c2ada7
Optimize conditionals where the consequent and alternative are both booleans and not equivalent
2015-01-13 18:27:21 +01:00
Richard van Velzen
42ecd42ac0
Replace the correct node when replacing in void sequences
...
Close #611 .
2015-01-12 17:09:34 +01:00
Mihai Bazon
a10f6a96d7
Merge pull request #482 from arty-name/inline-ng-inject
...
added @ngInject support for inline functions
2015-01-11 12:10:42 +02:00
Mihai Bazon
61c233a08e
Fix make_node_from_constant for Regexp-s
...
Close #588
2015-01-07 11:20:04 +02:00
Mihai Bazon
d2d716483a
aborts(AST_If) returns the if node
...
Previously it returned the abort node from the alternative branch. This is
not much use as it can be different from the one in the body
branch (i.e. return vs. throw) and can trick us into issues like #591 .
Fix #591
2015-01-06 14:01:35 +02:00
Mihai Bazon
e1f0747e4c
Support keep_fnames in compressor, and --keep-fnames. #552
...
Passing `--keep-fnames` will enable it both for compressor/mangler, so that
function names will not be dropped (when unused) nor mangled.
2015-01-05 11:03:13 +02:00
Richard van Velzen
f4d36a58c2
Fix #569
...
When no arguments are given to `new Function()`, it should be treated as
a regular anonymous function (http://es5.github.io/#x15.3.2.1 )
2015-01-04 13:37:59 +01:00
Richard van Velzen
c75f5a1fd8
Fix #597
...
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.
2014-12-31 12:23:00 +01:00
Mihai Bazon
01d19b4b52
Referencing a global is assumed to have side effects.
...
Close #550
2014-09-28 11:18:25 +03:00
Tal Ater
fb0ec720a4
Compress conditions that have side effects using sequences
2014-09-04 02:57:49 +03:00
Tal Ater
885835a655
Compress conditional assignments where all possible outcomes are equivalant and condition has no side effects
2014-09-02 23:30:25 +03:00
Mihai Bazon
4c64554808
Turn foo.new into foo["new"] when not --screw-ie8. Fix #534
2014-08-26 10:11:01 +03:00
Mihai Bazon
548beeb6b1
Prevent error for Function(""). Close #538
2014-08-20 09:16:34 +03:00