Alex Lam S.L
b38838c6bf
fix corner case in join_vars ( #3796 )
...
fixes #3795
2020-04-18 18:08:05 +08:00
Alex Lam S.L
708973e51d
report top-level default options ( #3797 )
2020-04-18 18:03:06 +08:00
Alex Lam S.L
dac9e69f9e
enhance collapse_vars ( #3793 )
2020-04-18 10:06:20 +08:00
Alex Lam S.L
da68ec6e19
fix corner cases in join_vars ( #3790 )
...
fixes #3789
fixes #3791
2020-04-18 02:53:26 +08:00
Alex Lam S.L
15a3ebd467
fix corner cases in join_vars ( #3787 )
...
fixes #3786
fixes #3788
2020-04-17 21:19:18 +08:00
Alex Lam S.L
9110fac9a2
suppress mutation of input options ( #3785 )
2020-04-17 15:13:49 +08:00
Alex Lam S.L
83f42ede36
support optional output of names in source maps ( #3784 )
2020-04-17 07:20:48 +08:00
Alex Lam S.L
0ce71bbec0
enhance join_vars ( #3783 )
2020-04-17 05:31:33 +08:00
Alex Lam S.L
46d142cbf6
improve source-map generation ( #3782 )
...
- emit singleton segments to mark generated code from input
2020-04-16 23:30:25 +08:00
Alex Lam S.L
6e9afdc94f
prevent input source map mutation ( #3781 )
...
fixes #3780
2020-04-15 17:25:58 +08:00
Alex Lam S.L
903a5df9a5
fix corner case in inline ( #3778 )
...
fixes #3777
2020-04-11 19:54:26 +08:00
Alex Lam S.L
c810ecd081
improve handling of eval ( #3776 )
...
closes #3768
2020-04-11 06:36:17 +08:00
Alex Lam S.L
dce9dfce0e
fix corner case in reduce_vars ( #3775 )
...
fixes #3774
2020-04-11 02:19:38 +08:00
Alex Lam S.L
a2b16e89a4
fix corner cases in inline ( #3773 )
...
fixes #3770
fixes #3771
fixes #3772
2020-04-11 00:34:45 +08:00
Alex Lam S.L
b35f4c5a83
enhance inline ( #3767 )
2020-04-10 10:48:24 +08:00
Alex Lam S.L
1b07f64057
enhance inline ( #3760 )
2020-04-05 10:42:23 +08:00
Alex Lam S.L
dc0cd088cf
fix corner case in evaluate & unsafe_math ( #3756 )
...
fixes #3755
2020-03-30 19:13:14 +08:00
Alex Lam S.L
b5f4e1187f
handle single-field segments ( #3757 )
2020-03-30 06:39:32 +08:00
Alex Lam S.L
827bcec186
handle source-map operations internally ( #3754 )
2020-03-28 22:18:56 +08:00
Alex Lam S.L
b39228892d
fix line accounting in multi-line strings ( #3752 )
...
fixes #3748
2020-03-21 07:17:41 +08:00
Alex Lam S.L
0a1c9b34ce
fix corner case in evaluate & ie8 ( #3751 )
...
fixes #3750
2020-03-21 00:55:24 +08:00
Alex Lam S.L
421bb7083a
fix corner case in unused ( #3747 )
...
fixes #3746
2020-03-06 18:27:42 +00:00
Alex Lam S.L
bdc8ef2218
fix corner case in collapse_vars ( #3745 )
...
fixes #3744
2020-03-06 18:27:06 +00:00
Alex Lam S.L
a051846d22
fix corner case in evaluate ( #3739 )
...
fixes #3738
2020-03-01 20:34:31 +00:00
Alex Lam S.L
6092bf23de
fix corner case in evaluate ( #3729 )
2020-02-19 00:41:10 +00:00
Alex Lam S.L
7052ce5aef
fix corner case in evaluate ( #3728 )
...
- augment `ufuzz` for further `RegExp` testing
2020-02-18 19:35:37 +00:00
Alex Lam S.L
5315dd95b0
minor cleanup ( #3723 )
2020-02-15 17:55:26 +00:00
Alex Lam S.L
f0a29902ac
enhance properties ( #3721 )
2020-02-15 13:04:44 +00:00
Alex Lam S.L
0d820e4c0a
workaround RegExp formatting bugs ( #3720 )
2020-02-15 05:26:48 +00:00
Alex Lam S.L
c01ff76288
improve code reuse ( #3718 )
2020-02-13 05:16:10 +00:00
Alex Lam S.L
83a42716c3
fix corner case in unused ( #3716 )
2020-02-12 23:46:16 +00:00
Alex Lam S.L
dd22eda888
enhance evaluate ( #3714 )
2020-02-12 01:01:17 +00:00
Alex Lam S.L
551420132c
export missing API for AST manipulation ( #3707 )
2020-02-06 18:46:25 +00:00
Alex Lam S.L
c93ca6ee53
fix corner case in ie8 & reduce_vars ( #3706 )
...
fixes #3703
2020-02-05 20:03:22 +00:00
Alex Lam S.L
df506439b1
fix corner case in sequences ( #3704 )
...
fixes #3703
2020-02-04 04:57:32 +00:00
Alex Lam S.L
79c60032a5
fix corner case in collapse_vars ( #3701 )
...
fixes #3700
2020-01-30 09:04:44 +08:00
Alex Lam S.L
a3754068dd
fix corner case in collapse_vars ( #3699 )
...
fixes #3698
2020-01-30 00:08:53 +08:00
Alex Lam S.L
2ba5f391e0
enhance collapse_vars ( #3697 )
2020-01-29 08:52:20 +08:00
Alex Lam S.L
87119e44a0
fix corner case in sign propagation ( #3696 )
...
- migrate de-facto functionality to `evaluate`
fixes #3695
2020-01-28 22:44:18 +08:00
Alex Lam S.L
b499e03f82
enhance conditionals ( #3694 )
2020-01-28 12:33:21 +08:00
Alex Lam S.L
a478f275e4
enhance sequences ( #3693 )
2020-01-28 09:58:01 +08:00
Alex Lam S.L
e9e76dcf04
fix corner case in string concatenations ( #3692 )
...
- migrate de-facto compression to `conditionals` & `strings`
fixes #3689
2020-01-28 07:33:11 +08:00
Alex Lam S.L
0dcedad2d5
fix corner case in booleans ( #3691 )
...
fixes #3690
2020-01-28 02:04:44 +08:00
Alex Lam S.L
41a6eb892a
fix corner case in evaluate ( #3685 )
...
fixes #3684
2020-01-16 01:51:37 +08:00
Alex Lam S.L
91d87ae663
fix corner case in unsafe_math ( #3683 )
...
fixes #3682
2020-01-15 04:05:58 +08:00
Alex Lam S.L
46caaa82ba
enhance collapse_vars ( #3680 )
...
closes #3679
2020-01-10 04:28:43 +08:00
Alex Lam S.L
14c35739dd
fix corner case in unsafe_math ( #3677 )
...
fixes #3676
2020-01-08 10:28:10 +08:00
Alex Lam S.L
f5ceff6e4b
fix corner case in unused ( #3674 )
...
fixes #3673
2020-01-07 20:06:25 +08:00
Alex Lam S.L
4d6771b9b1
fix corner case in collapse_vars ( #3672 )
...
fixes #3671
2020-01-07 19:34:16 +08:00
Alex Lam S.L
1988495d71
fix corner case in conditionals ( #3669 )
...
fixes #3668
2020-01-04 09:24:28 +08:00
Alex Lam S.L
fdc10086da
fix corner case in reduce_vars ( #3667 )
...
fixes #3666
2020-01-03 19:28:47 +08:00
Alex Lam S.L
746f5f6c62
fix corner case in unused ( #3665 )
...
fixes #3664
2020-01-01 20:24:30 +08:00
Alex Lam S.L
d83d3d741a
enhance unused ( #3662 )
2019-12-31 23:39:24 +08:00
Alex Lam S.L
99ac73a635
enhance booleans ( #3661 )
2019-12-31 13:10:05 +08:00
Alex Lam S.L
a2e4c2fd97
enhance evaluate ( #3660 )
2019-12-31 11:51:21 +08:00
Alex Lam S.L
94785e8e14
fix corner case in booleans ( #3659 )
...
fixes #3658
2019-12-31 09:57:35 +08:00
Alex Lam S.L
4dbdac9c31
enhance booleans ( #3657 )
2019-12-30 22:41:11 +08:00
Alex Lam S.L
78c8efd851
fix corner case in evaluate ( #3656 )
...
fixes #3655
2019-12-29 21:16:53 +08:00
Alex Lam S.L
af310ba2d0
fix corner case in evaluate ( #3654 )
...
fixes #3653
2019-12-29 02:50:57 +00:00
Alex Lam S.L
2f3930d1b9
fix corner case in collapse_vars ( #3652 )
...
fixes #3651
2019-12-29 00:57:59 +00:00
Alex Lam S.L
d1a78920d9
workaround firefox asm.js quirks ( #3650 )
...
fixes #3636
2019-12-28 23:14:53 +00:00
Alex Lam S.L
d9cd3d33c8
enhance evaluate ( #3649 )
2019-12-28 20:26:15 +00:00
Alex Lam S.L
22b47cdd63
improve unicode handling ( #3648 )
2019-12-28 18:06:51 +00:00
Alex Lam S.L
a19d31dd33
fix corner case in unsafe ( #3646 )
2019-12-27 14:24:54 +00:00
Alex Lam S.L
ab050e7a94
fix corner case in directives ( #3645 )
2019-12-25 00:55:39 +00:00
Alex Lam S.L
75aa6ef848
enhance conditionals ( #3643 )
2019-12-22 04:29:32 +00:00
Alex Lam S.L
519a00bd8a
fix corner case in collapse_vars ( #3642 )
...
fixes #3641
2019-12-22 01:08:56 +00:00
Alex Lam S.L
74396acc86
fix corner case in loops ( #3635 )
...
fixes #3634
2019-12-11 06:39:46 +08:00
Alex Lam S.L
036bca980c
enhance loops ( #3633 )
2019-12-10 12:57:47 +00:00
Alex Lam S.L
18c2b1841b
fix corner case in reduce_vars ( #3632 )
...
fixes #3631
2019-12-10 09:45:51 +00:00
Alex Lam S.L
9074f05129
fix corner case in collapse_vars ( #3629 )
...
fixes #3628
2019-12-05 05:08:37 +08:00
Alex Lam S.L
04fbb1f949
avoid collision with HTML comments ( #3625 )
...
fixes #3624
2019-12-05 02:43:25 +08:00
Alex Lam S.L
bf7e4ca1a3
fix corner case in collapse_vars ( #3627 )
...
fixes #3626
2019-12-05 00:59:57 +08:00
Alex Lam S.L
d68ddc31f9
fix corner case in reduce_vars ( #3623 )
...
fixes #3622
2019-12-04 20:24:55 +08:00
Alex Lam S.L
500e31e03b
enhance collapse_vars ( #3621 )
2019-12-02 15:25:38 +08:00
Alex Lam S.L
bef856addb
fix corner case in keep_fargs ( #3620 )
...
fixes #3619
2019-12-02 12:28:17 +08:00
Alex Lam S.L
9a6faf365b
fix corner cases in keep_fargs & unused ( #3618 )
2019-12-02 06:43:54 +08:00
Alex Lam S.L
e915832a36
enhance unused ( #3617 )
2019-12-01 18:10:37 +08:00
Alex Lam S.L
0593892d6e
enhance collapse_vars ( #3616 )
2019-12-01 02:31:04 +08:00
Alex Lam S.L
1283d73853
fix corner case in parsing directives ( #3615 )
2019-11-29 18:57:29 +08:00
Alex Lam S.L
1b61a81b5d
enhance collapse_vars ( #3613 )
2019-11-29 17:45:49 +08:00
Alex Lam S.L
5a88c30d65
enhance assignments ( #3612 )
2019-11-28 07:40:34 +08:00
Alex Lam S.L
168ae747ad
enhance collapse_vars ( #3611 )
2019-11-28 03:57:10 +08:00
Alex Lam S.L
d4b7010678
fix corner case in unsafe_regexp ( #3609 )
2019-11-27 17:35:21 +08:00
Alex Lam S.L
e27493f3c2
fix corner case in inline ( #3608 )
2019-11-27 14:54:36 +08:00
Alex Lam S.L
6768e6578f
inline functions with directives more effectively ( #3604 )
2019-11-26 01:51:04 +08:00
Alex Lam S.L
48a0f6fe41
enhance unsafe_math ( #3603 )
2019-11-25 21:14:13 +08:00
Alex Lam S.L
81caadb709
enhance collapse_vars ( #3602 )
2019-11-20 12:54:49 +08:00
Alex Lam S.L
d959e0b86f
fix corner case in if_return ( #3601 )
...
fixes #3600
2019-11-19 15:45:20 +08:00
Alex Lam S.L
67278e76c8
fix corner case in unused ( #3599 )
...
fixes #3598
2019-11-19 04:26:41 +08:00
Alex Lam S.L
c289ba1139
fix corner case in collapse_vars ( #3597 )
...
fixes #3596
2019-11-19 02:30:52 +08:00
Alex Lam S.L
4e06e1ca34
fix corner case in inline ( #3595 )
2019-11-18 15:04:55 +08:00
Alex Lam S.L
644f65feca
fix corner case in unsafe_math ( #3594 )
...
fixes #3593
2019-11-18 13:44:13 +08:00
Alex Lam S.L
8504a4ea0e
fix corner case in reduce_funcs ( #3592 )
2019-11-17 11:19:42 +08:00
Alex Lam S.L
10c1a78772
fix corner case in collapse_vars ( #3591 )
2019-11-17 05:24:02 +08:00
Alex Lam S.L
a6a0319f1c
compress empty for-in loops ( #3590 )
2019-11-17 02:36:42 +08:00
Alex Lam S.L
d1b2ecec27
refine precision limits on unsafe_math ( #3589 )
2019-11-17 01:16:42 +08:00
Alex Lam S.L
552be61c4d
introduce eager evaluation ( #3587 )
2019-11-16 06:10:47 +08:00
Alex Lam S.L
dcfc4aca5b
minor clean-ups ( #3588 )
2019-11-16 00:40:22 +08:00
Alex Lam S.L
910799ca99
fix corner case in switches ( #3585 )
2019-11-14 02:29:55 +08:00
Alex Lam S.L
4bd36dc8da
enhance unused ( #3584 )
2019-11-13 21:44:44 +08:00
Alex Lam S.L
ab15c40770
enhance switches ( #3583 )
2019-11-13 20:03:48 +08:00
Alex Lam S.L
fe65ce9658
fix corner case in collapse_vars ( #3582 )
...
fixes #3581
2019-11-13 16:45:16 +08:00
Alex Lam S.L
d6fd18d0b0
enhance evaluate & inline ( #3580 )
2019-11-13 04:17:09 +08:00
Alex Lam S.L
5b20bad4b3
fix corner case in dead_code ( #3579 )
...
fixes #3578
2019-11-12 05:16:14 +08:00
Alex Lam S.L
5045e140b1
fix corner case in conditionals ( #3577 )
...
fixes #3576
2019-11-09 00:53:15 +08:00
Alex Lam S.L
10648c9af6
enhance dead_code ( #3575 )
2019-11-08 13:45:28 +08:00
Alex Lam S.L
87e67ec299
fix corner case in collapse_vars ( #3574 )
...
fixes #3573
2019-11-07 20:38:03 +08:00
Alex Lam S.L
3e2c51a4da
enhance collapse_vars ( #3572 )
2019-11-05 18:15:28 +08:00
Alex Lam S.L
0e29ad5eb9
fix corner case in evaluate ( #3569 )
2019-11-04 13:13:48 +08:00
Alex Lam S.L
1c0defdc03
enhance unsafe evaluate ( #3564 )
2019-11-02 03:34:32 +08:00
Alex Lam S.L
24bb288832
fix corner case in collapse_vars ( #3563 )
...
fixes #3562
2019-11-01 22:38:19 +08:00
Alex Lam S.L
815eff1f7c
enhance if_return ( #3560 )
2019-11-01 02:08:31 +08:00
Alex Lam S.L
1e9b576ee9
fix corner case in evaluate ( #3559 )
...
fixes #3558
2019-11-01 00:01:25 +08:00
Alex Lam S.L
3797458365
enhance conditionals ( #3557 )
2019-10-31 09:33:46 +08:00
Alex Lam S.L
1858c2018c
enhance typeofs ( #3556 )
2019-10-31 08:00:04 +08:00
Alex Lam S.L
ec7f071272
fix corner case in dead_code ( #3553 )
...
fixes #3552
2019-10-30 14:21:22 +08:00
Alex Lam S.L
f1eb03f2c0
enhance dead_code ( #3551 )
2019-10-30 06:34:54 +08:00
Alex Lam S.L
0f4cfa877a
fix corner case in comments ( #3550 )
2019-10-30 03:49:39 +08:00
Alex Lam S.L
1d5c2becbd
enhance evaluate ( #3549 )
2019-10-29 19:51:55 +08:00
Alex Lam S.L
22a09ea7c5
fix corner case in unsafe_math ( #3548 )
...
fixes #3547
2019-10-29 17:06:57 +08:00
Alex Lam S.L
bad664c632
compress object literals ( #3546 )
2019-10-29 16:53:48 +08:00
Alex Lam S.L
83fb8b4ca1
fix corner case in ie8 ( #3543 )
...
fixes #3542
2019-10-28 23:54:27 +08:00
Alex Lam S.L
f38e31bd1e
fix corner case in evaluate ( #3540 )
...
fixes #3539
2019-10-28 19:56:42 +08:00
Alex Lam S.L
2f3b460212
fix & enhance unsafe_math ( #3537 )
...
closes #3535
fixes #3536
2019-10-28 13:37:08 +08:00
Alex Lam S.L
a270ba6b59
fix corner cases in unsafe_math ( #3532 )
...
fixes #3531
2019-10-27 08:25:11 +08:00
Alex Lam S.L
50a578c1f6
compress arithmetic expressions further ( #3529 )
2019-10-27 03:07:07 +08:00
Alex Lam S.L
85237b08d4
fix corner case in collapse_vars ( #3527 )
...
fixes #3526
2019-10-26 05:41:02 +08:00
Alex Lam S.L
82b3eed5ef
fix corner case in ie8 & mangle ( #3524 )
...
fixes #3523
2019-10-24 23:43:19 +08:00
Alex Lam S.L
0f7aa41e33
fix corner case in collapse_vars ( #3521 )
...
fixes #3520
2019-10-24 01:13:57 +08:00
Alex Lam S.L
4240fba9b8
fix corner cases in unused ( #3519 )
2019-10-23 06:46:05 +08:00
Alex Lam S.L
267bc70d33
fix corner case in unused ( #3517 )
...
fixes #3515
2019-10-23 01:58:40 +08:00
Alex Lam S.L
a53ab99378
fix corner case in side_effects ( #3514 )
...
fixes #3512
2019-10-23 01:04:00 +08:00
Alex Lam S.L
02308a7b56
fix corner case in reduce_vars ( #3510 )
...
fixes #3509
2019-10-22 20:36:05 +08:00
Alex Lam S.L
0b3705e82f
fix corner cases in inline ( #3507 )
...
fixes #3506
2019-10-22 15:41:55 +08:00
Alex Lam S.L
9199ab5846
minor tweaks ( #3502 )
2019-10-20 15:19:19 +08:00
Alex Lam S.L
ca6dce43fe
fix corner case in collapse_vars ( #3501 )
2019-10-20 03:53:20 +08:00
Alex Lam S.L
543dd7d3d7
fix corner case in comments ( #3500 )
2019-10-20 03:21:30 +08:00
Alex Lam S.L
0201cb4b52
fix corner case in unused ( #3499 )
...
fixes #3497
2019-10-18 20:08:05 +08:00
Alex Lam S.L
cd072317d0
fix corner case in unused ( #3496 )
...
fixes #3495
2019-10-18 17:09:43 +08:00
Alex Lam S.L
0785a15ace
fix corner case in dead_code & ie8 ( #3494 )
...
fixes #3493
2019-10-17 09:58:05 +08:00
Alex Lam S.L
b1279a46d9
fix corner case in sequences ( #3491 )
...
fixes #3490
2019-10-17 09:57:50 +08:00
Alex Lam S.L
1549db70e6
fix corner case in ie8 ( #3487 )
...
fixes #3486
2019-10-16 12:18:27 +08:00
Alex Lam S.L
8ff9a3c8fb
fix corner cases in ie8 ( #3485 )
...
fixes #3484
2019-10-16 06:37:40 +08:00
Alex Lam S.L
91cae51d8f
fix corner case in evaluate & ie8 ( #3483 )
...
fixes #3482
2019-10-16 01:09:16 +08:00
Alex Lam S.L
8af2f5fbcf
fix corner case in rename ( #3481 )
...
fixes #3480
2019-10-15 19:44:07 +08:00
Alex Lam S.L
86a8016323
fix corner case in ie8 & mangle ( #3479 )
...
fixes #3478
2019-10-15 17:14:48 +08:00
Alex Lam S.L
f86f615d83
fix corner case in ie8 & mangle ( #3476 )
...
fixes #3475
2019-10-15 14:18:12 +08:00
Alex Lam S.L
d3d1d11926
fix corner case in ie8 & rename ( #3474 )
...
fixes #3473
2019-10-15 07:27:02 +08:00
Alex Lam S.L
736019b767
fix corner cases in ie8 ( #3472 )
...
fixes #3471
2019-10-14 18:15:40 +08:00
Alex Lam S.L
a39bdb5840
fix corner case with collapse_vars & ie8 ( #3469 )
...
fixes #3468
2019-10-14 13:34:35 +08:00
Alex Lam S.L
eba3a37bb5
fix boolean context detection ( #3466 )
...
fixes #3465
2019-10-12 03:42:57 +08:00
Alex Lam S.L
6d57ca1a59
improve source map handling ( #3464 )
...
fixes #2947
fixes #3277
fixes #3411
2019-10-11 03:52:33 +08:00
Alex Lam S.L
33c94d3bd9
detect boolean context across IIFEs ( #3461 )
2019-10-10 09:37:02 +08:00
Alex Lam S.L
a0d4b648bb
remove extraneous property ( #3459 )
...
fixes #3455
2019-10-10 01:36:58 +08:00
Alex Lam S.L
6db880e16d
clean up AST_Binary optimisation logic ( #3458 )
2019-10-09 23:45:41 +08:00
Alex Lam S.L
8a4c7077bb
account for catch in constant lambda expressions ( #3454 )
2019-10-06 16:51:37 +08:00
Alex Lam S.L
0a63f2f2b0
workaround V8 RegExp bug ( #3453 )
...
fixes #3434
2019-10-06 11:49:39 +08:00
Alex Lam S.L
931ac66638
fix corner case in hoist_props ( #3452 )
...
fixes #3440
2019-10-06 10:29:13 +08:00
Alex Lam S.L
35338a100f
handle function/variable name collisions correctly ( #3451 )
...
fixes #3439
2019-10-06 08:51:38 +08:00
Alex Lam S.L
a31c477fea
fix variable scope determination ( #3449 )
...
fixes #3444
2019-10-06 05:13:44 +08:00
Alex Lam S.L
9d3b1efd86
fix corner case in assignments ( #3430 )
...
fixes #3429
2019-05-30 05:01:53 +08:00
Alex Lam S.L
482e1baea3
enhance assignments & unused ( #3428 )
...
closes #3427
2019-05-29 01:21:08 +08:00
Alex Lam S.L
b9053c7a25
fix corner case in keep_fargs ( #3424 )
...
fixes #3423
2019-05-21 12:55:34 +08:00
Alex Lam S.L
ae77ebe5a5
fix corner case in arguments ( #3421 )
...
fixes #3420
2019-05-19 12:59:40 +08:00
Alex Lam S.L
a246195412
enhance unsafe comparisons ( #3419 )
2019-05-17 01:28:18 +08:00
Alex Lam S.L
a21c348d93
improve sandbox fidelity ( #3415 )
2019-05-15 23:26:57 +08:00
Alex Lam S.L
1f0def10eb
fix corner case in comparisons ( #3414 )
...
fixes #3413
2019-05-15 01:01:18 +08:00
Alex Lam S.L
f87caac9d8
fix corner case in hoist_props ( #3412 )
...
fixes #3411
2019-05-14 19:12:00 +08:00
Alex Lam S.L
d538a73250
enhance side_effects ( #3410 )
2019-05-14 05:26:40 +08:00
Alex Lam S.L
2e4fbdeb08
enhance keep_fargs ( #3409 )
2019-05-13 21:58:04 +08:00
Alex Lam S.L
54cb678055
fix corner case in assignments ( #3407 )
...
fixes #3406
2019-05-12 03:52:46 +08:00
Alex Lam S.L
9fc8cd4076
fix corner case in functions ( #3403 )
...
fixes #3402
2019-05-11 18:55:45 +08:00
Alex Lam S.L
5476cb8f05
fix corner case in inline ( #3401 )
...
fixes #3400
2019-05-10 01:22:44 +08:00
Alex Lam S.L
354fec8a9c
make enclose & wrap work with sourceMap ( #3396 )
...
fixes #3313
2019-05-04 20:25:52 +08:00
Alex Lam S.L
11cdab745d
fix corner cases in sourceMap ( #3397 )
...
fixes #3255
fixes #3294
2019-05-04 20:08:57 +08:00
Alex Lam S.L
a89d424a0b
render comments in custom ASTs gracefully ( #3393 )
...
fixes #3246
2019-05-02 13:50:51 +08:00
Alex Lam S.L
2ea96549c5
unify logging functionality ( #3392 )
...
fixes #3253
fixes #3254
2019-04-30 06:32:24 +08:00
Alex Lam S.L
fba008e298
remove blanket safeguard from source-map ( #3391 )
...
Things has stabilised since 80a18fe2fa , so it makes sense to remove the unconditional masking for ease of debugging.
2019-04-30 02:40:36 +08:00
Alex Lam S.L
c37a8e927e
fix corner case in properties ( #3390 )
...
fixes #3389
2019-04-29 17:23:00 +08:00
Alex Lam S.L
413bbe0480
fix corner case in evaluate ( #3388 )
...
fixes #3387
2019-04-29 08:55:46 +08:00
Alex Lam S.L
e5436ca566
enhance side_effects ( #3384 )
2019-04-25 15:15:50 +08:00
Alex Lam S.L
a206964c0a
enhance side_effects ( #3383 )
2019-04-25 04:14:21 +08:00
Alex Lam S.L
c56d89f804
enhance unsafe ( #3382 )
2019-04-25 02:42:54 +08:00
Alex Lam S.L
c215706350
enhance unsafe comparisons ( #3381 )
2019-04-25 00:08:08 +08:00
Alex Lam S.L
d3b93ec682
fix corner case in unsafe ( #3380 )
2019-04-24 22:21:28 +08:00
Alex Lam S.L
6fe20dbe33
enhance comparisons ( #3379 )
2019-04-24 21:38:55 +08:00
Alex Lam S.L
dafed54764
fix corner case in reduce_vars ( #3378 )
...
fixes #3377
2019-04-24 14:01:01 +08:00
Alex Lam S.L
a84beafd1b
fix corner case in assignments ( #3376 )
...
fixes #3375
2019-04-24 02:50:15 +08:00
Alex Lam S.L
f01cc1e413
unwind IIFE class patterns ( #3373 )
...
fixes #2332
2019-04-21 09:49:07 +08:00
Alex Lam S.L
c719552317
fix corner cases in functions ( #3372 )
...
fixes #3371
2019-04-21 02:16:05 +08:00
Alex Lam S.L
855964a87a
enhance unsafe evaluate ( #3370 )
2019-04-20 19:42:41 +08:00
Alex Lam S.L
00833e893a
enhance functions ( #3368 )
2019-04-19 19:01:47 +08:00
Alex Lam S.L
b55a2fd531
fix corner case in functions ( #3367 )
...
fixes #3366
2019-04-19 02:55:43 +08:00
Alex Lam S.L
e8a2c0b5bf
fix corner case in functions ( #3365 )
...
fixes #3364
2019-04-18 17:03:52 +08:00
Alex Lam S.L
21cd7e3f57
reduce test exports ( #3361 )
2019-04-17 16:19:08 +08:00
Alex Lam S.L
5172ba5f2a
introduce functions ( #3360 )
...
`var f = function() {};` => `function f() {}`
2019-04-15 22:23:11 +08:00
Alex Lam S.L
a74e600fa0
mangle shadowed lambda under ie8 correctly ( #3356 )
...
fixes #3355
2019-04-01 15:22:00 +08:00
Alex Lam S.L
7436977aa5
fix infinite loop triggered by #3347 ( #3354 )
...
fixes #3353
2019-03-23 14:21:54 +08:00
Alex Lam S.L
54b0b49b68
enhance inline ( #3352 )
2019-03-21 02:58:33 +08:00
Alex Lam S.L
65648d84a5
enhance collapse_vars ( #3351 )
2019-03-20 23:31:21 +08:00
Alex Lam S.L
143f9054da
fix corner case in sequences ( #3350 )
2019-03-20 14:54:26 +08:00
Alex Lam S.L
f2286c33f1
enhance unsafe for Array ( #3349 )
2019-03-20 06:37:51 +08:00
Alex Lam S.L
b9615f7a62
improve compress performance ( #3348 )
...
fixes #3174
2019-03-20 02:53:04 +08:00
Alex Lam S.L
c520e99eda
enhance comparisons ( #3347 )
2019-03-19 01:34:25 +08:00
Alex Lam S.L
615ae37ca3
introduce assignments ( #3345 )
2019-03-18 21:28:41 +08:00
Alex Lam S.L
7aa7f21872
fix corner case in evaluate ( #3344 )
2019-03-18 21:24:42 +08:00
Alex Lam S.L
4430a436eb
fix corner case in inline ( #3343 )
2019-03-17 05:31:40 +08:00
Alex Lam S.L
8b3259e0c2
fix corner case in reduce_vars ( #3341 )
2019-03-15 16:06:47 +08:00
Alex Lam S.L
8d2e6f333e
fix function inlining after reduce_vars ( #3340 )
...
fixes #3297
2019-03-15 05:45:46 +08:00
Alex Lam S.L
b3ef5e514d
enhance evaluate ( #3339 )
...
fixes #3299
2019-03-15 02:48:23 +08:00
Alex Lam S.L
627f5fb41e
fix corner case with nameCache ( #3338 )
...
fixes #3301
2019-03-15 01:15:50 +08:00
Alex Lam S.L
d90777b724
parse mangle.properties.regex in --config-file properly ( #3337 )
...
fixes #3315
2019-03-15 00:20:20 +08:00
Alex Lam S.L
e49297e5eb
improve usability of pure_funcs ( #3336 )
...
fixes #3325
2019-03-14 21:36:45 +08:00
Alex Lam S.L
ebd82b3fb6
fix corner case in collapse_vars ( #3334 )
...
fixes #3274
2019-03-14 16:05:56 +08:00
Alex Lam S.L
d074aa6e27
fix corner case in collapse_vars ( #3333 )
...
fixes #3247
fixes #3305
fixes #3314
fixes #3327
2019-03-13 23:48:52 +08:00
Alex Lam S.L
b052f62710
fix corner case in reduce_vars ( #3332 )
...
fixes #3267
2019-03-13 21:56:38 +08:00
Alex Lam S.L
d4ac84b255
fix corner case in arguments & reduce_vars ( #3331 )
...
fixes #3282
2019-03-13 08:46:03 +08:00
Alex Lam S.L
e250396d7e
fix corner case in arguments ( #3330 )
...
Track modifications to `arguments[i]` under Strict Mode.
fixes #3273
2019-03-13 06:59:53 +08:00
Alex Lam S.L
008c236137
fix corner case in conditionals ( #3329 )
...
fixes #3245
fixes #3257
fixes #3260
fixes #3269
fixes #3271
fixes #3278
fixes #3309
fixes #3319
fixes #3321
2019-03-13 04:28:21 +08:00
Ed S
b1c0664066
Fix typo in warning ( #3324 )
...
protoype -> prototype
2019-03-13 02:15:54 +08:00
Alex Lam S.L
ce7e220de4
fix corner case in conditionals ( #3244 )
2018-08-30 15:59:05 +08:00
Alex Lam S.L
2bdaca10ae
enhance conditionals ( #3243 )
2018-08-30 01:06:34 +08:00
Alex Lam S.L
aa0029204e
fix corner case in reduce_vars ( #3241 )
...
fixes #3240
2018-08-29 22:14:25 +08:00
Alex Lam S.L
f352bcec3a
fix corner case in collapse_vars ( #3239 )
...
fixes #3238
2018-08-29 11:34:34 +08:00
Alex Lam S.L
694ca5d045
fix corner case in unused ( #3234 )
...
fixes #3233
2018-08-23 06:03:39 +08:00
Alex Lam S.L
57fb58b263
enhance if_return ( #3232 )
2018-08-21 18:34:16 +08:00
Alex Lam S.L
cfebeb2f63
fix corner case in mangle workaround for Safari ( #3230 )
...
fixes #3227
2018-08-09 17:34:28 +08:00
Alex Lam S.L
fc78423f1d
clean up webkit quirks ( #3229 )
2018-08-08 16:15:45 +08:00
Alex Lam S.L
d47547dc71
fix corner case in join_vars ( #3224 )
2018-07-27 19:34:44 +08:00
Alex Lam S.L
304db15a20
fix corner case in ie8 & rename ( #3223 )
2018-07-26 16:35:43 +08:00
Alex Lam S.L
7cf72b8d66
fix corner case in global_defs ( #3218 )
...
fixes #3217
2018-07-19 18:14:36 +08:00
Alex Lam S.L
cea685f8d9
fix corner case in ie8 ( #3216 )
...
fixes #3215
2018-07-19 14:45:36 +08:00
Alex Lam S.L
bcebacbb9e
fix corner cases in preserve_line ( #3212 )
2018-07-13 01:51:10 +08:00
Alex Lam S.L
66c126ffde
fix corner case in ie8 ( #3207 )
...
fixes #3206
2018-07-03 16:44:23 +08:00
alexlamsl
5ffc17d4aa
fix corner case in unused
2018-07-01 14:34:42 +08:00
Alex Lam S.L
76df77c08c
implement directives ( #3203 )
...
fixes #3166
2018-06-28 18:16:49 +08:00
Alex Lam S.L
957d5537a8
improve unsafe comparisons ( #3200 )
2018-06-28 03:46:19 +08:00
Alex Lam S.L
ab36b9b10a
fix corner case in ie8 ( #3198 )
...
fixes #3197
2018-06-24 04:00:36 +08:00
Alex Lam S.L
766a4147d4
enhance arguments ( #3193 )
...
fixes #3192
2018-06-24 04:00:21 +08:00
Alex Lam S.L
e54ddcbb8a
fix corner cases in properties ( #3189 )
...
fixes #3188
2018-06-19 18:20:11 +08:00
Alex Lam S.L
9e19e63551
general clean-ups ( #3175 )
2018-06-06 17:50:56 +08:00
Jiavan
b39043f3ab
re-introduce enclose ( #3163 )
...
fixes #2443
2018-06-01 16:47:11 +08:00
Alex Lam S.L
efa21ae3e6
fix corner case in reduce_vars ( #3151 )
2018-05-26 05:45:44 +08:00
Alex Lam S.L
24d9633a35
fix corner cases with eval() ( #3147 )
...
fixes #3146
2018-05-24 14:29:30 +08:00
Alex Lam S.L
b5af8a1914
fix corner case in reduce_vars ( #3141 )
...
fixes #3140
2018-05-21 15:53:51 +08:00
Alex Lam S.L
4fc39d8dad
fix corner case in collapse_vars ( #3139 )
2018-05-19 05:45:14 +08:00
Alex Lam S.L
7bc7704edf
fix corner case in reduce_vars ( #3129 )
2018-05-10 18:45:20 +08:00
Alex Lam S.L
14e712ee80
fix corner case in call binding ( #3128 )
...
fixes #3127
2018-05-10 06:16:35 +08:00
Alex Lam S.L
df8a99439a
fix various corner cases ( #3126 )
...
- augment ufuzz/reminify test options
fixes #3125
2018-05-07 07:36:25 +08:00
Alex Lam S.L
6b91d12ec3
fix corner case in reduce_vars ( #3124 )
2018-05-06 16:42:35 +08:00
Alex Lam S.L
f37b91879f
fix various corner cases ( #3123 )
2018-05-05 13:17:50 +08:00
Alex Lam S.L
d835c72c80
speed up collapse_vars ( #3119 )
2018-05-04 18:38:13 +08:00
Alex Lam S.L
c4cebb4b01
fix reduce_vars on nested invocations ( #3118 )
2018-05-04 06:05:38 +08:00
Alex Lam S.L
d51a00a450
compress AST_Sequence within AST_Call ( #3117 )
2018-05-03 19:14:56 +08:00
Alex Lam S.L
fc0f168a0c
better fix for #3113 ( #3115 )
2018-05-03 15:51:51 +08:00
Alex Lam S.L
a0ca595c2c
fix TreeWalker scan order ( #3114 )
...
fixes #3113
2018-05-03 00:27:45 +08:00
Alex Lam S.L
1a314e9f60
improve reduce_vars ( #3112 )
...
fixes #3110
2018-05-02 15:11:45 +08:00
Alex Lam S.L
22cea023d1
improve numeral compression ( #3108 )
2018-04-28 02:47:49 +08:00
Alex Lam S.L
838f837379
improve general performance ( #3104 )
2018-04-27 04:30:29 +08:00
Alex Lam S.L
82a8b6f612
improve collapse_vars ( #3103 )
2018-04-26 19:26:01 +08:00
Alex Lam S.L
9e87edfc2e
better fix for #2506 ( #3099 )
2018-04-25 04:46:07 +08:00
Alex Lam S.L
27211cf2d5
handle RHS side-effects in collapse_vars ( #3097 )
...
fixes #3096
2018-04-24 20:31:50 +08:00
Alex Lam S.L
b5ce199711
improve max_line_len ( #3095 )
...
fixes #304
2018-04-24 15:19:45 +08:00
Alex Lam S.L
7362f57966
improve performance when handling unused variables in collapse_vars ( #3084 )
...
fixes #3082
2018-04-15 12:38:31 +08:00
Alex Lam S.L
6a916523d4
fix inline of catch-scoped variables ( #3077 )
...
fixes #3076
2018-04-11 15:44:43 +08:00
Alex Lam S.L
ba7069d52b
suppress hoist_props for embedded assignments ( #3074 )
2018-04-11 05:19:16 +08:00
Alex Lam S.L
4dd7d0e39b
extend hoist_props ( #3073 )
...
- handle `AST_Assign` the same way as `AST_VarDef`
- inject `AST_Var` as succeeding statement
fixes #3071
2018-04-11 02:48:15 +08:00
Alex Lam S.L
90199d0a96
extend join_vars on object assignments ( #3072 )
2018-04-11 01:35:42 +08:00
Alex Lam S.L
b82fd0ad41
handle flow control in loops with reduce_vars ( #3069 )
...
fixes #3068
2018-04-10 06:51:03 +08:00
Alex Lam S.L
183da16896
handle pure_funcs under inline & reduce_vars correctly ( #3066 )
...
fixes #3065
2018-04-10 02:46:38 +08:00
Alex Lam S.L
e5f6a88233
fix corner case in reuse of mangle options ( #3062 )
2018-04-08 02:29:37 +08:00
Alex Lam S.L
db49daf365
mangle Object.defineProperty() ( #3059 )
...
fixes #869
2018-04-06 17:10:36 +08:00
Alex Lam S.L
923deeff35
support inline source map from multiple files ( #3058 )
...
fixes #145
2018-04-06 16:04:15 +08:00
Alex Lam S.L
0b62a28b47
improve usability of includeSources ( #3057 )
...
Exclude source contents from input source map if `includeSources=false`
fixes #3041
2018-04-06 13:32:26 +08:00
Alex Lam S.L
44116c6d2b
fix AST corruption during inline of simple return ( #3056 )
...
fixes #3054
2018-04-06 05:39:07 +08:00
Alex Lam S.L
b5bab254ce
speed up has_parens() (take 2) ( #3052 )
...
fixes #3050
2018-04-05 04:12:04 +08:00
Alex Lam S.L
81603ecd15
improve performance through makePredicate() ( #3048 )
2018-04-03 15:15:01 +08:00
Alex Lam S.L
e67553fa55
fix tree traversal on AST_Do ( #3047 )
...
fixes #3046
2018-04-02 22:31:23 +08:00
Alex Lam S.L
02f47e1713
give sensible error against invalid input source map ( #3044 )
2018-03-31 18:48:20 +09:00
Alex Lam S.L
07f64d4050
fix escape analysis on AST_New ( #3043 )
...
fixes #3042
2018-03-31 15:03:46 +09:00
Alex Lam S.L
fa3250199a
mangle unused nested AST_SymbolCatch correctly ( #3038 )
...
fixes #3035
2018-03-30 16:23:09 +09:00
Alex Lam S.L
06b9894c19
handle modifications to this correctly ( #3036 )
...
fixes #3032
2018-03-30 15:07:36 +09:00
Alex Lam S.L
82ae95c334
improve source map granularity ( #3030 )
...
fixes #3023
2018-03-29 14:47:55 +09:00
Fábio Santos
9a5e2052c4
fix extra regex slash when going through mozilla AST I/O ( #3025 )
...
This relates to #1929 , but in the context of mozilla AST input/output.
2018-03-27 03:22:01 +09:00
Alex Lam S.L
b1410be443
speed up has_parens() ( #3014 )
2018-03-24 04:05:28 +08:00
Alex Lam S.L
12985d86c2
fix corner case in hoist_props ( #3022 )
...
fixes #3021
2018-03-23 07:27:35 +08:00
Alex Lam S.L
49bfc6b555
improve performance ( #3020 )
...
- replace `find_if()` with `all()` wherever possible
- move ESTree-specific logic out of `figure_out_scope()`
2018-03-23 03:43:52 +08:00
Alex Lam S.L
d1c6bb8c7c
fix nested inline within loop ( #3019 )
...
fixes #3018
2018-03-23 02:31:59 +08:00
Alex Lam S.L
5c169615a8
fix corner case in inline ( #3017 )
...
fixes #3016
2018-03-22 23:46:26 +08:00
Alex Lam S.L
ccf0e2ef4f
extend fuzzy RHS folding ( #3006 )
...
- `a = []; if (1) x();` => `if (a = []) x();`
2018-03-17 03:10:21 +08:00
Alex Lam S.L
20ca0f5906
improve truthy compression ( #3009 )
2018-03-16 06:12:59 +08:00
Alex Lam S.L
b29d435bb5
refactor brackets to braces ( #3005 )
2018-03-15 15:46:45 +08:00
Alex Lam S.L
188c39e8d5
retain comments within brackets ( #2999 )
...
fixes #2998
2018-03-13 18:44:21 +08:00
Alex Lam S.L
5429234138
preserve non-constant value assignments with modifications ( #2997 )
...
fixes #2995
2018-03-13 17:35:34 +08:00
Alex Lam S.L
b9f72a4a81
handle case correctly under reduce_vars ( #2993 )
...
fixes #2992
2018-03-11 15:54:43 +08:00
Alex Lam S.L
fc6ebd04a5
preserve case when inline_script ( #2991 )
...
fixes #2989
2018-03-11 05:11:12 +08:00
Alex Lam S.L
10b3752b1e
fix mangle of AST_SymbolLambda under ie8 ( #2978 )
...
fixes #2976
2018-03-07 17:20:38 +08:00
Alex Lam S.L
fe51a91395
handle negated constants correctly in collapse_vars ( #2975 )
...
fixes #2974
2018-03-06 00:45:58 +08:00
Alex Lam S.L
a75a046abb
compress arguments[index] ( #2967 )
...
- always replace with existing parameter
- only introduce new parameter if `keep_fargs` is disabled
2018-03-02 11:22:09 +08:00
Alex Lam S.L
38f2b4579f
fix value reference caching in evaluate ( #2969 )
...
fixes #2968
2018-03-02 04:04:29 +08:00
Alex Lam S.L
56e2a369d0
enhance conditionals ( #2966 )
...
- `x ? (y, w) : (z, w)` => `x ? y : z, w`
2018-02-28 23:34:48 +08:00
Alex Lam S.L
0daa199fa8
migrate safe transformations out of unsafe_comps ( #2962 )
...
fixes #2959
2018-02-28 22:02:24 +08:00
Alex Lam S.L
73e98dcda4
drop side_effects-free return values ( #2965 )
2018-02-28 19:59:19 +08:00
Alex Lam S.L
36bca6934d
enhance collapse_vars ( #2952 )
...
- `a = b, b` => `a = b`
- `a.b = c, c()` => `(a.b = c)()`
2018-02-28 15:19:32 +08:00
Alex Lam S.L
ace5811691
drop lone "use strict" in function body ( #2963 )
...
fixes #2961
2018-02-26 15:22:52 +08:00
Alex Lam S.L
b8b2ac5230
improve fix for #2954 ( #2958 )
2018-02-26 03:14:22 +08:00
Alex Lam S.L
ea2359381b
fix collapse_vars on nested exception ( #2955 )
...
fixes #2954
2018-02-25 15:39:00 +08:00
Alex Lam S.L
52de64cf16
deduplicate parenthesis around object and function literals ( #2953 )
2018-02-25 02:14:33 +08:00
Alex Lam S.L
455790202a
minor clean-ups ( #2951 )
2018-02-24 02:24:47 +08:00
Alex Lam S.L
f40f5eb228
improve mangle ( #2948 )
2018-02-23 23:51:49 +08:00
Alex Lam S.L
39a907bde3
workaround pure_getters=true when dropping unused assignments ( #2939 )
...
fixes #2938
2018-02-20 17:38:40 +08:00
Alex Lam S.L
70474310f3
improve unsafe evaluate of function ( #2936 )
...
Miscellaneous
- simplify `run_code()` hack
2018-02-19 18:47:02 +08:00
Alex Lam S.L
4b5993ff15
fix crash in may_throw() ( #2932 )
...
fixes #2931
2018-02-18 21:51:27 +08:00
Alex Lam S.L
2351a672ea
fix dead_code on exceptional return ( #2930 )
...
fixes #2929
2018-02-18 04:36:00 +08:00
Alex Lam S.L
82d1ef0242
fix unsafe evaluate of function property ( #2927 )
...
fixes #2926
2018-02-17 21:33:36 +08:00
Alex Lam S.L
7fdd2082a6
drop unused "class" definition IIFEs ( #2923 )
...
fixes #805
2018-02-17 05:11:31 +08:00
Alex Lam S.L
d626e9bf19
improve inline efficiency ( #2924 )
2018-02-17 02:37:13 +08:00
Alex Lam S.L
a2a9459684
fix unsafe evaluate of AST_Function ( #2920 )
...
fixes #2919
2018-02-16 17:21:46 +08:00
Alex Lam S.L
d316fb139d
fix unsafe evaluate on type-converting operators ( #2917 )
...
fixes #2916
2018-02-14 16:48:47 +08:00
Alex Lam S.L
83d8aa8b12
fix collapse_vars within loops ( #2915 )
...
fixes #2914
2018-02-14 05:15:52 +08:00
Alex Lam S.L
d8e0e34354
collapse within unary expressions ( #2910 )
2018-02-13 07:10:37 +08:00
Alex Lam S.L
0c4f315c02
fix corner case in collapse_vars ( #2909 )
...
fixes #2908
2018-02-13 01:41:22 +08:00
Alex Lam S.L
0809699bdc
simplify do-while into for ( #2907 )
...
fixes #2904
2018-02-12 23:28:28 +08:00
Alex Lam S.L
2088e1c19d
fix AST corruption due to collapse_vars & inline ( #2899 )
...
fixes #2898
2018-02-09 06:54:37 +08:00
Alex Lam S.L
bf1d47180c
fix join_vars on property accessors ( #2895 )
...
fixes #2893
2018-02-09 01:52:39 +08:00
Alex Lam S.L
d66d86f20b
account for exceptions in AST_Assign.left ( #2892 )
...
fixes #2891
2018-02-08 03:31:51 +08:00
Alex Lam S.L
d69d8007d6
evaluate to{Low,Upp}erCase() under unsafe ( #2886 )
2018-02-06 15:57:15 +08:00
Dan
9637f51b68
change undefined == x to null == x ( #2882 )
...
fixes #2871
2018-02-05 15:00:23 +08:00
Alex Lam S.L
3026bd8975
improve exceptional flow compression by collapse_vars ( #2880 )
2018-02-04 04:18:22 +08:00
Alex Lam S.L
78a44d5ab0
maintain order between side-effects and externally observable assignments ( #2879 )
...
fixes #2878
2018-02-04 03:58:49 +08:00
Alex Lam S.L
7e13c0db40
handle break & continue in collapse_vars ( #2875 )
...
fixes #2873
2018-02-03 07:58:43 +08:00
Alex Lam S.L
e6a2e9e4d0
allow collapse_vars across conditional branches ( #2867 )
2018-02-03 02:44:40 +08:00
Alex Lam S.L
e773f03927
fix assignment logic in reduce_vars ( #2872 )
...
fixes #2869
2018-02-03 01:33:09 +08:00
Alex Lam S.L
b16380d669
fix missing corner case in #2855 ( #2868 )
2018-02-02 18:08:56 +08:00
Alex Lam S.L
525a61fb55
better fix for #2858 ( #2864 )
2018-02-01 20:06:36 +08:00
Alex Lam S.L
c3a002ff97
account for side-effects in comparisons of null & undefined ( #2863 )
2018-02-01 19:15:17 +08:00
Alex Lam S.L
fad6766a90
simplify comparisons with undefined & null ( #2862 )
...
fixes #2857
2018-02-01 16:50:54 +08:00
Alex Lam S.L
aa664dea0a
avoid evaluate of compound assignment after dead_code transform ( #2861 )
...
fixes #2860
2018-02-01 16:18:29 +08:00
Alex Lam S.L
102f994b9d
account for declaration assignment in collapse_vars ( #2859 )
...
fixes #2858
2018-02-01 15:09:53 +08:00
Alex Lam S.L
2a4c68be4f
relax collapse_vars on AST_Exit ( #2855 )
...
First introduced in #1862 to stop assignments to migrate beyond `return` or `throw`. Since then `collapse_vars` has been improved to handle various side-effect-related corner cases.
2018-01-31 23:49:59 +08:00
Alex Lam S.L
541e6011af
improve symbol replacement heuristic ( #2851 )
2018-01-29 17:41:15 +08:00
Alex Lam S.L
6fa3fbeae8
compress chained compound assignments ( #2850 )
2018-01-29 15:13:25 +08:00
Alex Lam S.L
193612ac67
fix accounting after conversion to assignment ( #2847 )
...
Missing reference to `AST_SymbolRef` created by `unused` causes `collapse_vars` to misbehave.
fixes #2846
2018-01-26 14:21:11 +08:00
Alex Lam S.L
95cfce68ea
backport of #2835 ( #2841 )
2018-01-23 05:45:45 +08:00
Alex Lam S.L
ec4202590d
drop assignments to constant expressions only ( #2839 )
...
fixes #2838
2018-01-23 02:49:54 +08:00
Alex Lam S.L
5e2cd07d6f
handle duplicate function declarations correctly ( #2837 )
...
fixes #2836
2018-01-23 01:28:09 +08:00
Alex Lam S.L
e2dc9cf091
fix unsafe evaluate of AST_Array ( #2825 )
...
fixes #2822
2018-01-21 01:39:44 +08:00
Alex Lam S.L
069df27bf1
enable unsafe for test/ufuzz.js ( #2819 )
...
- introduce `unsafe_undefined`
- safer `.toString()` compression
Miscellaneous
- rename `unsafe_Function`
2018-01-19 23:47:42 +08:00
Alex Lam S.L
3e7873217c
improve unused on built-in functions ( #2817 )
2018-01-19 20:41:57 +08:00
Alex Lam S.L
e21bab7ce6
avoid duplicate property names in object literals under "use strict" ( #2818 )
...
fixes #2816
2018-01-19 20:13:50 +08:00
Alex Lam S.L
082e004b87
compress undefined property names ( #2811 )
...
- enforce property names as string
- handle `void 0` as `undefined` in `hoist_props` & `reduce_vars`
2018-01-19 00:36:30 +08:00
kzc
983e69128b
fix join_vars property assignment for negative array index ( #2810 )
...
fixes #2790
2018-01-18 21:52:54 +08:00
Alex Lam S.L
cc07f3b806
faster output of comments ( #2806 )
2018-01-18 02:57:33 +08:00
Alex Lam S.L
07e4b64f3a
fix AST_Scope.clone() ( #2803 )
...
fixes #2799
2018-01-17 21:33:13 +08:00
Alex Lam S.L
d3ce2bc9e7
suppress unsafe_proto for LHS expressions ( #2804 )
2018-01-17 20:41:51 +08:00
Alex Lam S.L
79cfac77bd
extend join_vars & sequences ( #2798 )
2018-01-17 13:58:27 +08:00
Alex Lam S.L
b4aef753e7
general improvements around AST_ForIn ( #2796 )
...
- compress using `collapse_vars`
- remove unused `name`
- simplify `loop_body`
2018-01-16 17:03:12 +08:00
Alex Lam S.L
10f961c27b
enhance collapse_vars ( #2788 )
2018-01-15 18:47:23 +08:00
Alex Lam S.L
b483678ca7
avoid suboptimal termination in passes ( #2787 )
2018-01-15 16:42:31 +08:00
Alex Lam S.L
cbbe6fad60
avoid double counting within single-use functions ( #2785 )
...
fixes #2783
2018-01-15 16:42:15 +08:00
Alex Lam S.L
62a66dfff4
fix & extend join_vars for object assigments ( #2781 )
2018-01-14 17:11:31 +08:00
kzc
2cab348341
improve SymbolDef info in --output ast ( #2778 )
...
* SymbolDef info (a.k.a. `thedef`) is now represented as a string containing `"ID name [mangled_name]"`.
* Enhance display of `globals`, `variables`, `functions` and `enclosed`.
* `SymbolDef.next_id` starts at `1` and the `id` is adjusted for `-o ast` display.
2018-01-14 01:40:51 +08:00
Alex Lam S.L
e49416e4aa
fix reduce_vars on AST_Accessor ( #2776 )
...
fixes #2774
2018-01-13 02:46:14 +08:00
kzc
d4d7d99b70
add SymbolDef IDs to --output ast ( #2772 )
2018-01-12 15:41:09 +08:00
Alex Lam S.L
6a696d0a7b
fix output of imported AST ( #2771 )
2018-01-12 01:05:49 +08:00
Alex Lam S.L
b757450cd8
fix nested unused assignments ( #2769 )
...
fixes #2768
2018-01-11 23:13:44 +08:00
Alex Lam S.L
23ec484806
fix corner case in #2763 ( #2766 )
2018-01-11 21:18:08 +08:00
Alex Lam S.L
f1e1bb419a
join object assignments ( #2763 )
2018-01-11 17:08:21 +08:00
Alex Lam S.L
6a0af85c8b
skip only vars in if_return ( #2759 )
...
fixes #2747
2018-01-10 19:08:46 +08:00
Alex Lam S.L
09269be974
enhance conditionals ( #2758 )
...
`x ? y || z : z` --> `x && y || z`
2018-01-10 16:59:57 +08:00
Alex Lam S.L
bf832cde16
improve synergy between compress and rename ( #2755 )
2018-01-09 17:55:41 +08:00
Alex Lam S.L
2972d58dbb
patch variable declaractions extracted within catch ( #2753 )
...
fixes #2749
2018-01-09 13:54:35 +08:00
Alex Lam S.L
2e22d38a02
improve rename reproducibility ( #2754 )
...
fixes #2752
2018-01-09 13:53:05 +08:00
Alex Lam S.L
ce27bcd69a
compress loops with immediate break ( #2746 )
...
fixes #2740
2018-01-08 14:30:18 +08:00
Alex Lam S.L
1ee8be8d91
fix recursive function inline ( #2738 )
...
fixes #2737
2018-01-07 15:31:24 +08:00
Alex Lam S.L
659c8a7632
handle trailing line comments correctly ( #2736 )
...
fixes #2734
2018-01-06 21:05:21 +08:00
Alex Lam S.L
3564b4f20d
compress RegExp() in unsafe ( #2735 )
2018-01-06 21:04:47 +08:00
Alex Lam S.L
3505a3604a
enhance unsafe_proto ( #2733 )
2018-01-06 06:16:51 +08:00
Alex Lam S.L
9f23185f2b
fix corner case with arguments as function name ( #2729 )
...
fixes #2728
2018-01-05 22:21:18 +08:00
Alex Lam S.L
b82feb9302
improve if_return ( #2727 )
2018-01-05 20:24:30 +08:00
Alex Lam S.L
7f2a591c7e
warn on deprecated features ( #2726 )
...
- `function.arguments`
- `function.callers`
fixes #2719
2018-01-05 19:36:02 +08:00
Alex Lam S.L
afbcebddf6
fix mangle name collision across files ( #2722 )
2018-01-05 05:08:09 +08:00
Alex Lam S.L
484e484571
fix corner case in inline ( #2720 )
2018-01-04 23:38:37 +08:00
Alex Lam S.L
a6873a3859
forbid block-scoped AST_Defun in strict mode ( #2718 )
2018-01-04 18:45:51 +08:00
Alex Lam S.L
7a6d452b54
preserve constant modification under strict mode ( #2717 )
2018-01-04 15:53:53 +08:00
Alex Lam S.L
9b58b54e2d
extend inline ( #2714 )
...
- compress `function` with variables within loops
- restrict to `AST_Var` for better compatibility with ES6+
2018-01-04 12:58:40 +08:00
Alex Lam S.L
c598a12af9
apply collapse_vars to loop conditions ( #2712 )
2018-01-04 03:18:28 +08:00
Alex Lam S.L
cfe3a98ce5
drop unused assignment based on reduce_vars ( #2709 )
2018-01-04 01:03:33 +08:00
Alex Lam S.L
14778e049b
fix reduce_vars on AST_Defun ( #2708 )
2018-01-03 17:18:38 +08:00
Alex Lam S.L
446fb0198b
extend __PURE__ to AST_New ( #2706 )
...
fixes #2705
2018-01-03 04:48:07 +08:00
Alex Lam S.L
7d3cddf9d6
inline functions with AST_Var ( #2688 )
2018-01-03 01:54:44 +08:00
Alex Lam S.L
6dead95eb3
enhance collapse_vars ( #2704 )
2018-01-02 18:42:15 +08:00
Alex Lam S.L
cc931b3ad8
enhance if_return ( #2703 )
2018-01-02 15:09:51 +08:00
Alex Lam S.L
d838b4b52e
reset argument value within loop after inline ( #2699 )
2018-01-02 01:24:53 +08:00
Alex Lam S.L
2f3bddbaca
scan within IIFEs of assigned values ( #2702 )
...
fixes #2701
2018-01-02 01:24:23 +08:00
Alex Lam S.L
673b071637
enhance join_vars & sequences ( #2697 )
...
- nudge declarations without assignments
- within `AST_BlockStatement`
- across `AST_If`
2018-01-01 00:09:26 +08:00
Alex Lam S.L
da82fa59a7
fix inline on duplicate argument names ( #2698 )
2017-12-31 20:59:58 +08:00
Alex Lam S.L
333792352e
reduce hoisting declarations ( #2687 )
2017-12-31 16:15:00 +08:00
Alex Lam S.L
ed7a0a454e
fix dead_code on escaped return assignment ( #2693 )
...
fixes #2692
2017-12-30 15:20:25 +08:00
Alex Lam S.L
d819559a01
minor clean-ups ( #2686 )
2017-12-29 14:04:52 +08:00
Alex Lam S.L
b95e3338d9
fix pure_getters on AST_Binary ( #2681 )
...
fixes #2678
2017-12-28 17:01:01 +08:00
Alex Lam S.L
cb62bd98d3
fix function inlining within loops ( #2675 )
...
fixes #2663
2017-12-28 02:53:14 +08:00
Alex Lam S.L
f30790b11b
fix dead_code on return assignments ( #2668 )
...
fixes #2666
2017-12-27 07:40:34 +08:00
Alex Lam S.L
5205dbcbf4
retain recursive function names ( #2667 )
...
fixes #2665
2017-12-27 07:00:12 +08:00
Alex Lam S.L
3ff625de7e
fix bugs on substituted AST_Defun ( #2661 )
...
fixes #2660
2017-12-27 05:31:37 +08:00
Alex Lam S.L
4832bc5d88
replace single-use recursive functions ( #2659 )
...
fixes #2628
2017-12-26 21:25:35 +08:00
Alex Lam S.L
7f342cb3e3
suppress inline within substituted AST_Scope ( #2658 )
...
fixes #2657
2017-12-26 18:56:59 +08:00
Alex Lam S.L
05e7d34ed4
improve unused over duplicate variable names ( #2656 )
2017-12-26 18:29:28 +08:00
Alex Lam S.L
0fe259e9c5
parse LF & comment correctly ( #2653 )
...
fixes #2652
2017-12-26 01:38:01 +08:00
Alex Lam S.L
1476c78b53
add html-minifier to benchmarks ( #2646 )
2017-12-25 03:07:46 +08:00
Alex Lam S.L
cb6a92892f
fix infinite loop during inline ( #2645 )
...
fixes #2644
2017-12-25 01:57:11 +08:00
Alex Lam S.L
efffb81735
fix comments output & improve /*@__PURE__*/
...
- fix whitespace around comments
- fix comment parsing around parentheses
- consider parentheses when parsing `/*@__PURE__*/`
- remove all `/*@__PURE__*/` on output
fixes #2638
2017-12-24 12:38:45 +08:00
Alex Lam S.L
202f90ef8f
fix corner cases with collapse_vars, inline & reduce_vars ( #2637 )
...
fixes #2630
2017-12-24 01:24:12 +08:00
Alex Lam S.L
c07ea17c01
fix escape analysis on AST_PropAccess ( #2636 )
2017-12-24 00:36:46 +08:00
Alex Lam S.L
edb4e3bd52
make comments output more robust ( #2633 )
...
- improve handling of comments right after `return`
- retain comments after `OutputStream`
- preserve trailing comments
- fix handling of new line before comments
- handle comments around parentheses
fixes #88
fixes #112
fixes #218
fixes #372
fixes #2629
2017-12-22 04:59:54 +08:00
Alex Lam S.L
7ac7b0872f
remove AST hack from inline ( #2627 )
2017-12-20 17:05:53 +08:00
Alex Lam S.L
86ae5881b7
disable hoist_funs by default ( #2626 )
2017-12-20 17:05:40 +08:00
Alex Lam S.L
fac003c64f
avoid inline of function with special argument names ( #2625 )
2017-12-20 02:48:04 +08:00
Alex Lam S.L
2273655c17
fix inline after single-use reduce_vars ( #2623 )
2017-12-19 22:19:33 +08:00
Ondřej Španěl
01057cf76d
Transform can be simplified when clone is not done. ( #2621 )
2017-12-19 17:56:16 +08:00
Alex Lam S.L
4b334edf49
handle global constant collision with local variable after inline ( #2617 )
...
fixes #2616
2017-12-19 03:05:30 +08:00
Alex Lam S.L
8ddcbc39e6
compress apply() & call() of function ( #2613 )
...
- `fn.apply(a, [ ... ])` => `fn.call(a, ...)`
- `fn.call(a, ... )` => `a, fn(...)`
where `fn` can be `function` literal or symbol reference linked through `reduce_vars`
2017-12-18 16:23:39 +08:00
Alex Lam S.L
0b0eac1d5d
drop property assignment to constants ( #2612 )
2017-12-18 12:07:53 +08:00
Alex Lam S.L
b29fc8b27c
improve transversal efficiency in collapse_vars ( #2611 )
...
fixes #2603
2017-12-18 03:00:05 +08:00
Alex Lam S.L
7918a50d52
improve reset_opt_flags() ( #2610 )
2017-12-17 23:01:08 +08:00
Alex Lam S.L
21794c9b8d
account for catch variable when inline ( #2605 )
...
fixes #2604
2017-12-16 15:21:09 +08:00
Alex Lam S.L
6c686ce593
fix nested inline ( #2602 )
...
fixes #2601
2017-12-16 02:16:35 +08:00
Alex Lam S.L
db902af4c6
fix escape analysis on || and && ( #2600 )
...
fixes #2598
2017-12-15 19:48:14 +08:00
Alex Lam S.L
7d6907cb99
fix dead_code on nested try ( #2599 )
...
fixes #2597
2017-12-15 19:41:28 +08:00
Alex Lam S.L
092d9affb8
fix reduce_vars on do...while ( #2596 )
2017-12-15 16:33:19 +08:00
Alex Lam S.L
8f681b1d17
handle inline of function arguments ( #2590 )
...
fixes #2476
2017-12-15 13:28:30 +08:00
Alex Lam S.L
90313875f7
inline single-use function across loop ( #2594 )
2017-12-14 19:24:54 +08:00
Alex Lam S.L
3f18a61532
fix reduce_vars on single AST_Defun reference across loop ( #2593 )
2017-12-14 18:47:05 +08:00
Alex Lam S.L
02a6ce07eb
improve reduce_vars ( #2592 )
...
- account for hoisting nature of `var`
2017-12-14 15:32:13 +08:00
Alex Lam S.L
738fd52bc4
improve collapse_vars ( #2591 )
...
- handle single-use assignments other than `AST_VarDef`
- scan `AST_Call` for candidates
2017-12-14 15:31:35 +08:00
Alex Lam S.L
8266993c6e
fix dead_code on return/throw within try ( #2588 )
2017-12-14 04:38:21 +08:00
Alex Lam S.L
9a137e8613
drop local assign-only variable in return ( #2587 )
2017-12-14 02:59:59 +08:00
Alex Lam S.L
ef618332ea
fold cascade functionality into collapse_vars ( #2586 )
2017-12-14 01:20:36 +08:00
Alex Lam S.L
7f418978c9
recover lost opportunities from #2574 ( #2584 )
2017-12-13 18:20:53 +08:00
Alex Lam S.L
04cc395c35
improve collapse_vars on side-effect-free replacements ( #2583 )
2017-12-13 04:52:54 +08:00
Alex Lam S.L
e008dc1bde
minor clean-up for IIFE ( #2582 )
...
- faster exact type match
- aggressively convert to `!`
2017-12-13 01:27:26 +08:00
Alex Lam S.L
ebfd5c5c74
fix AST_VarDef.may_throw() ( #2580 )
2017-12-12 03:30:25 +08:00
Alex Lam S.L
f2ad542679
fix collapse_vars on switch ( #2578 )
2017-12-11 18:11:09 +08:00
Alex Lam S.L
c43118be4f
remove unused code ( #2579 )
...
fixes #2577
2017-12-11 17:39:08 +08:00
Alex Lam S.L
93f3b2b114
escape consecutive unpaired surrogates ( #2576 )
...
fixes #2569
2017-12-11 01:15:44 +08:00
Alex Lam S.L
0e16d92786
handle exceptional flow correctly in collapse_vars ( #2574 )
...
fixes #2571
2017-12-11 00:16:02 +08:00
Alex Lam S.L
0aff037a35
improve unused on assign-only symbols ( #2568 )
2017-12-09 06:19:29 +08:00
Alex Lam S.L
74a2f53683
fix escape analysis for AST_Throw ( #2564 )
2017-12-08 02:54:37 +08:00
Alex Lam S.L
e20935c3f2
fix escape analysis for AST_Conditional & AST_Sequence ( #2563 )
...
fixes #2560
2017-12-08 01:50:38 +08:00
Alex Lam S.L
3e34f62a1c
account for side-effects in conditional call inversion ( #2562 )
...
fixes #2560
2017-12-08 01:15:31 +08:00
Alex Lam S.L
d21cb84696
eliminate noop calls more aggressively ( #2559 )
2017-12-07 01:22:08 +08:00
Alex Lam S.L
3dd495ecdd
improve if_return ( #2558 )
...
`return void x()` => `x()`
2017-12-07 01:01:52 +08:00
Alex Lam S.L
77332a0315
fix dead_code on for ( #2552 )
2017-12-02 15:46:05 +08:00
Alex Lam S.L
8da3754e51
improve evaluate on typeof ( #2550 )
...
- gated through `typeofs`
2017-12-02 02:18:33 +08:00
Alex Lam S.L
9a6b11f8e6
improve boolean compression ( #2548 )
...
fixes #2535
2017-12-01 22:41:35 +08:00
Alex Lam S.L
7ac6fdcc99
improve switch case compression ( #2547 )
2017-12-01 14:32:00 +08:00
Alex Lam S.L
f6610baaa8
improve AST_For.init & AST_Switch.expression compression ( #2546 )
2017-12-01 12:53:59 +08:00
Alex Lam S.L
09b320e8a5
convert to number under boolean context ( #2545 )
2017-12-01 12:52:36 +08:00
Alex Lam S.L
5a1e99d713
improve compression of if conditions ( #2544 )
2017-12-01 06:18:31 +08:00
Alex Lam S.L
b762f2d6f4
improve compression of loop conditions ( #2543 )
2017-12-01 05:52:33 +08:00
Alex Lam S.L
172079a47f
improve code reuse ( #2542 )
2017-12-01 03:40:46 +08:00
Alex Lam S.L
c58d3936a3
fix corner case in call binding ( #2541 )
2017-12-01 03:18:20 +08:00
Alex Lam S.L
bc5047c1e7
fix inline on nested substitutions ( #2533 )
...
fixes #2531
2017-11-29 13:31:41 +08:00
Alex Lam S.L
206a54a746
fix nested hoist_props substitution ( #2523 )
...
fixes #2519
2017-11-28 14:39:00 +08:00
Alex Lam S.L
32def5ebf5
improve synergy between collapse_vars & unused ( #2521 )
2017-11-28 14:02:39 +08:00
Alex Lam S.L
ecc9f6b770
drop assignment in AST_VarDef.value ( #2522 )
...
fixes #2516
2017-11-28 13:08:40 +08:00
Alex Lam S.L
c141ae6f8d
fix argument/atom collision by properties ( #2514 )
...
fixes #2513
2017-11-25 22:52:46 +08:00
Alex Lam S.L
3b28b915eb
extend escape analysis on constant expression properties ( #2509 )
...
fixes #2508
2017-11-24 14:07:39 +08:00
Alex Lam S.L
eb001dc1d9
fix argument/atom collision by collapse_vars ( #2507 )
...
fixes #2506
2017-11-24 07:26:22 +08:00
Alex Lam S.L
aa9bdf416e
make AST_Lambda.contains_this() less magical ( #2505 )
2017-11-24 07:03:37 +08:00
Alex Lam S.L
8987780db6
eliminate invalid state caching in collapse_vars ( #2502 )
...
fixes #2497
2017-11-24 04:12:37 +08:00
Alex Lam S.L
30cfea2e7a
fix rename ( #2501 )
...
- suppress spurious `rename` from `commander`
- handle `AST_SymbolCatch` correctly
2017-11-24 03:05:43 +08:00
Alex Lam S.L
f4e2fb9864
expand symbol space to improve compression ( #2460 )
...
- give globally distinct names to distinct variables
- improve ability to compress cross-scoped
- introduce `options.rename` to `minify()`
- default `true` if both `compress` & `mangle`
2017-11-19 19:29:51 +08:00
Alex Lam S.L
b80062c490
enable hoist_props by default ( #2492 )
2017-11-19 14:56:23 +08:00
Alex Lam S.L
ae28a24c7f
fix cross-scope inlining of AST_Functions ( #2486 )
...
fixes #2485
2017-11-16 10:04:30 +08:00
Alex Lam S.L
ebe761cad0
minor consolidations ( #2484 )
...
- unique symbol generation
- `unsafe` on `AST_Call`
2017-11-16 04:37:37 +08:00
Alex Lam S.L
49fbe9c5ac
fix replacement logic in collapse_vars ( #2475 )
2017-11-13 07:37:42 +08:00
Alex Lam S.L
2ac5086831
fix top_retain on hoist_props ( #2474 )
...
fixes #2473
2017-11-13 00:59:41 +08:00
Alex Lam S.L
c6cfa04d10
allow symbol replacement on multiple occurrences ( #2472 )
...
- all-or-nothing replacement
- avoid unmangleable names
fixes #2436
2017-11-12 22:31:47 +08:00
Alex Lam S.L
cda27b0970
extend reduce_funcs to cover cross-scope substitutions ( #2469 )
...
fixes #2468
2017-11-11 15:30:17 +08:00
Alex Lam S.L
3c74047368
implement compress option reduce_funcs ( #2466 )
...
- inline single-use function declarations as expressions when permissible
- depend on `reduce_vars`
- enabled by default
- disable for speed critical code
fixes #2464
2017-11-11 05:59:35 +08:00
Alex Lam S.L
94525d859f
fix object literal tracing in reduce_vars ( #2461 )
2017-11-10 05:47:10 +08:00
Alex Lam S.L
1127a2caf3
fix multiple nested function substitutions ( #2458 )
...
fixes #2449
2017-11-09 23:30:00 +08:00
Alex Lam S.L
246d9d4e83
remove hack in collapse_vars ( #2457 )
...
fixes #2456
2017-11-09 20:00:58 +08:00
Alex Lam S.L
4c0b0177b6
preserve function identity in reduce_vars ( #2451 )
...
fixes #2450
2017-11-08 03:28:46 +08:00
Alex Lam S.L
bbedbf4ea0
handle circular function reference gracefully ( #2446 )
...
fixes #2442
2017-11-07 02:37:23 +08:00
Alex Lam S.L
2cfb5aa7da
account for eval & with in reduce_vars ( #2441 )
...
fixes #2440
2017-11-06 16:10:57 +08:00
Alex Lam S.L
6c45101870
consolidate & enhance unused ( #2439 )
...
- defer declaration removal in `collapse_vars`
- account for `AST_SymbolFunarg` in deduplication
- private accounting for `collapse_vars`
- avoid issues with identity reference due to deep cloning
fixes #2437
2017-11-06 14:25:10 +08:00
Alex Lam S.L
2c2fd89e34
inline single-use functions that are not constant expressions ( #2434 )
...
fixes #2428
2017-11-05 22:14:11 +08:00
Alex Lam S.L
5b4b07e9a7
extend function inlining safety checks ( #2430 )
2017-11-05 06:18:45 +08:00
Alex Lam S.L
a8aa28a7a6
consolidate single-use function reduction ( #2427 )
...
fixes #2423
2017-11-05 04:27:01 +08:00
Alex Lam S.L
fe5a68f9d5
maintain call argument order in collapse_vars ( #2426 )
...
fixes #2425
2017-11-05 00:00:18 +08:00
Alex Lam S.L
c8b6f4733d
reduce this within functions ( #2421 )
...
- only replace same-scope usages
- augment `test/ufuzz.js` to test for `this`
fixes #2420
2017-11-04 00:31:37 +08:00
Alex Lam S.L
a48f87abf2
compress new function containing this ( #2417 )
2017-10-30 23:19:27 +08:00
Alex Lam S.L
8428326ea1
enhance properties ( #2412 )
...
- trim array items only if `side_effects`
- extend to non-identifier properties
2017-10-29 04:11:26 +08:00
Alex Lam S.L
31f8209193
remove dead code ( #2405 )
2017-10-27 14:28:09 +08:00
Alex Lam S.L
9b0f86f5a1
fix reduce_vars on AST_Array.length ( #2404 )
2017-10-27 02:33:37 +08:00
Alex Lam S.L
ee082ace1b
compress self comparisons ( #2398 )
2017-10-26 01:16:12 +08:00
Alex Lam S.L
4178289c38
implement hoist_props ( #2396 )
...
fixes #2377
2017-10-25 03:38:11 +08:00
Alex Lam S.L
74ae16f9f8
fix unsafe reduce_vars on arrays & objects ( #2397 )
2017-10-24 22:10:36 +08:00
Alex Lam S.L
86ea38a259
enhance unsafe evaluate of arrays & objects ( #2394 )
2017-10-24 02:58:30 +08:00
Alex Lam S.L
8a713e449f
deduplicate declarations regardless of toplevel ( #2393 )
2017-10-23 01:00:50 +08:00
Alex Lam S.L
24aa07855b
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
2017-10-22 20:10:13 +08:00
Alex Lam S.L
5fd723f143
fix unsafe expansion of object literals ( #2390 )
2017-10-22 15:00:36 +08:00
Alex Lam S.L
516eaef50c
fix unsafe evaluation of AST_Sub ( #2389 )
2017-10-22 13:14:15 +08:00
Alex Lam S.L
4ae1fb3ed8
fix unsafe evaluation of objects ( #2388 )
2017-10-22 04:19:40 +08:00
Alex Lam S.L
011123223b
fix unsafe escape analysis in reduce_vars ( #2387 )
2017-10-22 03:23:31 +08:00
Alex Lam S.L
c927cea632
unsafe fix-ups for #2351 ( #2379 )
2017-10-21 04:08:26 +08:00
Alex Lam S.L
0f2ef3367c
enhance collapse_vars around lazy operations ( #2369 )
2017-10-19 04:52:00 +08:00
Alex Lam S.L
7e5b5cac97
fix AST_PropAccess in collapse_vars (take 3) ( #2375 )
...
Suppress scanning beyond assignment to `a.b`
2017-10-18 02:54:51 +08:00
Alex Lam S.L
c1346e06b7
clean up lazy operator detection ( #2373 )
2017-10-17 23:25:45 +08:00
Alex Lam S.L
0d2fe8e3ef
fix AST_PropAccess in collapse_vars (take 2) ( #2372 )
...
fixes #2364
2017-10-17 22:59:15 +08:00
Alex Lam S.L
f2b9c11e2a
fix AST_PropAccess in collapse_vars ( #2370 )
...
fixes #2364
2017-10-17 18:33:03 +08:00
Alex Lam S.L
fe647b083e
account for side-effects from AST_This in collapse_vars ( #2365 )
2017-10-17 01:18:55 +08:00
Alex Lam S.L
b810e2f8da
perform reduce_vars on safe literals ( #2351 )
...
- constant expression
- single reference
- same scope
- not across loop body
2017-10-09 12:25:06 +08:00
Alex Lam S.L
1abe14296e
collapse a.b whenever safe ( #2350 )
2017-10-08 13:17:48 +08:00
Alex Lam S.L
dd71639264
enhance reduce_vars for AST_Accessor ( #2339 )
...
fixes #2336
2017-10-01 03:01:50 +08:00
Alex Lam S.L
2dcc552ce0
trap invalid use of reserved words ( #2338 )
...
fixes #2337
2017-10-01 02:10:41 +08:00
kzc
7e3e9da860
fix "use asm" numeric output ( #2328 )
...
fixes #2324
2017-09-21 04:42:40 +08:00
Alex Lam S.L
00f509405b
suppress collapse_vars of this into "use strict" ( #2326 )
...
fixes #2319
2017-09-20 05:23:20 +08:00
Alex Lam S.L
4f0953f7e9
handle LHS side-effects on cascade & collapse_vars ( #2314 )
...
fixes #2313
2017-09-16 11:45:19 +08:00
Alex Lam S.L
182a47bfb1
improve source mapping ( #2312 )
...
fixes #2310
2017-09-15 12:46:48 +08:00
Mateusz Burzyński
8158b1bdcf
Testing all leading comments against being PURE comments ( #2305 )
2017-09-10 02:08:15 +08:00
Alex Lam S.L
aacf3edc68
extend unsafe on pure global functions ( #2303 )
2017-09-07 22:08:34 +08:00
kzc
8b89072190
add Date and other known globals to unsafe compress option ( #2302 )
2017-09-07 02:44:26 +08:00
Alex Lam S.L
395a17ccda
fix collapse_vars on default function argument ( #2299 )
...
Avoid collision with local variable `undefined` under certain corner cases.
fixes #2298
2017-09-04 02:32:33 +08:00
Alex Lam S.L
3f355866cf
correctly count declarations after hoist_vars ( #2297 )
...
fixes #2295
2017-09-03 17:23:31 +08:00
Alex Lam S.L
e5cf7972ea
fix unused patching of AST_For.init blocks ( #2289 )
...
fixes #2288
2017-08-29 01:10:04 +08:00
Erik Desjardins
16d40915b4
don't escape null characters as \0 when followed by any digit ( #2273 )
...
fixes #2272
2017-08-14 12:30:08 +08:00
Alex Lam S.L
e7c21e87e3
fix ie8 mangling of top-level AST_SymbolCatch ( #2263 )
...
fixes #2254
2017-08-01 02:38:32 +08:00
Alex Lam S.L
a845897758
improve mangle.properties ( #2261 )
...
- include dead code when `keep_quoted`
- unify `keep_quoted` & `reserved`
- make `test/run-tests.js` consistent with `minify()`
fixes #2256
2017-07-29 23:02:04 +08:00
Alex Lam S.L
6a5e74b44e
unescape surrogate pairs only ( #2246 )
...
fixes #2242
2017-07-23 12:38:21 +08:00
Alex Lam S.L
b35dfc2599
reject malformed CLI parameters ( #2239 )
...
fixes #2237
2017-07-15 23:50:27 +08:00
Alex Lam S.L
9e1da9235e
ensure ie8 works with mangled properties ( #2238 )
...
fixes #2234
2017-07-15 22:50:59 +08:00
Alex Lam S.L
a5ffe2c23f
drop unused builtin globals under unsafe ( #2236 )
...
fixes #2233
2017-07-15 15:16:11 +08:00
Alex Lam S.L
9282e7b0c6
fix unsafe evaluate of Object static methods ( #2232 )
...
fixes #2231
2017-07-14 19:52:01 +08:00
Alex Lam S.L
5229cb2b1b
drop unused compound assignments ( #2230 )
...
fixes #2226
2017-07-14 00:39:34 +08:00
Alex Lam S.L
458e3e15f0
enhance passes ( #2229 )
...
- remove hardcoded upper limit
- continue based on node count reduction
- emit verbose statistics
fixes #2226
2017-07-13 02:18:59 +08:00
Alex Lam S.L
10a938cb79
enhance source mapping on IIFEs ( #2224 )
...
fixes #2213
2017-07-11 02:34:28 +08:00
Alex Lam S.L
71ee91e716
handle duplicate argument names in collapse_vars ( #2215 )
2017-07-08 04:42:35 +08:00
Alex Lam S.L
4f70d2e28c
inlining of static methods & constants ( #2211 )
...
- guard by `unsafe`
- support `Array`, `Math`, `Number`, `Object` & `String`
fixes #2207
2017-07-07 05:35:32 +08:00
Alex Lam S.L
4b6ca5e742
inline property access of object literal ( #2209 )
...
- only if property value is side-effect-free
- guard by `unsafe`
fixes #2208
2017-07-06 21:51:58 +08:00
Alex Lam S.L
9306da3c58
suppress collapse_vars of this as call argument ( #2204 )
...
fixes #2203
2017-07-06 01:03:52 +08:00
Alex Lam S.L
1ac25fc032
improve compress granularity through typeofs ( #2201 )
...
fixes #2198
2017-07-05 19:20:33 +08:00
Alex Lam S.L
5f046c724b
minor clean-ups to evaluate ( #2197 )
2017-07-03 18:52:39 +08:00
Alex Lam S.L
af0262b7e5
improve parenthesis emission ( #2196 )
...
- eliminate `throw` usages
- suppress extraneous parenthesis
- `new function() {foo.bar()}.baz`
- `for (function() { "foo" in bar; };;);`
2017-07-03 04:17:37 +08:00
Alex Lam S.L
6b3aeff1d8
clean up TreeWalker.pop() ( #2195 )
...
Remove superfluous parameter.
2017-07-03 03:23:38 +08:00
Alex Lam S.L
20e4f8277f
refactor throw usage within compress ( #2193 )
...
Eliminate exceptional constructs from normal control flow.
2017-07-03 02:10:56 +08:00
Alex Lam S.L
8b69a3d18e
drop argument value after collapse_vars ( #2190 )
2017-07-02 04:28:11 +08:00
Alex Lam S.L
d40950b741
improve inline efficiency ( #2188 )
...
... by teaching `collapse_vars` some new tricks.
fixes #2187
2017-07-02 01:05:14 +08:00
Alex Lam S.L
bdeadffbf5
improve usability of name cache under minify() ( #2176 )
...
fixes #2174
2017-06-29 12:48:34 +08:00
Alex Lam S.L
f0a99125ee
improve unsafe_Func ( #2171 )
...
- minimise disturbance to `compute_char_frequency()`
- remove extraneous quotation marks
2017-06-27 23:53:42 +08:00
Alex Lam S.L
1e4de2e6d3
parse @global_defs as expressions ( #2169 )
...
- let parser rejects non-conformant input
- eliminate need for extraneous parenthesis
2017-06-27 10:31:19 +08:00
Alex Lam S.L
9db4c42380
fix cascade & collapse on property access of constants ( #2158 )
2017-06-24 21:30:06 +08:00
Alex Lam S.L
94e5e00c03
refactor compute_char_frequency() ( #2152 )
...
- minimise maintenance when updating AST
- maximise code sharing between `master` & `harmony`
2017-06-23 20:05:31 +08:00
Alex Lam S.L
dc6bcaa18e
synchronise mangle.properties for minify() & test/compress ( #2151 )
2017-06-23 15:53:13 +08:00
Alex Lam S.L
d58b184835
refactor Compressor.toplevel ( #2149 )
2017-06-23 13:11:40 +08:00
Alex Lam S.L
b3a57ff019
minimise reduce_vars cloning overhead ( #2148 )
2017-06-23 06:59:53 +08:00
Alex Lam S.L
3d5bc08185
fix reduce_vars on this ( #2145 )
...
fixes #2140
2017-06-23 04:44:57 +08:00
Alex Lam S.L
0692435f01
fix for-in loop parsing ( #2144 )
2017-06-23 04:14:30 +08:00
Alex Lam S.L
343ea326c2
ensure mangling works if catch reuses a scope variable ( #2123 )
...
fixes #2120
2017-06-20 02:14:05 +08:00
Alex Lam S.L
0a0f4f5591
make defensive copies when inline ( #2116 )
...
fixes #2114
2017-06-17 14:32:37 +08:00
Alex Lam S.L
931daa85bf
fix loss of context in collapse_vars & cascade ( #2112 )
...
fixes #2110
2017-06-16 21:18:43 +08:00
Alex Lam S.L
00e4f7b3c1
in-place tigten_body() ( #2111 )
...
By reducing copies of `AST_Node` arrays, we should be able to reduce:
- memory pressure
- potential bugs caused by multiple references in AST
- duplicated executions of `OPT()`
2017-06-16 19:19:54 +08:00
Alex Lam S.L
11e63bc335
correctly determine scope of AST_This ( #2109 )
...
fixes #2107
2017-06-16 14:54:46 +08:00
Alex Lam S.L
33405bb24b
enforce inline scope restriction ( #2106 )
...
fixes #2105
2017-06-16 03:21:38 +08:00
Alex Lam S.L
b85a358deb
suppress inline of this ( #2103 )
...
fixes #2101
2017-06-15 12:14:16 +08:00
Alex Lam S.L
3f961bbba0
compute uses_arguments correctly in figure_out_scope() ( #2099 )
...
fixes #2097
2017-06-15 03:28:26 +08:00
Alex Lam S.L
2bdc8802dd
fix variable accounting in inline ( #2085 )
...
fixes #2084
2017-06-13 01:40:14 +08:00
Alex Lam S.L
293c566d6c
marshal mangle[.properties].reserved from non-Array values ( #2072 )
2017-06-09 04:29:12 +08:00
Alex Lam S.L
9c306406f1
fix iteration over object with inherited properties ( #2068 )
...
fixes #2055
2017-06-08 03:27:03 +08:00
Alex Lam S.L
9db0695b10
fix cascade on multi-branch evaluations ( #2067 )
...
Partially reverts #2059 as this has better coverage and performance.
fixes #2062
2017-06-07 19:52:01 +08:00
Alex Lam S.L
b9ad53d1ab
fix inline handling of AST_Call.args ( #2059 )
2017-06-06 22:55:25 +08:00
Alex Lam S.L
3493a182b2
implement function inlining ( #2053 )
...
- empty body
- single `AST_Return`
- single `AST_SimpleStatement`
- avoid `/*#__PURE__*/`
Miscellaneous
- enhance single-use function substitution
fixes #281
2017-06-06 05:49:53 +08:00
Alex Lam S.L
27c5284d3d
workaround webkit parsing error ( #2056 )
...
apply `webkit` to jetstream tests
2017-06-06 04:06:42 +08:00
Alex Lam S.L
540220b91b
fix AST_Function scope invariance ( #2052 )
...
improve function name hack in `run_code()`
2017-06-04 19:27:43 +08:00
Alex Lam S.L
1743621889
clean up lib/parse.js ( #2047 )
...
- remove unused definitions
- replace `array_to_hash()`
2017-06-03 14:00:59 +08:00
Alex Lam S.L
bac14ba881
fix non-identifier getter/setter name ( #2041 )
...
fixes #2040
2017-06-01 18:11:16 +08:00
Alex Lam S.L
ec095ed647
whitelist unsafe evaluate candidates ( #2039 )
...
- all arguments may accept constant values
- return constant value
- free of side effects
- available & identical across locales and runtime environments
2017-06-01 04:33:05 +08:00
Alex Lam S.L
17e73121fa
enhance unsafe evaluate ( #2037 )
2017-06-01 00:56:28 +08:00
Alex Lam S.L
e9645e017f
introduce unsafe_Func ( #2033 )
...
Separate flag for #203 functionality.
2017-05-31 03:38:00 +08:00
Alex Lam S.L
1aa38051fb
better fix for #512 & #2010 ( #2019 )
...
- remove duplicated functionalities
- fix similar issue with `else`
2017-05-29 10:51:41 +08:00
Alex Lam S.L
c6c9f4f5a8
implement --help options ( #2017 )
2017-05-28 18:21:44 +08:00
Alex Lam S.L
7b13159cda
fix hoist_funs on block-scoped function under "use strict" ( #2013 )
...
Technically not part of ES5, but commonly used code exists in the wild.
2017-05-27 17:44:59 +08:00
Alex Lam S.L
95094b9c22
fix if_return on AST_Defun ( #2010 )
...
Previous fiix for #1052 perturbs declaration order of functions which leads to incorrect behaviour under "use strict".
2017-05-27 13:41:49 +08:00
Alex Lam S.L
dc33facfcb
fix dead_code on block-scoped function under "use strict" ( #2006 )
...
Technically not part of ES5, but commonly used code exists in the wild.
2017-05-26 16:08:51 +08:00
Alex Lam S.L
c70fb60384
clean up lib/scope.js ( #2003 )
...
fixes #2004
2017-05-26 03:58:35 +08:00
Alex Lam S.L
793d61499b
report timing breakdown ( #2000 )
...
fix corner cases with `sourceMap`
fixes #1998
2017-05-25 07:15:55 +08:00
Alex Lam S.L
e667f0acb8
fix source map offset ( #1993 )
...
Account for whitespace insertions.
fixes #505
fixes #890
2017-05-23 20:25:48 +08:00
Alex Lam S.L
efdb65913b
improve usability of global_defs in minify() ( #1987 )
...
Use `@key` to `parse()` string value as `AST_Node`.
fixes #1986
2017-05-22 01:38:43 +08:00
Alex Lam S.L
58fae7dc07
enhance if_return to handle return void... ( #1977 )
...
fixes #512
2017-05-20 15:58:46 +08:00
Alex Lam S.L
eae26756f1
introduce unsafe_regexp ( #1970 )
...
fixes #1964
2017-05-19 09:06:29 +08:00
Alex Lam S.L
569c21e952
improve RegExp handling ( #1959 )
...
- remove `options.output.unescape_regexps`
- preserve original pattern whenever possible
fixes #54
fixes #1929
2017-05-17 20:10:50 +08:00
Alex Lam S.L
87c3a2c0ce
remove space_colon ( #1960 )
...
Always emit space after colon when `options.output.beautify` is enabled.
2017-05-17 14:07:34 +08:00
Alex Lam S.L
9464d3c20f
fix parsing of property access after new line ( #1944 )
...
Account for comments when detecting property access in `tokenizer`.
fixes #1943
2017-05-16 05:40:49 +08:00
Alex Lam S.L
265008c948
improve keyword-related parser errors ( #1941 )
...
fixes #1937
2017-05-15 23:02:55 +08:00
Alex Lam S.L
e005099fb1
fix & improve coverage of estree ( #1935 )
...
- fix `estree` conversion of getter/setter
- fix non-directive literal in `to_mozilla_ast()`
- revamp `test/mozilla-ast.js`
- reuse `test/ufuzz.js` for code generation
- use `acorn.parse()` for creating `estree`
- extend `test/ufuzz.js` for `acorn` workaround
- catch variable redefinition
- non-trivial literal as directive
- adjust options for tolerance
Miscellaneous
- optional semi-colon when parsing directives
fixes #1914
closes #1915
2017-05-15 02:37:53 +08:00
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
ac73c5d421
avoid arguments and eval in reduce_vars ( #1924 )
...
fixes #1922
2017-05-12 12:34:55 +08:00
Alex Lam S.L
1d407e761e
fix invalid transform on const ( #1919 )
...
- preserve (re)assignment to `const` for runtime error
- suppress `cascade` on `const`, as runtime behaviour is ill-defined
2017-05-12 04:51:44 +08:00
Alex Lam S.L
a3b2eb75bd
return Error from minify() ( #1880 )
...
Have `minify()` return `Error` in `result.error` rather than throwing it.
2017-05-08 07:05:19 +08:00
Alex Lam S.L
da295de82b
support dumping AST ( #1879 )
...
Re-order `AST_Binary` properties to make dump more readable.
closes #769
2017-05-08 06:23:01 +08:00
Alex Lam S.L
e54748365c
support minify() output as AST ( #1878 )
...
- `options.output.ast` (default `false`)
- `options.output.code` (default `true`)
2017-05-08 02:11:45 +08:00
Alex Lam S.L
2c7ee956fd
fix unsafe on evaluate of reduce_vars ( #1870 )
...
Determine if variables with non-constant values can escape and be modified.
fixes #1865
2017-05-06 23:18:55 +08:00
Alex Lam S.L
ecf3563c45
kill opera ( #1869 )
2017-05-06 17:42:07 +08:00
Alex Lam S.L
dee5a27516
enhance collapse_vars ( #1862 )
...
- extend expression types
- `a++`
- `a=x;`
- extend scan range
- `for(init;;);`
- `switch(expr){case expr:}`
- `a = x; a = a || y;`
- terminate upon `debugger;`
closes #1821
fixes #27
fixes #315
fixes #1858
2017-05-06 16:15:43 +08:00
Alex Lam S.L
5a25d24b56
rename variables for better readability ( #1863 )
2017-05-02 20:47:10 +08:00
kzc
ea9289771b
improve literal return optimization ( #1860 )
2017-05-02 00:10:11 +08:00
Alex Lam S.L
2cb55b2ad0
enforce toplevel on other compress options ( #1855 )
...
Respect "funcs" and "vars" properly.
fixes #1850
2017-04-30 22:52:36 +08:00
Alex Lam S.L
9e62628171
fix unused on for-in statements ( #1843 )
...
Only need to avoid `var` within the initialisation block.
fixes #1841
2017-04-24 03:14:01 +08:00
Alex Lam S.L
9bf72cf758
improve parser under "use strict" ( #1836 )
...
- `const` without value
- `delete` of expression
- redefining `arguments` or `eval`
extend `test/ufuzz.js`
- optionally generate "use strict"
- improve handling of test cases with syntax errors
- group IIFE generation
- generate bare anonymous functions
- workaround `console.log()` for `new function()`
- generate expressions with `this`
fixes #1810
2017-04-23 20:05:22 +08:00
Alex Lam S.L
45ce369480
fix AST_For.init patch-up in drop_unused() ( #1839 )
...
fixes #1838
2017-04-23 01:51:56 +08:00
Alex Lam S.L
ca32a09032
fix label-related bugs ( #1835 )
...
- deep cloning of `AST_LabeledStatement`
- `L:do{...}while(false)`
- empty statement with label within block
extend `test/ufuzz.js`
- generate labels for blocks & loops
- generate for-in statements
- skip suspicious option search if `minify()` errs
fixes #1833
2017-04-22 22:15:04 +08:00
Alex Lam S.L
f05d4f7af3
improve unused ( #1832 )
...
- extract leading value with side-effects out of `var` statement
- reduce scanning of `AST_Definitions` from 3 passes to just once
2017-04-20 13:06:14 +08:00
Alex Lam S.L
88e7a542cd
fix unused on labeled for-loop ( #1831 )
...
fixes #1830
2017-04-20 04:18:38 +08:00
Alex Lam S.L
4dcff038cb
improve collapse_vars on AST_Var ( #1828 )
...
Perform the same cascaded scanning within `var` statement as we do on array of statements.
2017-04-19 04:49:09 +08:00
Alex Lam S.L
b4b9305db0
fix parser bugs & CLI reporting ( #1827 )
...
fixes #1825
2017-04-19 04:27:13 +08:00
Alex Lam S.L
28cfb65c47
extend cascade into a.b ( #1829 )
...
fixes #27
2017-04-19 04:17:15 +08:00
Alex Lam S.L
0f4f01b66c
clean up collapse_vars ( #1826 )
...
- remove overlap in functionality of singular, consecutive reference of constant value
- remove workarounds for previous bugs in `lib/scope.js`
- distribute recursive `collapse_single_use_vars()` calls to their respective `OPT(AST_Node)`
- enable collapsing of variables within a single `AST_Definitions`
2017-04-18 21:45:34 +08:00
Alex Lam S.L
5d9f1da3ab
support safe reassignments in reduce_vars ( #1823 )
...
`var a=1;a=2;x(a)` => `x(2)`
fix pre-existing issues
- reference counting on assignment
- walking of anonymous functions
- chained assignment
2017-04-18 13:38:42 +08:00
Alex Lam S.L
d1aa09c5c7
fix reduce_vars on conditionals ( #1822 )
2017-04-18 01:44:23 +08:00
Alex Lam S.L
6d5f341999
fix reduce_vars on boolean binary expressions ( #1819 )
...
Side effects of `&&` and `||` have not mattered until #1814 , which takes assignment expressions into account.
2017-04-17 17:24:29 +08:00
Alex Lam S.L
4ffb6fce76
compress duplicated variable definitions ( #1817 )
...
These are surprisingly common, as people reuse the same variable name within loops or switch branches.
2017-04-17 17:11:29 +08:00
Alex Lam S.L
71a8d0d236
fix reduce_vars within try-block ( #1818 )
...
Possible partial execution due to exceptions.
2017-04-17 14:03:29 +08:00
Alex Lam S.L
1a498db2d3
enhance reduce_vars ( #1814 )
...
- allow immediate assignment after declaration of variable
- relax modification rule for immutable value
- fix order of visit for TreeWalker
- remove extraneous code
2017-04-17 01:36:50 +08:00
Alex Lam S.L
44dfa5a318
fix variable substitution ( #1816 )
...
- let `collapse_vars` take care of value containing any symbols
- improve overhead accounting
2017-04-16 17:25:39 +08:00
Alex Lam S.L
ec443e422c
unify CLI & API under minify() ( #1811 )
...
- rename `screw_ie8` to `ie8`
- rename `mangle.except` to `mangle.reserved`
- rename `mangle.properties.ignore_quoted` to `mangle.properties.keep_quoted`
- compact `sourceMap` options
- more stringent verification on input `options`
- toplevel shorthands
- `ie8`
- `keep_fnames`
- `toplevel`
- `warnings`
- support arrays and unquoted string values on CLI
- drop `fromString` from `minify()`
- `minify()` no longer handles any `fs` operations
- unify order of operations for `mangle_properties()` on CLI & API
- `bin/uglifyjs` used to `mangle_properties()` before even `Compressor`
- `minify()` used to `mangle_properties()` after `Compressor` but before `mangle_names()`
- both will now do `Compressor`, `mangle_names()` then `mangle_properties()`
- `options.parse` / `--parse` for parser options beyond `bare_returns`
- add `mangle.properties.builtins` to disable built-in reserved list
- disable with `--mangle-props builtins` on CLI
- `warnings` now off by default
- add `--warn` and `--verbose` on CLI
- drop `--enclose`
- drop `--export-all`
- drop `--reserved-file`
- use `--mangle reserved` instead
- drop `--reserve-domprops`
- enabled by default, disable with `--mangle-props domprops`
- drop `--prefix`
- use `--source-map base` instead
- drop `--lint`
- remove `bin/extract-props.js`
- limit exposure of internal APIs
- update documentations
closes #96
closes #102
closes #136
closes #166
closes #243
closes #254
closes #261
closes #311
closes #700
closes #748
closes #912
closes #1072
closes #1366
fixes #101
fixes #123
fixes #124
fixes #263
fixes #379
fixes #419
fixes #423
fixes #461
fixes #465
fixes #576
fixes #737
fixes #772
fixes #958
fixes #1036
fixes #1142
fixes #1175
fixes #1220
fixes #1223
fixes #1280
fixes #1359
fixes #1368
2017-04-15 23:50:50 +08:00
Alex Lam S.L
32deb365d5
drop angular ( #1812 )
...
Remove support for `@ngInject` as there are proper alternatives anyway.
2017-04-15 05:52:29 +08:00
Alex Lam S.L
2244743545
convert AST_Seq from binary tree to array ( #1460 )
...
- rename `AST_Seq` to `AST_Sequence`
- raise default sequences_limit from 200 to 800
2017-04-12 21:56:27 +08:00
Alex Lam S.L
d6fbc365e2
fix LHS cases for NaN & friends ( #1804 )
...
`Infinity = beyond` should not become `1/0 = beyond`
2017-04-09 03:18:14 +08:00
Alex Lam S.L
0479ff0c54
fix a couple of bugs in global_defs ( #1802 )
...
- `optimize()` substituted expression
- compute nested property string correctly
fixes #1801
Miscellaneous
- reset optimisation flags on all node types
2017-04-08 16:46:25 +08:00
Alex Lam S.L
cf72fe552f
fix delete corner cases ( #1799 )
...
- assignment
- boolean
- conditional
- sequence
2017-04-08 14:25:28 +08:00
Alex Lam S.L
c2a1bceb77
fix pure_getters for chained property access ( #1798 )
2017-04-07 17:06:01 +08:00
Alex Lam S.L
e3c9c22c75
fix corner cases with delete ( #1796 )
...
`delete Infinity` returns `false` where as `delete (1/0)` returns `true`
2017-04-07 15:39:59 +08:00
Alex Lam S.L
0f4cd73dcc
introduce "strict" to pure_getters ( #1795 )
2017-04-07 13:31:58 +08:00
Alex Lam S.L
281e882d27
fix reduce_vars on catch variable ( #1794 )
...
Improved catch handling in `figure_out_scope()` means special case treatment of IE8 is no longer valid in `reset_opt_flags()`.
Also fixed recursive assignment in variable definition.
2017-04-07 12:32:56 +08:00
Alex Lam S.L
cc6aa3e5ac
fix incorrect context in variable substitution ( #1791 )
...
`AST_Node.optimize()` is context-aware, so don't cache its results to be used elsewhere.
Also fixed a few cases of AST corruption and beef up safety of `pure_getters`.
2017-04-07 03:42:17 +08:00
Alex Lam S.L
e869779a98
enable inline_script by default ( #1793 )
2017-04-07 00:45:51 +08:00
Alex Lam S.L
06cdb74279
improve pure_getters ( #1786 )
...
- property access to `null` & `undefined` always has side effects
- utilise `reduce_vars` to determine safe property access
- may-be cases treated as side effects unless `unsafe`
2017-04-06 11:18:59 +08:00
Alex Lam S.L
ff289b90a9
implement delayed resolution for reduce_vars ( #1788 )
...
Although it would be nice to enforce `AST_Node` cloning during transformation, that ship has sailed a long time ago.
We now get the assigned value when resolving `AST_SymbolRef` instead of `reset_opt_flags()`, which has the added advantage of improved compressor efficiency.
fixes #1787
2017-04-05 21:06:42 +08:00
Alex Lam S.L
9b6bc67c33
optimise do{...}while(false) ( #1785 )
...
- better heuristics to avoid issues like #1532
- fix `TreeWalker.loopcontrol_target()`
- `continue` cannot refer to `switch` blocks
2017-04-04 23:48:22 +08:00
Alex Lam S.L
951770fc68
exclude mangling of special property names ( #1779 )
...
- `null`
- `true`
- `false`
- numeric literals
2017-04-04 03:50:19 +08:00
Alex Lam S.L
48b3fe9952
fix mangleProperties on identifiers ( #1776 )
...
- fix handling of "-Infinity"
- add test case for "-0"
reverts #1481
2017-04-03 23:17:47 +08:00
Alex Lam S.L
59a4e56bc8
fix mangleProperties of undefined & Infinity ( #1772 )
...
`NaN` already works by the happy accident of `Number.NaN`
fixes #1770
2017-04-03 12:31:05 +08:00
Alex Lam S.L
9469c03ac9
fix corner case in switch ( #1765 )
2017-04-02 17:07:20 +08:00
Alex Lam S.L
d57527697f
avoid confusion of NaN & Infinity with catch symbol of the same name ( #1763 )
...
fixes #1760
fixes #1761
2017-04-02 16:14:09 +08:00
Alex Lam S.L
f7ca4f2297
fix corner cases in switch and undefined ( #1762 )
...
- fix side effects in switch condition for singular blocks
- fix `undefined` confusion with local variable
- gate `OPT(AST_Switch)` with `switches`
fixes #1758
fixes #1759
2017-04-02 14:52:25 +08:00
Alex Lam S.L
ee3fe0f4cd
fix switch branch elimination ( #1752 )
...
Merge unreachable case body with previous fallthrough case
fixes #1750
2017-04-01 17:19:57 +08:00