diff --git a/.changeset/famous-panthers-sparkle.md b/.changeset/famous-panthers-sparkle.md new file mode 100644 index 000000000000..6dade03c8528 --- /dev/null +++ b/.changeset/famous-panthers-sparkle.md @@ -0,0 +1,9 @@ +--- +swc_ecma_ast: patch +swc_css_visit: patch +swc_ecma_visit: patch +swc_xml_visit: patch +swc_html_visit: patch +--- + +fix(es): Fix regression diff --git a/Cargo.lock b/Cargo.lock index 42dab84597dd..f19c72423311 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5422,6 +5422,7 @@ name = "swc_visit" version = "0.6.1" dependencies = [ "either", + "new_debug_unreachable", ] [[package]] diff --git a/crates/swc_css_visit/src/generated.rs b/crates/swc_css_visit/src/generated.rs index d1bd673559ea..c96243158ec0 100644 --- a/crates/swc_css_visit/src/generated.rs +++ b/crates/swc_css_visit/src/generated.rs @@ -33932,7 +33932,7 @@ impl VisitWithAstPath for PageSelector { { let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::PageSelector( self, - self::fields::PageSelectorField::Pseudos, + self::fields::PageSelectorField::Pseudos(usize::MAX), )); > as VisitWithAstPath>::visit_with_ast_path( pseudos, @@ -34177,7 +34177,7 @@ impl VisitWithAstPath for PseudoClassSelector { let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::PseudoClassSelector( self, - self::fields::PseudoClassSelectorField::Children, + self::fields::PseudoClassSelectorField::Children(usize::MAX), )); < Option < Vec < PseudoClassSelectorChildren > > as VisitWithAstPath < V > > :: visit_with_ast_path (children , visitor , & mut * __ast_path) }; @@ -34401,7 +34401,7 @@ impl VisitWithAstPath for PseudoElementSelector { let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::PseudoElementSelector( self, - self::fields::PseudoElementSelectorField::Children, + self::fields::PseudoElementSelectorField::Children(usize::MAX), )); < Option < Vec < PseudoElementSelectorChildren > > as VisitWithAstPath < V > > :: visit_with_ast_path (children , visitor , & mut * __ast_path) }; @@ -36982,7 +36982,7 @@ impl VisitWithAstPath for Url { { let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Url( self, - self::fields::UrlField::Modifiers, + self::fields::UrlField::Modifiers(usize::MAX), )); > as VisitWithAstPath>::visit_with_ast_path( modifiers, @@ -69682,7 +69682,7 @@ impl VisitMutWithAstPath for PageSelector { }; { let mut __ast_path = __ast_path.with_guard(AstParentKind::PageSelector( - self::fields::PageSelectorField::Pseudos, + self::fields::PageSelectorField::Pseudos(usize::MAX), )); < Option < Vec < PageSelectorPseudo > > as VisitMutWithAstPath < V > > :: visit_mut_with_ast_path (pseudos , visitor , & mut * __ast_path) }; @@ -69867,7 +69867,7 @@ impl VisitMutWithAstPath for PseudoClassSelector }; { let mut __ast_path = __ast_path.with_guard(AstParentKind::PseudoClassSelector( - self::fields::PseudoClassSelectorField::Children, + self::fields::PseudoClassSelectorField::Children(usize::MAX), )); < Option < Vec < PseudoClassSelectorChildren > > as VisitMutWithAstPath < V > > :: visit_mut_with_ast_path (children , visitor , & mut * __ast_path) }; @@ -70060,7 +70060,7 @@ impl VisitMutWithAstPath for PseudoElementSelect { let mut __ast_path = __ast_path.with_guard(AstParentKind::PseudoElementSelector( - self::fields::PseudoElementSelectorField::Children, + self::fields::PseudoElementSelectorField::Children(usize::MAX), )); < Option < Vec < PseudoElementSelectorChildren > > as VisitMutWithAstPath < V > > :: visit_mut_with_ast_path (children , visitor , & mut * __ast_path) }; @@ -72132,8 +72132,9 @@ impl VisitMutWithAstPath for Url { ) }; { - let mut __ast_path = __ast_path - .with_guard(AstParentKind::Url(self::fields::UrlField::Modifiers)); + let mut __ast_path = __ast_path.with_guard(AstParentKind::Url( + self::fields::UrlField::Modifiers(usize::MAX), + )); > as VisitMutWithAstPath>::visit_mut_with_ast_path( modifiers, visitor, @@ -105328,7 +105329,7 @@ impl FoldWithAstPath for PageSelector { }; let pseudos = { let mut __ast_path = __ast_path.with_guard(AstParentKind::PageSelector( - self::fields::PageSelectorField::Pseudos, + self::fields::PageSelectorField::Pseudos(usize::MAX), )); > as FoldWithAstPath>::fold_with_ast_path( pseudos, @@ -105526,7 +105527,7 @@ impl FoldWithAstPath for PseudoClassSelector { }; let children = { let mut __ast_path = __ast_path.with_guard(AstParentKind::PseudoClassSelector( - self::fields::PseudoClassSelectorField::Children, + self::fields::PseudoClassSelectorField::Children(usize::MAX), )); < Option < Vec < PseudoClassSelectorChildren > > as FoldWithAstPath < V > > :: fold_with_ast_path (children , visitor , & mut * __ast_path) }; @@ -105737,7 +105738,7 @@ impl FoldWithAstPath for PseudoElementSelector { let children = { let mut __ast_path = __ast_path.with_guard(AstParentKind::PseudoElementSelector( - self::fields::PseudoElementSelectorField::Children, + self::fields::PseudoElementSelectorField::Children(usize::MAX), )); < Option < Vec < PseudoElementSelectorChildren > > as FoldWithAstPath < V > > :: fold_with_ast_path (children , visitor , & mut * __ast_path) }; @@ -107950,8 +107951,9 @@ impl FoldWithAstPath for Url { ) }; let modifiers = { - let mut __ast_path = __ast_path - .with_guard(AstParentKind::Url(self::fields::UrlField::Modifiers)); + let mut __ast_path = __ast_path.with_guard(AstParentKind::Url( + self::fields::UrlField::Modifiers(usize::MAX), + )); > as FoldWithAstPath>::fold_with_ast_path( modifiers, visitor, @@ -122114,7 +122116,9 @@ pub mod fields { } impl AbsoluteColorBaseField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AbsoluteColorBaseField { @@ -122127,7 +122131,9 @@ pub mod fields { } impl AlphaValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AlphaValueField { @@ -122138,7 +122144,9 @@ pub mod fields { } impl AnPlusBField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AnPlusBField { @@ -122150,7 +122158,7 @@ pub mod fields { impl AnPlusBNotationField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122170,7 +122178,7 @@ pub mod fields { impl AngleField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122185,7 +122193,9 @@ pub mod fields { } impl AnglePercentageField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AnglePercentageField { @@ -122197,7 +122207,7 @@ pub mod fields { impl AnyNamespaceField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122209,7 +122219,7 @@ pub mod fields { impl AtRuleField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122226,7 +122236,9 @@ pub mod fields { } impl AtRuleNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AtRuleNameField { @@ -122237,7 +122249,9 @@ pub mod fields { } impl AtRulePreludeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AtRulePreludeField { @@ -122283,7 +122297,7 @@ pub mod fields { impl AttributeSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122303,7 +122317,7 @@ pub mod fields { impl AttributeSelectorMatcherField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122316,7 +122330,9 @@ pub mod fields { } impl AttributeSelectorMatcherValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AttributeSelectorMatcherValueField { @@ -122336,7 +122352,7 @@ pub mod fields { impl AttributeSelectorModifierField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122349,7 +122365,9 @@ pub mod fields { } impl AttributeSelectorValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AttributeSelectorValueField { @@ -122360,7 +122378,9 @@ pub mod fields { } impl BinOpField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum BinOpField { @@ -122376,7 +122396,7 @@ pub mod fields { impl CalcOperatorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122389,7 +122409,9 @@ pub mod fields { } impl CalcOperatorTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum CalcOperatorTypeField { @@ -122409,7 +122431,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122422,7 +122444,9 @@ pub mod fields { } impl CalcProductOrOperatorField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum CalcProductOrOperatorField { @@ -122438,7 +122462,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122451,7 +122475,9 @@ pub mod fields { } impl CalcValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum CalcValueField { @@ -122470,7 +122496,9 @@ pub mod fields { } impl CalcValueOrOperatorField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum CalcValueOrOperatorField { @@ -122482,7 +122510,7 @@ pub mod fields { impl ClassSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122495,7 +122523,9 @@ pub mod fields { } impl CmykComponentField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum CmykComponentField { @@ -122508,7 +122538,9 @@ pub mod fields { } impl ColorField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ColorField { @@ -122521,7 +122553,9 @@ pub mod fields { } impl ColorProfileNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ColorProfileNameField { @@ -122533,7 +122567,7 @@ pub mod fields { impl CombinatorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122546,7 +122580,9 @@ pub mod fields { } impl CombinatorValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum CombinatorValueField { @@ -122568,7 +122604,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122581,7 +122617,9 @@ pub mod fields { } impl ComplexSelectorChildrenField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ComplexSelectorChildrenField { @@ -122592,7 +122630,9 @@ pub mod fields { } impl ComponentValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ComponentValueField { @@ -122668,7 +122708,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122690,7 +122730,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122704,7 +122744,7 @@ pub mod fields { impl ContainerConditionField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122719,7 +122759,9 @@ pub mod fields { } impl ContainerNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ContainerNameField { @@ -122733,7 +122775,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122747,7 +122789,7 @@ pub mod fields { impl ContainerQueryAndField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122763,7 +122805,7 @@ pub mod fields { impl ContainerQueryNotField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122779,7 +122821,7 @@ pub mod fields { impl ContainerQueryOrField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122794,7 +122836,9 @@ pub mod fields { } impl ContainerQueryTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ContainerQueryTypeField { @@ -122810,7 +122854,7 @@ pub mod fields { impl CustomHighlightNameField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122826,7 +122870,7 @@ pub mod fields { impl CustomIdentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122842,7 +122886,7 @@ pub mod fields { impl CustomMediaQueryField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122857,7 +122901,9 @@ pub mod fields { } impl CustomMediaQueryMediaTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum CustomMediaQueryMediaTypeField { @@ -122869,7 +122915,7 @@ pub mod fields { impl CustomPropertyNameField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122885,7 +122931,7 @@ pub mod fields { impl DashedIdentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122905,7 +122951,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122922,7 +122968,9 @@ pub mod fields { } impl DeclarationNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DeclarationNameField { @@ -122933,7 +122981,9 @@ pub mod fields { } impl DeclarationOrAtRuleField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DeclarationOrAtRuleField { @@ -122947,7 +122997,7 @@ pub mod fields { impl DelimiterField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -122960,7 +123010,9 @@ pub mod fields { } impl DelimiterValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DelimiterValueField { @@ -122973,7 +123025,9 @@ pub mod fields { } impl DimensionField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DimensionField { @@ -122995,7 +123049,7 @@ pub mod fields { impl DimensionTokenField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123019,7 +123073,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123032,7 +123086,9 @@ pub mod fields { } impl DocumentPreludeMatchingFunctionField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DocumentPreludeMatchingFunctionField { @@ -123044,7 +123100,7 @@ pub mod fields { impl ExtensionNameField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123059,7 +123115,9 @@ pub mod fields { } impl FamilyNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum FamilyNameField { @@ -123071,7 +123129,7 @@ pub mod fields { impl FlexField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123091,7 +123149,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123104,7 +123162,9 @@ pub mod fields { } impl ForgivingComplexSelectorField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ForgivingComplexSelectorField { @@ -123115,7 +123175,9 @@ pub mod fields { } impl ForgivingRelativeSelectorField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ForgivingRelativeSelectorField { @@ -123131,7 +123193,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123149,7 +123211,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123163,7 +123225,7 @@ pub mod fields { impl FrequencyField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123178,7 +123240,9 @@ pub mod fields { } impl FrequencyPercentageField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum FrequencyPercentageField { @@ -123194,7 +123258,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123209,7 +123273,9 @@ pub mod fields { } impl FunctionNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum FunctionNameField { @@ -123220,7 +123286,9 @@ pub mod fields { } impl GeneralEnclosedField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum GeneralEnclosedField { @@ -123232,7 +123300,7 @@ pub mod fields { impl HexColorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123247,7 +123315,9 @@ pub mod fields { } impl HueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum HueField { @@ -123259,7 +123329,7 @@ pub mod fields { impl IdSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123273,7 +123343,7 @@ pub mod fields { impl IdentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123289,7 +123359,7 @@ pub mod fields { impl ImportConditionsField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123304,7 +123374,9 @@ pub mod fields { } impl ImportHrefField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ImportHrefField { @@ -123315,7 +123387,9 @@ pub mod fields { } impl ImportLayerNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ImportLayerNameField { @@ -123327,7 +123401,7 @@ pub mod fields { impl ImportPreludeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123345,7 +123419,7 @@ pub mod fields { impl ImportantFlagField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123359,7 +123433,7 @@ pub mod fields { impl IntegerField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123379,7 +123453,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123394,7 +123468,9 @@ pub mod fields { } impl KeyframeSelectorField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum KeyframeSelectorField { @@ -123405,7 +123481,9 @@ pub mod fields { } impl KeyframesNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum KeyframesNameField { @@ -123421,7 +123499,7 @@ pub mod fields { impl KeyframesPseudoFunctionField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123437,7 +123515,7 @@ pub mod fields { impl KeyframesPseudoPrefixField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123457,7 +123535,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123475,7 +123553,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123488,7 +123566,9 @@ pub mod fields { } impl LayerPreludeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum LayerPreludeField { @@ -123500,7 +123580,7 @@ pub mod fields { impl LengthField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123515,7 +123595,9 @@ pub mod fields { } impl LengthPercentageField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum LengthPercentageField { @@ -123531,7 +123613,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123545,7 +123627,7 @@ pub mod fields { impl MediaAndField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123565,7 +123647,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123578,7 +123660,9 @@ pub mod fields { } impl MediaConditionAllTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MediaConditionAllTypeField { @@ -123593,7 +123677,9 @@ pub mod fields { } impl MediaConditionTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MediaConditionTypeField { @@ -123609,7 +123695,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123622,7 +123708,9 @@ pub mod fields { } impl MediaConditionWithoutOrTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MediaConditionWithoutOrTypeField { @@ -123635,7 +123723,9 @@ pub mod fields { } impl MediaFeatureField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MediaFeatureField { @@ -123651,7 +123741,7 @@ pub mod fields { impl MediaFeatureBooleanField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123664,7 +123754,9 @@ pub mod fields { } impl MediaFeatureNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MediaFeatureNameField { @@ -123676,7 +123768,7 @@ pub mod fields { impl MediaFeaturePlainField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123692,7 +123784,7 @@ pub mod fields { impl MediaFeatureRangeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123709,7 +123801,9 @@ pub mod fields { } impl MediaFeatureRangeComparisonField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MediaFeatureRangeComparisonField { @@ -123727,7 +123821,7 @@ pub mod fields { impl MediaFeatureRangeIntervalField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123748,7 +123842,9 @@ pub mod fields { } impl MediaFeatureValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MediaFeatureValueField { @@ -123765,7 +123861,9 @@ pub mod fields { } impl MediaInParensField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MediaInParensField { @@ -123779,7 +123877,7 @@ pub mod fields { impl MediaNotField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123795,7 +123893,7 @@ pub mod fields { impl MediaOrField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123811,7 +123909,7 @@ pub mod fields { impl MediaQueryField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123835,7 +123933,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123848,7 +123946,9 @@ pub mod fields { } impl MediaTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MediaTypeField { @@ -123858,7 +123958,7 @@ pub mod fields { impl NamedNamespaceField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123871,7 +123971,9 @@ pub mod fields { } impl NamespaceField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum NamespaceField { @@ -123883,7 +123985,7 @@ pub mod fields { impl NamespacePrefixField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123897,7 +123999,7 @@ pub mod fields { impl NamespacePreludeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123912,7 +124014,9 @@ pub mod fields { } impl NamespacePreludeUriField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum NamespacePreludeUriField { @@ -123924,7 +124028,7 @@ pub mod fields { impl NestingSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123936,7 +124040,7 @@ pub mod fields { impl NumberField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123951,7 +124055,9 @@ pub mod fields { } impl NumberTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum NumberTypeField { @@ -123963,7 +124069,11 @@ pub mod fields { impl PageSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + Self::Pseudos(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), } } } @@ -123974,7 +124084,7 @@ pub mod fields { #[doc = "Represents [`PageSelector::page_type`]"] PageType, #[doc = "Represents [`PageSelector::pseudos`]"] - Pseudos, + Pseudos(usize), } impl PageSelectorListField { pub(crate) fn set_index(&mut self, index: usize) { @@ -123983,7 +124093,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -123997,7 +124107,7 @@ pub mod fields { impl PageSelectorPseudoField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124011,7 +124121,7 @@ pub mod fields { impl PageSelectorTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124025,7 +124135,7 @@ pub mod fields { impl PercentageField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124039,7 +124149,11 @@ pub mod fields { impl PseudoClassSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + Self::Children(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), } } } @@ -124050,11 +124164,13 @@ pub mod fields { #[doc = "Represents [`PseudoClassSelector::name`]"] Name, #[doc = "Represents [`PseudoClassSelector::children`]"] - Children, + Children(usize), } impl PseudoClassSelectorChildrenField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum PseudoClassSelectorChildrenField { @@ -124086,7 +124202,11 @@ pub mod fields { impl PseudoElementSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + Self::Children(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), } } } @@ -124097,11 +124217,13 @@ pub mod fields { #[doc = "Represents [`PseudoElementSelector::name`]"] Name, #[doc = "Represents [`PseudoElementSelector::children`]"] - Children, + Children(usize), } impl PseudoElementSelectorChildrenField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum PseudoElementSelectorChildrenField { @@ -124117,7 +124239,7 @@ pub mod fields { impl QualifiedRuleField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124132,7 +124254,9 @@ pub mod fields { } impl QualifiedRulePreludeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum QualifiedRulePreludeField { @@ -124145,7 +124269,9 @@ pub mod fields { } impl QueryInParensField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum QueryInParensField { @@ -124159,7 +124285,7 @@ pub mod fields { impl RatioField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124175,7 +124301,7 @@ pub mod fields { impl RelativeSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124195,7 +124321,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124209,7 +124335,7 @@ pub mod fields { impl ResolutionField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124224,7 +124350,9 @@ pub mod fields { } impl RuleField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum RuleField { @@ -124238,7 +124366,7 @@ pub mod fields { impl ScopeRangeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124258,7 +124386,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124276,7 +124404,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124294,7 +124422,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124309,7 +124437,9 @@ pub mod fields { } impl SizeFeatureField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SizeFeatureField { @@ -124325,7 +124455,7 @@ pub mod fields { impl SizeFeatureBooleanField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124338,7 +124468,9 @@ pub mod fields { } impl SizeFeatureNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SizeFeatureNameField { @@ -124348,7 +124480,7 @@ pub mod fields { impl SizeFeaturePlainField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124364,7 +124496,7 @@ pub mod fields { impl SizeFeatureRangeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124381,7 +124513,9 @@ pub mod fields { } impl SizeFeatureRangeComparisonField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SizeFeatureRangeComparisonField { @@ -124399,7 +124533,7 @@ pub mod fields { impl SizeFeatureRangeIntervalField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124420,7 +124554,9 @@ pub mod fields { } impl SizeFeatureValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SizeFeatureValueField { @@ -124438,7 +124574,7 @@ pub mod fields { impl StrField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124453,7 +124589,9 @@ pub mod fields { } impl StyleBlockField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum StyleBlockField { @@ -124473,7 +124611,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124486,7 +124624,9 @@ pub mod fields { } impl SubclassSelectorField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SubclassSelectorField { @@ -124504,7 +124644,7 @@ pub mod fields { impl SupportsAndField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124524,7 +124664,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124537,7 +124677,9 @@ pub mod fields { } impl SupportsConditionTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SupportsConditionTypeField { @@ -124552,7 +124694,9 @@ pub mod fields { } impl SupportsFeatureField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SupportsFeatureField { @@ -124563,7 +124707,9 @@ pub mod fields { } impl SupportsInParensField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SupportsInParensField { @@ -124577,7 +124723,7 @@ pub mod fields { impl SupportsNotField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124593,7 +124739,7 @@ pub mod fields { impl SupportsOrField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124609,7 +124755,7 @@ pub mod fields { impl TagNameSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124623,7 +124769,7 @@ pub mod fields { impl TimeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124638,7 +124784,9 @@ pub mod fields { } impl TimePercentageField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TimePercentageField { @@ -124649,7 +124797,9 @@ pub mod fields { } impl TokenField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TokenField { @@ -124705,7 +124855,7 @@ pub mod fields { impl TokenAndSpanField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124718,7 +124868,9 @@ pub mod fields { } impl TypeSelectorField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TypeSelectorField { @@ -124730,7 +124882,7 @@ pub mod fields { impl UnicodeRangeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124748,7 +124900,7 @@ pub mod fields { impl UniversalSelectorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124762,7 +124914,7 @@ pub mod fields { impl UnknownDimensionField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124778,7 +124930,11 @@ pub mod fields { impl UrlField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + Self::Modifiers(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), } } } @@ -124791,12 +124947,12 @@ pub mod fields { #[doc = "Represents [`Url::value`]"] Value, #[doc = "Represents [`Url::modifiers`]"] - Modifiers, + Modifiers(usize), } impl UrlKeyValueField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124804,7 +124960,9 @@ pub mod fields { pub enum UrlKeyValueField {} impl UrlModifierField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum UrlModifierField { @@ -124815,7 +124973,9 @@ pub mod fields { } impl UrlValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum UrlValueField { @@ -124827,7 +124987,7 @@ pub mod fields { impl UrlValueRawField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -124843,7 +125003,7 @@ pub mod fields { impl WqNameField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } diff --git a/crates/swc_ecma_ast/src/lib.rs b/crates/swc_ecma_ast/src/lib.rs index 368e441e6caf..b9502b737920 100644 --- a/crates/swc_ecma_ast/src/lib.rs +++ b/crates/swc_ecma_ast/src/lib.rs @@ -31,7 +31,7 @@ pub use self::{ }, list::ListFormat, lit::{BigInt, Bool, Lit, Null, Number, Regex, Str}, - module::{Module, ModuleItem, Program, ReservedUnused, Script}, + module::{Module, ModuleItem, Program, Script}, module_decl::{ DefaultDecl, ExportAll, ExportDecl, ExportDefaultDecl, ExportDefaultExpr, ExportDefaultSpecifier, ExportNamedSpecifier, ExportNamespaceSpecifier, ExportSpecifier, @@ -198,9 +198,7 @@ pub use self::{ ArchivedBigInt, ArchivedBool, ArchivedLit, ArchivedNull, ArchivedNumber, ArchivedRegex, ArchivedStr, }, - module::{ - ArchivedModule, ArchivedModuleItem, ArchivedProgram, ArchivedReservedUnused, ArchivedScript, - }, + module::{ArchivedModule, ArchivedModuleItem, ArchivedProgram, ArchivedScript}, module_decl::{ ArchivedDefaultDecl, ArchivedExportAll, ArchivedExportDecl, ArchivedExportDefaultDecl, ArchivedExportDefaultExpr, ArchivedExportDefaultSpecifier, ArchivedExportNamedSpecifier, diff --git a/crates/swc_ecma_ast/src/module.rs b/crates/swc_ecma_ast/src/module.rs index fe9456d323e1..68df93b3e461 100644 --- a/crates/swc_ecma_ast/src/module.rs +++ b/crates/swc_ecma_ast/src/module.rs @@ -12,28 +12,6 @@ pub enum Program { Module(Module), #[tag("Script")] Script(Script), - // Reserved type for the testing purpose only. Prod codes does not utilize - // this at all and user should not try to attempt to use this as well. - // TODO: reenable once experimental_metadata breaking change is merged - // #[tag("ReservedUnused")] - // ReservedUnused(ReservedUnused), -} - -#[ast_node("ReservedUnused")] -#[derive(Eq, Hash, EqIgnoreSpan)] -pub struct ReservedUnused { - pub span: Span, - pub body: Option>, -} - -#[cfg(feature = "arbitrary")] -#[cfg_attr(docsrs, doc(cfg(feature = "arbitrary")))] -impl<'a> arbitrary::Arbitrary<'a> for ReservedUnused { - fn arbitrary(u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result { - let span = u.arbitrary()?; - let body = u.arbitrary()?; - Ok(Self { span, body }) - } } #[ast_node("Module")] diff --git a/crates/swc_ecma_visit/src/generated.rs b/crates/swc_ecma_visit/src/generated.rs index 41183dcc7c49..a2fb31abeff7 100644 --- a/crates/swc_ecma_visit/src/generated.rs +++ b/crates/swc_ecma_visit/src/generated.rs @@ -982,13 +982,6 @@ pub trait Visit { fn visit_opt_module_export_name(&mut self, node: &Option) { as VisitWith>::visit_children_with(node, self) } - #[doc = "Visit a node of type `Option < Vec < ModuleItem > >`.\n\nBy default, this method \ - calls [`Option < Vec < ModuleItem > >::visit_children_with`]. If you want to recurse, \ - you need to call it manually."] - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - > as VisitWith>::visit_children_with(node, self) - } #[doc = "Visit a node of type `Option < Box < ObjectLit > >`.\n\nBy default, this method calls \ [`Option < Box < ObjectLit > >::visit_children_with`]. If you want to recurse, you \ need to call it manually."] @@ -1202,13 +1195,6 @@ pub trait Visit { fn visit_regex(&mut self, node: &Regex) { >::visit_children_with(node, self) } - #[doc = "Visit a node of type `ReservedUnused`.\n\nBy default, this method calls \ - [`ReservedUnused::visit_children_with`]. If you want to recurse, you need to call it \ - manually."] - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - >::visit_children_with(node, self) - } #[doc = "Visit a node of type `RestPat`.\n\nBy default, this method calls \ [`RestPat::visit_children_with`]. If you want to recurse, you need to call it \ manually."] @@ -2749,11 +2735,6 @@ where ::visit_opt_module_export_name(&mut **self, node) } - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - ::visit_opt_module_items(&mut **self, node) - } - #[inline] fn visit_opt_object_lit(&mut self, node: &Option>) { ::visit_opt_object_lit(&mut **self, node) @@ -2912,11 +2893,6 @@ where ::visit_regex(&mut **self, node) } - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - ::visit_reserved_unused(&mut **self, node) - } - #[inline] fn visit_rest_pat(&mut self, node: &RestPat) { ::visit_rest_pat(&mut **self, node) @@ -4226,11 +4202,6 @@ where ::visit_opt_module_export_name(&mut **self, node) } - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - ::visit_opt_module_items(&mut **self, node) - } - #[inline] fn visit_opt_object_lit(&mut self, node: &Option>) { ::visit_opt_object_lit(&mut **self, node) @@ -4389,11 +4360,6 @@ where ::visit_regex(&mut **self, node) } - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - ::visit_reserved_unused(&mut **self, node) - } - #[inline] fn visit_rest_pat(&mut self, node: &RestPat) { ::visit_rest_pat(&mut **self, node) @@ -6148,14 +6114,6 @@ where } } - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - match self { - swc_visit::Either::Left(visitor) => Visit::visit_opt_module_items(visitor, node), - swc_visit::Either::Right(visitor) => Visit::visit_opt_module_items(visitor, node), - } - } - #[inline] fn visit_opt_object_lit(&mut self, node: &Option>) { match self { @@ -6415,14 +6373,6 @@ where } } - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - match self { - swc_visit::Either::Left(visitor) => Visit::visit_reserved_unused(visitor, node), - swc_visit::Either::Right(visitor) => Visit::visit_reserved_unused(visitor, node), - } - } - #[inline] fn visit_rest_pat(&mut self, node: &RestPat) { match self { @@ -8537,14 +8487,6 @@ where } } - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - if self.enabled { - ::visit_opt_module_items(&mut self.visitor, node) - } else { - } - } - #[inline] fn visit_opt_object_lit(&mut self, node: &Option>) { if self.enabled { @@ -8796,14 +8738,6 @@ where } } - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - if self.enabled { - ::visit_reserved_unused(&mut self.visitor, node) - } else { - } - } - #[inline] fn visit_rest_pat(&mut self, node: &RestPat) { if self.enabled { @@ -10612,12 +10546,6 @@ where as VisitWith>::visit_children_with(node, self); } - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - ::visit_opt_module_items(&mut self.visitor, node); - > as VisitWith>::visit_children_with(node, self); - } - #[inline] fn visit_opt_object_lit(&mut self, node: &Option>) { ::visit_opt_object_lit(&mut self.visitor, node); @@ -10807,12 +10735,6 @@ where >::visit_children_with(node, self); } - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - ::visit_reserved_unused(&mut self.visitor, node); - >::visit_children_with(node, self); - } - #[inline] fn visit_rest_pat(&mut self, node: &RestPat) { ::visit_rest_pat(&mut self.visitor, node); @@ -14717,25 +14639,6 @@ impl VisitWith for Regex { } } } -impl VisitWith for ReservedUnused { - #[doc = "Calls [Visit`::visit_reserved_unused`] with `self`."] - fn visit_with(&self, visitor: &mut V) { - ::visit_reserved_unused(visitor, self) - } - - fn visit_children_with(&self, visitor: &mut V) { - match self { - ReservedUnused { span, body } => { - { - >::visit_with(span, visitor) - }; - { - > as VisitWith>::visit_with(body, visitor) - }; - } - } - } -} impl VisitWith for RestPat { #[doc = "Calls [Visit`::visit_rest_pat`] with `self`."] fn visit_with(&self, visitor: &mut V) { @@ -17646,21 +17549,6 @@ impl VisitWith for Option { } } } -impl VisitWith for Option> { - #[doc = "Calls [Visit`::visit_opt_module_items`] with `self`. (Extra impl)"] - #[inline] - fn visit_with(&self, visitor: &mut V) { - ::visit_opt_module_items(visitor, self) - } - - #[inline] - fn visit_children_with(&self, visitor: &mut V) { - match self { - Some(inner) => as VisitWith>::visit_with(inner, visitor), - None => {} - } - } -} impl VisitWith for Option> { #[doc = "Calls [Visit`::visit_opt_object_lit`] with `self`. (Extra impl)"] #[inline] @@ -19811,19 +19699,6 @@ pub trait VisitAstPath { node, self, __ast_path, ) } - #[doc = "Visit a node of type `Option < Vec < ModuleItem > >`.\n\nBy default, this method \ - calls [`Option < Vec < ModuleItem > >::visit_children_with_ast_path`]. If you want to \ - recurse, you need to call it manually."] - #[inline] - fn visit_opt_module_items<'ast: 'r, 'r>( - &mut self, - node: &'ast Option>, - __ast_path: &mut AstNodePath<'r>, - ) { - > as VisitWithAstPath>::visit_children_with_ast_path( - node, self, __ast_path, - ) - } #[doc = "Visit a node of type `Option < Box < ObjectLit > >`.\n\nBy default, this method calls \ [`Option < Box < ObjectLit > >::visit_children_with_ast_path`]. If you want to \ recurse, you need to call it manually."] @@ -20188,19 +20063,6 @@ pub trait VisitAstPath { fn visit_regex<'ast: 'r, 'r>(&mut self, node: &'ast Regex, __ast_path: &mut AstNodePath<'r>) { >::visit_children_with_ast_path(node, self, __ast_path) } - #[doc = "Visit a node of type `ReservedUnused`.\n\nBy default, this method calls \ - [`ReservedUnused::visit_children_with_ast_path`]. If you want to recurse, you need to \ - call it manually."] - #[inline] - fn visit_reserved_unused<'ast: 'r, 'r>( - &mut self, - node: &'ast ReservedUnused, - __ast_path: &mut AstNodePath<'r>, - ) { - >::visit_children_with_ast_path( - node, self, __ast_path, - ) - } #[doc = "Visit a node of type `RestPat`.\n\nBy default, this method calls \ [`RestPat::visit_children_with_ast_path`]. If you want to recurse, you need to call \ it manually."] @@ -22879,15 +22741,6 @@ where ::visit_opt_module_export_name(&mut **self, node, __ast_path) } - #[inline] - fn visit_opt_module_items<'ast: 'r, 'r>( - &mut self, - node: &'ast Option>, - __ast_path: &mut AstNodePath<'r>, - ) { - ::visit_opt_module_items(&mut **self, node, __ast_path) - } - #[inline] fn visit_opt_object_lit<'ast: 'r, 'r>( &mut self, @@ -23147,15 +23000,6 @@ where ::visit_regex(&mut **self, node, __ast_path) } - #[inline] - fn visit_reserved_unused<'ast: 'r, 'r>( - &mut self, - node: &'ast ReservedUnused, - __ast_path: &mut AstNodePath<'r>, - ) { - ::visit_reserved_unused(&mut **self, node, __ast_path) - } - #[inline] fn visit_rest_pat<'ast: 'r, 'r>( &mut self, @@ -25435,15 +25279,6 @@ where ::visit_opt_module_export_name(&mut **self, node, __ast_path) } - #[inline] - fn visit_opt_module_items<'ast: 'r, 'r>( - &mut self, - node: &'ast Option>, - __ast_path: &mut AstNodePath<'r>, - ) { - ::visit_opt_module_items(&mut **self, node, __ast_path) - } - #[inline] fn visit_opt_object_lit<'ast: 'r, 'r>( &mut self, @@ -25703,15 +25538,6 @@ where ::visit_regex(&mut **self, node, __ast_path) } - #[inline] - fn visit_reserved_unused<'ast: 'r, 'r>( - &mut self, - node: &'ast ReservedUnused, - __ast_path: &mut AstNodePath<'r>, - ) { - ::visit_reserved_unused(&mut **self, node, __ast_path) - } - #[inline] fn visit_rest_pat<'ast: 'r, 'r>( &mut self, @@ -28968,22 +28794,6 @@ where } } - #[inline] - fn visit_opt_module_items<'ast: 'r, 'r>( - &mut self, - node: &'ast Option>, - __ast_path: &mut AstNodePath<'r>, - ) { - match self { - swc_visit::Either::Left(visitor) => { - VisitAstPath::visit_opt_module_items(visitor, node, __ast_path) - } - swc_visit::Either::Right(visitor) => { - VisitAstPath::visit_opt_module_items(visitor, node, __ast_path) - } - } - } - #[inline] fn visit_opt_object_lit<'ast: 'r, 'r>( &mut self, @@ -29452,22 +29262,6 @@ where } } - #[inline] - fn visit_reserved_unused<'ast: 'r, 'r>( - &mut self, - node: &'ast ReservedUnused, - __ast_path: &mut AstNodePath<'r>, - ) { - match self { - swc_visit::Either::Left(visitor) => { - VisitAstPath::visit_reserved_unused(visitor, node, __ast_path) - } - swc_visit::Either::Right(visitor) => { - VisitAstPath::visit_reserved_unused(visitor, node, __ast_path) - } - } - } - #[inline] fn visit_rest_pat<'ast: 'r, 'r>( &mut self, @@ -32998,18 +32792,6 @@ where } } - #[inline] - fn visit_opt_module_items<'ast: 'r, 'r>( - &mut self, - node: &'ast Option>, - __ast_path: &mut AstNodePath<'r>, - ) { - if self.enabled { - ::visit_opt_module_items(&mut self.visitor, node, __ast_path) - } else { - } - } - #[inline] fn visit_opt_object_lit<'ast: 'r, 'r>( &mut self, @@ -33366,18 +33148,6 @@ where } } - #[inline] - fn visit_reserved_unused<'ast: 'r, 'r>( - &mut self, - node: &'ast ReservedUnused, - __ast_path: &mut AstNodePath<'r>, - ) { - if self.enabled { - ::visit_reserved_unused(&mut self.visitor, node, __ast_path) - } else { - } - } - #[inline] fn visit_rest_pat<'ast: 'r, 'r>( &mut self, @@ -41369,7 +41139,7 @@ impl VisitWithAstPath for NewExpr { { let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::NewExpr( self, - self::fields::NewExprField::Args, + self::fields::NewExprField::Args(usize::MAX), )); > as VisitWithAstPath>::visit_with_ast_path( args, @@ -42578,51 +42348,6 @@ impl VisitWithAstPath for Regex { } #[cfg(any(docsrs, feature = "path"))] #[cfg_attr(docsrs, doc(cfg(feature = "path")))] -impl VisitWithAstPath for ReservedUnused { - #[doc = "Calls [VisitAstPath`::visit_reserved_unused`] with `self`."] - fn visit_with_ast_path<'ast: 'r, 'r>( - &'ast self, - visitor: &mut V, - __ast_path: &mut AstNodePath<'r>, - ) { - ::visit_reserved_unused(visitor, self, __ast_path) - } - - fn visit_children_with_ast_path<'ast: 'r, 'r>( - &'ast self, - visitor: &mut V, - __ast_path: &mut AstNodePath<'r>, - ) { - match self { - ReservedUnused { span, body } => { - { - let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ReservedUnused( - self, - self::fields::ReservedUnusedField::Span, - )); - >::visit_with_ast_path( - span, - visitor, - &mut *__ast_path, - ) - }; - { - let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ReservedUnused( - self, - self::fields::ReservedUnusedField::Body, - )); - > as VisitWithAstPath>::visit_with_ast_path( - body, - visitor, - &mut *__ast_path, - ) - }; - } - } - } -} -#[cfg(any(docsrs, feature = "path"))] -#[cfg_attr(docsrs, doc(cfg(feature = "path")))] impl VisitWithAstPath for RestPat { #[doc = "Calls [VisitAstPath`::visit_rest_pat`] with `self`."] fn visit_with_ast_path<'ast: 'r, 'r>( @@ -49507,33 +49232,6 @@ impl VisitWithAstPath for Option } #[cfg(any(docsrs, feature = "path"))] #[cfg_attr(docsrs, doc(cfg(feature = "path")))] -impl VisitWithAstPath for Option> { - #[doc = "Calls [VisitAstPath`::visit_opt_module_items`] with `self`. (Extra impl)"] - #[inline] - fn visit_with_ast_path<'ast: 'r, 'r>( - &'ast self, - visitor: &mut V, - __ast_path: &mut AstNodePath<'r>, - ) { - ::visit_opt_module_items(visitor, self, __ast_path) - } - - #[inline] - fn visit_children_with_ast_path<'ast: 'r, 'r>( - &'ast self, - visitor: &mut V, - __ast_path: &mut AstNodePath<'r>, - ) { - match self { - Some(inner) => as VisitWithAstPath>::visit_with_ast_path( - inner, visitor, __ast_path, - ), - None => {} - } - } -} -#[cfg(any(docsrs, feature = "path"))] -#[cfg_attr(docsrs, doc(cfg(feature = "path")))] impl VisitWithAstPath for Option> { #[doc = "Calls [VisitAstPath`::visit_opt_object_lit`] with `self`. (Extra impl)"] #[inline] @@ -51459,13 +51157,6 @@ pub trait VisitMut { fn visit_mut_opt_module_export_name(&mut self, node: &mut Option) { as VisitMutWith>::visit_mut_children_with(node, self) } - #[doc = "Visit a node of type `Option < Vec < ModuleItem > >`.\n\nBy default, this method \ - calls [`Option < Vec < ModuleItem > >::visit_mut_children_with`]. If you want to \ - recurse, you need to call it manually."] - #[inline] - fn visit_mut_opt_module_items(&mut self, node: &mut Option>) { - > as VisitMutWith>::visit_mut_children_with(node, self) - } #[doc = "Visit a node of type `Option < Box < ObjectLit > >`.\n\nBy default, this method calls \ [`Option < Box < ObjectLit > >::visit_mut_children_with`]. If you want to recurse, \ you need to call it manually."] @@ -51686,13 +51377,6 @@ pub trait VisitMut { fn visit_mut_regex(&mut self, node: &mut Regex) { >::visit_mut_children_with(node, self) } - #[doc = "Visit a node of type `ReservedUnused`.\n\nBy default, this method calls \ - [`ReservedUnused::visit_mut_children_with`]. If you want to recurse, you need to call \ - it manually."] - #[inline] - fn visit_mut_reserved_unused(&mut self, node: &mut ReservedUnused) { - >::visit_mut_children_with(node, self) - } #[doc = "Visit a node of type `RestPat`.\n\nBy default, this method calls \ [`RestPat::visit_mut_children_with`]. If you want to recurse, you need to call it \ manually."] @@ -53240,11 +52924,6 @@ where ::visit_mut_opt_module_export_name(&mut **self, node) } - #[inline] - fn visit_mut_opt_module_items(&mut self, node: &mut Option>) { - ::visit_mut_opt_module_items(&mut **self, node) - } - #[inline] fn visit_mut_opt_object_lit(&mut self, node: &mut Option>) { ::visit_mut_opt_object_lit(&mut **self, node) @@ -53403,11 +53082,6 @@ where ::visit_mut_regex(&mut **self, node) } - #[inline] - fn visit_mut_reserved_unused(&mut self, node: &mut ReservedUnused) { - ::visit_mut_reserved_unused(&mut **self, node) - } - #[inline] fn visit_mut_rest_pat(&mut self, node: &mut RestPat) { ::visit_mut_rest_pat(&mut **self, node) @@ -54717,11 +54391,6 @@ where ::visit_mut_opt_module_export_name(&mut **self, node) } - #[inline] - fn visit_mut_opt_module_items(&mut self, node: &mut Option>) { - ::visit_mut_opt_module_items(&mut **self, node) - } - #[inline] fn visit_mut_opt_object_lit(&mut self, node: &mut Option>) { ::visit_mut_opt_object_lit(&mut **self, node) @@ -54880,11 +54549,6 @@ where ::visit_mut_regex(&mut **self, node) } - #[inline] - fn visit_mut_reserved_unused(&mut self, node: &mut ReservedUnused) { - ::visit_mut_reserved_unused(&mut **self, node) - } - #[inline] fn visit_mut_rest_pat(&mut self, node: &mut RestPat) { ::visit_mut_rest_pat(&mut **self, node) @@ -56763,16 +56427,6 @@ where } } - #[inline] - fn visit_mut_opt_module_items(&mut self, node: &mut Option>) { - match self { - swc_visit::Either::Left(visitor) => VisitMut::visit_mut_opt_module_items(visitor, node), - swc_visit::Either::Right(visitor) => { - VisitMut::visit_mut_opt_module_items(visitor, node) - } - } - } - #[inline] fn visit_mut_opt_object_lit(&mut self, node: &mut Option>) { match self { @@ -57060,14 +56714,6 @@ where } } - #[inline] - fn visit_mut_reserved_unused(&mut self, node: &mut ReservedUnused) { - match self { - swc_visit::Either::Left(visitor) => VisitMut::visit_mut_reserved_unused(visitor, node), - swc_visit::Either::Right(visitor) => VisitMut::visit_mut_reserved_unused(visitor, node), - } - } - #[inline] fn visit_mut_rest_pat(&mut self, node: &mut RestPat) { match self { @@ -59334,14 +58980,6 @@ where } } - #[inline] - fn visit_mut_opt_module_items(&mut self, node: &mut Option>) { - if self.enabled { - ::visit_mut_opt_module_items(&mut self.visitor, node) - } else { - } - } - #[inline] fn visit_mut_opt_object_lit(&mut self, node: &mut Option>) { if self.enabled { @@ -59593,14 +59231,6 @@ where } } - #[inline] - fn visit_mut_reserved_unused(&mut self, node: &mut ReservedUnused) { - if self.enabled { - ::visit_mut_reserved_unused(&mut self.visitor, node) - } else { - } - } - #[inline] fn visit_mut_rest_pat(&mut self, node: &mut RestPat) { if self.enabled { @@ -63778,25 +63408,6 @@ impl VisitMutWith for Regex { } } } -impl VisitMutWith for ReservedUnused { - #[doc = "Calls [VisitMut`::visit_mut_reserved_unused`] with `self`."] - fn visit_mut_with(&mut self, visitor: &mut V) { - ::visit_mut_reserved_unused(visitor, self) - } - - fn visit_mut_children_with(&mut self, visitor: &mut V) { - match self { - ReservedUnused { span, body } => { - { - >::visit_mut_with(span, visitor) - }; - { - > as VisitMutWith>::visit_mut_with(body, visitor) - }; - } - } - } -} impl VisitMutWith for RestPat { #[doc = "Calls [VisitMut`::visit_mut_rest_pat`] with `self`."] fn visit_mut_with(&mut self, visitor: &mut V) { @@ -66733,21 +66344,6 @@ impl VisitMutWith for Option { } } } -impl VisitMutWith for Option> { - #[doc = "Calls [VisitMut`::visit_mut_opt_module_items`] with `self`. (Extra impl)"] - #[inline] - fn visit_mut_with(&mut self, visitor: &mut V) { - ::visit_mut_opt_module_items(visitor, self) - } - - #[inline] - fn visit_mut_children_with(&mut self, visitor: &mut V) { - match self { - Some(inner) => as VisitMutWith>::visit_mut_with(inner, visitor), - None => {} - } - } -} impl VisitMutWith for Option> { #[doc = "Calls [VisitMut`::visit_mut_opt_object_lit`] with `self`. (Extra impl)"] #[inline] @@ -68673,19 +68269,6 @@ pub trait VisitMutAstPath { node, self, __ast_path, ) } - #[doc = "Visit a node of type `Option < Vec < ModuleItem > >`.\n\nBy default, this method \ - calls [`Option < Vec < ModuleItem > >::visit_mut_children_with_ast_path`]. If you \ - want to recurse, you need to call it manually."] - #[inline] - fn visit_mut_opt_module_items( - &mut self, - node: &mut Option>, - __ast_path: &mut AstKindPath, - ) { - > as VisitMutWithAstPath>::visit_mut_children_with_ast_path( - node, self, __ast_path, - ) - } #[doc = "Visit a node of type `Option < Box < ObjectLit > >`.\n\nBy default, this method calls \ [`Option < Box < ObjectLit > >::visit_mut_children_with_ast_path`]. If you want to \ recurse, you need to call it manually."] @@ -69020,19 +68603,6 @@ pub trait VisitMutAstPath { node, self, __ast_path, ) } - #[doc = "Visit a node of type `ReservedUnused`.\n\nBy default, this method calls \ - [`ReservedUnused::visit_mut_children_with_ast_path`]. If you want to recurse, you \ - need to call it manually."] - #[inline] - fn visit_mut_reserved_unused( - &mut self, - node: &mut ReservedUnused, - __ast_path: &mut AstKindPath, - ) { - >::visit_mut_children_with_ast_path( - node, self, __ast_path, - ) - } #[doc = "Visit a node of type `RestPat`.\n\nBy default, this method calls \ [`RestPat::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \ call it manually."] @@ -71225,15 +70795,6 @@ where ::visit_mut_opt_module_export_name(&mut **self, node, __ast_path) } - #[inline] - fn visit_mut_opt_module_items( - &mut self, - node: &mut Option>, - __ast_path: &mut AstKindPath, - ) { - ::visit_mut_opt_module_items(&mut **self, node, __ast_path) - } - #[inline] fn visit_mut_opt_object_lit( &mut self, @@ -71453,15 +71014,6 @@ where ::visit_mut_regex(&mut **self, node, __ast_path) } - #[inline] - fn visit_mut_reserved_unused( - &mut self, - node: &mut ReservedUnused, - __ast_path: &mut AstKindPath, - ) { - ::visit_mut_reserved_unused(&mut **self, node, __ast_path) - } - #[inline] fn visit_mut_rest_pat(&mut self, node: &mut RestPat, __ast_path: &mut AstKindPath) { ::visit_mut_rest_pat(&mut **self, node, __ast_path) @@ -73185,15 +72737,6 @@ where ::visit_mut_opt_module_export_name(&mut **self, node, __ast_path) } - #[inline] - fn visit_mut_opt_module_items( - &mut self, - node: &mut Option>, - __ast_path: &mut AstKindPath, - ) { - ::visit_mut_opt_module_items(&mut **self, node, __ast_path) - } - #[inline] fn visit_mut_opt_object_lit( &mut self, @@ -73413,15 +72956,6 @@ where ::visit_mut_regex(&mut **self, node, __ast_path) } - #[inline] - fn visit_mut_reserved_unused( - &mut self, - node: &mut ReservedUnused, - __ast_path: &mut AstKindPath, - ) { - ::visit_mut_reserved_unused(&mut **self, node, __ast_path) - } - #[inline] fn visit_mut_rest_pat(&mut self, node: &mut RestPat, __ast_path: &mut AstKindPath) { ::visit_mut_rest_pat(&mut **self, node, __ast_path) @@ -76140,22 +75674,6 @@ where } } - #[inline] - fn visit_mut_opt_module_items( - &mut self, - node: &mut Option>, - __ast_path: &mut AstKindPath, - ) { - match self { - swc_visit::Either::Left(visitor) => { - VisitMutAstPath::visit_mut_opt_module_items(visitor, node, __ast_path) - } - swc_visit::Either::Right(visitor) => { - VisitMutAstPath::visit_mut_opt_module_items(visitor, node, __ast_path) - } - } - } - #[inline] fn visit_mut_opt_object_lit( &mut self, @@ -76592,22 +76110,6 @@ where } } - #[inline] - fn visit_mut_reserved_unused( - &mut self, - node: &mut ReservedUnused, - __ast_path: &mut AstKindPath, - ) { - match self { - swc_visit::Either::Left(visitor) => { - VisitMutAstPath::visit_mut_reserved_unused(visitor, node, __ast_path) - } - swc_visit::Either::Right(visitor) => { - VisitMutAstPath::visit_mut_reserved_unused(visitor, node, __ast_path) - } - } - } - #[inline] fn visit_mut_rest_pat(&mut self, node: &mut RestPat, __ast_path: &mut AstKindPath) { match self { @@ -79690,18 +79192,6 @@ where } } - #[inline] - fn visit_mut_opt_module_items( - &mut self, - node: &mut Option>, - __ast_path: &mut AstKindPath, - ) { - if self.enabled { - ::visit_mut_opt_module_items(&mut self.visitor, node, __ast_path) - } else { - } - } - #[inline] fn visit_mut_opt_object_lit( &mut self, @@ -80046,18 +79536,6 @@ where } } - #[inline] - fn visit_mut_reserved_unused( - &mut self, - node: &mut ReservedUnused, - __ast_path: &mut AstKindPath, - ) { - if self.enabled { - ::visit_mut_reserved_unused(&mut self.visitor, node, __ast_path) - } else { - } - } - #[inline] fn visit_mut_rest_pat(&mut self, node: &mut RestPat, __ast_path: &mut AstKindPath) { if self.enabled { @@ -86582,8 +86060,9 @@ impl VisitMutWithAstPath for NewExpr { ) }; { - let mut __ast_path = __ast_path - .with_guard(AstParentKind::NewExpr(self::fields::NewExprField::Args)); + let mut __ast_path = __ast_path.with_guard(AstParentKind::NewExpr( + self::fields::NewExprField::Args(usize::MAX), + )); > as VisitMutWithAstPath>::visit_mut_with_ast_path( args, visitor, @@ -87548,41 +87027,6 @@ impl VisitMutWithAstPath for Regex { } #[cfg(any(docsrs, feature = "path"))] #[cfg_attr(docsrs, doc(cfg(feature = "path")))] -impl VisitMutWithAstPath for ReservedUnused { - #[doc = "Calls [VisitMutAstPath`::visit_mut_reserved_unused`] with `self`."] - fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { - ::visit_mut_reserved_unused(visitor, self, __ast_path) - } - - fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { - match self { - ReservedUnused { span, body } => { - { - let mut __ast_path = __ast_path.with_guard(AstParentKind::ReservedUnused( - self::fields::ReservedUnusedField::Span, - )); - >::visit_mut_with_ast_path( - span, - visitor, - &mut *__ast_path, - ) - }; - { - let mut __ast_path = __ast_path.with_guard(AstParentKind::ReservedUnused( - self::fields::ReservedUnusedField::Body, - )); - > as VisitMutWithAstPath>::visit_mut_with_ast_path( - body, - visitor, - &mut *__ast_path, - ) - }; - } - } - } -} -#[cfg(any(docsrs, feature = "path"))] -#[cfg_attr(docsrs, doc(cfg(feature = "path")))] impl VisitMutWithAstPath for RestPat { #[doc = "Calls [VisitMutAstPath`::visit_mut_rest_pat`] with `self`."] fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { @@ -92993,25 +92437,6 @@ impl VisitMutWithAstPath for Option VisitMutWithAstPath for Option> { - #[doc = "Calls [VisitMutAstPath`::visit_mut_opt_module_items`] with `self`. (Extra impl)"] - #[inline] - fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { - ::visit_mut_opt_module_items(visitor, self, __ast_path) - } - - #[inline] - fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { - match self { - Some(inner) => as VisitMutWithAstPath>::visit_mut_with_ast_path( - inner, visitor, __ast_path, - ), - None => {} - } - } -} -#[cfg(any(docsrs, feature = "path"))] -#[cfg_attr(docsrs, doc(cfg(feature = "path")))] impl VisitMutWithAstPath for Option> { #[doc = "Calls [VisitMutAstPath`::visit_mut_opt_object_lit`] with `self`. (Extra impl)"] #[inline] @@ -94665,13 +94090,6 @@ pub trait Fold { ) -> Option { as FoldWith>::fold_children_with(node, self) } - #[doc = "Visit a node of type `Option < Vec < ModuleItem > >`.\n\nBy default, this method \ - calls [`Option < Vec < ModuleItem > >::fold_children_with`]. If you want to recurse, \ - you need to call it manually."] - #[inline] - fn fold_opt_module_items(&mut self, node: Option>) -> Option> { - > as FoldWith>::fold_children_with(node, self) - } #[doc = "Visit a node of type `Option < Box < ObjectLit > >`.\n\nBy default, this method calls \ [`Option < Box < ObjectLit > >::fold_children_with`]. If you want to recurse, you \ need to call it manually."] @@ -94896,13 +94314,6 @@ pub trait Fold { fn fold_regex(&mut self, node: Regex) -> Regex { >::fold_children_with(node, self) } - #[doc = "Visit a node of type `ReservedUnused`.\n\nBy default, this method calls \ - [`ReservedUnused::fold_children_with`]. If you want to recurse, you need to call it \ - manually."] - #[inline] - fn fold_reserved_unused(&mut self, node: ReservedUnused) -> ReservedUnused { - >::fold_children_with(node, self) - } #[doc = "Visit a node of type `RestPat`.\n\nBy default, this method calls \ [`RestPat::fold_children_with`]. If you want to recurse, you need to call it manually."] #[inline] @@ -96480,11 +95891,6 @@ where ::fold_opt_module_export_name(&mut **self, node) } - #[inline] - fn fold_opt_module_items(&mut self, node: Option>) -> Option> { - ::fold_opt_module_items(&mut **self, node) - } - #[inline] fn fold_opt_object_lit(&mut self, node: Option>) -> Option> { ::fold_opt_object_lit(&mut **self, node) @@ -96655,11 +96061,6 @@ where ::fold_regex(&mut **self, node) } - #[inline] - fn fold_reserved_unused(&mut self, node: ReservedUnused) -> ReservedUnused { - ::fold_reserved_unused(&mut **self, node) - } - #[inline] fn fold_rest_pat(&mut self, node: RestPat) -> RestPat { ::fold_rest_pat(&mut **self, node) @@ -98011,11 +97412,6 @@ where ::fold_opt_module_export_name(&mut **self, node) } - #[inline] - fn fold_opt_module_items(&mut self, node: Option>) -> Option> { - ::fold_opt_module_items(&mut **self, node) - } - #[inline] fn fold_opt_object_lit(&mut self, node: Option>) -> Option> { ::fold_opt_object_lit(&mut **self, node) @@ -98186,11 +97582,6 @@ where ::fold_regex(&mut **self, node) } - #[inline] - fn fold_reserved_unused(&mut self, node: ReservedUnused) -> ReservedUnused { - ::fold_reserved_unused(&mut **self, node) - } - #[inline] fn fold_rest_pat(&mut self, node: RestPat) -> RestPat { ::fold_rest_pat(&mut **self, node) @@ -99973,14 +99364,6 @@ where } } - #[inline] - fn fold_opt_module_items(&mut self, node: Option>) -> Option> { - match self { - swc_visit::Either::Left(visitor) => Fold::fold_opt_module_items(visitor, node), - swc_visit::Either::Right(visitor) => Fold::fold_opt_module_items(visitor, node), - } - } - #[inline] fn fold_opt_object_lit(&mut self, node: Option>) -> Option> { match self { @@ -100248,14 +99631,6 @@ where } } - #[inline] - fn fold_reserved_unused(&mut self, node: ReservedUnused) -> ReservedUnused { - match self { - swc_visit::Either::Left(visitor) => Fold::fold_reserved_unused(visitor, node), - swc_visit::Either::Right(visitor) => Fold::fold_reserved_unused(visitor, node), - } - } - #[inline] fn fold_rest_pat(&mut self, node: RestPat) -> RestPat { match self { @@ -102546,15 +101921,6 @@ where } } - #[inline] - fn fold_opt_module_items(&mut self, node: Option>) -> Option> { - if self.enabled { - ::fold_opt_module_items(&mut self.visitor, node) - } else { - node - } - } - #[inline] fn fold_opt_object_lit(&mut self, node: Option>) -> Option> { if self.enabled { @@ -102849,15 +102215,6 @@ where } } - #[inline] - fn fold_reserved_unused(&mut self, node: ReservedUnused) -> ReservedUnused { - if self.enabled { - ::fold_reserved_unused(&mut self.visitor, node) - } else { - node - } - } - #[inline] fn fold_rest_pat(&mut self, node: RestPat) -> RestPat { if self.enabled { @@ -107130,22 +106487,6 @@ impl FoldWith for Regex { } } } -impl FoldWith for ReservedUnused { - #[doc = "Calls [Fold`::fold_reserved_unused`] with `self`."] - fn fold_with(self, visitor: &mut V) -> Self { - ::fold_reserved_unused(visitor, self) - } - - fn fold_children_with(self, visitor: &mut V) -> Self { - match self { - ReservedUnused { span, body } => { - let span = { >::fold_with(span, visitor) }; - let body = { > as FoldWith>::fold_with(body, visitor) }; - ReservedUnused { span, body } - } - } - } -} impl FoldWith for RestPat { #[doc = "Calls [Fold`::fold_rest_pat`] with `self`."] fn fold_with(self, visitor: &mut V) -> Self { @@ -110014,18 +109355,6 @@ impl FoldWith for Option { self.map(|inner| >::fold_with(inner, visitor)) } } -impl FoldWith for Option> { - #[doc = "Calls [Fold`::fold_opt_module_items`] with `self`. (Extra impl)"] - #[inline] - fn fold_with(self, visitor: &mut V) -> Self { - ::fold_opt_module_items(visitor, self) - } - - #[inline] - fn fold_children_with(self, visitor: &mut V) -> Self { - self.map(|inner| as FoldWith>::fold_with(inner, visitor)) - } -} impl FoldWith for Option> { #[doc = "Calls [Fold`::fold_opt_object_lit`] with `self`. (Extra impl)"] #[inline] @@ -111869,19 +111198,6 @@ pub trait FoldAstPath { node, self, __ast_path, ) } - #[doc = "Visit a node of type `Option < Vec < ModuleItem > >`.\n\nBy default, this method \ - calls [`Option < Vec < ModuleItem > >::fold_children_with_ast_path`]. If you want to \ - recurse, you need to call it manually."] - #[inline] - fn fold_opt_module_items( - &mut self, - node: Option>, - __ast_path: &mut AstKindPath, - ) -> Option> { - > as FoldWithAstPath>::fold_children_with_ast_path( - node, self, __ast_path, - ) - } #[doc = "Visit a node of type `Option < Box < ObjectLit > >`.\n\nBy default, this method calls \ [`Option < Box < ObjectLit > >::fold_children_with_ast_path`]. If you want to \ recurse, you need to call it manually."] @@ -112218,19 +111534,6 @@ pub trait FoldAstPath { fn fold_regex(&mut self, node: Regex, __ast_path: &mut AstKindPath) -> Regex { >::fold_children_with_ast_path(node, self, __ast_path) } - #[doc = "Visit a node of type `ReservedUnused`.\n\nBy default, this method calls \ - [`ReservedUnused::fold_children_with_ast_path`]. If you want to recurse, you need to \ - call it manually."] - #[inline] - fn fold_reserved_unused( - &mut self, - node: ReservedUnused, - __ast_path: &mut AstKindPath, - ) -> ReservedUnused { - >::fold_children_with_ast_path( - node, self, __ast_path, - ) - } #[doc = "Visit a node of type `RestPat`.\n\nBy default, this method calls \ [`RestPat::fold_children_with_ast_path`]. If you want to recurse, you need to call it \ manually."] @@ -114531,15 +113834,6 @@ where ::fold_opt_module_export_name(&mut **self, node, __ast_path) } - #[inline] - fn fold_opt_module_items( - &mut self, - node: Option>, - __ast_path: &mut AstKindPath, - ) -> Option> { - ::fold_opt_module_items(&mut **self, node, __ast_path) - } - #[inline] fn fold_opt_object_lit( &mut self, @@ -114779,15 +114073,6 @@ where ::fold_regex(&mut **self, node, __ast_path) } - #[inline] - fn fold_reserved_unused( - &mut self, - node: ReservedUnused, - __ast_path: &mut AstKindPath, - ) -> ReservedUnused { - ::fold_reserved_unused(&mut **self, node, __ast_path) - } - #[inline] fn fold_rest_pat(&mut self, node: RestPat, __ast_path: &mut AstKindPath) -> RestPat { ::fold_rest_pat(&mut **self, node, __ast_path) @@ -116723,15 +116008,6 @@ where ::fold_opt_module_export_name(&mut **self, node, __ast_path) } - #[inline] - fn fold_opt_module_items( - &mut self, - node: Option>, - __ast_path: &mut AstKindPath, - ) -> Option> { - ::fold_opt_module_items(&mut **self, node, __ast_path) - } - #[inline] fn fold_opt_object_lit( &mut self, @@ -116971,15 +116247,6 @@ where ::fold_regex(&mut **self, node, __ast_path) } - #[inline] - fn fold_reserved_unused( - &mut self, - node: ReservedUnused, - __ast_path: &mut AstKindPath, - ) -> ReservedUnused { - ::fold_reserved_unused(&mut **self, node, __ast_path) - } - #[inline] fn fold_rest_pat(&mut self, node: RestPat, __ast_path: &mut AstKindPath) -> RestPat { ::fold_rest_pat(&mut **self, node, __ast_path) @@ -119862,22 +119129,6 @@ where } } - #[inline] - fn fold_opt_module_items( - &mut self, - node: Option>, - __ast_path: &mut AstKindPath, - ) -> Option> { - match self { - swc_visit::Either::Left(visitor) => { - FoldAstPath::fold_opt_module_items(visitor, node, __ast_path) - } - swc_visit::Either::Right(visitor) => { - FoldAstPath::fold_opt_module_items(visitor, node, __ast_path) - } - } - } - #[inline] fn fold_opt_object_lit( &mut self, @@ -120312,22 +119563,6 @@ where } } - #[inline] - fn fold_reserved_unused( - &mut self, - node: ReservedUnused, - __ast_path: &mut AstKindPath, - ) -> ReservedUnused { - match self { - swc_visit::Either::Left(visitor) => { - FoldAstPath::fold_reserved_unused(visitor, node, __ast_path) - } - swc_visit::Either::Right(visitor) => { - FoldAstPath::fold_reserved_unused(visitor, node, __ast_path) - } - } - } - #[inline] fn fold_rest_pat(&mut self, node: RestPat, __ast_path: &mut AstKindPath) -> RestPat { match self { @@ -123636,19 +122871,6 @@ where } } - #[inline] - fn fold_opt_module_items( - &mut self, - node: Option>, - __ast_path: &mut AstKindPath, - ) -> Option> { - if self.enabled { - ::fold_opt_module_items(&mut self.visitor, node, __ast_path) - } else { - node - } - } - #[inline] fn fold_opt_object_lit( &mut self, @@ -124016,19 +123238,6 @@ where } } - #[inline] - fn fold_reserved_unused( - &mut self, - node: ReservedUnused, - __ast_path: &mut AstKindPath, - ) -> ReservedUnused { - if self.enabled { - ::fold_reserved_unused(&mut self.visitor, node, __ast_path) - } else { - node - } - } - #[inline] fn fold_rest_pat(&mut self, node: RestPat, __ast_path: &mut AstKindPath) -> RestPat { if self.enabled { @@ -131050,8 +130259,9 @@ impl FoldWithAstPath for NewExpr { ) }; let args = { - let mut __ast_path = __ast_path - .with_guard(AstParentKind::NewExpr(self::fields::NewExprField::Args)); + let mut __ast_path = __ast_path.with_guard(AstParentKind::NewExpr( + self::fields::NewExprField::Args(usize::MAX), + )); > as FoldWithAstPath>::fold_with_ast_path( args, visitor, @@ -132102,42 +131312,6 @@ impl FoldWithAstPath for Regex { } #[cfg(any(docsrs, feature = "path"))] #[cfg_attr(docsrs, doc(cfg(feature = "path")))] -impl FoldWithAstPath for ReservedUnused { - #[doc = "Calls [FoldAstPath`::fold_reserved_unused`] with `self`."] - fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { - ::fold_reserved_unused(visitor, self, __ast_path) - } - - fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { - match self { - ReservedUnused { span, body } => { - let span = { - let mut __ast_path = __ast_path.with_guard(AstParentKind::ReservedUnused( - self::fields::ReservedUnusedField::Span, - )); - >::fold_with_ast_path( - span, - visitor, - &mut *__ast_path, - ) - }; - let body = { - let mut __ast_path = __ast_path.with_guard(AstParentKind::ReservedUnused( - self::fields::ReservedUnusedField::Body, - )); - > as FoldWithAstPath>::fold_with_ast_path( - body, - visitor, - &mut *__ast_path, - ) - }; - ReservedUnused { span, body } - } - } - } -} -#[cfg(any(docsrs, feature = "path"))] -#[cfg_attr(docsrs, doc(cfg(feature = "path")))] impl FoldWithAstPath for RestPat { #[doc = "Calls [FoldAstPath`::fold_rest_pat`] with `self`."] fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { @@ -137948,22 +137122,6 @@ impl FoldWithAstPath for Option { } #[cfg(any(docsrs, feature = "path"))] #[cfg_attr(docsrs, doc(cfg(feature = "path")))] -impl FoldWithAstPath for Option> { - #[doc = "Calls [FoldAstPath`::fold_opt_module_items`] with `self`. (Extra impl)"] - #[inline] - fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { - ::fold_opt_module_items(visitor, self, __ast_path) - } - - #[inline] - fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { - self.map(|inner| { - as FoldWithAstPath>::fold_with_ast_path(inner, visitor, __ast_path) - }) - } -} -#[cfg(any(docsrs, feature = "path"))] -#[cfg_attr(docsrs, doc(cfg(feature = "path")))] impl FoldWithAstPath for Option> { #[doc = "Calls [FoldAstPath`::fold_opt_object_lit`] with `self`. (Extra impl)"] #[inline] @@ -139619,14 +138777,6 @@ pub trait VisitAll { fn visit_opt_module_export_name(&mut self, node: &Option) { as VisitAllWith>::visit_children_with(node, self) } - #[doc = "Visit a node of type `Option < Vec < ModuleItem > >`.\n\nBy default, this method \ - calls [`Option < Vec < ModuleItem > >::visit_children_with`]. This method \ - unconditionally calls the visitor method for all children because it's defined in the \ - trait [VisitAll]."] - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - > as VisitAllWith>::visit_children_with(node, self) - } #[doc = "Visit a node of type `Option < Box < ObjectLit > >`.\n\nBy default, this method calls \ [`Option < Box < ObjectLit > >::visit_children_with`]. This method unconditionally \ calls the visitor method for all children because it's defined in the trait \ @@ -139857,13 +139007,6 @@ pub trait VisitAll { fn visit_regex(&mut self, node: &Regex) { >::visit_children_with(node, self) } - #[doc = "Visit a node of type `ReservedUnused`.\n\nBy default, this method calls \ - [`ReservedUnused::visit_children_with`]. This method unconditionally calls the \ - visitor method for all children because it's defined in the trait [VisitAll]."] - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - >::visit_children_with(node, self) - } #[doc = "Visit a node of type `RestPat`.\n\nBy default, this method calls \ [`RestPat::visit_children_with`]. This method unconditionally calls the visitor \ method for all children because it's defined in the trait [VisitAll]."] @@ -141414,11 +140557,6 @@ where ::visit_opt_module_export_name(&mut **self, node) } - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - ::visit_opt_module_items(&mut **self, node) - } - #[inline] fn visit_opt_object_lit(&mut self, node: &Option>) { ::visit_opt_object_lit(&mut **self, node) @@ -141577,11 +140715,6 @@ where ::visit_regex(&mut **self, node) } - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - ::visit_reserved_unused(&mut **self, node) - } - #[inline] fn visit_rest_pat(&mut self, node: &RestPat) { ::visit_rest_pat(&mut **self, node) @@ -142891,11 +142024,6 @@ where ::visit_opt_module_export_name(&mut **self, node) } - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - ::visit_opt_module_items(&mut **self, node) - } - #[inline] fn visit_opt_object_lit(&mut self, node: &Option>) { ::visit_opt_object_lit(&mut **self, node) @@ -143054,11 +142182,6 @@ where ::visit_regex(&mut **self, node) } - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - ::visit_reserved_unused(&mut **self, node) - } - #[inline] fn visit_rest_pat(&mut self, node: &RestPat) { ::visit_rest_pat(&mut **self, node) @@ -144831,14 +143954,6 @@ where } } - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - match self { - swc_visit::Either::Left(visitor) => VisitAll::visit_opt_module_items(visitor, node), - swc_visit::Either::Right(visitor) => VisitAll::visit_opt_module_items(visitor, node), - } - } - #[inline] fn visit_opt_object_lit(&mut self, node: &Option>) { match self { @@ -145116,14 +144231,6 @@ where } } - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - match self { - swc_visit::Either::Left(visitor) => VisitAll::visit_reserved_unused(visitor, node), - swc_visit::Either::Right(visitor) => VisitAll::visit_reserved_unused(visitor, node), - } - } - #[inline] fn visit_rest_pat(&mut self, node: &RestPat) { match self { @@ -147280,14 +146387,6 @@ where } } - #[inline] - fn visit_opt_module_items(&mut self, node: &Option>) { - if self.enabled { - ::visit_opt_module_items(&mut self.visitor, node) - } else { - } - } - #[inline] fn visit_opt_object_lit(&mut self, node: &Option>) { if self.enabled { @@ -147539,14 +146638,6 @@ where } } - #[inline] - fn visit_reserved_unused(&mut self, node: &ReservedUnused) { - if self.enabled { - ::visit_reserved_unused(&mut self.visitor, node) - } else { - } - } - #[inline] fn visit_rest_pat(&mut self, node: &RestPat) { if self.enabled { @@ -151698,25 +150789,6 @@ impl VisitAllWith for Regex { } } } -impl VisitAllWith for ReservedUnused { - #[doc = "Calls [VisitAll`::visit_reserved_unused`] with `self`."] - fn visit_with(&self, visitor: &mut V) { - ::visit_reserved_unused(visitor, self) - } - - fn visit_children_with(&self, visitor: &mut V) { - match self { - ReservedUnused { span, body } => { - { - >::visit_with(span, visitor) - }; - { - > as VisitAllWith>::visit_with(body, visitor) - }; - } - } - } -} impl VisitAllWith for RestPat { #[doc = "Calls [VisitAll`::visit_rest_pat`] with `self`."] fn visit_with(&self, visitor: &mut V) { @@ -154650,21 +153722,6 @@ impl VisitAllWith for Option { } } } -impl VisitAllWith for Option> { - #[doc = "Calls [VisitAll`::visit_opt_module_items`] with `self`. (Extra impl)"] - #[inline] - fn visit_with(&self, visitor: &mut V) { - ::visit_opt_module_items(visitor, self) - } - - #[inline] - fn visit_children_with(&self, visitor: &mut V) { - match self { - Some(inner) => as VisitAllWith>::visit_with(inner, visitor), - None => {} - } - } -} impl VisitAllWith for Option> { #[doc = "Calls [VisitAll`::visit_opt_object_lit`] with `self`. (Extra impl)"] #[inline] @@ -155159,7 +154216,9 @@ pub mod fields { } impl AccessibilityField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AccessibilityField { @@ -155177,7 +154236,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155195,7 +154254,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155217,7 +154276,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155243,7 +154302,7 @@ pub mod fields { impl AssignExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155260,7 +154319,9 @@ pub mod fields { } impl AssignOpField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AssignOpField { @@ -155300,7 +154361,7 @@ pub mod fields { impl AssignPatField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155316,7 +154377,7 @@ pub mod fields { impl AssignPatPropField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155332,7 +154393,7 @@ pub mod fields { impl AssignPropField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155347,7 +154408,9 @@ pub mod fields { } impl AssignTargetField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AssignTargetField { @@ -155358,7 +154421,9 @@ pub mod fields { } impl AssignTargetPatField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum AssignTargetPatField { @@ -155376,7 +154441,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155406,7 +154471,7 @@ pub mod fields { impl AwaitExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155420,7 +154485,7 @@ pub mod fields { impl BigIntField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155436,7 +154501,7 @@ pub mod fields { impl BinExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155453,7 +154518,9 @@ pub mod fields { } impl BinaryOpField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum BinaryOpField { @@ -155511,7 +154578,7 @@ pub mod fields { impl BindingIdentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155529,7 +154596,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155544,7 +154611,9 @@ pub mod fields { } impl BlockStmtOrExprField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum BlockStmtOrExprField { @@ -155556,7 +154625,7 @@ pub mod fields { impl BoolField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155570,7 +154639,7 @@ pub mod fields { impl BreakStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155588,7 +154657,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155607,7 +154676,9 @@ pub mod fields { } impl CalleeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum CalleeField { @@ -155621,7 +154692,7 @@ pub mod fields { impl CatchClauseField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155649,7 +154720,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155677,7 +154748,7 @@ pub mod fields { impl ClassDeclField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155693,7 +154764,7 @@ pub mod fields { impl ClassExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155706,7 +154777,9 @@ pub mod fields { } impl ClassMemberField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ClassMemberField { @@ -155732,7 +154805,7 @@ pub mod fields { impl ClassMethodField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155764,7 +154837,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155800,7 +154873,7 @@ pub mod fields { impl ComputedPropNameField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155814,7 +154887,7 @@ pub mod fields { impl CondExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155836,7 +154909,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155860,7 +154933,7 @@ pub mod fields { impl ContinueStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155874,7 +154947,7 @@ pub mod fields { impl DebuggerStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155885,7 +154958,9 @@ pub mod fields { } impl DeclField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DeclField { @@ -155909,7 +154984,7 @@ pub mod fields { impl DecoratorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155922,7 +154997,9 @@ pub mod fields { } impl DefaultDeclField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DefaultDeclField { @@ -155936,7 +155013,7 @@ pub mod fields { impl DoWhileStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155952,7 +155029,7 @@ pub mod fields { impl EmptyStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -155963,7 +155040,9 @@ pub mod fields { } impl EsVersionField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum EsVersionField { @@ -155993,7 +155072,7 @@ pub mod fields { impl ExportAllField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156011,7 +155090,7 @@ pub mod fields { impl ExportDeclField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156025,7 +155104,7 @@ pub mod fields { impl ExportDefaultDeclField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156039,7 +155118,7 @@ pub mod fields { impl ExportDefaultExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156053,7 +155132,7 @@ pub mod fields { impl ExportDefaultSpecifierField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156065,7 +155144,7 @@ pub mod fields { impl ExportNamedSpecifierField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156083,7 +155162,7 @@ pub mod fields { impl ExportNamespaceSpecifierField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156096,7 +155175,9 @@ pub mod fields { } impl ExportSpecifierField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ExportSpecifierField { @@ -156109,7 +155190,9 @@ pub mod fields { } impl ExprField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ExprField { @@ -156193,7 +155276,7 @@ pub mod fields { impl ExprOrSpreadField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156207,7 +155290,7 @@ pub mod fields { impl ExprStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156221,7 +155304,7 @@ pub mod fields { impl FnDeclField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156237,7 +155320,7 @@ pub mod fields { impl FnExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156250,7 +155333,9 @@ pub mod fields { } impl ForHeadField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ForHeadField { @@ -156264,7 +155349,7 @@ pub mod fields { impl ForInStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156282,7 +155367,7 @@ pub mod fields { impl ForOfStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156302,7 +155387,7 @@ pub mod fields { impl ForStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156330,7 +155415,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156358,7 +155443,7 @@ pub mod fields { impl GetterPropField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156376,7 +155461,7 @@ pub mod fields { impl IdentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156394,7 +155479,7 @@ pub mod fields { impl IdentNameField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156408,7 +155493,7 @@ pub mod fields { impl IfStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156426,7 +155511,7 @@ pub mod fields { impl ImportField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156444,7 +155529,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156466,7 +155551,7 @@ pub mod fields { impl ImportDefaultSpecifierField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156480,7 +155565,7 @@ pub mod fields { impl ImportNamedSpecifierField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156497,7 +155582,9 @@ pub mod fields { } impl ImportPhaseField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ImportPhaseField { @@ -156510,7 +155597,9 @@ pub mod fields { } impl ImportSpecifierField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ImportSpecifierField { @@ -156524,7 +155613,7 @@ pub mod fields { impl ImportStarAsSpecifierField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156542,7 +155631,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156556,7 +155645,7 @@ pub mod fields { impl ImportWithItemField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156570,7 +155659,7 @@ pub mod fields { impl InvalidField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156582,7 +155671,7 @@ pub mod fields { impl JSXAttrField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156597,7 +155686,9 @@ pub mod fields { } impl JSXAttrNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum JSXAttrNameField { @@ -156608,7 +155699,9 @@ pub mod fields { } impl JSXAttrOrSpreadField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum JSXAttrOrSpreadField { @@ -156619,7 +155712,9 @@ pub mod fields { } impl JSXAttrValueField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum JSXAttrValueField { @@ -156635,7 +155730,7 @@ pub mod fields { impl JSXClosingElementField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156649,7 +155744,7 @@ pub mod fields { impl JSXClosingFragmentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156665,7 +155760,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156682,7 +155777,9 @@ pub mod fields { } impl JSXElementChildField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum JSXElementChildField { @@ -156699,7 +155796,9 @@ pub mod fields { } impl JSXElementNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum JSXElementNameField { @@ -156713,7 +155812,7 @@ pub mod fields { impl JSXEmptyExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156724,7 +155823,9 @@ pub mod fields { } impl JSXExprField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum JSXExprField { @@ -156736,7 +155837,7 @@ pub mod fields { impl JSXExprContainerField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156754,7 +155855,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156772,7 +155873,7 @@ pub mod fields { impl JSXMemberExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156788,7 +155889,7 @@ pub mod fields { impl JSXNamespacedNameField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156803,7 +155904,9 @@ pub mod fields { } impl JSXObjectField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum JSXObjectField { @@ -156819,7 +155922,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156839,7 +155942,7 @@ pub mod fields { impl JSXOpeningFragmentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156851,7 +155954,7 @@ pub mod fields { impl JSXSpreadChildField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156865,7 +155968,7 @@ pub mod fields { impl JSXTextField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156880,7 +155983,9 @@ pub mod fields { } impl KeyField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum KeyField { @@ -156892,7 +155997,7 @@ pub mod fields { impl KeyValuePatPropField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156906,7 +156011,7 @@ pub mod fields { impl KeyValuePropField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156920,7 +156025,7 @@ pub mod fields { impl LabeledStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156935,7 +156040,9 @@ pub mod fields { } impl LitField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum LitField { @@ -156957,7 +156064,7 @@ pub mod fields { impl MemberExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156972,7 +156079,9 @@ pub mod fields { } impl MemberPropField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MemberPropField { @@ -156986,7 +156095,7 @@ pub mod fields { impl MetaPropExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -156999,7 +156108,9 @@ pub mod fields { } impl MetaPropKindField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MetaPropKindField { @@ -157010,7 +156121,9 @@ pub mod fields { } impl MethodKindField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum MethodKindField { @@ -157024,7 +156137,7 @@ pub mod fields { impl MethodPropField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157042,7 +156155,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157057,7 +156170,9 @@ pub mod fields { } impl ModuleDeclField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ModuleDeclField { @@ -157082,7 +156197,9 @@ pub mod fields { } impl ModuleExportNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ModuleExportNameField { @@ -157093,7 +156210,9 @@ pub mod fields { } impl ModuleItemField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ModuleItemField { @@ -157109,7 +156228,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157129,7 +156248,11 @@ pub mod fields { impl NewExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + Self::Args(idx) => { + assert_initial_index(*idx, index); + *idx = index; + } + _ => swc_visit::wrong_ast_path(), } } } @@ -157142,14 +156265,14 @@ pub mod fields { #[doc = "Represents [`NewExpr::callee`]"] Callee, #[doc = "Represents [`NewExpr::args`]"] - Args, + Args(usize), #[doc = "Represents [`NewExpr::type_args`]"] TypeArgs, } impl NullField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157161,7 +156284,7 @@ pub mod fields { impl NumberField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157181,7 +156304,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157199,7 +156322,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157216,7 +156339,9 @@ pub mod fields { } impl ObjectPatPropField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ObjectPatPropField { @@ -157234,7 +156359,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157253,7 +156378,9 @@ pub mod fields { } impl OptChainBaseField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum OptChainBaseField { @@ -157265,7 +156392,7 @@ pub mod fields { impl OptChainExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157285,7 +156412,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157300,7 +156427,9 @@ pub mod fields { } impl ParamOrTsParamPropField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ParamOrTsParamPropField { @@ -157312,7 +156441,7 @@ pub mod fields { impl ParenExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157325,7 +156454,9 @@ pub mod fields { } impl PatField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum PatField { @@ -157347,7 +156478,7 @@ pub mod fields { impl PrivateMethodField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157375,7 +156506,7 @@ pub mod fields { impl PrivateNameField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157393,7 +156524,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157426,7 +156557,9 @@ pub mod fields { } impl ProgramField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ProgramField { @@ -157437,7 +156570,9 @@ pub mod fields { } impl PropField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum PropField { @@ -157456,7 +156591,9 @@ pub mod fields { } impl PropNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum PropNameField { @@ -157473,7 +156610,9 @@ pub mod fields { } impl PropOrSpreadField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum PropOrSpreadField { @@ -157485,7 +156624,7 @@ pub mod fields { impl RegexField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157498,24 +156637,10 @@ pub mod fields { #[doc = "Represents [`Regex::flags`]"] Flags, } - impl ReservedUnusedField { - pub(crate) fn set_index(&mut self, index: usize) { - match self { - _ => {} - } - } - } - #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] - pub enum ReservedUnusedField { - #[doc = "Represents [`ReservedUnused::span`]"] - Span, - #[doc = "Represents [`ReservedUnused::body`]"] - Body, - } impl RestPatField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157533,7 +156658,7 @@ pub mod fields { impl ReturnStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157551,7 +156676,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157571,7 +156696,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157585,7 +156710,7 @@ pub mod fields { impl SetterPropField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157604,7 +156729,9 @@ pub mod fields { } impl SimpleAssignTargetField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SimpleAssignTargetField { @@ -157634,7 +156761,7 @@ pub mod fields { impl SpreadElementField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157648,7 +156775,7 @@ pub mod fields { impl StaticBlockField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157661,7 +156788,9 @@ pub mod fields { } impl StmtField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum StmtField { @@ -157707,7 +156836,7 @@ pub mod fields { impl StrField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157723,7 +156852,7 @@ pub mod fields { impl SuperField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157734,7 +156863,9 @@ pub mod fields { } impl SuperPropField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum SuperPropField { @@ -157746,7 +156877,7 @@ pub mod fields { impl SuperPropExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157766,7 +156897,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157786,7 +156917,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157802,7 +156933,7 @@ pub mod fields { impl TaggedTplField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157822,7 +156953,7 @@ pub mod fields { impl ThisExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157834,7 +156965,7 @@ pub mod fields { impl ThrowStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157856,7 +156987,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157872,7 +157003,7 @@ pub mod fields { impl TplElementField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157889,7 +157020,9 @@ pub mod fields { } impl TruePlusMinusField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TruePlusMinusField { @@ -157903,7 +157036,7 @@ pub mod fields { impl TryStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157921,7 +157054,7 @@ pub mod fields { impl TsArrayTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157935,7 +157068,7 @@ pub mod fields { impl TsAsExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157955,7 +157088,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157973,7 +157106,7 @@ pub mod fields { impl TsConditionalTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -157993,7 +157126,7 @@ pub mod fields { impl TsConstAssertionField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158011,7 +157144,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158033,7 +157166,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158052,7 +157185,9 @@ pub mod fields { } impl TsEntityNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsEntityNameField { @@ -158068,7 +157203,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158088,7 +157223,7 @@ pub mod fields { impl TsEnumMemberField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158103,7 +157238,9 @@ pub mod fields { } impl TsEnumMemberIdField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsEnumMemberIdField { @@ -158115,7 +157252,7 @@ pub mod fields { impl TsExportAssignmentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158129,7 +157266,7 @@ pub mod fields { impl TsExprWithTypeArgsField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158145,7 +157282,7 @@ pub mod fields { impl TsExternalModuleRefField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158158,7 +157295,9 @@ pub mod fields { } impl TsFnOrConstructorTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsFnOrConstructorTypeField { @@ -158169,7 +157308,9 @@ pub mod fields { } impl TsFnParamField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsFnParamField { @@ -158189,7 +157330,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158207,7 +157348,7 @@ pub mod fields { impl TsGetterSignatureField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158225,7 +157366,7 @@ pub mod fields { impl TsImportEqualsDeclField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158245,7 +157386,7 @@ pub mod fields { impl TsImportTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158267,7 +157408,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158287,7 +157428,7 @@ pub mod fields { impl TsIndexedAccessTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158305,7 +157446,7 @@ pub mod fields { impl TsInferTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158319,7 +157460,7 @@ pub mod fields { impl TsInstantiationField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158339,7 +157480,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158357,7 +157498,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158383,7 +157524,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158397,7 +157538,7 @@ pub mod fields { impl TsKeywordTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158410,7 +157551,9 @@ pub mod fields { } impl TsKeywordTypeKindField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsKeywordTypeKindField { @@ -158443,7 +157586,9 @@ pub mod fields { } impl TsLitField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsLitField { @@ -158461,7 +157606,7 @@ pub mod fields { impl TsLitTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158475,7 +157620,7 @@ pub mod fields { impl TsMappedTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158501,7 +157646,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158529,7 +157674,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158543,7 +157688,7 @@ pub mod fields { impl TsModuleDeclField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158562,7 +157707,9 @@ pub mod fields { } impl TsModuleNameField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsModuleNameField { @@ -158573,7 +157720,9 @@ pub mod fields { } impl TsModuleRefField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsModuleRefField { @@ -158584,7 +157733,9 @@ pub mod fields { } impl TsNamespaceBodyField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsNamespaceBodyField { @@ -158596,7 +157747,7 @@ pub mod fields { impl TsNamespaceDeclField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158616,7 +157767,7 @@ pub mod fields { impl TsNamespaceExportDeclField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158630,7 +157781,7 @@ pub mod fields { impl TsNonNullExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158644,7 +157795,7 @@ pub mod fields { impl TsOptionalTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158662,7 +157813,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158683,7 +157834,9 @@ pub mod fields { } impl TsParamPropParamField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsParamPropParamField { @@ -158695,7 +157848,7 @@ pub mod fields { impl TsParenthesizedTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158709,7 +157862,7 @@ pub mod fields { impl TsPropertySignatureField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158731,7 +157884,7 @@ pub mod fields { impl TsQualifiedNameField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158747,7 +157900,7 @@ pub mod fields { impl TsRestTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158761,7 +157914,7 @@ pub mod fields { impl TsSatisfiesExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158777,7 +157930,7 @@ pub mod fields { impl TsSetterSignatureField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158795,7 +157948,7 @@ pub mod fields { impl TsThisTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158806,7 +157959,9 @@ pub mod fields { } impl TsThisTypeOrIdentField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsThisTypeOrIdentField { @@ -158826,7 +157981,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158842,7 +157997,7 @@ pub mod fields { impl TsTupleElementField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158862,7 +158017,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158875,7 +158030,9 @@ pub mod fields { } impl TsTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsTypeField { @@ -158923,7 +158080,7 @@ pub mod fields { impl TsTypeAliasDeclField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158943,7 +158100,7 @@ pub mod fields { impl TsTypeAnnField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158957,7 +158114,7 @@ pub mod fields { impl TsTypeAssertionField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -158972,7 +158129,9 @@ pub mod fields { } impl TsTypeElementField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsTypeElementField { @@ -158998,7 +158157,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159012,7 +158171,7 @@ pub mod fields { impl TsTypeOperatorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159027,7 +158186,9 @@ pub mod fields { } impl TsTypeOperatorOpField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsTypeOperatorOpField { @@ -159041,7 +158202,7 @@ pub mod fields { impl TsTypeParamField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159069,7 +158230,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159087,7 +158248,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159101,7 +158262,7 @@ pub mod fields { impl TsTypePredicateField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159119,7 +158280,7 @@ pub mod fields { impl TsTypeQueryField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159134,7 +158295,9 @@ pub mod fields { } impl TsTypeQueryExprField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsTypeQueryExprField { @@ -159146,7 +158309,7 @@ pub mod fields { impl TsTypeRefField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159161,7 +158324,9 @@ pub mod fields { } impl TsUnionOrIntersectionTypeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TsUnionOrIntersectionTypeField { @@ -159177,7 +158342,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159191,7 +158356,7 @@ pub mod fields { impl UnaryExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159206,7 +158371,9 @@ pub mod fields { } impl UnaryOpField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum UnaryOpField { @@ -159228,7 +158395,7 @@ pub mod fields { impl UpdateExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159245,7 +158412,9 @@ pub mod fields { } impl UpdateOpField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum UpdateOpField { @@ -159261,7 +158430,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159281,7 +158450,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159300,7 +158469,9 @@ pub mod fields { } impl VarDeclKindField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum VarDeclKindField { @@ -159313,7 +158484,9 @@ pub mod fields { } impl VarDeclOrExprField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum VarDeclOrExprField { @@ -159325,7 +158498,7 @@ pub mod fields { impl VarDeclaratorField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159343,7 +158516,7 @@ pub mod fields { impl WhileStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159359,7 +158532,7 @@ pub mod fields { impl WithStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159375,7 +158548,7 @@ pub mod fields { impl YieldExprField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -159521,7 +158694,6 @@ pub mod fields { PropName(PropNameField), PropOrSpread(PropOrSpreadField), Regex(RegexField), - ReservedUnused(ReservedUnusedField), RestPat(RestPatField), ReturnStmt(ReturnStmtField), Script(ScriptField), @@ -159763,7 +158935,6 @@ pub mod fields { Self::PropName(v) => v.set_index(index), Self::PropOrSpread(v) => v.set_index(index), Self::Regex(v) => v.set_index(index), - Self::ReservedUnused(v) => v.set_index(index), Self::RestPat(v) => v.set_index(index), Self::ReturnStmt(v) => v.set_index(index), Self::Script(v) => v.set_index(index), @@ -160009,7 +159180,6 @@ pub mod fields { PropName(&'ast PropName, PropNameField), PropOrSpread(&'ast PropOrSpread, PropOrSpreadField), Regex(&'ast Regex, RegexField), - ReservedUnused(&'ast ReservedUnused, ReservedUnusedField), RestPat(&'ast RestPat, RestPatField), ReturnStmt(&'ast ReturnStmt, ReturnStmtField), Script(&'ast Script, ScriptField), @@ -160266,7 +159436,6 @@ pub mod fields { Self::PropName(_, __field_kind) => __field_kind.set_index(index), Self::PropOrSpread(_, __field_kind) => __field_kind.set_index(index), Self::Regex(_, __field_kind) => __field_kind.set_index(index), - Self::ReservedUnused(_, __field_kind) => __field_kind.set_index(index), Self::RestPat(_, __field_kind) => __field_kind.set_index(index), Self::ReturnStmt(_, __field_kind) => __field_kind.set_index(index), Self::Script(_, __field_kind) => __field_kind.set_index(index), @@ -160564,9 +159733,6 @@ pub mod fields { Self::PropName(_, __field_kind) => AstParentKind::PropName(*__field_kind), Self::PropOrSpread(_, __field_kind) => AstParentKind::PropOrSpread(*__field_kind), Self::Regex(_, __field_kind) => AstParentKind::Regex(*__field_kind), - Self::ReservedUnused(_, __field_kind) => { - AstParentKind::ReservedUnused(*__field_kind) - } Self::RestPat(_, __field_kind) => AstParentKind::RestPat(*__field_kind), Self::ReturnStmt(_, __field_kind) => AstParentKind::ReturnStmt(*__field_kind), Self::Script(_, __field_kind) => AstParentKind::Script(*__field_kind), diff --git a/crates/swc_ecma_visit/src/lib.rs b/crates/swc_ecma_visit/src/lib.rs index 710d6d581490..c57f156c6747 100644 --- a/crates/swc_ecma_visit/src/lib.rs +++ b/crates/swc_ecma_visit/src/lib.rs @@ -317,8 +317,6 @@ where method!(fold_program, Program); - method!(fold_reserved_unused, ReservedUnused); - #[inline(always)] fn fold_module(&mut self, mut n: Module) -> Module { #[cfg(all(debug_assertions, feature = "debug"))] diff --git a/crates/swc_html_visit/src/generated.rs b/crates/swc_html_visit/src/generated.rs index 99e57a70f36c..bb355b2657ba 100644 --- a/crates/swc_html_visit/src/generated.rs +++ b/crates/swc_html_visit/src/generated.rs @@ -12325,7 +12325,7 @@ pub mod fields { impl AttributeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12349,7 +12349,7 @@ pub mod fields { impl AttributeTokenField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12368,7 +12368,9 @@ pub mod fields { } impl ChildField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ChildField { @@ -12384,7 +12386,7 @@ pub mod fields { impl CommentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12404,7 +12406,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12424,7 +12426,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12437,7 +12439,9 @@ pub mod fields { } impl DocumentModeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DocumentModeField { @@ -12451,7 +12455,7 @@ pub mod fields { impl DocumentTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12479,7 +12483,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12502,7 +12506,9 @@ pub mod fields { } impl NamespaceField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum NamespaceField { @@ -12521,7 +12527,9 @@ pub mod fields { } impl RawField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum RawField { @@ -12533,7 +12541,7 @@ pub mod fields { impl TextField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12548,7 +12556,9 @@ pub mod fields { } impl TokenField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TokenField { @@ -12568,7 +12578,7 @@ pub mod fields { impl TokenAndSpanField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } diff --git a/crates/swc_visit/Cargo.toml b/crates/swc_visit/Cargo.toml index a63f597c5882..7ac2d35bc4c9 100644 --- a/crates/swc_visit/Cargo.toml +++ b/crates/swc_visit/Cargo.toml @@ -14,4 +14,5 @@ bench = false path = [] [dependencies] -either = { workspace = true } +either = { workspace = true } +new_debug_unreachable = { workspace = true } diff --git a/crates/swc_visit/src/lib.rs b/crates/swc_visit/src/lib.rs index 9d3ddd8d58bf..b5b18401f803 100644 --- a/crates/swc_visit/src/lib.rs +++ b/crates/swc_visit/src/lib.rs @@ -541,3 +541,11 @@ where .set_index(usize::MAX); } } + +/// NOT A PUBLIC API +#[doc(hidden)] +pub fn wrong_ast_path() { + unsafe { + debug_unreachable::debug_unreachable!("Wrong ast path"); + } +} diff --git a/crates/swc_xml_visit/src/generated.rs b/crates/swc_xml_visit/src/generated.rs index 3cb5440bfb61..b5a6395da32f 100644 --- a/crates/swc_xml_visit/src/generated.rs +++ b/crates/swc_xml_visit/src/generated.rs @@ -11797,7 +11797,7 @@ pub mod fields { impl AttributeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -11821,7 +11821,7 @@ pub mod fields { impl AttributeTokenField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -11841,7 +11841,7 @@ pub mod fields { impl CdataSectionField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -11856,7 +11856,9 @@ pub mod fields { } impl ChildField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ChildField { @@ -11876,7 +11878,7 @@ pub mod fields { impl CommentField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -11896,7 +11898,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -11909,7 +11911,9 @@ pub mod fields { } impl DocumentModeField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DocumentModeField { @@ -11923,7 +11927,7 @@ pub mod fields { impl DocumentTypeField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -11951,7 +11955,7 @@ pub mod fields { assert_initial_index(*idx, index); *idx = index; } - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -11968,7 +11972,9 @@ pub mod fields { } impl NamespaceField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum NamespaceField { @@ -11988,7 +11994,7 @@ pub mod fields { impl ProcessingInstructionField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12004,7 +12010,7 @@ pub mod fields { impl TextField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } @@ -12019,7 +12025,9 @@ pub mod fields { } impl TokenField { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TokenField { @@ -12045,7 +12053,7 @@ pub mod fields { impl TokenAndSpanField { pub(crate) fn set_index(&mut self, index: usize) { match self { - _ => {} + _ => swc_visit::wrong_ast_path(), } } } diff --git a/packages/core/e2e/fixtures/plugin_transform_schema_vtest/src/lib.rs b/packages/core/e2e/fixtures/plugin_transform_schema_vtest/src/lib.rs index 8d583425aa61..1e0a9df53d94 100644 --- a/packages/core/e2e/fixtures/plugin_transform_schema_vtest/src/lib.rs +++ b/packages/core/e2e/fixtures/plugin_transform_schema_vtest/src/lib.rs @@ -31,11 +31,6 @@ pub fn process(program: Program, _metadata: TransformPluginProgramMetadata) -> P // Ensure this plugin uses vtest AST struct schema, by compile-time validating // it does have new enum for the testing purpose. match &program { - /* TODO: reenable once experimental_metadata breaking change is merged - Program::ReservedUnused(_reserved_unused) => { - println!("{:#?}", _reserved_unused); - panic!("ReservedUnused is not supported"); - }*/ Program::Script(..) => {} Program::Module(..) => {} } diff --git a/scripts/bisect/list-commits.sh b/scripts/bisect/list-commits.sh new file mode 100755 index 000000000000..bdfb46af6856 --- /dev/null +++ b/scripts/bisect/list-commits.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -eu + +commits=$(git rev-list --ancestry-path $1...$2) + +# Filter out commits made by `swc-bot` +filtered_commits=$(echo "$commits" | while read -r commit; do + author=$(git show -s --format='%an' "$commit") + if [[ "$author" != "SWC Bot" ]]; then + echo "$commit" + fi +done) + +# Print the filtered commits in `$hash: $title` format +echo "$filtered_commits" | while read -r commit; do + title=$(git show -s --format='%s' "$commit") + echo "$commit: $title" +done diff --git a/tools/generate-code/src/generators/visitor.rs b/tools/generate-code/src/generators/visitor.rs index e0315b186300..750790ef2047 100644 --- a/tools/generate-code/src/generators/visitor.rs +++ b/tools/generate-code/src/generators/visitor.rs @@ -805,7 +805,7 @@ impl Generator { { let mut kind = quote!(self::fields::#fields_enum_name::#field_variant); - if extract_vec(ty).is_some() { + if extract_vec(extract_generic("Option", ty).unwrap_or(ty)).is_some() { kind = quote!(#kind(usize::MAX)); } @@ -1254,7 +1254,7 @@ fn field_variant(type_name: &Ident, field: &Field) -> Option<(TokenStream, Optio let variant_name = Ident::new(&field_name.to_string().to_pascal_case(), Span::call_site()); let variant_doc = doc(&format!("Represents [`{type_name}::{field_name}`]")); - if extract_vec(&field.ty).is_some() { + if extract_vec(extract_generic("Option", &field.ty).unwrap_or(&field.ty)).is_some() { let v = quote!( #variant_doc #variant_name(usize) @@ -1386,7 +1386,9 @@ fn define_fields(crate_name: &Ident, node_types: &[&Item]) -> Vec { defs.push(parse_quote!( impl #fields_enum_name { #[inline(always)] - pub(crate) fn set_index(&mut self, _: usize) {} + pub(crate) fn set_index(&mut self, _: usize) { + swc_visit::wrong_ast_path(); + } } )); } @@ -1418,7 +1420,9 @@ fn define_fields(crate_name: &Ident, node_types: &[&Item]) -> Vec { match self { #(#set_index_arms)* - _ => {} + _ => { + swc_visit::wrong_ast_path() + } } } }