Alex Lam S.L
3ca902258c
fix bugs with getter/setter ( #1926 )
...
- `reduce_vars`
- `side_effects`
- property access for object
- `AST_SymbolAccessor` as key names
enhance `test/ufuzz.js`
- add object getter & setter
- property assignment to setter
- avoid infinite recursion in setter
- fix & adjust assignment operators
- 50% `=`
- 25% `+=`
- 2.5% each for the rest
- avoid "Invalid array length"
- fix `console.log()`
- bypass getter
- curb recursive reference
- deprecate `-E`, always report runtime errors
2017-05-14 02:10:34 +08:00
Alex Lam S.L
c391576d52
remove support for const ( #1910 )
...
As this is not part of ES5.
2017-05-12 14:57:41 +08:00
Alex Lam S.L
7bea38a05d
optimize try-catch-finally ( #1731 )
...
- eliminate empty blocks
- flatten out if try-block does not throw
2017-03-30 12:16:58 +08:00
Alex Lam S.L
a3cc3a9b87
make expect_stdout work on Node.js 0.12 ( #1623 )
...
That particular version of Node.js has messed up error messages, so provide a version-specific workaround.
Also fixed an formatting issue which would cause `expect_stdout` to fail if error message contains excerpts of input.
Apply `expect_stdout` to more applicable tests.
2017-03-19 12:00:32 +08:00
Alex Lam S.L
d787d70127
avoid substitution of global variables ( #1557 )
...
- unless `toplevel` is enabled
- global `const` works as before
2017-03-07 03:11:03 +08:00
Alex Lam S.L
858e6c78a4
warn & drop #__PURE__ iff IIFE is dropped ( #1511 )
...
- consolidate `side-effects` optimisations
- improve string `+` optimisation
- enhance literal & `conditionals` optimisations
2017-02-28 02:25:44 +08:00
alexlamsl
4e49302916
enable collapse_vars & reduce_vars by default
...
- fix corner cases in `const` optimisation
- deprecate `/*@const*/`
fixes #1497
closes #1498
2017-02-24 01:46:57 +08:00
Anthony Van de Gejuchte
c06a50f338
Add .gitattributes to checkout lf eol style
...
closes #1487
2017-02-21 13:29:58 +08:00
Samuel Reed
1b703349cf
Tighten up @const regex.
2016-01-20 11:35:45 -06:00
Samuel Reed
f97da4294a
Use TreeWalker for more accurate @const results and update tests
2016-01-20 10:54:00 -06:00
Samuel Reed
8b71c6559b
Mark vars with /** @const */ pragma as consts so they can be eliminated.
...
Fixes older browser support for consts and allows more flexibility
in dead code removal.
2016-01-19 13:23:02 -06:00
Richard van Velzen
61e850ceb5
Clean up unit test breakage
...
In 992b6b9fcc 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-02-11 21:27:21 +01:00
Mihai Bazon
919b2733ab
always keep declarations found in unreachable code
...
a few more tests and some cleanups.
2012-09-07 15:18:32 +03:00
Mihai Bazon
8dfa9fe7e5
minor
2012-08-27 11:00:26 +03:00
Mihai Bazon
159a6f048c
wrote more of the compressor and added some tests
2012-08-22 15:21:58 +03:00