kzc
335b72df03
Fix spidermonkey AST (ESTree) export and import, Array holes
...
Fixes : #1156 #1161
Also add test to exercise Uglify after spidermonkey export/import of itself.
2016-06-30 21:44:12 +02:00
Anthony Van de Gejuchte
6eaeb19a4a
Add exponentiation operator
2016-06-22 12:23:37 +02:00
kzc
ace8aaa0f4
Fix conditional expressions of form (x ? -1 : -1)
...
Fixes #1154 , #1153
2016-06-21 14:52:13 -04:00
kzc
0c003c92a8
Don't replace undefined, NaN and Infinity within with scope
2016-06-21 10:53:29 +02:00
Anthony Van de Gejuchte
2246c79318
Merge branch 'master' into fix-harmony
2016-06-20 19:21:25 +02:00
Anthony Van de Gejuchte
d7971ba0e4
Fix test262 failures related to <, <=, in and instanceof
...
Fixed-by: @kzc
2016-06-15 23:11:08 +02:00
Richard van Velzen
0a3d780327
Merge branch 'master' into harmony
2016-06-12 17:29:42 +02:00
Anthony Van de Gejuchte
ea31da2455
Don't drop unused if scope uses with statement
...
Fix provided by @kzc
2016-06-12 14:30:28 +02:00
Richard van Velzen
fa29344781
Merge branch 'master' into harmony
2016-06-09 22:29:52 +02:00
Anthony Van de Gejuchte
dcfc514c38
Improve yield support and restrict usage of strict
...
- Partially reverting 91cdb93e57 and eaf3911c31 and reimplement
- Add generators support for objects and classes
- Only classes can have static methods so restrict use of it
Special thanks to @rvanvelzen and @kzc for reviewing this patch and
providing constructive feedback over and over again.
2016-06-09 22:22:15 +02:00
kzc
09d5707a8a
collapse_vars: Do not consider RegExp literals to be constants
...
Fixes #1100
2016-05-27 00:03:51 -04:00
Richard van Velzen
0357e5923f
Merge branch 'master' into harmony
2016-05-24 17:56:20 +02:00
kzc
1e390269d4
Optimize if_return for single if/return cases.
...
Fixes #1089
2016-05-24 17:54:08 +02:00
Richard van Velzen
bc49dfd27a
Completely allow evaluating -0
2016-05-24 17:50:29 +02:00
Richard van Velzen
27eedbc302
Never produce -0 when evaluating expressions (like -"")
...
Fix for #1085 . The major case was already there, but more expressions can result in -0.
2016-05-17 22:34:38 +02:00
Richard van Velzen
f63803e3e3
Merge branch 'master' into harmony
2016-05-16 09:53:13 +02:00
kzc
5f464b41e2
Simplify iife new fix
...
as suggested by @rvanvelzen.
Added a test for IIFEs in nested contexts.
2016-05-15 19:12:17 -04:00
Richard van Velzen
63be1f3a4d
Only allow var definitions to be moved into the for-init clause
...
Fixes #1079
2016-05-15 21:00:51 +02:00
kzc
bcc1318d4b
Do not apply negate_iife optimization to new expression
2016-05-09 03:19:28 -04:00
Richard van Velzen
e36e07fa77
Merge branch 'master' into harmony
2016-05-04 20:13:35 +02:00
Richard van Velzen
4fe630431c
Hoist functions when reversing if (x) return; ... vs. if (!x) ...
...
Fixes #1052
2016-04-23 23:48:33 +02:00
kzc
c55dd5ed74
Add passes compress option. Fix duplicate compress warnings.
2016-04-19 20:05:33 +02:00
Richard van Velzen
8571a08a93
Do not attempt evaluating class expressions
...
Broadly the same as function expressions - these actually are statements but
we're limited by the inheritance tree.
Fixes #1044
2016-04-19 20:01:26 +02:00
Richard van Velzen
68cc14f846
Fixups after merge
2016-04-18 15:51:32 +02:00
Richard van Velzen
f94497d1d6
Merge branch 'master' into harmony
2016-04-18 15:50:35 +02:00
Richard van Velzen
4b4528ee05
Prevent endless recursion when evaluating self-referencing consts
...
Fix #1041
2016-04-13 15:03:31 +02:00
Richard van Velzen
eaf3911c31
Consider yield expressions as having side-effects
...
See #1043
2016-04-13 14:39:49 +02:00
Mihai Bazon
b5a7a231f7
Actually limit sequence length.
...
Fix #1038
2016-04-12 14:17:24 +03:00
kzc
3907a5e3b2
Fix warnings for referenced non-hoisted functions.
...
Fixes #1034
Also added `expect_warnings` functionality to test framework.
2016-04-11 18:15:20 +02:00
Mihai Bazon
9317237372
Avoid using inherited hasOwnProperty
...
Fix #1031
2016-04-07 13:16:22 +03:00
kzc
98434258d0
Optimize ternaries with boolean consequent or alternative.
...
Fixes #511
2016-04-02 17:22:12 +02:00
kzc
45ddb9caeb
Speedup unused compress option for already minified code
...
Fixes : #321 #917 #1022
2016-03-28 17:58:50 -04:00
Fábio Santos
634f231b78
First class block scope
...
- Make let, const, and class symbols be declared in a block scope.
- Piggy back on existing catch symbol implementation to get block-aware mangling working
- Make sure unused block-scoped declarations can be dropped
- Don't eliminate a block if it has a block-scoped declaration
- Remove silly empty anonymous blocks left over from drop_unused
- AST_Toplevel now gets to call drop_unused too, since block-scoped variables aren't global!
- Don't consider block declarations global
2016-03-27 19:40:20 +02:00
Fábio Santos
accca2445f
fix crash: Import statements don't abort
2016-03-14 12:54:05 +01:00
Fábio Santos
d35a9e7839
Importing names from places
2016-03-14 12:54:05 +01:00
kzc
11b0efdf84
boolean_expression ? true : false --> boolean_expression
2016-02-22 17:59:36 +01:00
kzc
5486b68850
Take operator || precendence into account for AST_If optimization.
...
Fixes #979 .
2016-02-21 12:05:02 -05:00
alexlamsl
6547437725
preserve ThisBinding for side_effects
2016-02-17 19:34:01 +01:00
Richard van Velzen
9662228f6a
Don't compress (0, eval)() to eval()
2016-02-16 19:00:48 +01:00
alexlamsl
31a9b05c96
Preserve ThisBinding in conditionals & collapse_vars
...
Fixes #973
2016-02-16 18:47:49 +01:00
kzc
7c3fee9e31
collapse_vars: avoid replacement across AST_Case nodes to be on safe side even though no issues seen.
2016-01-29 10:35:07 -05:00
kzc
929de2b0de
collapse_vars: fix if/else and ternary operator side effects
2016-01-28 12:17:06 -05:00
kzc
af2472d85e
collapse_vars: fix bug in repeated var defs of same name
2016-01-28 16:48:50 +01:00
kzc
0a38a688f9
fix bug in collapse_vars for right side of "||" and "&&"
2016-01-27 14:18:46 -05:00
kzc
f4c2ea37bf
Collapse single use var definitions
...
Fix #721
2016-01-27 11:48:15 +02:00
Mihai Bazon
fe4e9f9d97
Fix hoisting the var in ForIn
...
Close #913
2016-01-05 13:56:52 +02:00
Richard van Velzen
7f3dbb6df7
Merge branch 'master' into harmony
2015-12-26 17:59:38 +01:00
kzc
774bda13cd
#873 Fix conditionals optimizations with default compress options
2015-11-24 13:27:50 -05:00
Mihai Bazon
7f48d5b33c
Fix endless loop
...
Close #866
2015-11-16 12:08:24 +02:00
Mihai Bazon
b6968b6bd2
Limit max iterations for tighten_body
...
Ref #866
2015-11-16 12:08:24 +02:00