swc/crates/swc_ecma_minifier/tests/terser/compress
Donny/강동윤 6a97c7bef8
fix(es/utils): Fix wrong apis (#4604)
# API Changes

## `swc_ecma_utils`

### Renames

 - `find_ids` => `find_pat_ids`
 - `prepend` => `prepend_stmt`
 - `as_bool` => `cast_to_bool`
 - `as_number` => `as_pure_number`
 - `as_string` => `cast_to_string`
 - (`as_pure_bool`, `cast_to_number` is not renamed)
 - `UsageFinder` => `IdentUsageFinder`.
 - `IdentFinder` => `IdentRefFinder`.

## Changes

 - Re-export of `HANDLER` from `swc_common::errors` is removed. Use `swc_common::error::HANDLER` instead.
 - Re-export of `Id` from `swc_ecma_ast` is removed. Use `swc_ecma_ast::Id` instead.
 - `ExprCtx` is used for apis related to `Expr`.
 - `preserve_effects` is now a method of `ExprCtx`. It was a top-level function.
 - `extract_side_effects_to` is now a method of `ExprCtx`. It was a top-level function.
 - `IdentUsageFinder` (previously `UsageFinder`) now takes `Id` instead of `Ident`.
 - `IdentRefFinder` (previously `IdentFinder`) now takes `Id` instead of `Ident`.
 - `ExprExt::is_ident_ref_to` is removed.
 - `Expr::is_global_ref_to` is added.
 - `:🆔:id` is removed. Use `Ident::to_id()` instead.
2022-05-11 04:36:22 +00:00
..
arguments feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
array_constructor test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
arrays feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
arrow feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
ascii feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
asm feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
assignment feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
async test(es/minifier): Fix test system (#4571) 2022-05-08 08:27:14 +00:00
big_int feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
block_scope feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
blocks fix(es/minifier): Unwrap blocks more carefully (#4586) 2022-05-09 11:24:53 +00:00
class_properties feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
classes feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
collapse_vars fix(es/minifier): Fix with and NaN (#4596) 2022-05-10 03:21:43 +00:00
comments chore(es/minifier): Update terser test references (#4297) 2022-04-10 06:50:52 +00:00
comparing feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
concat_strings feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
conditionals feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
const feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
dead_code fix(es/resolver): Fix more try catch issues (#4582) 2022-05-09 17:50:30 +09:00
debugger feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
defaults feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
destructuring feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
directives feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
drop_console feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
drop_unused fix(es/utils): Fix wrong apis (#4604) 2022-05-11 04:36:22 +00:00
evaluate fix(es/minifier): Fix handling of NaN (#4593) 2022-05-09 19:08:28 +00:00
expansions feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
export feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
expression feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
functions fix(es/utils): Fix wrong apis (#4604) 2022-05-11 04:36:22 +00:00
global_defs feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
harmony fix(es/minifier): Respect keepClassNames for class expressions (#4536) 2022-05-06 05:17:45 +00:00
hoist feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
hoist_props feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
hoist_vars feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
html_comments feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
identity fix(es/utils): Fix wrong apis (#4604) 2022-05-11 04:36:22 +00:00
ie8 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
if_return feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
inline feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_12 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_22/return_with_no_value_in_if_body test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_44 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_59/keep_continue test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_126/concatenate_rhs_strings test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_143 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_203 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_208 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_229/template_strings test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_267/issue_267 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_269 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_281 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_368/collapse feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_417 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_427 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_597 fix(es/minifier): Fix with and NaN (#4596) 2022-05-10 03:21:43 +00:00
issue_611/issue_611 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_637/wrongly_optimized feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_640 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_747 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_751 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_782 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_892/dont_mangle_arguments test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_913/keep_var_for_in test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_926/template_strings test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_973 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_976 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_979 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1001/parenthesis_strings_in_parenthesis feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1034 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1041 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_1043/issue_1043 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_1044/issue_1044 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1052 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1105 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1202 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_1212 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1261 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1275/string_plus_optimization feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1321 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1431 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_1443 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1446 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1447 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1466 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1569/inner_reference test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_1588 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1609 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_1639 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1656/f7 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1673 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1704 fix(es/resolver): Fix handling of a complex try catch (#4574) 2022-05-08 10:12:50 +00:00
issue_1733 fix(es/resolver): Fix more try catch issues (#4582) 2022-05-09 17:50:30 +09:00
issue_1750 test(es/minifier): Fix test system (#4571) 2022-05-08 08:27:14 +00:00
issue_1770 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1787/unary_prefix test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_1833 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_1943 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_2001 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_2652 chore(repo): Configure prettier (#4523) 2022-05-04 14:25:28 +00:00
issue_2719/warn feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_2871/comparison_with_undefined test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_2989 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_t50 test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
issue_t120 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
issue_t292 feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
join_vars feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
keep_names feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
keep_quoted_strict/keep_quoted_strict feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
labels feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
logical_assignment feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
loops feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
max_line_len feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
negate_iife feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
new fix(es/utils): Fix wrong apis (#4604) 2022-05-11 04:36:22 +00:00
node_version/eval_let_6 feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
nullish feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
numbers feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
object feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
parameters feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
parse_errors refactor: Flatten ecmascript (#2708) 2021-11-10 19:00:54 +09:00
properties test(es/minifier): Fix test system (#4571) 2022-05-08 08:27:14 +00:00
pure_funcs feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
pure_getters feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
pure_globals feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
reduce_vars fix(es/minifier): Consider more aliases in sequences pass (#4583) 2022-05-09 16:36:40 +00:00
regexp feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
rename fix(es/resolver): Fix more try catch issues (#4582) 2022-05-09 17:50:30 +09:00
return_undefined feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
sandbox/console_log feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
sequences fix(es/utils): Fix wrong apis (#4604) 2022-05-11 04:36:22 +00:00
string_literal feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
super/super_can_be_parsed refactor: Flatten ecmascript (#2708) 2021-11-10 19:00:54 +09:00
switch fix(es/utils): Fix wrong apis (#4604) 2022-05-11 04:36:22 +00:00
syntax_errors test(es/minifier): Use _ instead of - for terser tests (#4411) 2022-04-23 18:34:00 +00:00
template_string feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
transform fix(es/minifier): Fix handling of template literals (#4563) 2022-05-08 01:56:38 +09:00
try_catch feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
typeof fix(es/minifier): Consider more aliases in sequences pass (#4583) 2022-05-09 16:36:40 +00:00
unicode feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00
unsafe_symbols feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
wrap_iife feat(es/minifier): Drop noop calls (#4019) 2022-03-15 16:23:32 +09:00
yield feat(es/resolver): Use different syntax context for unresolved refs (#4436) 2022-04-26 07:38:50 +00:00