swc/crates/swc_ecma_minifier/tests/terser/compress/collapse_vars
Donny/강동윤 dd805e95a4
feat(es/minifier): Respect inline level and preserve native names (#8205)
**Description:**

Note: Preserving native names is a hack, but it's used by `terser` and it's the only way to preserve the name of `class AbortSignal` while mangling without `keep_classnames: true`. We can special case `AbortSignal`, but let's just follow `terser`.


**Related issue:**

 - https://github.com/vercel/next.js/pull/57904
2023-11-02 08:59:59 +09:00
..
anonymous_function 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
boolean_binary_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
boolean_binary_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
cascade_call test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
cascade_conditional test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
cascade_forin test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
cascade_if_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
cascade_if_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
cascade_return test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
cascade_statement test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
cascade_switch test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
chained_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
chained_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
chained_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_rhs_array test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_rhs_boolean_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_rhs_boolean_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_rhs_conditional_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_rhs_conditional_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_rhs_function test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_rhs_lhs_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_rhs_lhs_2 fix(es/renamer): Use a separate scope for the name of FnExpr (#6008) 2022-10-01 12:33:19 +09:00
collapse_rhs_loop test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_rhs_number test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_rhs_object test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_rhs_regexp test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_rhs_side_effects test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_rhs_string test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_rhs_this test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_rhs_undefined test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_rhs_var test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_rhs_vardef test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_arguments test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_array test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_assignment test(es/minifier): Organize terser tests (#6247) 2022-10-25 05:12:30 +00:00
collapse_vars_closures test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_constants test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_do_while test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_do_while_drop_assign test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_eval_and_with test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_if test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_issue_721 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_lvalues test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_lvalues_drop_assign test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_misc1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_vars_object test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_properties test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
collapse_vars_regexp test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_repeated test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_self_reference feat(es/minifier): Drop recursively used var declaration (#7649) 2023-07-15 05:54:34 +09:00
collapse_vars_seq test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_short_circuit test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_short_circuited_conditions test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_side_effects_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_side_effects_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_switch test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_throw feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
collapse_vars_try feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
collapse_vars_unary test(es/minifier): Organize terser tests (#6247) 2022-10-25 05:12:30 +00:00
collapse_vars_unary_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
collapse_vars_while test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
compound_assignment test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
cond_branch_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
cond_branch_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
cond_branch_switch test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
conditional_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
conditional_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
double_def_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
double_def_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
duplicate_argname test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
for_init test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
ignore_class test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
iife_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
iife_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
inner_lvalues test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_27 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_315 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_348 fix(es/renamer): Use a separate scope for the name of FnExpr (#6008) 2022-10-01 12:33:19 +09:00
issue_805 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1537 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1537_destructuring_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1537_destructuring_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1537_destructuring_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1537_destructuring_for_in test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1537_destructuring_for_of test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1537_for_of test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1562 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_1605_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1605_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1631_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_1631_2 fix(es/minifier): Abort seq inliner if var is not fn_local or reassigned (#7804) 2023-08-17 05:15:59 +00:00
issue_1631_3 feat(es/minifier): Merge functions using sequential inliner (#6148) 2022-10-20 02:24:09 +00:00
issue_1858 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2187_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2187_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2187_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2203_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2203_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2203_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2203_4 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2250_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2250_2 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_2298 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_2313_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2313_2 feat(es/minifier): Clone trivial literals in sequential inliner (#6005) 2022-10-03 07:20:48 +00:00
issue_2319_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2319_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2319_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2364_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2364_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2364_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2364_4 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2364_5 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2364_6 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2364_7 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2364_8 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2364_9 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2365 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2425_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2425_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2425_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2436_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2436_2 refactor(es/minifier): Respect toplevel and module options (#7671) 2023-07-20 11:35:08 +09:00
issue_2436_3 refactor(es/minifier): Respect toplevel and module options (#7671) 2023-07-20 11:35:08 +09:00
issue_2436_4 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2436_5 refactor(es/minifier): Respect toplevel and module options (#7671) 2023-07-20 11:35:08 +09:00
issue_2436_6 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2436_7 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2436_8 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2436_9 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2436_10 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2436_11 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2436_12 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2436_13 fix(es/renamer): Use a separate scope for the name of FnExpr (#6008) 2022-10-01 12:33:19 +09:00
issue_2436_14 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2437 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2437_1 feat(es/minifier): Respect inline level and preserve native names (#8205) 2023-11-02 08:59:59 +09:00
issue_2437_2 feat(es/minifier): Respect inline level and preserve native names (#8205) 2023-11-02 08:59:59 +09:00
issue_2453 feat(es/minifier): Drop more variables while invoking IIFE (#5987) 2022-09-29 02:15:56 +00:00
issue_2497 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2506 fix(es/resolver): Correctly resolve global value (#7893) 2023-08-31 05:54:18 +00:00
issue_2571_1 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_2571_2 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_2858 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2873_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2873_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2878 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2891_1 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_2891_2 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_2908 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2914_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2914_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2931 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2954_1 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
issue_2954_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2954_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2974 fix(es/renamer): Use a separate scope for the name of FnExpr (#6008) 2022-10-01 12:33:19 +09:00
issue_3032 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_3096 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
lvalues_def test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
may_throw_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
may_throw_2 feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
modified test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
noinline_annotation test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
pure_getters_chain test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
reassign_const_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
reassign_const_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
recursive_function_replacement fix(es/minifier): Consider function body cost while inlining function (#5342) 2022-10-15 05:47:56 +00:00
reduce_vars_assign feat(es/minifier): Respect options (#6245) 2022-10-25 04:00:16 +00:00
ref_scope test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
replace_all_var test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
replace_all_var_scope test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
return_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
return_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
return_3 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
return_4 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
side_effect_free_replacement test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
side_effects_property test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
switch_case_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
switch_case_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
switch_case_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
toplevel_single_reference test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
undeclared test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
unsafe_builtin test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
unused_orig feat(es/minifier): Make name mangler understand block scoping (#6670) 2023-01-06 03:14:10 +00:00
var_defs test(es/minifier): Organize terser tests (#6247) 2022-10-25 05:12:30 +00:00
var_side_effects_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
var_side_effects_2 test(es/minifier): Organize terser tests (#6247) 2022-10-25 05:12:30 +00:00
var_side_effects_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00