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
Mihai Bazon
7691bebea5
Rework has_directive
...
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
2015-11-11 22:15:25 +02:00
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