├── .gitignore ├── rust-toolchain.toml ├── .ignore ├── .typos.toml ├── .github ├── renovate.json └── workflows │ └── ci.yml ├── src ├── implementation │ ├── es6_let.rs │ ├── es6_map.rs │ ├── es6_set.rs │ ├── es5_json.rs │ ├── es6_class.rs │ ├── es6_const.rs │ ├── es6_proxy.rs │ ├── es6_super.rs │ ├── es6_promise.rs │ ├── es6_reflect.rs │ ├── es6_symbol.rs │ ├── es6_weak_map.rs │ ├── es6_weak_set.rs │ ├── es2020_big_int.rs │ ├── es5_strict_mode.rs │ ├── es6_generators.rs │ ├── es6_new_target.rs │ ├── es5_date_methods.rs │ ├── es6_for_of_loops.rs │ ├── es6_math_methods.rs │ ├── es6_typed_arrays.rs │ ├── es2020_global_this.rs │ ├── es2021_promise_any.rs │ ├── es2025_promise_try.rs │ ├── es2025_set_methods.rs │ ├── es5_array_methods.rs │ ├── es5_miscellaneous.rs │ ├── es5_number_methods.rs │ ├── es6_miscellaneous.rs │ ├── es2019_json_superset.rs │ ├── es2024_reg_exp_v_flag.rs │ ├── es6_arrow_functions.rs │ ├── es6_rest_parameters.rs │ ├── esnext_shadow_realm.rs │ ├── es2017_string_padding.rs │ ├── es2022_object_has_own.rs │ ├── es2024_array_grouping.rs │ ├── es5_immutable_globals.rs │ ├── es6_number_properties.rs │ ├── es6_own_property_order.rs │ ├── es6_template_literals.rs │ ├── es6_well_known_symbols.rs │ ├── es2017_async_functions.rs │ ├── es2019_string_trimming.rs │ ├── es2021_weak_references.rs │ ├── es2023_hashbang_grammar.rs │ ├── es2025_iterator_helpers.rs │ ├── es6_array_static_methods.rs │ ├── es6_html_style_comments.rs │ ├── es6_reg_exp_y_and_u_flags.rs │ ├── esnext_reg_exp_escaping.rs │ ├── es2021_numeric_separators.rs │ ├── es5_object_static_methods.rs │ ├── es6_array_is_subclassable.rs │ ├── es6_object_static_methods.rs │ ├── es6_string_static_methods.rs │ ├── esnext_throw_expressions.rs │ ├── es2019_object_from_entries.rs │ ├── es2020_promise_all_settled.rs │ ├── es2022_error_cause_property.rs │ ├── es2022_static_class_fields.rs │ ├── es2023_array_find_from_last.rs │ ├── es2023_change_array_by_copy.rs │ ├── es5_function_prototype_bind.rs │ ├── es6_array_prototype_methods.rs │ ├── es6_function_name_property.rs │ ├── es6_object_prototype_proto.rs │ ├── es6_promise_is_subclassable.rs │ ├── es6_proto_in_object_literals.rs │ ├── es6_proxy_internal_get_calls.rs │ ├── es6_proxy_internal_set_calls.rs │ ├── es6_reg_exp_is_subclassable.rs │ ├── esnext_map_prototype_upsert.rs │ ├── es2017_object_static_methods.rs │ ├── es2019_optional_catch_binding.rs │ ├── es2022_instance_class_fields.rs │ ├── es2022_private_class_methods.rs │ ├── es2024_promise_with_resolvers.rs │ ├── es6_destructuring_assignment.rs │ ├── es6_destructuring_parameters.rs │ ├── es6_function_is_subclassable.rs │ ├── es6_object_literal_extensions.rs │ ├── es6_octal_and_binary_literals.rs │ ├── es6_reg_exp_prototype_compile.rs │ ├── es6_reg_exp_syntax_extensions.rs │ ├── es6_string_prototype_methods.rs │ ├── es6_updated_identifier_syntax.rs │ ├── esnext_async_iterator_helpers.rs │ ├── es2018_asynchronous_iterators.rs │ ├── es6_destructuring_declarations.rs │ ├── es6_unicode_code_point_escapes.rs │ ├── esnext_array_is_template_object.rs │ ├── es2016_array_prototype_includes.rs │ ├── es2017_arguments_caller_removed.rs │ ├── es2017_reg_exp_u_flag_case_folding.rs │ ├── es2017_shared_memory_and_atomics.rs │ ├── es2018_promise_prototype_finally.rs │ ├── es2018_template_literal_revision.rs │ ├── es2019_well_formed_json_stringify.rs │ ├── es2020_string_prototype_match_all.rs │ ├── es2025_reg_exp_pattern_modifiers.rs │ ├── es5_string_properties_and_methods.rs │ ├── es6_default_function_parameters.rs │ ├── es6_miscellaneous_subclassables.rs │ ├── es6_non_strict_function_semantics.rs │ ├── es6_prototype_of_bound_functions.rs │ ├── es6_proxy_internal_own_keys_calls.rs │ ├── es6_reg_exp_prototype_properties.rs │ ├── es6_string_prototype_html_methods.rs │ ├── es2018_reg_exp_named_capture_groups.rs │ ├── es2018_reg_exp_lookbehind_assertions.rs │ ├── es2019_array_prototype_flat_flat_map.rs │ ├── es2019_symbol_prototype_description.rs │ ├── es2021_string_prototype_replace_all.rs │ ├── es5_object_array_literal_extensions.rs │ ├── es6_block_level_function_declaration.rs │ ├── esnext_class_and_property_decorators.rs │ ├── esnext_uint_array_to_from_base_and_hex.rs │ ├── es2016_proxy_enumerate_handler_removed.rs │ ├── es2024_array_buffer_prototype_transfer.rs │ ├── es6_date_prototype_symbol_to_primitive.rs │ ├── es6_spread_syntax_for_iterable_objects.rs │ ├── es2018_reg_exp_unicode_property_escapes.rs │ ├── es2025_duplicate_named_capturing_groups.rs │ ├── es6_proxy_internal_define_property_calls.rs │ ├── es6_proxy_internal_delete_property_calls.rs │ ├── es2017_trailing_commas_in_function_syntax.rs │ ├── es2022_at_method_on_the_built_in_indexables.rs │ ├── es2022_class_static_initialization_blocks.rs │ ├── es2016_nested_rest_destructuring_parameters.rs │ ├── es2018_s_dot_all_flag_for_regular_expressions.rs │ ├── es6_object_static_methods_accept_primitives.rs │ ├── es6_proper_tail_calls_tail_call_optimisation.rs │ ├── esnext_legacy_reg_exp_features_in_java_script.rs │ ├── es2017_object_prototype_getter_setter_methods.rs │ ├── es2019_function_prototype_to_string_revision.rs │ ├── es2022_reg_exp_match_indices_has_indices_d_flag.rs │ ├── esnext_generator_function_sent_meta_property.rs │ ├── es2016_generator_functions_can_t_be_used_with_new.rs │ ├── es2016_nested_rest_destructuring_declarations.rs │ ├── es2016_generator_throw_caught_by_inner_generator.rs │ ├── es2017_proxy_internal_calls_getter_setter_methods.rs │ ├── es2022_ergonomic_brand_checks_for_private_fields.rs │ ├── es2016_proxy_internal_calls_array_prototype_includes.rs │ ├── es6_proxy_internal_get_own_property_descriptor_calls.rs │ ├── es2016_strict_fn_w_non_strict_non_simple_params_is_error.rs │ ├── es2017_assignments_allowed_in_for_in_head_in_non_strict_mode.rs │ ├── es2018_proxy_own_keys_handler_duplicate_keys_for_non_extensible_targets.rs │ ├── es2020_optional_chaining_operator.rs │ ├── es2021_logical_assignment.rs │ ├── es2016_exponentiation_operator.rs │ ├── es2020_nullish_coalescing_operator.rs │ └── es2018_object_rest_spread_properties.rs ├── cli.rs ├── lib.rs ├── ctx.rs ├── feature.rs ├── meta │ ├── es5_json.rs │ ├── es6_html_style_comments.rs │ ├── es2021_numeric_separators.rs │ ├── esnext_array_is_template_object.rs │ ├── esnext_shadow_realm.rs │ ├── es5_function_prototype_bind.rs │ ├── es2023_hashbang_grammar.rs │ ├── es2025_duplicate_named_capturing_groups.rs │ ├── es2017_arguments_caller_removed.rs │ ├── es2016_nested_rest_destructuring_parameters.rs │ ├── es2019_object_from_entries.rs │ ├── es2022_ergonomic_brand_checks_for_private_fields.rs │ ├── es2018_reg_exp_lookbehind_assertions.rs │ ├── esnext_generator_function_sent_meta_property.rs │ ├── es2021_string_prototype_replace_all.rs │ ├── es2022_class_static_initialization_blocks.rs │ ├── es2018_s_dot_all_flag_for_regular_expressions.rs │ ├── es2017_reg_exp_u_flag_case_folding.rs │ ├── esnext_reg_exp_escaping.rs │ ├── es2016_strict_fn_w_non_strict_non_simple_params_is_error.rs │ ├── es2019_well_formed_json_stringify.rs │ ├── es2024_promise_with_resolvers.rs │ ├── es6_block_level_function_declaration.rs │ ├── es2020_nullish_coalescing_operator.rs │ ├── es6_string_static_methods.rs │ ├── es2016_nested_rest_destructuring_declarations.rs │ ├── es2016_generator_functions_can_t_be_used_with_new.rs │ ├── es2017_assignments_allowed_in_for_in_head_in_non_strict_mode.rs │ ├── es2025_promise_try.rs │ ├── esnext_class_and_property_decorators.rs │ ├── es2019_json_superset.rs │ ├── es6_date_prototype_symbol_to_primitive.rs │ ├── es2018_template_literal_revision.rs │ ├── es2016_proxy_enumerate_handler_removed.rs │ ├── es2020_promise_all_settled.rs │ ├── es2018_reg_exp_named_capture_groups.rs │ ├── es2017_trailing_commas_in_function_syntax.rs │ ├── es6_octal_and_binary_literals.rs │ ├── es6_reg_exp_prototype_compile.rs │ ├── es2016_generator_throw_caught_by_inner_generator.rs │ ├── es6_updated_identifier_syntax.rs │ ├── es2018_proxy_own_keys_handler_duplicate_keys_for_non_extensible_targets.rs │ ├── es2023_array_find_from_last.rs │ ├── es2021_weak_references.rs │ ├── es5_date_methods.rs │ ├── esnext_legacy_reg_exp_features_in_java_script.rs │ ├── es2018_object_rest_spread_properties.rs │ ├── es2022_object_has_own.rs │ ├── es5_immutable_globals.rs │ ├── es2019_symbol_prototype_description.rs │ ├── es2016_proxy_internal_calls_array_prototype_includes.rs │ ├── es2021_promise_any.rs │ ├── es6_new_target.rs │ ├── esnext_map_prototype_upsert.rs │ ├── es2024_array_grouping.rs │ ├── es2019_optional_catch_binding.rs │ ├── es6_unicode_code_point_escapes.rs │ ├── es2016_exponentiation_operator.rs │ ├── es2025_reg_exp_pattern_modifiers.rs │ ├── es6_proper_tail_calls_tail_call_optimisation.rs │ ├── es2019_array_prototype_flat_flat_map.rs │ ├── es2017_string_padding.rs │ ├── es2019_string_trimming.rs │ ├── es5_object_array_literal_extensions.rs │ ├── es2022_static_class_fields.rs │ ├── es2020_string_prototype_match_all.rs │ ├── es5_number_methods.rs │ ├── esnext_throw_expressions.rs │ ├── es2024_array_buffer_prototype_transfer.rs │ ├── es6_reg_exp_is_subclassable.rs │ ├── es6_proxy_internal_define_property_calls.rs │ ├── es2018_asynchronous_iterators.rs │ ├── es6_object_static_methods.rs │ ├── es2020_global_this.rs │ ├── es2022_private_class_methods.rs │ ├── es2022_reg_exp_match_indices_has_indices_d_flag.rs │ ├── es6_proxy_internal_own_keys_calls.rs │ ├── es6_string_prototype_html_methods.rs │ ├── es6_reg_exp_y_and_u_flags.rs │ ├── es2024_reg_exp_v_flag.rs │ ├── es6_non_strict_function_semantics.rs │ ├── es5_string_properties_and_methods.rs │ ├── es6_proto_in_object_literals.rs │ ├── es6_object_literal_extensions.rs │ └── es6_reg_exp_prototype_properties.rs └── scanner.rs ├── README.md ├── package.json ├── tasks └── codegen │ ├── Cargo.toml │ └── src │ └── lib.rs ├── pnpm-lock.yaml ├── dprint.json ├── .rustfmt.toml ├── justfile ├── LICENSE └── tests └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /node_modules 3 | /compat-table 4 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "1.84.1" 3 | profile = "default" 4 | -------------------------------------------------------------------------------- /.ignore: -------------------------------------------------------------------------------- 1 | # For watchexec https://github.com/watchexec/watchexec/tree/main/crates/cli#features 2 | 3 | target/** 4 | **/node_modules/** 5 | -------------------------------------------------------------------------------- /.typos.toml: -------------------------------------------------------------------------------- 1 | # https://github.com/crate-ci/typos 2 | # cargo install typos-cli 3 | # typos 4 | 5 | [files] 6 | extend-exclude = [ 7 | "data.json", 8 | "src/meta/*.rs", 9 | ] 10 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["github>Boshen/renovate", "helpers:pinGitHubActionDigests"], 4 | "updateNotScheduled": true 5 | } 6 | -------------------------------------------------------------------------------- /src/implementation/es6_let.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Let}; 4 | impl Feature for Es6Let { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_map.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Map}; 4 | impl Feature for Es6Map { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_set.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Set}; 4 | impl Feature for Es6Set { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_json.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5Json}; 4 | impl Feature for Es5Json { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_class.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Class}; 4 | impl Feature for Es6Class { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_const.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Const}; 4 | impl Feature for Es6Const { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_proxy.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Proxy}; 4 | impl Feature for Es6Proxy { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_super.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Super}; 4 | impl Feature for Es6Super { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_promise.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Promise}; 4 | impl Feature for Es6Promise { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_reflect.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Reflect}; 4 | impl Feature for Es6Reflect { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_symbol.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Symbol}; 4 | impl Feature for Es6Symbol { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_weak_map.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6WeakMap}; 4 | impl Feature for Es6WeakMap { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_weak_set.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6WeakSet}; 4 | impl Feature for Es6WeakSet { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2020_big_int.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2020BigInt}; 4 | impl Feature for Es2020BigInt { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_strict_mode.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5StrictMode}; 4 | impl Feature for Es5StrictMode { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_generators.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Generators}; 4 | impl Feature for Es6Generators { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_new_target.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6NewTarget}; 4 | impl Feature for Es6NewTarget { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_date_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5DateMethods}; 4 | impl Feature for Es5DateMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_for_of_loops.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ForOfLoops}; 4 | impl Feature for Es6ForOfLoops { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_math_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6MathMethods}; 4 | impl Feature for Es6MathMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_typed_arrays.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6TypedArrays}; 4 | impl Feature for Es6TypedArrays { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/cli.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use bpaf::Bpaf; 4 | 5 | #[derive(Debug, Clone, Bpaf)] 6 | #[bpaf(options)] 7 | pub struct Command { 8 | #[bpaf(switch)] 9 | pub quiet: bool, 10 | 11 | #[bpaf(positional("PATH"), many)] 12 | pub paths: Vec, 13 | } 14 | -------------------------------------------------------------------------------- /src/implementation/es2020_global_this.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2020GlobalThis}; 4 | impl Feature for Es2020GlobalThis { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2021_promise_any.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2021PromiseAny}; 4 | impl Feature for Es2021PromiseAny { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2025_promise_try.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2025PromiseTry}; 4 | impl Feature for Es2025PromiseTry { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2025_set_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2025SetMethods}; 4 | impl Feature for Es2025SetMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_array_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5ArrayMethods}; 4 | impl Feature for Es5ArrayMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_miscellaneous.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5Miscellaneous}; 4 | impl Feature for Es5Miscellaneous { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_number_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5NumberMethods}; 4 | impl Feature for Es5NumberMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_miscellaneous.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6Miscellaneous}; 4 | impl Feature for Es6Miscellaneous { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2019_json_superset.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2019JsonSuperset}; 4 | impl Feature for Es2019JsonSuperset { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2024_reg_exp_v_flag.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2024RegExpVFlag}; 4 | impl Feature for Es2024RegExpVFlag { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_arrow_functions.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ArrowFunctions}; 4 | impl Feature for Es6ArrowFunctions { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_rest_parameters.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6RestParameters}; 4 | impl Feature for Es6RestParameters { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_shadow_realm.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextShadowRealm}; 4 | impl Feature for EsnextShadowRealm { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2017_string_padding.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2017StringPadding}; 4 | impl Feature for Es2017StringPadding { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2022_object_has_own.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2022ObjectHasOwn}; 4 | impl Feature for Es2022ObjectHasOwn { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2024_array_grouping.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2024ArrayGrouping}; 4 | impl Feature for Es2024ArrayGrouping { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_immutable_globals.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5ImmutableGlobals}; 4 | impl Feature for Es5ImmutableGlobals { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_number_properties.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6NumberProperties}; 4 | impl Feature for Es6NumberProperties { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_own_property_order.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6OwnPropertyOrder}; 4 | impl Feature for Es6OwnPropertyOrder { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_template_literals.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6TemplateLiterals}; 4 | impl Feature for Es6TemplateLiterals { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_well_known_symbols.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6WellKnownSymbols}; 4 | impl Feature for Es6WellKnownSymbols { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2017_async_functions.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2017AsyncFunctions}; 4 | impl Feature for Es2017AsyncFunctions { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2019_string_trimming.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2019StringTrimming}; 4 | impl Feature for Es2019StringTrimming { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2021_weak_references.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2021WeakReferences}; 4 | impl Feature for Es2021WeakReferences { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2023_hashbang_grammar.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2023HashbangGrammar}; 4 | impl Feature for Es2023HashbangGrammar { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2025_iterator_helpers.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2025IteratorHelpers}; 4 | impl Feature for Es2025IteratorHelpers { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_array_static_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ArrayStaticMethods}; 4 | impl Feature for Es6ArrayStaticMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_html_style_comments.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6HtmlStyleComments}; 4 | impl Feature for Es6HtmlStyleComments { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_reg_exp_y_and_u_flags.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6RegExpYAndUFlags}; 4 | impl Feature for Es6RegExpYAndUFlags { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_reg_exp_escaping.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextRegExpEscaping}; 4 | impl Feature for EsnextRegExpEscaping { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2021_numeric_separators.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2021NumericSeparators}; 4 | impl Feature for Es2021NumericSeparators { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_object_static_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5ObjectStaticMethods}; 4 | impl Feature for Es5ObjectStaticMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_array_is_subclassable.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ArrayIsSubclassable}; 4 | impl Feature for Es6ArrayIsSubclassable { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_object_static_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ObjectStaticMethods}; 4 | impl Feature for Es6ObjectStaticMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_string_static_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6StringStaticMethods}; 4 | impl Feature for Es6StringStaticMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_throw_expressions.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextThrowExpressions}; 4 | impl Feature for EsnextThrowExpressions { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Scan 262 2 | 3 | Scan for features defined in ECMA-262. 4 | 5 | Use cases: 6 | 7 | - last defense of accidentally publishing unwanted features in bundled code, for preventing tool misconfiguration 8 | - ECMAScript language feature adoption rate 9 | - which language features are underutilized 10 | -------------------------------------------------------------------------------- /src/implementation/es2019_object_from_entries.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2019ObjectFromEntries}; 4 | impl Feature for Es2019ObjectFromEntries { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2020_promise_all_settled.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2020PromiseAllSettled}; 4 | impl Feature for Es2020PromiseAllSettled { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2022_error_cause_property.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2022ErrorCauseProperty}; 4 | impl Feature for Es2022ErrorCauseProperty { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2022_static_class_fields.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2022StaticClassFields}; 4 | impl Feature for Es2022StaticClassFields { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2023_array_find_from_last.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2023ArrayFindFromLast}; 4 | impl Feature for Es2023ArrayFindFromLast { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2023_change_array_by_copy.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2023ChangeArrayByCopy}; 4 | impl Feature for Es2023ChangeArrayByCopy { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_function_prototype_bind.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5FunctionPrototypeBind}; 4 | impl Feature for Es5FunctionPrototypeBind { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_array_prototype_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ArrayPrototypeMethods}; 4 | impl Feature for Es6ArrayPrototypeMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_function_name_property.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6FunctionNameProperty}; 4 | impl Feature for Es6FunctionNameProperty { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_object_prototype_proto.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ObjectPrototypeProto}; 4 | impl Feature for Es6ObjectPrototypeProto { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_promise_is_subclassable.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6PromiseIsSubclassable}; 4 | impl Feature for Es6PromiseIsSubclassable { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_proto_in_object_literals.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ProtoInObjectLiterals}; 4 | impl Feature for Es6ProtoInObjectLiterals { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_proxy_internal_get_calls.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ProxyInternalGetCalls}; 4 | impl Feature for Es6ProxyInternalGetCalls { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_proxy_internal_set_calls.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ProxyInternalSetCalls}; 4 | impl Feature for Es6ProxyInternalSetCalls { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_reg_exp_is_subclassable.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6RegExpIsSubclassable}; 4 | impl Feature for Es6RegExpIsSubclassable { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_map_prototype_upsert.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextMapPrototypeUpsert}; 4 | impl Feature for EsnextMapPrototypeUpsert { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2017_object_static_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2017ObjectStaticMethods}; 4 | impl Feature for Es2017ObjectStaticMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2019_optional_catch_binding.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2019OptionalCatchBinding}; 4 | impl Feature for Es2019OptionalCatchBinding { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2022_instance_class_fields.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2022InstanceClassFields}; 4 | impl Feature for Es2022InstanceClassFields { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2022_private_class_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2022PrivateClassMethods}; 4 | impl Feature for Es2022PrivateClassMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2024_promise_with_resolvers.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2024PromiseWithResolvers}; 4 | impl Feature for Es2024PromiseWithResolvers { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_destructuring_assignment.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6DestructuringAssignment}; 4 | impl Feature for Es6DestructuringAssignment { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_destructuring_parameters.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6DestructuringParameters}; 4 | impl Feature for Es6DestructuringParameters { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_function_is_subclassable.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6FunctionIsSubclassable}; 4 | impl Feature for Es6FunctionIsSubclassable { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_object_literal_extensions.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ObjectLiteralExtensions}; 4 | impl Feature for Es6ObjectLiteralExtensions { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_octal_and_binary_literals.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6OctalAndBinaryLiterals}; 4 | impl Feature for Es6OctalAndBinaryLiterals { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_reg_exp_prototype_compile.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6RegExpPrototypeCompile}; 4 | impl Feature for Es6RegExpPrototypeCompile { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_reg_exp_syntax_extensions.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6RegExpSyntaxExtensions}; 4 | impl Feature for Es6RegExpSyntaxExtensions { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_string_prototype_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6StringPrototypeMethods}; 4 | impl Feature for Es6StringPrototypeMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_updated_identifier_syntax.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6UpdatedIdentifierSyntax}; 4 | impl Feature for Es6UpdatedIdentifierSyntax { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_async_iterator_helpers.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextAsyncIteratorHelpers}; 4 | impl Feature for EsnextAsyncIteratorHelpers { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2018_asynchronous_iterators.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2018AsynchronousIterators}; 4 | impl Feature for Es2018AsynchronousIterators { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_destructuring_declarations.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6DestructuringDeclarations}; 4 | impl Feature for Es6DestructuringDeclarations { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_unicode_code_point_escapes.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6UnicodeCodePointEscapes}; 4 | impl Feature for Es6UnicodeCodePointEscapes { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_array_is_template_object.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextArrayIsTemplateObject}; 4 | impl Feature for EsnextArrayIsTemplateObject { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2016_array_prototype_includes.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2016ArrayPrototypeIncludes}; 4 | impl Feature for Es2016ArrayPrototypeIncludes { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2017_arguments_caller_removed.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2017ArgumentsCallerRemoved}; 4 | impl Feature for Es2017ArgumentsCallerRemoved { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2017_reg_exp_u_flag_case_folding.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2017RegExpUFlagCaseFolding}; 4 | impl Feature for Es2017RegExpUFlagCaseFolding { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2017_shared_memory_and_atomics.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2017SharedMemoryAndAtomics}; 4 | impl Feature for Es2017SharedMemoryAndAtomics { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2018_promise_prototype_finally.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2018PromisePrototypeFinally}; 4 | impl Feature for Es2018PromisePrototypeFinally { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2018_template_literal_revision.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2018TemplateLiteralRevision}; 4 | impl Feature for Es2018TemplateLiteralRevision { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2019_well_formed_json_stringify.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2019WellFormedJsonStringify}; 4 | impl Feature for Es2019WellFormedJsonStringify { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2020_string_prototype_match_all.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2020StringPrototypeMatchAll}; 4 | impl Feature for Es2020StringPrototypeMatchAll { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2025_reg_exp_pattern_modifiers.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2025RegExpPatternModifiers}; 4 | impl Feature for Es2025RegExpPatternModifiers { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_string_properties_and_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5StringPropertiesAndMethods}; 4 | impl Feature for Es5StringPropertiesAndMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_default_function_parameters.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6DefaultFunctionParameters}; 4 | impl Feature for Es6DefaultFunctionParameters { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_miscellaneous_subclassables.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6MiscellaneousSubclassables}; 4 | impl Feature for Es6MiscellaneousSubclassables { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_non_strict_function_semantics.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6NonStrictFunctionSemantics}; 4 | impl Feature for Es6NonStrictFunctionSemantics { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_prototype_of_bound_functions.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6PrototypeOfBoundFunctions}; 4 | impl Feature for Es6PrototypeOfBoundFunctions { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_proxy_internal_own_keys_calls.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ProxyInternalOwnKeysCalls}; 4 | impl Feature for Es6ProxyInternalOwnKeysCalls { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_reg_exp_prototype_properties.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6RegExpPrototypeProperties}; 4 | impl Feature for Es6RegExpPrototypeProperties { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_string_prototype_html_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6StringPrototypeHtmlMethods}; 4 | impl Feature for Es6StringPrototypeHtmlMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2018_reg_exp_named_capture_groups.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2018RegExpNamedCaptureGroups}; 4 | impl Feature for Es2018RegExpNamedCaptureGroups { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2018_reg_exp_lookbehind_assertions.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2018RegExpLookbehindAssertions}; 4 | impl Feature for Es2018RegExpLookbehindAssertions { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2019_array_prototype_flat_flat_map.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2019ArrayPrototypeFlatFlatMap}; 4 | impl Feature for Es2019ArrayPrototypeFlatFlatMap { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2019_symbol_prototype_description.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2019SymbolPrototypeDescription}; 4 | impl Feature for Es2019SymbolPrototypeDescription { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2021_string_prototype_replace_all.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2021StringPrototypeReplaceAll}; 4 | impl Feature for Es2021StringPrototypeReplaceAll { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es5_object_array_literal_extensions.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es5ObjectArrayLiteralExtensions}; 4 | impl Feature for Es5ObjectArrayLiteralExtensions { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_block_level_function_declaration.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6BlockLevelFunctionDeclaration}; 4 | impl Feature for Es6BlockLevelFunctionDeclaration { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_class_and_property_decorators.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextClassAndPropertyDecorators}; 4 | impl Feature for EsnextClassAndPropertyDecorators { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_uint_array_to_from_base_and_hex.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextUintArrayToFromBaseAndHex}; 4 | impl Feature for EsnextUintArrayToFromBaseAndHex { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scan262", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "init": "degit compat-table/compat-table#4fd1acb5bdd34846cb18887310f7a8000989c34e compat-table", 7 | "build": "node ./build.cjs > data.json" 8 | }, 9 | "devDependencies": { 10 | "degit": "2.8.4" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/implementation/es2016_proxy_enumerate_handler_removed.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2016ProxyEnumerateHandlerRemoved}; 4 | impl Feature for Es2016ProxyEnumerateHandlerRemoved { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2024_array_buffer_prototype_transfer.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2024ArrayBufferPrototypeTransfer}; 4 | impl Feature for Es2024ArrayBufferPrototypeTransfer { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_date_prototype_symbol_to_primitive.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6DatePrototypeSymbolToPrimitive}; 4 | impl Feature for Es6DatePrototypeSymbolToPrimitive { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_spread_syntax_for_iterable_objects.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6SpreadSyntaxForIterableObjects}; 4 | impl Feature for Es6SpreadSyntaxForIterableObjects { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #![expect(clippy::self_named_module_files)] 2 | 3 | mod cli; 4 | mod ctx; 5 | mod feature; 6 | mod features; 7 | mod implementation; 8 | mod meta; 9 | mod scanner; 10 | 11 | pub use scanner::Scanner; 12 | 13 | pub use crate::{ 14 | cli::{command, Command}, 15 | feature::Feature, 16 | features::FEATURES, 17 | }; 18 | -------------------------------------------------------------------------------- /src/implementation/es2018_reg_exp_unicode_property_escapes.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2018RegExpUnicodePropertyEscapes}; 4 | impl Feature for Es2018RegExpUnicodePropertyEscapes { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2025_duplicate_named_capturing_groups.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2025DuplicateNamedCapturingGroups}; 4 | impl Feature for Es2025DuplicateNamedCapturingGroups { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_proxy_internal_define_property_calls.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ProxyInternalDefinePropertyCalls}; 4 | impl Feature for Es6ProxyInternalDefinePropertyCalls { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_proxy_internal_delete_property_calls.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ProxyInternalDeletePropertyCalls}; 4 | impl Feature for Es6ProxyInternalDeletePropertyCalls { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2017_trailing_commas_in_function_syntax.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2017TrailingCommasInFunctionSyntax}; 4 | impl Feature for Es2017TrailingCommasInFunctionSyntax { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2022_at_method_on_the_built_in_indexables.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2022AtMethodOnTheBuiltInIndexables}; 4 | impl Feature for Es2022AtMethodOnTheBuiltInIndexables { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2022_class_static_initialization_blocks.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2022ClassStaticInitializationBlocks}; 4 | impl Feature for Es2022ClassStaticInitializationBlocks { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2016_nested_rest_destructuring_parameters.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2016NestedRestDestructuringParameters}; 4 | impl Feature for Es2016NestedRestDestructuringParameters { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2018_s_dot_all_flag_for_regular_expressions.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2018SDotAllFlagForRegularExpressions}; 4 | impl Feature for Es2018SDotAllFlagForRegularExpressions { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_object_static_methods_accept_primitives.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ObjectStaticMethodsAcceptPrimitives}; 4 | impl Feature for Es6ObjectStaticMethodsAcceptPrimitives { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_proper_tail_calls_tail_call_optimisation.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ProperTailCallsTailCallOptimisation}; 4 | impl Feature for Es6ProperTailCallsTailCallOptimisation { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_legacy_reg_exp_features_in_java_script.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextLegacyRegExpFeaturesInJavaScript}; 4 | impl Feature for EsnextLegacyRegExpFeaturesInJavaScript { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2017_object_prototype_getter_setter_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2017ObjectPrototypeGetterSetterMethods}; 4 | impl Feature for Es2017ObjectPrototypeGetterSetterMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2019_function_prototype_to_string_revision.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2019FunctionPrototypeToStringRevision}; 4 | impl Feature for Es2019FunctionPrototypeToStringRevision { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2022_reg_exp_match_indices_has_indices_d_flag.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2022RegExpMatchIndicesHasIndicesDFlag}; 4 | impl Feature for Es2022RegExpMatchIndicesHasIndicesDFlag { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/esnext_generator_function_sent_meta_property.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::EsnextGeneratorFunctionSentMetaProperty}; 4 | impl Feature for EsnextGeneratorFunctionSentMetaProperty { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2016_generator_functions_can_t_be_used_with_new.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2016GeneratorFunctionsCanTBeUsedWithNew}; 4 | impl Feature for Es2016GeneratorFunctionsCanTBeUsedWithNew { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2016_nested_rest_destructuring_declarations.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2016NestedRestDestructuringDeclarations}; 4 | impl Feature for Es2016NestedRestDestructuringDeclarations { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2016_generator_throw_caught_by_inner_generator.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2016GeneratorThrowCaughtByInnerGenerator}; 4 | impl Feature for Es2016GeneratorThrowCaughtByInnerGenerator { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2017_proxy_internal_calls_getter_setter_methods.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2017ProxyInternalCallsGetterSetterMethods}; 4 | impl Feature for Es2017ProxyInternalCallsGetterSetterMethods { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2022_ergonomic_brand_checks_for_private_fields.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2022ErgonomicBrandChecksForPrivateFields}; 4 | impl Feature for Es2022ErgonomicBrandChecksForPrivateFields { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2016_proxy_internal_calls_array_prototype_includes.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2016ProxyInternalCallsArrayPrototypeIncludes}; 4 | impl Feature for Es2016ProxyInternalCallsArrayPrototypeIncludes { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es6_proxy_internal_get_own_property_descriptor_calls.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es6ProxyInternalGetOwnPropertyDescriptorCalls}; 4 | impl Feature for Es6ProxyInternalGetOwnPropertyDescriptorCalls { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /src/implementation/es2016_strict_fn_w_non_strict_non_simple_params_is_error.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ctx::Ctx, feature::Feature, features::Es2016StrictFnWNonStrictNonSimpleParamsIsError}; 4 | impl Feature for Es2016StrictFnWNonStrictNonSimpleParamsIsError { 5 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 6 | } 7 | -------------------------------------------------------------------------------- /tasks/codegen/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "codegen" 3 | version = "0.0.0" 4 | edition = "2021" 5 | publish = false 6 | 7 | [lints] 8 | workspace = true 9 | 10 | [dependencies] 11 | convert_case = "0.7.0" 12 | prettyplease = "0.2.20" 13 | proc-macro2 = "1" 14 | project-root = "0.2.2" 15 | quote = "1" 16 | serde = { version = "1", features = ["derive"] } 17 | serde_json = "1" 18 | syn = "2" 19 | -------------------------------------------------------------------------------- /src/implementation/es2017_assignments_allowed_in_for_in_head_in_non_strict_mode.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ 4 | ctx::Ctx, feature::Feature, features::Es2017AssignmentsAllowedInForInHeadInNonStrictMode, 5 | }; 6 | impl Feature for Es2017AssignmentsAllowedInForInHeadInNonStrictMode { 7 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 8 | } 9 | -------------------------------------------------------------------------------- /src/implementation/es2018_proxy_own_keys_handler_duplicate_keys_for_non_extensible_targets.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::{ 4 | ctx::Ctx, feature::Feature, 5 | features::Es2018ProxyOwnKeysHandlerDuplicateKeysForNonExtensibleTargets, 6 | }; 7 | impl Feature for Es2018ProxyOwnKeysHandlerDuplicateKeysForNonExtensibleTargets { 8 | fn test(&self, _node: &AstNode<'_>, _semantic: &Semantic<'_>, _ctx: &mut Ctx) {} 9 | } 10 | -------------------------------------------------------------------------------- /src/implementation/es2020_optional_chaining_operator.rs: -------------------------------------------------------------------------------- 1 | use oxc::{ 2 | ast::AstKind, 3 | semantic::{AstNode, Semantic}, 4 | }; 5 | 6 | use crate::{ctx::Ctx, feature::Feature, features::Es2020OptionalChainingOperator}; 7 | impl Feature for Es2020OptionalChainingOperator { 8 | fn test(&self, node: &AstNode<'_>, _semantic: &Semantic<'_>, ctx: &mut Ctx) { 9 | let AstKind::ChainExpression(expr) = node.kind() else { return }; 10 | ctx.diagnostic(self, expr.span); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '9.0' 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | importers: 8 | 9 | .: 10 | devDependencies: 11 | degit: 12 | specifier: 2.8.4 13 | version: 2.8.4 14 | 15 | packages: 16 | 17 | degit@2.8.4: 18 | resolution: {integrity: sha512-vqYuzmSA5I50J882jd+AbAhQtgK6bdKUJIex1JNfEUPENCgYsxugzKVZlFyMwV4i06MmnV47/Iqi5Io86zf3Ng==} 19 | engines: {node: '>=8.0.0'} 20 | hasBin: true 21 | 22 | snapshots: 23 | 24 | degit@2.8.4: {} 25 | -------------------------------------------------------------------------------- /src/implementation/es2021_logical_assignment.rs: -------------------------------------------------------------------------------- 1 | use oxc::{ 2 | ast::AstKind, 3 | semantic::{AstNode, Semantic}, 4 | }; 5 | 6 | use crate::{ctx::Ctx, feature::Feature, features::Es2021LogicalAssignment}; 7 | impl Feature for Es2021LogicalAssignment { 8 | fn test(&self, node: &AstNode<'_>, _semantic: &Semantic<'_>, ctx: &mut Ctx) { 9 | let AstKind::AssignmentExpression(expr) = node.kind() else { return }; 10 | if !expr.operator.is_logical() { 11 | return; 12 | } 13 | ctx.diagnostic(self, expr.span); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/implementation/es2016_exponentiation_operator.rs: -------------------------------------------------------------------------------- 1 | use oxc::{ 2 | ast::{ast::BinaryOperator, AstKind}, 3 | semantic::{AstNode, Semantic}, 4 | }; 5 | 6 | use crate::{ctx::Ctx, feature::Feature, features::Es2016ExponentiationOperator}; 7 | impl Feature for Es2016ExponentiationOperator { 8 | fn test(&self, node: &AstNode<'_>, _semantic: &Semantic<'_>, ctx: &mut Ctx) { 9 | let AstKind::BinaryExpression(expr) = node.kind() else { return }; 10 | if expr.operator != BinaryOperator::Exponential { 11 | return; 12 | } 13 | ctx.diagnostic(self, expr.span); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /dprint.json: -------------------------------------------------------------------------------- 1 | { 2 | "lineWidth": 120, 3 | "typescript": { 4 | "quoteStyle": "preferSingle", 5 | "binaryExpression.operatorPosition": "sameLine" 6 | }, 7 | "json": { 8 | "indentWidth": 2 9 | }, 10 | "toml": { 11 | }, 12 | "excludes": [ 13 | "pnpm-lock.yaml" 14 | ], 15 | "plugins": [ 16 | "https://plugins.dprint.dev/typescript-0.93.3.wasm", 17 | "https://plugins.dprint.dev/json-0.19.4.wasm", 18 | "https://plugins.dprint.dev/markdown-0.17.8.wasm", 19 | "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm", 20 | "https://plugins.dprint.dev/toml-0.6.3.wasm" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /src/implementation/es2020_nullish_coalescing_operator.rs: -------------------------------------------------------------------------------- 1 | use oxc::{ 2 | ast::{ast::LogicalOperator, AstKind}, 3 | semantic::{AstNode, Semantic}, 4 | }; 5 | 6 | use crate::{ctx::Ctx, feature::Feature, features::Es2020NullishCoalescingOperator}; 7 | impl Feature for Es2020NullishCoalescingOperator { 8 | fn test(&self, node: &AstNode<'_>, _semantic: &Semantic<'_>, ctx: &mut Ctx) { 9 | let AstKind::LogicalExpression(expr) = node.kind() else { return }; 10 | if expr.operator != LogicalOperator::Coalesce { 11 | return; 12 | } 13 | ctx.diagnostic(self, expr.span); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.rustfmt.toml: -------------------------------------------------------------------------------- 1 | # Make Rust more readable given most people have wide screens nowadays. 2 | # This is also the setting used by [rustc](https://github.com/rust-lang/rust/blob/master/rustfmt.toml) 3 | use_small_heuristics = "Max" 4 | 5 | # Use field initialize shorthand if possible 6 | use_field_init_shorthand = true 7 | 8 | # All unstable features that we wish for 9 | # unstable_features = true 10 | # version = "Two" 11 | # Provide a cleaner impl order 12 | # reorder_impl_items = true 13 | # Provide a cleaner import sort order 14 | # group_imports = "StdExternalCrate" 15 | # Group "use" statements by crate 16 | # imports_granularity = "Crate" 17 | -------------------------------------------------------------------------------- /src/ctx.rs: -------------------------------------------------------------------------------- 1 | use oxc::{diagnostics::OxcDiagnostic, span::Span}; 2 | 3 | use crate::feature::Feature; 4 | 5 | #[derive(Default)] 6 | pub struct Ctx { 7 | pub diagnostics: Vec, 8 | } 9 | 10 | impl Ctx { 11 | pub fn diagnostic(&mut self, feature: &dyn Feature, span: Span) { 12 | let d = OxcDiagnostic::warn(feature.name()) 13 | .with_error_code_scope(feature.target()) 14 | .with_label(span) 15 | .with_url(feature.mdn()); 16 | self.diagnostics.push(d); 17 | } 18 | 19 | pub fn diagnostics(self) -> Vec { 20 | self.diagnostics 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/feature.rs: -------------------------------------------------------------------------------- 1 | use oxc::semantic::{AstNode, Semantic}; 2 | 3 | use crate::ctx::Ctx; 4 | 5 | #[derive(Debug)] 6 | pub struct Subtest { 7 | pub name: &'static str, 8 | pub exec: &'static str, 9 | } 10 | 11 | pub trait Meta { 12 | fn name(&self) -> &'static str; 13 | fn key(&self) -> &'static str; 14 | fn target(&self) -> &'static str; 15 | fn category(&self) -> &'static str; 16 | fn spec(&self) -> &'static str; 17 | fn significance(&self) -> &'static str; 18 | fn mdn(&self) -> &'static str; 19 | fn exec(&self) -> &'static str; 20 | fn subtests(&self) -> Vec; 21 | } 22 | 23 | pub trait Feature: Meta { 24 | fn test(&self, _node: &AstNode<'_>, semantic: &Semantic<'_>, ctx: &mut Ctx); 25 | } 26 | -------------------------------------------------------------------------------- /src/implementation/es2018_object_rest_spread_properties.rs: -------------------------------------------------------------------------------- 1 | use oxc::{ 2 | ast::AstKind, 3 | semantic::{AstNode, Semantic}, 4 | }; 5 | 6 | use crate::{ctx::Ctx, feature::Feature, features::Es2018ObjectRestSpreadProperties}; 7 | impl Feature for Es2018ObjectRestSpreadProperties { 8 | fn test(&self, node: &AstNode<'_>, semantic: &Semantic<'_>, ctx: &mut Ctx) { 9 | let span = match node.kind() { 10 | AstKind::ObjectPattern(obj) if obj.rest.is_some() => obj.rest.as_ref().unwrap().span, 11 | AstKind::SpreadElement(e) 12 | if matches!( 13 | semantic.nodes().parent_kind(node.id()), 14 | Some(AstKind::ObjectExpression(_)) 15 | ) => 16 | { 17 | e.span 18 | } 19 | _ => return, 20 | }; 21 | ctx.diagnostic(self, span); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/meta/es5_json.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | feature::{Meta, Subtest}, 3 | features::Es5Json, 4 | }; 5 | impl Meta for Es5Json { 6 | fn name(&self) -> &'static str { 7 | "JSON" 8 | } 9 | 10 | fn key(&self) -> &'static str { 11 | "es5_json" 12 | } 13 | 14 | fn target(&self) -> &'static str { 15 | "es5" 16 | } 17 | 18 | fn category(&self) -> &'static str { 19 | "" 20 | } 21 | 22 | fn spec(&self) -> &'static str { 23 | "" 24 | } 25 | 26 | fn significance(&self) -> &'static str { 27 | "medium" 28 | } 29 | 30 | fn mdn(&self) -> &'static str { 31 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON" 32 | } 33 | 34 | fn exec(&self) -> &'static str { 35 | "function () {\nreturn typeof JSON === 'object';\n }" 36 | } 37 | 38 | fn subtests(&self) -> Vec { 39 | vec![] 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/meta/es6_html_style_comments.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | feature::{Meta, Subtest}, 3 | features::Es6HtmlStyleComments, 4 | }; 5 | impl Meta for Es6HtmlStyleComments { 6 | fn name(&self) -> &'static str { 7 | "HTML-style comments" 8 | } 9 | 10 | fn key(&self) -> &'static str { 11 | "es6_html_style_comments" 12 | } 13 | 14 | fn target(&self) -> &'static str { 15 | "es6" 16 | } 17 | 18 | fn category(&self) -> &'static str { 19 | "annex b" 20 | } 21 | 22 | fn spec(&self) -> &'static str { 23 | "http://www.ecma-international.org/ecma-262/6.0/#sec-html-like-comments" 24 | } 25 | 26 | fn significance(&self) -> &'static str { 27 | "tiny" 28 | } 29 | 30 | fn mdn(&self) -> &'static str { 31 | "" 32 | } 33 | 34 | fn exec(&self) -> &'static str { 35 | "--> A comment\n