UglifyJS.git
6 years agov3.1.7
Alex Lam S.L [Sun, 5 Nov 2017 07:03:19 +0000 (15:03 +0800)]
v3.1.7

6 years agotweak #2424 (#2432)
Alex Lam S.L [Sun, 5 Nov 2017 04:49:14 +0000 (12:49 +0800)]
tweak #2424 (#2432)

6 years agoextend function inlining safety checks (#2430)
Alex Lam S.L [Sat, 4 Nov 2017 22:18:45 +0000 (06:18 +0800)]
extend function inlining safety checks (#2430)

6 years agoconsolidate single-use `function` reduction (#2427)
Alex Lam S.L [Sat, 4 Nov 2017 20:27:01 +0000 (04:27 +0800)]
consolidate single-use `function` reduction (#2427)

fixes #2423

6 years agomaintain call argument order in `collapse_vars` (#2426)
Alex Lam S.L [Sat, 4 Nov 2017 16:00:18 +0000 (00:00 +0800)]
maintain call argument order in `collapse_vars` (#2426)

fixes #2425

6 years agoimprove variations on call arguments for `ufuzz` (#2424)
Alex Lam S.L [Sat, 4 Nov 2017 08:29:42 +0000 (16:29 +0800)]
improve variations on call arguments for `ufuzz` (#2424)

6 years agoreduce `this` within functions (#2421)
Alex Lam S.L [Fri, 3 Nov 2017 16:31:37 +0000 (00:31 +0800)]
reduce `this` within functions (#2421)

- only replace same-scope usages
- augment `test/ufuzz.js` to test for `this`

fixes #2420

6 years agocompress `new` `function` containing `this` (#2417)
Alex Lam S.L [Mon, 30 Oct 2017 15:19:27 +0000 (23:19 +0800)]
compress `new` `function` containing `this` (#2417)

6 years agov3.1.6
Alex Lam S.L [Sun, 29 Oct 2017 04:38:10 +0000 (12:38 +0800)]
v3.1.6

6 years agoenhance `properties` (#2412)
Alex Lam S.L [Sat, 28 Oct 2017 20:11:26 +0000 (04:11 +0800)]
enhance `properties` (#2412)

- trim array items only if `side_effects`
- extend to non-identifier properties

6 years agoremove dead code (#2405)
Alex Lam S.L [Fri, 27 Oct 2017 06:28:09 +0000 (14:28 +0800)]
remove dead code (#2405)

6 years agofix `reduce_vars` on `AST_Array.length` (#2404)
Alex Lam S.L [Thu, 26 Oct 2017 18:33:37 +0000 (02:33 +0800)]
fix `reduce_vars` on `AST_Array.length` (#2404)

6 years agocompress self comparisons (#2398)
Alex Lam S.L [Wed, 25 Oct 2017 17:16:12 +0000 (01:16 +0800)]
compress self comparisons (#2398)

6 years agodocument compress option `hoist_props` (#2399)
kzc [Wed, 25 Oct 2017 06:03:43 +0000 (02:03 -0400)]
document compress option `hoist_props` (#2399)

6 years agoimplement `hoist_props` (#2396)
Alex Lam S.L [Tue, 24 Oct 2017 19:38:11 +0000 (03:38 +0800)]
implement `hoist_props` (#2396)

fixes #2377

6 years agofix `unsafe` `reduce_vars` on arrays & objects (#2397)
Alex Lam S.L [Tue, 24 Oct 2017 14:10:36 +0000 (22:10 +0800)]
fix `unsafe` `reduce_vars` on arrays & objects (#2397)

6 years agodocs: Fix spelling and style (#2395)
Tom MacWright [Mon, 23 Oct 2017 20:53:56 +0000 (13:53 -0700)]
docs: Fix spelling and style (#2395)

6 years agoenhance `unsafe` `evaluate` of arrays & objects (#2394)
Alex Lam S.L [Mon, 23 Oct 2017 18:58:30 +0000 (02:58 +0800)]
enhance `unsafe` `evaluate` of arrays & objects (#2394)

6 years agodeduplicate declarations regardless of `toplevel` (#2393)
Alex Lam S.L [Sun, 22 Oct 2017 17:00:50 +0000 (01:00 +0800)]
deduplicate declarations regardless of `toplevel` (#2393)

6 years agosafer `properties` transform (#2391)
Alex Lam S.L [Sun, 22 Oct 2017 12:10:13 +0000 (20:10 +0800)]
safer `properties` transform (#2391)

`{ a: x, b: y }.a` => `[ x, y ][0]`
- `x` cannot be function containing `this`

`[ x, y, z ][1]` => `(x, z, y)`
- only if `z` is side-effect-free

6 years agofix `unsafe` expansion of object literals (#2390)
Alex Lam S.L [Sun, 22 Oct 2017 07:00:36 +0000 (15:00 +0800)]
fix `unsafe` expansion of object literals (#2390)

6 years agofix `unsafe` evaluation of `AST_Sub` (#2389)
Alex Lam S.L [Sun, 22 Oct 2017 05:14:15 +0000 (13:14 +0800)]
fix `unsafe` evaluation of `AST_Sub` (#2389)

6 years agofix `unsafe` evaluation of objects (#2388)
Alex Lam S.L [Sat, 21 Oct 2017 20:19:40 +0000 (04:19 +0800)]
fix `unsafe` evaluation of objects (#2388)

6 years agofix `unsafe` escape analysis in `reduce_vars` (#2387)
Alex Lam S.L [Sat, 21 Oct 2017 19:23:31 +0000 (03:23 +0800)]
fix `unsafe` escape analysis in `reduce_vars` (#2387)

6 years agov3.1.5
Alex Lam S.L [Sat, 21 Oct 2017 16:27:26 +0000 (00:27 +0800)]
v3.1.5

6 years ago`unsafe` fix-ups for #2351 (#2379)
Alex Lam S.L [Fri, 20 Oct 2017 20:08:26 +0000 (04:08 +0800)]
`unsafe` fix-ups for #2351 (#2379)

6 years agobackport #2374 (#2376)
Alex Lam S.L [Thu, 19 Oct 2017 15:02:27 +0000 (23:02 +0800)]
backport #2374 (#2376)

6 years agoenhance `collapse_vars` around lazy operations (#2369)
Alex Lam S.L [Wed, 18 Oct 2017 20:52:00 +0000 (04:52 +0800)]
enhance `collapse_vars` around lazy operations (#2369)

6 years agofix `AST_PropAccess` in `collapse_vars` (take 3) (#2375)
Alex Lam S.L [Tue, 17 Oct 2017 18:54:51 +0000 (02:54 +0800)]
fix `AST_PropAccess` in `collapse_vars` (take 3) (#2375)

Suppress scanning beyond assignment to `a.b`

6 years agoclean up lazy operator detection (#2373)
Alex Lam S.L [Tue, 17 Oct 2017 15:25:45 +0000 (23:25 +0800)]
clean up lazy operator detection (#2373)

6 years agofix `AST_PropAccess` in `collapse_vars` (take 2) (#2372)
Alex Lam S.L [Tue, 17 Oct 2017 14:59:15 +0000 (22:59 +0800)]
fix `AST_PropAccess` in `collapse_vars` (take 2) (#2372)

fixes #2364

6 years agofix `AST_PropAccess` in `collapse_vars` (#2370)
Alex Lam S.L [Tue, 17 Oct 2017 10:33:03 +0000 (18:33 +0800)]
fix `AST_PropAccess` in `collapse_vars` (#2370)

fixes #2364

6 years agoaccount for side-effects from `AST_This` in `collapse_vars` (#2365)
Alex Lam S.L [Mon, 16 Oct 2017 17:18:55 +0000 (01:18 +0800)]
account for side-effects from `AST_This` in `collapse_vars` (#2365)

6 years agov3.1.4
Alex Lam S.L [Sun, 15 Oct 2017 18:44:17 +0000 (02:44 +0800)]
v3.1.4

6 years agoupdate dependency (#2362)
Alex Lam S.L [Sun, 15 Oct 2017 18:41:22 +0000 (02:41 +0800)]
update dependency (#2362)

- source-map@0.6.1

6 years agofix-ups for #2356 (#2360)
Alex Lam S.L [Sun, 15 Oct 2017 14:33:55 +0000 (22:33 +0800)]
fix-ups for #2356 (#2360)

6 years agomore tests for #2351 (#2357)
Alex Lam S.L [Wed, 11 Oct 2017 18:58:25 +0000 (02:58 +0800)]
more tests for #2351 (#2357)

6 years agoupdate README to include defaults (#2356)
Roger Peppe [Wed, 11 Oct 2017 18:56:02 +0000 (19:56 +0100)]
update README to include defaults (#2356)

fixes #2353

6 years agoUpdate README.md - sourceMappingURL directive note (#2355)
Tim Malone [Wed, 11 Oct 2017 11:48:43 +0000 (22:48 +1100)]
Update README.md - sourceMappingURL directive note (#2355)

Moves this README note to underneath the 'url' rather than 'root' option.

6 years agoperform `reduce_vars` on safe literals (#2351)
Alex Lam S.L [Mon, 9 Oct 2017 04:25:06 +0000 (12:25 +0800)]
perform `reduce_vars` on safe literals (#2351)

- constant expression
- single reference
- same scope
- not across loop body

6 years agocollapse `a.b` whenever safe (#2350)
Alex Lam S.L [Sun, 8 Oct 2017 05:17:48 +0000 (13:17 +0800)]
collapse `a.b` whenever safe (#2350)

6 years agov3.1.3
Alex Lam S.L [Sun, 1 Oct 2017 04:36:07 +0000 (12:36 +0800)]
v3.1.3

6 years agoenhance `reduce_vars` for `AST_Accessor` (#2339)
Alex Lam S.L [Sat, 30 Sep 2017 19:01:50 +0000 (03:01 +0800)]
enhance `reduce_vars` for `AST_Accessor` (#2339)

fixes #2336

6 years agotrap invalid use of reserved words (#2338)
Alex Lam S.L [Sat, 30 Sep 2017 18:10:41 +0000 (02:10 +0800)]
trap invalid use of reserved words (#2338)

fixes #2337

6 years agov3.1.2
Alex Lam S.L [Sat, 23 Sep 2017 18:02:04 +0000 (02:02 +0800)]
v3.1.2

7 years agofix "use asm" numeric output (#2328)
kzc [Wed, 20 Sep 2017 16:52:48 +0000 (12:52 -0400)]
fix "use asm" numeric output (#2328)

fixes #2324

7 years agosuppress `collapse_vars` of `this` into "use strict" (#2326)
Alex Lam S.L [Tue, 19 Sep 2017 21:23:20 +0000 (05:23 +0800)]
suppress `collapse_vars` of `this` into "use strict" (#2326)

fixes #2319

7 years agov3.1.1
Alex Lam S.L [Sat, 16 Sep 2017 20:36:27 +0000 (04:36 +0800)]
v3.1.1

7 years agohandle LHS side-effects on `cascade` & `collapse_vars` (#2314)
Alex Lam S.L [Sat, 16 Sep 2017 03:45:19 +0000 (11:45 +0800)]
handle LHS side-effects on `cascade` & `collapse_vars` (#2314)

fixes #2313

7 years agoimprove source mapping (#2312)
Alex Lam S.L [Fri, 15 Sep 2017 04:46:48 +0000 (12:46 +0800)]
improve source mapping (#2312)

fixes #2310

7 years agov3.1.0
Alex Lam S.L [Sun, 10 Sep 2017 07:17:24 +0000 (15:17 +0800)]
v3.1.0

7 years agoTesting all leading comments against being PURE comments (#2305)
Mateusz Burzyński [Sat, 9 Sep 2017 18:08:15 +0000 (20:08 +0200)]
Testing all leading comments against being PURE comments (#2305)

7 years agoextend `unsafe` on pure global functions (#2303)
Alex Lam S.L [Thu, 7 Sep 2017 14:08:34 +0000 (22:08 +0800)]
extend `unsafe` on pure global functions (#2303)

7 years agoadd `Date` and other known globals to `unsafe` compress option (#2302)
kzc [Wed, 6 Sep 2017 18:44:26 +0000 (14:44 -0400)]
add `Date` and other known globals to `unsafe` compress option (#2302)

7 years agofix `collapse_vars` on default function argument (#2299)
Alex Lam S.L [Sun, 3 Sep 2017 18:32:33 +0000 (02:32 +0800)]
fix `collapse_vars` on default function argument (#2299)

Avoid collision with local variable `undefined` under certain corner cases.

fixes #2298

7 years agocorrectly count declarations after `hoist_vars` (#2297)
Alex Lam S.L [Sun, 3 Sep 2017 09:23:31 +0000 (17:23 +0800)]
correctly count declarations after `hoist_vars` (#2297)

fixes #2295

7 years agoFix CLI example for mangle reserved list of names (#2294)
David Šanda [Wed, 30 Aug 2017 16:55:32 +0000 (18:55 +0200)]
Fix CLI example for mangle reserved list of names (#2294)

7 years agoFix CLI source-maps examples (#2291)
David Šanda [Tue, 29 Aug 2017 15:49:20 +0000 (17:49 +0200)]
Fix CLI source-maps examples (#2291)

fixes #2284

7 years agofix `unused` patching of `AST_For.init` blocks (#2289)
Alex Lam S.L [Mon, 28 Aug 2017 17:10:04 +0000 (01:10 +0800)]
fix `unused` patching of `AST_For.init` blocks (#2289)

fixes #2288

7 years agov3.0.28
Alex Lam S.L [Sat, 19 Aug 2017 16:27:01 +0000 (00:27 +0800)]
v3.0.28

7 years agodon't escape null characters as \0 when followed by any digit (#2273)
Erik Desjardins [Mon, 14 Aug 2017 04:30:08 +0000 (00:30 -0400)]
don't escape null characters as \0 when followed by any digit (#2273)

fixes #2272

7 years agofix `ie8` mangling of top-level `AST_SymbolCatch` (#2263)
Alex Lam S.L [Mon, 31 Jul 2017 18:38:32 +0000 (02:38 +0800)]
fix `ie8` mangling of top-level `AST_SymbolCatch` (#2263)

fixes #2254

7 years agov3.0.27
Alex Lam S.L [Sat, 29 Jul 2017 17:50:42 +0000 (01:50 +0800)]
v3.0.27

7 years agoimprove `mangle.properties` (#2261)
Alex Lam S.L [Sat, 29 Jul 2017 15:02:04 +0000 (23:02 +0800)]
improve `mangle.properties` (#2261)

- include dead code when `keep_quoted`
- unify `keep_quoted` & `reserved`
- make `test/run-tests.js` consistent with `minify()`

fixes #2256

7 years agoissue template: describe acceptable JS input (#2255)
kzc [Thu, 27 Jul 2017 13:38:36 +0000 (09:38 -0400)]
issue template: describe acceptable JS input (#2255)

7 years agov3.0.26
Alex Lam S.L [Sun, 23 Jul 2017 04:39:36 +0000 (12:39 +0800)]
v3.0.26

7 years agounescape surrogate pairs only (#2246)
Alex Lam S.L [Sun, 23 Jul 2017 04:38:21 +0000 (12:38 +0800)]
unescape surrogate pairs only (#2246)

fixes #2242

7 years agoupdate dependencies (#2241)
Alex Lam S.L [Sun, 16 Jul 2017 08:20:40 +0000 (16:20 +0800)]
update dependencies (#2241)

- acorn@5.1.1
- commander@2.11.0
- mocha@3.4.2

7 years agov3.0.25
Alex Lam S.L [Sun, 16 Jul 2017 03:05:53 +0000 (11:05 +0800)]
v3.0.25

7 years agoreject malformed CLI parameters (#2239)
Alex Lam S.L [Sat, 15 Jul 2017 15:50:27 +0000 (23:50 +0800)]
reject malformed CLI parameters (#2239)

fixes #2237

7 years agoensure `ie8` works with mangled properties (#2238)
Alex Lam S.L [Sat, 15 Jul 2017 14:50:59 +0000 (22:50 +0800)]
ensure `ie8` works with mangled properties (#2238)

fixes #2234

7 years agodrop `unused` builtin globals under `unsafe` (#2236)
Alex Lam S.L [Sat, 15 Jul 2017 07:16:11 +0000 (15:16 +0800)]
drop `unused` builtin globals under `unsafe` (#2236)

fixes #2233

7 years agofix `unsafe` `evaluate` of `Object` static methods (#2232)
Alex Lam S.L [Fri, 14 Jul 2017 11:52:01 +0000 (19:52 +0800)]
fix `unsafe` `evaluate` of `Object` static methods (#2232)

fixes #2231

7 years agodrop `unused` compound assignments (#2230)
Alex Lam S.L [Thu, 13 Jul 2017 16:39:34 +0000 (00:39 +0800)]
drop `unused` compound assignments (#2230)

fixes #2226

7 years agoenhance `passes` (#2229)
Alex Lam S.L [Wed, 12 Jul 2017 18:18:59 +0000 (02:18 +0800)]
enhance `passes` (#2229)

- remove hardcoded upper limit
- continue based on node count reduction
- emit verbose statistics

fixes #2226

7 years agofix gzip stream in `test/benchmark.js` (#2228)
Alex Lam S.L [Tue, 11 Jul 2017 18:55:57 +0000 (02:55 +0800)]
fix gzip stream in `test/benchmark.js` (#2228)

7 years agoenhance source mapping on IIFEs (#2224)
Alex Lam S.L [Mon, 10 Jul 2017 18:34:28 +0000 (02:34 +0800)]
enhance source mapping on IIFEs (#2224)

fixes #2213

7 years agobenchmark gzipped output (#2220)
Alex Lam S.L [Sat, 8 Jul 2017 17:44:59 +0000 (01:44 +0800)]
benchmark gzipped output (#2220)

7 years agodocs: update benchmarks using node 8, add babili (#2218)
kzc [Sat, 8 Jul 2017 16:48:53 +0000 (12:48 -0400)]
docs: update benchmarks using node 8, add babili (#2218)

7 years agov3.0.24
Alex Lam S.L [Sat, 8 Jul 2017 04:53:20 +0000 (12:53 +0800)]
v3.0.24

7 years agohandle duplicate argument names in `collapse_vars` (#2215)
Alex Lam S.L [Fri, 7 Jul 2017 20:42:35 +0000 (04:42 +0800)]
handle duplicate argument names in `collapse_vars` (#2215)

7 years agoinlining of static methods & constants (#2211)
Alex Lam S.L [Thu, 6 Jul 2017 21:35:32 +0000 (05:35 +0800)]
inlining of static methods & constants (#2211)

- guard by `unsafe`
- support `Array`, `Math`, `Number`, `Object` & `String`

fixes #2207

7 years agoinline property access of object literal (#2209)
Alex Lam S.L [Thu, 6 Jul 2017 13:51:58 +0000 (21:51 +0800)]
inline property access of object literal (#2209)

- only if property value is side-effect-free
- guard by `unsafe`

fixes #2208

7 years agosuppress `collapse_vars` of `this` as call argument (#2204)
Alex Lam S.L [Wed, 5 Jul 2017 17:03:52 +0000 (01:03 +0800)]
suppress `collapse_vars` of `this` as call argument (#2204)

fixes #2203

7 years agoimprove `compress` granularity through `typeofs` (#2201)
Alex Lam S.L [Wed, 5 Jul 2017 11:20:33 +0000 (19:20 +0800)]
improve `compress` granularity through `typeofs` (#2201)

fixes #2198

7 years agominor clean-ups to `evaluate` (#2197)
Alex Lam S.L [Mon, 3 Jul 2017 10:52:39 +0000 (18:52 +0800)]
minor clean-ups to `evaluate` (#2197)

7 years agoimprove parenthesis emission (#2196)
Alex Lam S.L [Sun, 2 Jul 2017 20:17:37 +0000 (04:17 +0800)]
improve parenthesis emission (#2196)

- eliminate `throw` usages
- suppress extraneous parenthesis
  - `new function() {foo.bar()}.baz`
  - `for (function() { "foo" in bar; };;);`

7 years agoclean up `TreeWalker.pop()` (#2195)
Alex Lam S.L [Sun, 2 Jul 2017 19:23:38 +0000 (03:23 +0800)]
clean up `TreeWalker.pop()` (#2195)

Remove superfluous parameter.

7 years agorefactor `throw` usage within `compress` (#2193)
Alex Lam S.L [Sun, 2 Jul 2017 18:10:56 +0000 (02:10 +0800)]
refactor `throw` usage within `compress` (#2193)

Eliminate exceptional constructs from normal control flow.

7 years agodocument fast mangle-only minify mode (#2194)
kzc [Sun, 2 Jul 2017 17:37:04 +0000 (13:37 -0400)]
document fast mangle-only minify mode (#2194)

7 years agov3.0.23
Alex Lam S.L [Sun, 2 Jul 2017 09:24:22 +0000 (17:24 +0800)]
v3.0.23

7 years agodrop argument value after `collapse_vars` (#2190)
Alex Lam S.L [Sat, 1 Jul 2017 20:28:11 +0000 (04:28 +0800)]
drop argument value after `collapse_vars` (#2190)

7 years agoimprove `inline` efficiency (#2188)
Alex Lam S.L [Sat, 1 Jul 2017 17:05:14 +0000 (01:05 +0800)]
improve `inline` efficiency (#2188)

... by teaching `collapse_vars` some new tricks.

fixes #2187

7 years agov3.0.22
Alex Lam S.L [Fri, 30 Jun 2017 03:18:34 +0000 (11:18 +0800)]
v3.0.22

7 years agoimprove usability of name cache under `minify()` (#2176)
Alex Lam S.L [Thu, 29 Jun 2017 04:48:34 +0000 (12:48 +0800)]
improve usability of name cache under `minify()` (#2176)

fixes #2174

7 years agov3.0.21
Alex Lam S.L [Wed, 28 Jun 2017 16:49:06 +0000 (00:49 +0800)]
v3.0.21

7 years agoimprove `unsafe_Func` (#2171)
Alex Lam S.L [Tue, 27 Jun 2017 15:53:42 +0000 (23:53 +0800)]
improve `unsafe_Func` (#2171)

- minimise disturbance to `compute_char_frequency()`
- remove extraneous quotation marks

7 years agoparse `@global_defs` as expressions (#2169)
Alex Lam S.L [Tue, 27 Jun 2017 02:31:19 +0000 (10:31 +0800)]
parse `@global_defs` as expressions (#2169)

- let parser rejects non-conformant input
- eliminate need for extraneous parenthesis

7 years agov3.0.20
Alex Lam S.L [Sun, 25 Jun 2017 07:05:05 +0000 (15:05 +0800)]
v3.0.20

7 years agomore tests for #2158 (#2160)
Alex Lam S.L [Sun, 25 Jun 2017 06:21:48 +0000 (14:21 +0800)]
more tests for #2158 (#2160)