swc/crates/swc_ecma_minifier/tests/terser/compress
Austaras f8ca366cc1
fix(es/minifier): Abort seq inliner if var is not fn_local or reassigned (#7804)
**Description:**

It turns out that the original implementation of `infect`is incomplete
because it cannot cover function param, and the new implementation
introduced in #7772 is redundant because what
[terser](https://github.com/terser/terser/blob/master/lib/compress/tighten-body.js#L909C18-L909C28)
do is basically checking `fn_local`


**Related issue:**

 - Closes #7784
2023-08-17 05:15:59 +00:00
..
arguments test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
array_constructor test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
arrays test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
arrow test(es/minifier): Organize terser tests (#6116) 2022-10-11 08:25:11 +00:00
ascii test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
asm test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
assignment test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
async feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
big_int test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
block_scope feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
blocks feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
class_properties test(es/minifier): Organize terser tests (#6015) 2022-10-02 07:00:10 +00:00
classes test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars fix(es/minifier): Abort seq inliner if var is not fn_local or reassigned (#7804) 2023-08-17 05:15:59 +00:00
comments test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
comparing test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
concat_strings test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
conditionals feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
const test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
dead_code refactor(es/minifier): Respect toplevel and module options (#7671) 2023-07-20 11:35:08 +09:00
debugger test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
defaults test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
destructuring feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
directives test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
drop_console test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
drop_unused refactor(es/minifier): Respect toplevel and module options (#7671) 2023-07-20 11:35:08 +09:00
evaluate refactor(es/ast): Reimplement optional chaining (#7441) 2023-06-12 06:47:40 +00:00
expansions fix(es/renamer): Handle rest params correctly (#6821) 2023-01-16 06:57:16 +00:00
export fix(es/minifier): Handle synthesized export default expression (#7707) 2023-07-31 04:10:18 +00:00
expression test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
functions refactor(es/minifier): Respect toplevel and module options (#7671) 2023-07-20 11:35:08 +09:00
global_defs test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
harmony fix(es/renamer): Handle rest params correctly (#6821) 2023-01-16 06:57:16 +00:00
hoist test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
hoist_props feat(es/minifier): Inline and remove vars in one pass (#6093) 2022-10-12 01:52:58 +00:00
hoist_vars fix(es/minifier): Remove wrong variable joiner pass (#5992) 2022-09-29 19:11:18 +09:00
html_comments test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
identity refactor(es/minifier): Respect toplevel and module options (#7671) 2023-07-20 11:35:08 +09:00
ie8 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
if_return test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
inline test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_12 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_22/return_with_no_value_in_if_body test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_44 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_59/keep_continue test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_126/concatenate_rhs_strings test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_143 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_203 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_208 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_229/template_strings test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_267/issue_267 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_269 fix(es/minifier): Bailout regex optimization on invalid flags (#7020) 2023-03-07 11:05:04 +09:00
issue_281 refactor(es/minifier): Respect toplevel and module options (#7671) 2023-07-20 11:35:08 +09:00
issue_368/collapse feat(es/minifier): Swap more binary expressions (#6134) 2022-10-13 03:45:05 +00:00
issue_417 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_427 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_597 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_611/issue_611 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_637/wrongly_optimized test(es/minifier): Organize terser tests (#6116) 2022-10-11 08:25:11 +00:00
issue_640 test(es/minifier): Enable more terser tests (#7396) 2023-05-16 03:21:08 +00:00
issue_747 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_751 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_782 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_892/dont_mangle_arguments test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_913/keep_var_for_in test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_926/template_strings test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_973 fix(es/minifier): Fix detection of direct eval (#6215) 2022-10-21 12:18:10 +09:00
issue_976 fix(es/renamer): Don't use symbols used by declarations if eval exists (#7116) 2023-03-22 06:31:43 +00:00
issue_979 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1001/parenthesis_strings_in_parenthesis test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1034 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1041 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1043/issue_1043 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1044/issue_1044 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1052 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1105 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1202 fix(es/renamer): Use a separate scope for the name of FnExpr (#6008) 2022-10-01 12:33:19 +09:00
issue_1212 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1261 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1275/string_plus_optimization feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_1321 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1431 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1443 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1446 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1447 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1466 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_1569/inner_reference fix(es/renamer): Use a separate scope for the name of FnExpr (#6008) 2022-10-01 12:33:19 +09:00
issue_1588 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1609 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1639 test(es/minifier): Organize terser tests (#6015) 2022-10-02 07:00:10 +00:00
issue_1656/f7 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1673 test(es/minifier): Organize terser tests (#6015) 2022-10-02 07:00:10 +00:00
issue_1704 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_1733 test(es/minifier): Organize terser tests (#6015) 2022-10-02 07:00:10 +00:00
issue_1750 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1770 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1787/unary_prefix test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1833 test(es/minifier): Organize terser tests (#6116) 2022-10-11 08:25:11 +00:00
issue_1943 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2001 test(es/minifier): Organize terser tests (#6116) 2022-10-11 08:25:11 +00:00
issue_2652 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2719/warn fix(es/minifier): Consider function body cost while inlining function (#5342) 2022-10-15 05:47:56 +00:00
issue_2871/comparison_with_undefined test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2989 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_t50 feat(es/minfiier): Compute more with sequential inliner (#6169) 2022-10-27 00:50:52 +00:00
issue_t120 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_t292 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_vars test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
keep_names feat(es/renamer): Support safari10 from the name mangler (#6801) 2023-01-13 05:00:13 +00:00
keep_quoted_strict/keep_quoted_strict test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
labels feat(es/minifier): Remove unused labels (#7478) 2023-06-07 04:23:40 +00:00
logical_assignment test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
loops feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
max_line_len test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
negate_iife refactor(es/minifier): Don't create invalid nodes (#6191) 2022-10-21 00:33:40 +00:00
new fix(es/renamer): Use a separate scope for the name of FnExpr (#6008) 2022-10-01 12:33:19 +09:00
node_version/eval_let_6 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
nullish test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
numbers feat(es/minifier): Implement trivial optimizations (#6256) 2022-11-02 01:21:32 +00:00
object fix(es/codegen): Fix codegen of string literals with \x000 (#6838) 2023-01-20 08:08:58 +00:00
parameters test(es/minifier): Organize terser tests (#6015) 2022-10-02 07:00:10 +00:00
parse_errors refactor(es/minifier): Make rust-analyzer fast, really (#4746) 2022-05-23 16:16:05 +09:00
properties fix(es/renamer): Ensure that param and function body are in same scope (#7271) 2023-04-15 04:19:52 +00:00
pure_funcs fix(es/helpers): Use snake_case for helpers (#7147) 2023-03-31 15:15:21 +09:00
pure_getters fix(es/minifier): Mark all function params as potential property mutation (#7409) 2023-05-18 01:19:17 +00:00
pure_globals test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
reduce_vars fix(es/minifier): Mark all function params as potential property mutation (#7409) 2023-05-18 01:19:17 +00:00
regexp test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
rename feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
return_undefined test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
sandbox/console_log test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
sequences feat(es/minifier): Implement trivial optimizations (#6256) 2022-11-02 01:21:32 +00:00
string_literal test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
super/super_can_be_parsed test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
switch test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
syntax_errors refactor(es/minifier): Make rust-analyzer fast, really (#4746) 2022-05-23 16:16:05 +09:00
template_string fix(es/minifier): Preserve this of tagged template literals (#6165) 2022-10-15 09:11:20 +00:00
transform test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
try_catch feat(es/renamer): Support safari10 from the name mangler (#6801) 2023-01-13 05:00:13 +00:00
typeof test(es/minifier): Enable more terser tests (#7396) 2023-05-16 03:21:08 +00:00
unicode test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
unsafe_symbols test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
wrap_iife test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
yield test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00