diff --git a/crates/oxc_ast/src/ast/jsx.rs b/crates/oxc_ast/src/ast/jsx.rs index e4e82d8bc2e4c7..2fe377bfb37adf 100644 --- a/crates/oxc_ast/src/ast/jsx.rs +++ b/crates/oxc_ast/src/ast/jsx.rs @@ -165,12 +165,14 @@ pub struct JSXClosingFragment { #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] #[serde(untagged)] pub enum JSXElementName<'a> { - /// `` + /// `
` Identifier(Box<'a, JSXIdentifier<'a>>) = 0, + /// `` + IdentifierReference(Box<'a, IdentifierReference<'a>>) = 1, /// `` - NamespacedName(Box<'a, JSXNamespacedName<'a>>) = 1, + NamespacedName(Box<'a, JSXNamespacedName<'a>>) = 2, /// `` - MemberExpression(Box<'a, JSXMemberExpression<'a>>) = 2, + MemberExpression(Box<'a, JSXMemberExpression<'a>>) = 3, } /// JSX Namespaced Name @@ -230,7 +232,8 @@ pub struct JSXMemberExpression<'a> { #[serde(untagged)] pub enum JSXMemberExpressionObject<'a> { Identifier(Box<'a, JSXIdentifier<'a>>) = 0, - MemberExpression(Box<'a, JSXMemberExpression<'a>>) = 1, + IdentifierReference(Box<'a, IdentifierReference<'a>>) = 1, + MemberExpression(Box<'a, JSXMemberExpression<'a>>) = 2, } /// JSX Expression Container diff --git a/crates/oxc_ast/src/ast_impl/js.rs b/crates/oxc_ast/src/ast_impl/js.rs index 3f8054d5fca52f..09107734be003c 100644 --- a/crates/oxc_ast/src/ast_impl/js.rs +++ b/crates/oxc_ast/src/ast_impl/js.rs @@ -351,6 +351,12 @@ impl<'a> fmt::Display for IdentifierReference<'a> { } } +impl<'a> From> for IdentifierReference<'a> { + fn from(value: JSXIdentifier<'a>) -> Self { + IdentifierReference { span: value.span, name: value.name, reference_id: Cell::default() } + } +} + impl<'a> Hash for BindingIdentifier<'a> { fn hash(&self, state: &mut H) { self.name.hash(state); @@ -763,6 +769,7 @@ impl<'a> Declaration<'a> { Self::VariableDeclaration(decl) => decl.is_typescript_syntax(), Self::FunctionDeclaration(func) => func.is_typescript_syntax(), Self::ClassDeclaration(class) => class.is_typescript_syntax(), + Self::UsingDeclaration(_) => false, _ => true, } } @@ -788,7 +795,7 @@ impl<'a> Declaration<'a> { Declaration::TSTypeAliasDeclaration(decl) => decl.declare, Declaration::TSModuleDeclaration(decl) => decl.declare, Declaration::TSInterfaceDeclaration(decl) => decl.declare, - Declaration::TSImportEqualsDeclaration(_) => false, + _ => false, } } } @@ -816,17 +823,11 @@ impl VariableDeclarationKind { matches!(self, Self::Const | Self::Let) } - pub fn is_await(&self) -> bool { - matches!(self, Self::AwaitUsing) - } - pub fn as_str(&self) -> &'static str { match self { Self::Var => "var", Self::Const => "const", Self::Let => "let", - Self::Using => "using", - Self::AwaitUsing => "await using", } } } diff --git a/crates/oxc_ast/src/ast_impl/jsx.rs b/crates/oxc_ast/src/ast_impl/jsx.rs index 3ced6b276f7b26..f5208840e7f0be 100644 --- a/crates/oxc_ast/src/ast_impl/jsx.rs +++ b/crates/oxc_ast/src/ast_impl/jsx.rs @@ -11,6 +11,7 @@ impl<'a> JSXIdentifier<'a> { Self { span, name } } } + impl<'a> fmt::Display for JSXIdentifier<'a> { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -18,6 +19,13 @@ impl<'a> fmt::Display for JSXIdentifier<'a> { } } +impl<'a> JSXIdentifier<'a> { + /// Determines whether the given current identifier is a reference + pub fn is_reference(&self) -> bool { + self.name.chars().next().map_or(false, char::is_uppercase) + } +} + impl<'a> fmt::Display for JSXNamespacedName<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}:{}", self.namespace.name, self.property.name) @@ -25,22 +33,26 @@ impl<'a> fmt::Display for JSXNamespacedName<'a> { } impl<'a> JSXElementName<'a> { - pub fn as_identifier(&self) -> Option<&JSXIdentifier<'a>> { + pub fn get_identifier_name(&self) -> Option> { match self { - Self::Identifier(id) => Some(id.as_ref()), + Self::Identifier(id) => Some(id.as_ref().name.clone()), + Self::IdentifierReference(id) => Some(id.as_ref().name.clone()), _ => None, } } } impl<'a> JSXMemberExpression<'a> { - pub fn get_object_identifier(&self) -> &JSXIdentifier { + pub fn get_object_identifier(&self) -> &JSXIdentifier<'a> { let mut member_expr = self; loop { match &member_expr.object { JSXMemberExpressionObject::Identifier(ident) => { break ident; } + JSXMemberExpressionObject::IdentifierReference(_) => { + unreachable!() + } JSXMemberExpressionObject::MemberExpression(expr) => { member_expr = expr; } @@ -55,6 +67,9 @@ impl<'a> JSXMemberExpression<'a> { JSXMemberExpressionObject::Identifier(ident) => { break &mut *ident; } + JSXMemberExpressionObject::IdentifierReference(_) => { + unreachable!() + } JSXMemberExpressionObject::MemberExpression(expr) => { member_expr = expr; } @@ -73,6 +88,7 @@ impl<'a> fmt::Display for JSXMemberExpressionObject<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Identifier(id) => id.fmt(f), + Self::IdentifierReference(id) => id.fmt(f), Self::MemberExpression(expr) => expr.fmt(f), } } @@ -82,6 +98,7 @@ impl<'a> fmt::Display for JSXElementName<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Identifier(ident) => ident.fmt(f), + Self::IdentifierReference(ident) => ident.fmt(f), Self::NamespacedName(namespaced) => namespaced.fmt(f), Self::MemberExpression(member_expr) => member_expr.fmt(f), } diff --git a/crates/oxc_ast/src/generated/ast_builder.rs b/crates/oxc_ast/src/generated/ast_builder.rs index 066ac8b062b865..b119612ea0cf24 100644 --- a/crates/oxc_ast/src/generated/ast_builder.rs +++ b/crates/oxc_ast/src/generated/ast_builder.rs @@ -12806,6 +12806,30 @@ impl<'a> AstBuilder<'a> { JSXElementName::Identifier(inner.into_in(self.allocator)) } + /// Build a [`JSXElementName::IdentifierReference`] + /// + /// This node contains a [`IdentifierReference`] that will be stored in the memory arena. + /// + /// ## Parameters + /// - span: The [`Span`] covering this node + /// - name: The name of the identifier being referenced. + #[inline] + pub fn jsx_element_name_identifier_reference(self, span: Span, name: A) -> JSXElementName<'a> + where + A: IntoIn<'a, Atom<'a>>, + { + JSXElementName::IdentifierReference(self.alloc(self.identifier_reference(span, name))) + } + + /// Convert a [`IdentifierReference`] into a [`JSXElementName::IdentifierReference`] + #[inline] + pub fn jsx_element_name_from_identifier_reference(self, inner: T) -> JSXElementName<'a> + where + T: IntoIn<'a, Box<'a, IdentifierReference<'a>>>, + { + JSXElementName::IdentifierReference(inner.into_in(self.allocator)) + } + /// Build a [`JSXElementName::NamespacedName`] /// /// This node contains a [`JSXNamespacedName`] that will be stored in the memory arena. @@ -12967,6 +12991,39 @@ impl<'a> AstBuilder<'a> { JSXMemberExpressionObject::Identifier(inner.into_in(self.allocator)) } + /// Build a [`JSXMemberExpressionObject::IdentifierReference`] + /// + /// This node contains a [`IdentifierReference`] that will be stored in the memory arena. + /// + /// ## Parameters + /// - span: The [`Span`] covering this node + /// - name: The name of the identifier being referenced. + #[inline] + pub fn jsx_member_expression_object_identifier_reference( + self, + span: Span, + name: A, + ) -> JSXMemberExpressionObject<'a> + where + A: IntoIn<'a, Atom<'a>>, + { + JSXMemberExpressionObject::IdentifierReference( + self.alloc(self.identifier_reference(span, name)), + ) + } + + /// Convert a [`IdentifierReference`] into a [`JSXMemberExpressionObject::IdentifierReference`] + #[inline] + pub fn jsx_member_expression_object_from_identifier_reference( + self, + inner: T, + ) -> JSXMemberExpressionObject<'a> + where + T: IntoIn<'a, Box<'a, IdentifierReference<'a>>>, + { + JSXMemberExpressionObject::IdentifierReference(inner.into_in(self.allocator)) + } + /// Build a [`JSXMemberExpressionObject::MemberExpression`] /// /// This node contains a [`JSXMemberExpression`] that will be stored in the memory arena. diff --git a/crates/oxc_ast/src/generated/derive_clone_in.rs b/crates/oxc_ast/src/generated/derive_clone_in.rs index 8b330c63d71816..707336ceb5bd17 100644 --- a/crates/oxc_ast/src/generated/derive_clone_in.rs +++ b/crates/oxc_ast/src/generated/derive_clone_in.rs @@ -3482,6 +3482,9 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for JSXElementName<'old_alloc> fn clone_in(&self, allocator: &'new_alloc Allocator) -> Self::Cloned { match self { Self::Identifier(it) => JSXElementName::Identifier(it.clone_in(allocator)), + Self::IdentifierReference(it) => { + JSXElementName::IdentifierReference(it.clone_in(allocator)) + } Self::NamespacedName(it) => JSXElementName::NamespacedName(it.clone_in(allocator)), Self::MemberExpression(it) => JSXElementName::MemberExpression(it.clone_in(allocator)), } @@ -3515,6 +3518,9 @@ impl<'old_alloc, 'new_alloc> CloneIn<'new_alloc> for JSXMemberExpressionObject<' fn clone_in(&self, allocator: &'new_alloc Allocator) -> Self::Cloned { match self { Self::Identifier(it) => JSXMemberExpressionObject::Identifier(it.clone_in(allocator)), + Self::IdentifierReference(it) => { + JSXMemberExpressionObject::IdentifierReference(it.clone_in(allocator)) + } Self::MemberExpression(it) => { JSXMemberExpressionObject::MemberExpression(it.clone_in(allocator)) } diff --git a/crates/oxc_ast/src/generated/derive_get_span.rs b/crates/oxc_ast/src/generated/derive_get_span.rs index 7164a11ce3684e..1dd97ae38953e7 100644 --- a/crates/oxc_ast/src/generated/derive_get_span.rs +++ b/crates/oxc_ast/src/generated/derive_get_span.rs @@ -2030,6 +2030,7 @@ impl<'a> GetSpan for JSXElementName<'a> { fn span(&self) -> Span { match self { Self::Identifier(it) => it.span(), + Self::IdentifierReference(it) => it.span(), Self::NamespacedName(it) => it.span(), Self::MemberExpression(it) => it.span(), } @@ -2054,6 +2055,7 @@ impl<'a> GetSpan for JSXMemberExpressionObject<'a> { fn span(&self) -> Span { match self { Self::Identifier(it) => it.span(), + Self::IdentifierReference(it) => it.span(), Self::MemberExpression(it) => it.span(), } } diff --git a/crates/oxc_ast/src/generated/derive_get_span_mut.rs b/crates/oxc_ast/src/generated/derive_get_span_mut.rs index bd14972eb73c3f..c1f69ac7fcf967 100644 --- a/crates/oxc_ast/src/generated/derive_get_span_mut.rs +++ b/crates/oxc_ast/src/generated/derive_get_span_mut.rs @@ -2030,6 +2030,7 @@ impl<'a> GetSpanMut for JSXElementName<'a> { fn span_mut(&mut self) -> &mut Span { match self { Self::Identifier(it) => it.span_mut(), + Self::IdentifierReference(it) => it.span_mut(), Self::NamespacedName(it) => it.span_mut(), Self::MemberExpression(it) => it.span_mut(), } @@ -2054,6 +2055,7 @@ impl<'a> GetSpanMut for JSXMemberExpressionObject<'a> { fn span_mut(&mut self) -> &mut Span { match self { Self::Identifier(it) => it.span_mut(), + Self::IdentifierReference(it) => it.span_mut(), Self::MemberExpression(it) => it.span_mut(), } } diff --git a/crates/oxc_ast/src/generated/visit.rs b/crates/oxc_ast/src/generated/visit.rs index 5b0123fc812f50..318c645d9d26be 100644 --- a/crates/oxc_ast/src/generated/visit.rs +++ b/crates/oxc_ast/src/generated/visit.rs @@ -3298,6 +3298,7 @@ pub mod walk { visitor.enter_node(kind); match it { JSXElementName::Identifier(it) => visitor.visit_jsx_identifier(it), + JSXElementName::IdentifierReference(it) => visitor.visit_identifier_reference(it), JSXElementName::NamespacedName(it) => visitor.visit_jsx_namespaced_name(it), JSXElementName::MemberExpression(it) => visitor.visit_jsx_member_expression(it), } @@ -3341,6 +3342,9 @@ pub mod walk { visitor.enter_node(kind); match it { JSXMemberExpressionObject::Identifier(it) => visitor.visit_jsx_identifier(it), + JSXMemberExpressionObject::IdentifierReference(it) => { + visitor.visit_identifier_reference(it) + } JSXMemberExpressionObject::MemberExpression(it) => { visitor.visit_jsx_member_expression(it) } diff --git a/crates/oxc_ast/src/generated/visit_mut.rs b/crates/oxc_ast/src/generated/visit_mut.rs index d37a81659efa24..b91d97796fcd3a 100644 --- a/crates/oxc_ast/src/generated/visit_mut.rs +++ b/crates/oxc_ast/src/generated/visit_mut.rs @@ -3462,6 +3462,7 @@ pub mod walk_mut { visitor.enter_node(kind); match it { JSXElementName::Identifier(it) => visitor.visit_jsx_identifier(it), + JSXElementName::IdentifierReference(it) => visitor.visit_identifier_reference(it), JSXElementName::NamespacedName(it) => visitor.visit_jsx_namespaced_name(it), JSXElementName::MemberExpression(it) => visitor.visit_jsx_member_expression(it), } @@ -3508,6 +3509,9 @@ pub mod walk_mut { visitor.enter_node(kind); match it { JSXMemberExpressionObject::Identifier(it) => visitor.visit_jsx_identifier(it), + JSXMemberExpressionObject::IdentifierReference(it) => { + visitor.visit_identifier_reference(it) + } JSXMemberExpressionObject::MemberExpression(it) => { visitor.visit_jsx_member_expression(it) } diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 7d5aee94b09d6e..8a7d673d95cd04 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -2244,6 +2244,7 @@ impl<'a> Gen for JSXMemberExpressionObject<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { match self { Self::Identifier(ident) => ident.gen(p, ctx), + Self::IdentifierReference(ident) => ident.gen(p, ctx), Self::MemberExpression(member_expr) => member_expr.gen(p, ctx), } } @@ -2261,6 +2262,7 @@ impl<'a> Gen for JSXElementName<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { match self { Self::Identifier(identifier) => identifier.gen(p, ctx), + Self::IdentifierReference(identifier) => identifier.gen(p, ctx), Self::NamespacedName(namespaced_name) => namespaced_name.gen(p, ctx), Self::MemberExpression(member_expr) => member_expr.gen(p, ctx), } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs b/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs index 27747423f170b1..eb6936507db3e1 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs @@ -1,12 +1,12 @@ use std::ops::Deref; use oxc_ast::{ - ast::{JSXAttributeItem, JSXAttributeValue, JSXElementName, JSXExpression}, + ast::{JSXAttributeItem, JSXAttributeValue, JSXExpression}, AstKind, }; use oxc_diagnostics::OxcDiagnostic; use oxc_macros::declare_oxc_lint; -use oxc_span::{CompactStr, Span}; +use oxc_span::{CompactStr, GetSpan, Span}; use serde_json::Value; use crate::{ @@ -129,15 +129,13 @@ impl Rule for AnchorIsValid { fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) { if let AstKind::JSXElement(jsx_el) = node.kind() { - let JSXElementName::Identifier(ident) = &jsx_el.opening_element.name else { - return; - }; let Some(name) = &get_element_type(ctx, &jsx_el.opening_element) else { return; }; if name != "a" { return; }; + let span = jsx_el.opening_element.name.span(); if let Option::Some(href_attr) = has_jsx_prop_ignore_case(&jsx_el.opening_element, "href") { @@ -147,17 +145,17 @@ impl Rule for AnchorIsValid { // Check if the 'a' element has a correct href attribute let Some(value) = attr.value.as_ref() else { - ctx.diagnostic(incorrect_href(ident.span)); + ctx.diagnostic(incorrect_href(span)); return; }; let is_empty = self.check_value_is_empty(value); if is_empty { if has_jsx_prop_ignore_case(&jsx_el.opening_element, "onclick").is_some() { - ctx.diagnostic(cant_be_anchor(ident.span)); + ctx.diagnostic(cant_be_anchor(span)); return; } - ctx.diagnostic(incorrect_href(ident.span)); + ctx.diagnostic(incorrect_href(span)); return; } return; @@ -170,7 +168,7 @@ impl Rule for AnchorIsValid { if has_spread_attr { return; } - ctx.diagnostic(missing_href_attribute(ident.span)); + ctx.diagnostic(missing_href_attribute(span)); } } } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs index f4e7d011973ebe..15ef149c09c026 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs @@ -82,14 +82,22 @@ impl Rule for AriaActivedescendantHasTabindex { return; } - let JSXElementName::Identifier(identifier) = &jsx_opening_el.name else { - return; - }; + match &jsx_opening_el.name { + JSXElementName::Identifier(identifier) => { + ctx.diagnostic(aria_activedescendant_has_tabindex_diagnostic( + identifier.span, + identifier.name.as_str(), + )); + } - ctx.diagnostic(aria_activedescendant_has_tabindex_diagnostic( - identifier.span, - identifier.name.as_str(), - )); + JSXElementName::IdentifierReference(identifier_reference) => { + ctx.diagnostic(aria_activedescendant_has_tabindex_diagnostic( + identifier_reference.span, + identifier_reference.name.as_str(), + )); + } + _ => {} + } } } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs b/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs index fb936b0830f82c..f58a06059e53d2 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs @@ -1,10 +1,10 @@ use oxc_ast::{ - ast::{JSXAttributeItem, JSXAttributeValue, JSXElementName, JSXExpression}, + ast::{JSXAttributeItem, JSXAttributeValue, JSXExpression}, AstKind, }; use oxc_diagnostics::OxcDiagnostic; use oxc_macros::declare_oxc_lint; -use oxc_span::Span; +use oxc_span::{GetSpan, Span}; use crate::{ context::LintContext, @@ -66,12 +66,8 @@ impl Rule for HtmlHasLang { return; } - let JSXElementName::Identifier(identifier) = &jsx_el.name else { - return; - }; - has_jsx_prop_ignore_case(jsx_el, "lang").map_or_else( - || ctx.diagnostic(missing_lang_prop(identifier.span)), + || ctx.diagnostic(missing_lang_prop(jsx_el.name.span())), |lang_prop| { if !is_valid_lang_prop(lang_prop) { ctx.diagnostic(missing_lang_value(jsx_el.span)); diff --git a/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs b/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs index f4cf98b97656d5..7b1b2d652cfc8d 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs @@ -1,10 +1,10 @@ use oxc_ast::{ - ast::{JSXAttributeValue, JSXElementName, JSXExpression}, + ast::{JSXAttributeValue, JSXExpression}, AstKind, }; use oxc_diagnostics::OxcDiagnostic; use oxc_macros::declare_oxc_lint; -use oxc_span::Span; +use oxc_span::{GetSpan, Span}; use crate::{ context::LintContext, @@ -63,10 +63,6 @@ impl Rule for IframeHasTitle { return; }; - let JSXElementName::Identifier(iden) = &jsx_el.name else { - return; - }; - let Some(name) = get_element_type(ctx, jsx_el) else { return; }; @@ -74,9 +70,8 @@ impl Rule for IframeHasTitle { if name != "iframe" { return; } - let Some(alt_prop) = has_jsx_prop_ignore_case(jsx_el, "title") else { - ctx.diagnostic(iframe_has_title_diagnostic(iden.span)); + ctx.diagnostic(iframe_has_title_diagnostic(jsx_el.name.span())); return; }; @@ -112,7 +107,7 @@ impl Rule for IframeHasTitle { _ => {} } - ctx.diagnostic(iframe_has_title_diagnostic(iden.span)); + ctx.diagnostic(iframe_has_title_diagnostic(jsx_el.name.span())); } } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/lang.rs b/crates/oxc_linter/src/rules/jsx_a11y/lang.rs index a4351d10778a40..b9bd3406c89c3e 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/lang.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/lang.rs @@ -1,11 +1,11 @@ use language_tags::LanguageTag; use oxc_ast::{ - ast::{JSXAttributeItem, JSXAttributeValue, JSXElementName}, + ast::{JSXAttributeItem, JSXAttributeValue}, AstKind, }; use oxc_diagnostics::OxcDiagnostic; use oxc_macros::declare_oxc_lint; -use oxc_span::Span; +use oxc_span::{GetSpan, Span}; use crate::{ context::LintContext, @@ -71,12 +71,8 @@ impl Rule for Lang { return; } - let JSXElementName::Identifier(identifier) = &jsx_el.name else { - return; - }; - has_jsx_prop_ignore_case(jsx_el, "lang").map_or_else( - || ctx.diagnostic(lang_diagnostic(identifier.span)), + || ctx.diagnostic(lang_diagnostic(jsx_el.name.span())), |lang_prop| { if !is_valid_lang_prop(lang_prop) { if let JSXAttributeItem::Attribute(attr) = lang_prop { diff --git a/crates/oxc_linter/src/rules/jsx_a11y/no_distracting_elements.rs b/crates/oxc_linter/src/rules/jsx_a11y/no_distracting_elements.rs index cb3bb6cade8ca8..464b5aca1bcf91 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/no_distracting_elements.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/no_distracting_elements.rs @@ -1,8 +1,8 @@ -use oxc_ast::{ast::JSXElementName, AstKind}; +use oxc_ast::AstKind; use oxc_diagnostics::OxcDiagnostic; use oxc_macros::declare_oxc_lint; use oxc_semantic::AstNode; -use oxc_span::Span; +use oxc_span::{GetSpan, Span}; use crate::{rule::Rule, utils::get_element_type, LintContext}; @@ -55,15 +55,12 @@ impl Rule for NoDistractingElements { let AstKind::JSXOpeningElement(jsx_el) = node.kind() else { return; }; - let JSXElementName::Identifier(iden) = &jsx_el.name else { - return; - }; let Some(element_type) = get_element_type(ctx, jsx_el) else { return; }; if let "marquee" | "blink" = element_type.as_ref() { - ctx.diagnostic(no_distracting_elements_diagnostic(iden.span)); + ctx.diagnostic(no_distracting_elements_diagnostic(jsx_el.name.span())); } } } diff --git a/crates/oxc_linter/src/rules/nextjs/no_before_interactive_script_outside_document.rs b/crates/oxc_linter/src/rules/nextjs/no_before_interactive_script_outside_document.rs index 74ee6d38cd04d7..180f9920a0a53a 100644 --- a/crates/oxc_linter/src/rules/nextjs/no_before_interactive_script_outside_document.rs +++ b/crates/oxc_linter/src/rules/nextjs/no_before_interactive_script_outside_document.rs @@ -1,5 +1,5 @@ use oxc_ast::{ - ast::{JSXAttributeItem, JSXAttributeName, JSXAttributeValue, JSXElementName}, + ast::{JSXAttributeItem, JSXAttributeName, JSXAttributeValue}, AstKind, }; use oxc_diagnostics::OxcDiagnostic; @@ -45,9 +45,7 @@ impl Rule for NoBeforeInteractiveScriptOutsideDocument { if is_in_app_dir(file_path) { return; } - let tag_name = if let JSXElementName::Identifier(ident) = &jsx_el.name { - &ident.name - } else { + let Some(tag_name) = jsx_el.name.get_identifier_name() else { return; }; if jsx_el.attributes.len() == 0 { diff --git a/crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs b/crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs index c992bbe3a24612..95d9f4d2e39a33 100644 --- a/crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs +++ b/crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs @@ -80,7 +80,7 @@ impl Rule for NoScriptComponentInHead { for child in &jsx_element.children { if let JSXChild::Element(child_element) = child { - if let JSXElementName::Identifier(child_element_name) = + if let JSXElementName::IdentifierReference(child_element_name) = &child_element.opening_element.name { if child_element_name.name.as_str() == "Script" { @@ -102,7 +102,7 @@ fn test() { let pass = vec![ r#"import Script from "next/script"; const Head = ({children}) => children - + export default function Index() { return ( @@ -117,7 +117,7 @@ fn test() { r#" import Head from "next/head"; import Script from "next/script"; - + export default function Index() { return ( diff --git a/crates/oxc_linter/src/rules/nextjs/no_unwanted_polyfillio.rs b/crates/oxc_linter/src/rules/nextjs/no_unwanted_polyfillio.rs index 239b70751ff7a2..f9aff5d42f3da0 100644 --- a/crates/oxc_linter/src/rules/nextjs/no_unwanted_polyfillio.rs +++ b/crates/oxc_linter/src/rules/nextjs/no_unwanted_polyfillio.rs @@ -1,5 +1,5 @@ use oxc_ast::{ - ast::{JSXAttributeItem, JSXAttributeName, JSXAttributeValue, JSXElementName}, + ast::{JSXAttributeItem, JSXAttributeName, JSXAttributeValue}, AstKind, }; use oxc_diagnostics::OxcDiagnostic; @@ -108,11 +108,7 @@ const NEXT_POLYFILLED_FEATURES: Set<&'static str> = phf_set! { impl Rule for NoUnwantedPolyfillio { fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) { if let AstKind::JSXOpeningElement(jsx_el) = node.kind() { - let tag_name = if let JSXElementName::Identifier(ident) = &jsx_el.name { - &ident.name - } else { - return; - }; + let Some(tag_name) = jsx_el.name.get_identifier_name() else { return }; if tag_name.as_str() != "script" { let next_script_import_local_name = get_next_script_import_local_name(ctx); diff --git a/crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs b/crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs index 7e6191bb3d25b0..282e0600e588b0 100644 --- a/crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs +++ b/crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs @@ -3,7 +3,7 @@ use std::ops::Deref; use oxc_ast::{ ast::{ match_expression, Expression, JSXAttributeItem, JSXAttributeName, JSXAttributeValue, - JSXElementName, JSXExpression, StringLiteral, + JSXExpression, StringLiteral, }, AstKind, }; @@ -121,95 +121,87 @@ declare_oxc_lint!( impl Rule for JsxNoTargetBlank { fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) { if let AstKind::JSXOpeningElement(jsx_ele) = node.kind() { - if let JSXElementName::Identifier(tag_identifier) = &jsx_ele.name { - let tag_name = tag_identifier.name.as_str(); - if self.check_is_link(tag_name, ctx) || self.check_is_forms(tag_name, ctx) { - let mut target_blank_tuple = (false, "", false, false); - let mut rel_valid_tuple = (false, "", false, false); - let mut is_href_valid = true; - let mut has_href_value = false; - let mut is_warn_on_spread_attributes = false; - let mut target_span = None; - let mut spread_span = Span::default(); - - jsx_ele.attributes.iter().for_each(|attribute| match attribute { - JSXAttributeItem::Attribute(attribute) => { - if let JSXAttributeName::Identifier(identifier) = - &attribute.deref().name + let Some(tag_name) = &jsx_ele.name.get_identifier_name() else { + return; + }; + if self.check_is_link(tag_name, ctx) || self.check_is_forms(tag_name, ctx) { + let mut target_blank_tuple = (false, "", false, false); + let mut rel_valid_tuple = (false, "", false, false); + let mut is_href_valid = true; + let mut has_href_value = false; + let mut is_warn_on_spread_attributes = false; + let mut target_span = None; + let mut spread_span = Span::default(); + + jsx_ele.attributes.iter().for_each(|attribute| match attribute { + JSXAttributeItem::Attribute(attribute) => { + if let JSXAttributeName::Identifier(identifier) = &attribute.deref().name { + let attribute_name = identifier.name.as_str(); + if attribute_name == "target" { + if let Some(val) = attribute.deref().value.as_ref() { + target_blank_tuple = check_target(val); + target_span = attribute.value.as_ref().map(GetSpan::span); + } + } else if attribute_name == "href" + || attribute_name == "action" + || ctx.settings().react.get_link_component_attrs(tag_name).map_or( + false, + |link_attribute| { + link_attribute.contains(&CompactStr::new(attribute_name)) + }, + ) + || ctx.settings().react.get_form_component_attrs(tag_name).map_or( + false, + |form_attribute| { + form_attribute.contains(&CompactStr::new(attribute_name)) + }, + ) { - let attribute_name = identifier.name.as_str(); - if attribute_name == "target" { - if let Some(val) = attribute.deref().value.as_ref() { - target_blank_tuple = check_target(val); - target_span = attribute.value.as_ref().map(GetSpan::span); - } - } else if attribute_name == "href" - || attribute_name == "action" - || ctx - .settings() - .react - .get_link_component_attrs(tag_name) - .map_or(false, |link_attribute| { - link_attribute - .contains(&CompactStr::new(attribute_name)) - }) - || ctx - .settings() - .react - .get_form_component_attrs(tag_name) - .map_or(false, |form_attribute| { - form_attribute - .contains(&CompactStr::new(attribute_name)) - }) - { - if let Some(val) = attribute.value.as_ref() { - has_href_value = true; - is_href_valid = - check_href(val, &self.enforce_dynamic_links); - } - } else if attribute_name == "rel" { - if let Some(val) = attribute.value.as_ref() { - rel_valid_tuple = check_rel(val, self.allow_referrer); - } - }; - } - } - JSXAttributeItem::SpreadAttribute(_) => { - if self.warn_on_spread_attributes { - is_warn_on_spread_attributes = true; - spread_span = attribute.span(); - target_blank_tuple = (false, "", false, false); - rel_valid_tuple = (false, "", false, false); - is_href_valid = false; - has_href_value = true; + if let Some(val) = attribute.value.as_ref() { + has_href_value = true; + is_href_valid = check_href(val, &self.enforce_dynamic_links); + } + } else if attribute_name == "rel" { + if let Some(val) = attribute.value.as_ref() { + rel_valid_tuple = check_rel(val, self.allow_referrer); + } }; } - }); + } + JSXAttributeItem::SpreadAttribute(_) => { + if self.warn_on_spread_attributes { + is_warn_on_spread_attributes = true; + spread_span = attribute.span(); + target_blank_tuple = (false, "", false, false); + rel_valid_tuple = (false, "", false, false); + is_href_valid = false; + has_href_value = true; + }; + } + }); - if is_warn_on_spread_attributes { - if (has_href_value && is_href_valid) || rel_valid_tuple.0 { - return; - } - ctx.diagnostic(explicit_props_in_spread_attributes(spread_span)); + if is_warn_on_spread_attributes { + if (has_href_value && is_href_valid) || rel_valid_tuple.0 { return; } + ctx.diagnostic(explicit_props_in_spread_attributes(spread_span)); + return; + } - let span = target_span.unwrap_or(jsx_ele.span); - if !is_href_valid { - if !target_blank_tuple.1.is_empty() - && target_blank_tuple.1 == rel_valid_tuple.1 + let span = target_span.unwrap_or(jsx_ele.span); + if !is_href_valid { + if !target_blank_tuple.1.is_empty() && target_blank_tuple.1 == rel_valid_tuple.1 + { + if (target_blank_tuple.2 && !rel_valid_tuple.2) + || (target_blank_tuple.3 && !rel_valid_tuple.3) { - if (target_blank_tuple.2 && !rel_valid_tuple.2) - || (target_blank_tuple.3 && !rel_valid_tuple.3) - { - self.diagnostic(span, ctx); - } - return; - } - - if target_blank_tuple.0 && !rel_valid_tuple.0 { self.diagnostic(span, ctx); } + return; + } + + if target_blank_tuple.0 && !rel_valid_tuple.0 { + self.diagnostic(span, ctx); } } } diff --git a/crates/oxc_linter/src/rules/react/jsx_no_undef.rs b/crates/oxc_linter/src/rules/react/jsx_no_undef.rs index 75061dcbd84db8..6dd66bf56ac45f 100644 --- a/crates/oxc_linter/src/rules/react/jsx_no_undef.rs +++ b/crates/oxc_linter/src/rules/react/jsx_no_undef.rs @@ -1,5 +1,5 @@ use oxc_ast::{ - ast::{JSXElementName, JSXIdentifier, JSXMemberExpression, JSXMemberExpressionObject}, + ast::{IdentifierReference, JSXElementName, JSXMemberExpression, JSXMemberExpressionObject}, AstKind, }; use oxc_diagnostics::OxcDiagnostic; @@ -33,21 +33,18 @@ declare_oxc_lint!( correctness ); -fn get_resolvable_ident<'a>(node: &'a JSXElementName<'a>) -> Option<&'a JSXIdentifier> { +fn get_resolvable_ident<'a>(node: &'a JSXElementName<'a>) -> Option<&'a IdentifierReference> { match node { - JSXElementName::Identifier(ref ident) - if !(ident.name.as_str().starts_with(char::is_lowercase)) => - { - Some(ident) - } JSXElementName::Identifier(_) | JSXElementName::NamespacedName(_) => None, - JSXElementName::MemberExpression(expr) => Some(get_member_ident(expr)), + JSXElementName::IdentifierReference(ref ident) => Some(ident), + JSXElementName::MemberExpression(expr) => get_member_ident(expr), } } -fn get_member_ident<'a>(expr: &'a JSXMemberExpression<'a>) -> &'a JSXIdentifier { +fn get_member_ident<'a>(expr: &'a JSXMemberExpression<'a>) -> Option<&'a IdentifierReference> { match &expr.object { - JSXMemberExpressionObject::Identifier(ident) => ident, + JSXMemberExpressionObject::Identifier(_) => None, + JSXMemberExpressionObject::IdentifierReference(ident) => Some(ident), JSXMemberExpressionObject::MemberExpression(next_expr) => get_member_ident(next_expr), } } diff --git a/crates/oxc_linter/src/rules/react/jsx_no_useless_fragment.rs b/crates/oxc_linter/src/rules/react/jsx_no_useless_fragment.rs index 6020a2ef985607..bcd1d274af126b 100644 --- a/crates/oxc_linter/src/rules/react/jsx_no_useless_fragment.rs +++ b/crates/oxc_linter/src/rules/react/jsx_no_useless_fragment.rs @@ -164,19 +164,19 @@ fn is_html_element(elem_name: &JSXElementName) -> bool { fn is_jsx_fragment(elem: &JSXOpeningElement) -> bool { match &elem.name { - JSXElementName::Identifier(ident) => ident.name.as_str() == "Fragment", + JSXElementName::IdentifierReference(ident) => ident.name.as_str() == "Fragment", JSXElementName::MemberExpression(mem_expr) => { if mem_expr.property.name.as_str() != "Fragment" { return false; } - let JSXMemberExpressionObject::Identifier(ident) = &mem_expr.object else { + let JSXMemberExpressionObject::IdentifierReference(ident) = &mem_expr.object else { return false; }; return ident.name.as_str() == "React"; } - JSXElementName::NamespacedName(_) => false, + JSXElementName::NamespacedName(_) | JSXElementName::Identifier(_) => false, } } diff --git a/crates/oxc_linter/src/rules/tree_shaking/no_side_effects_in_initialization/listener_map.rs b/crates/oxc_linter/src/rules/tree_shaking/no_side_effects_in_initialization/listener_map.rs index c79122be9d6570..65c94af6d89c44 100644 --- a/crates/oxc_linter/src/rules/tree_shaking/no_side_effects_in_initialization/listener_map.rs +++ b/crates/oxc_linter/src/rules/tree_shaking/no_side_effects_in_initialization/listener_map.rs @@ -789,6 +789,7 @@ impl<'a> ListenerMap for JSXElementName<'a> { fn report_effects_when_called(&self, options: &NodeListenerOptions) { match self { Self::Identifier(ident) => ident.report_effects_when_called(options), + Self::IdentifierReference(ident) => ident.report_effects_when_called(options), Self::NamespacedName(name) => name.property.report_effects_when_called(options), Self::MemberExpression(member) => { member.property.report_effects_when_called(options); @@ -1129,7 +1130,37 @@ impl<'a> ListenerMap for IdentifierReference<'a> { } let ctx = options.ctx; + if let Some(symbol_id) = get_symbol_id_of_variable(self, ctx) { + let is_used_in_jsx = matches!( + ctx.nodes().parent_kind( + ctx.symbols().get_reference(self.reference_id.get().unwrap()).node_id() + ), + Some(AstKind::JSXElementName(_) | AstKind::JSXMemberExpressionObject(_)) + ); + + if is_used_in_jsx { + // TODO: remove the repeat the same logic in `JSXIdentifier::report_effects_when_called` method + for reference in options.ctx.symbols().get_resolved_references(symbol_id) { + if reference.is_write() { + let node_id = reference.node_id(); + if let Some(expr) = get_write_expr(node_id, options.ctx) { + let old_val = options.called_with_new.get(); + options.called_with_new.set(true); + expr.report_effects_when_called(options); + options.called_with_new.set(old_val); + } + } + } + let symbol_table = options.ctx.semantic().symbols(); + let node = options.ctx.nodes().get_node(symbol_table.get_declaration(symbol_id)); + let old_val = options.called_with_new.get(); + options.called_with_new.set(true); + node.report_effects_when_called(options); + options.called_with_new.set(old_val); + return; + } + if options.insert_called_node(symbol_id) { let symbol_table = ctx.semantic().symbols(); for reference in symbol_table.get_resolved_references(symbol_id) { diff --git a/crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs b/crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs index 8f99875ed97350..a84eeb890dd6a3 100644 --- a/crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs +++ b/crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs @@ -1,4 +1,4 @@ -use oxc_ast::{AstKind, Visit}; +use oxc_ast::{visit::walk, AstKind, Visit}; use oxc_diagnostics::OxcDiagnostic; use oxc_macros::declare_oxc_lint; use oxc_semantic::ReferenceId; @@ -260,6 +260,21 @@ impl<'a> Visit<'a> for ReferencesFinder { self.references.push(it.reference_id().unwrap()); } + fn visit_jsx_element_name(&mut self, it: &oxc_ast::ast::JSXElementName<'a>) { + if !matches!(it, oxc_ast::ast::JSXElementName::IdentifierReference(_)) { + walk::walk_jsx_element_name(self, it); + } + } + + fn visit_jsx_member_expression_object( + &mut self, + it: &oxc_ast::ast::JSXMemberExpressionObject<'a>, + ) { + if !matches!(it, oxc_ast::ast::JSXMemberExpressionObject::IdentifierReference(_)) { + walk::walk_jsx_member_expression_object(self, it); + } + } + fn visit_this_expression(&mut self, _: &oxc_ast::ast::ThisExpression) { if self.in_function == 0 { self.is_parent_this_referenced = true; diff --git a/crates/oxc_linter/src/rules/unicorn/text_encoding_identifier_case.rs b/crates/oxc_linter/src/rules/unicorn/text_encoding_identifier_case.rs index af0243bcccfa65..983eac76fd832e 100644 --- a/crates/oxc_linter/src/rules/unicorn/text_encoding_identifier_case.rs +++ b/crates/oxc_linter/src/rules/unicorn/text_encoding_identifier_case.rs @@ -1,5 +1,5 @@ use oxc_ast::{ - ast::{JSXAttributeItem, JSXAttributeName, JSXElementName}, + ast::{JSXAttributeItem, JSXAttributeName}, AstKind, }; use oxc_diagnostics::OxcDiagnostic; @@ -118,11 +118,9 @@ fn is_jsx_meta_elem_with_charset_attr(id: AstNodeId, ctx: &LintContext) -> bool return false; }; - let JSXElementName::Identifier(name) = &opening_elem.name else { - return false; - }; + let Some(tag_name) = opening_elem.name.get_identifier_name() else { return false }; - if !name.name.eq_ignore_ascii_case("meta") { + if !tag_name.eq_ignore_ascii_case("meta") { return false; } diff --git a/crates/oxc_linter/src/utils/react.rs b/crates/oxc_linter/src/utils/react.rs index 72f72fd0135ffd..4807232a81db6d 100644 --- a/crates/oxc_linter/src/utils/react.rs +++ b/crates/oxc_linter/src/utils/react.rs @@ -219,7 +219,7 @@ pub fn get_element_type<'c, 'a>( context: &'c LintContext<'a>, element: &JSXOpeningElement<'a>, ) -> Option> { - let name = element.name.as_identifier()?; + let name = element.name.get_identifier_name()?; let OxlintSettings { jsx_a11y, .. } = context.settings(); @@ -233,7 +233,7 @@ pub fn get_element_type<'c, 'a>( .and_then(JSXAttributeValue::as_string_literal) .map(|s| s.value.as_str()); - let raw_type = polymorphic_prop.unwrap_or_else(|| name.name.as_str()); + let raw_type = polymorphic_prop.unwrap_or_else(|| name.as_str()); match jsx_a11y.components.get(raw_type) { Some(component) => Some(Cow::Borrowed(component)), None => Some(Cow::Borrowed(raw_type)), diff --git a/crates/oxc_parser/src/jsx/mod.rs b/crates/oxc_parser/src/jsx/mod.rs index cf86451cefd885..1240dcba3208a9 100644 --- a/crates/oxc_parser/src/jsx/mod.rs +++ b/crates/oxc_parser/src/jsx/mod.rs @@ -154,7 +154,12 @@ impl<'a> ParserImpl<'a> { .map(JSXElementName::MemberExpression); } - Ok(JSXElementName::Identifier(self.ast.alloc(identifier))) + let element_name = if identifier.is_reference() { + JSXElementName::IdentifierReference(self.ast.alloc(identifier.into())) + } else { + JSXElementName::Identifier(self.ast.alloc(identifier)) + }; + Ok(element_name) } /// `JSXMemberExpression` : @@ -166,7 +171,8 @@ impl<'a> ParserImpl<'a> { object: JSXIdentifier<'a>, ) -> Result>> { let mut span = span; - let mut object = JSXMemberExpressionObject::Identifier(self.ast.alloc(object)); + let mut object = + JSXMemberExpressionObject::IdentifierReference(self.ast.alloc(object.into())); let mut property = None; while self.eat(Kind::Dot) && !self.at(Kind::Eof) { @@ -398,6 +404,10 @@ impl<'a> ParserImpl<'a> { (JSXElementName::Identifier(lhs), JSXElementName::Identifier(rhs)) => { lhs.name == rhs.name } + ( + JSXElementName::IdentifierReference(lhs), + JSXElementName::IdentifierReference(rhs), + ) => lhs.name == rhs.name, (JSXElementName::NamespacedName(lhs), JSXElementName::NamespacedName(rhs)) => { lhs.namespace.name == rhs.namespace.name && lhs.property.name == rhs.property.name } @@ -420,6 +430,10 @@ impl<'a> ParserImpl<'a> { JSXMemberExpressionObject::Identifier(lhs), JSXMemberExpressionObject::Identifier(rhs), ) => lhs.name == rhs.name, + ( + JSXMemberExpressionObject::IdentifierReference(lhs), + JSXMemberExpressionObject::IdentifierReference(rhs), + ) => lhs.name == rhs.name, ( JSXMemberExpressionObject::MemberExpression(lhs), JSXMemberExpressionObject::MemberExpression(rhs), diff --git a/crates/oxc_semantic/src/builder.rs b/crates/oxc_semantic/src/builder.rs index f5650a5cb38e81..a487eae5af6113 100644 --- a/crates/oxc_semantic/src/builder.rs +++ b/crates/oxc_semantic/src/builder.rs @@ -1863,9 +1863,6 @@ impl<'a> SemanticBuilder<'a> { AstKind::IdentifierReference(ident) => { self.reference_identifier(ident); } - AstKind::JSXIdentifier(ident) => { - self.reference_jsx_identifier(ident); - } AstKind::UpdateExpression(_) => { if !self.current_reference_flags.is_type() && self.is_not_expression_statement_parent() @@ -1994,20 +1991,6 @@ impl<'a> SemanticBuilder<'a> { } } - fn reference_jsx_identifier(&mut self, ident: &JSXIdentifier<'a>) { - match self.nodes.parent_kind(self.current_node_id) { - Some(AstKind::JSXElementName(_)) => { - if !ident.name.chars().next().is_some_and(char::is_uppercase) { - return; - } - } - Some(AstKind::JSXMemberExpressionObject(_)) => {} - _ => return, - } - let reference = Reference::new(self.current_node_id, ReferenceFlags::read()); - self.declare_reference(ident.name.clone(), reference); - } - fn is_not_expression_statement_parent(&self) -> bool { for node in self.nodes.iter_parents(self.current_node_id).skip(1) { return match node.kind() { diff --git a/crates/oxc_semantic/src/counter.rs b/crates/oxc_semantic/src/counter.rs index 4d8f8d7b827155..cca87e48186b02 100644 --- a/crates/oxc_semantic/src/counter.rs +++ b/crates/oxc_semantic/src/counter.rs @@ -5,10 +5,7 @@ use std::cell::Cell; use oxc_ast::{ - ast::{ - BindingIdentifier, IdentifierReference, JSXElementName, JSXMemberExpressionObject, - TSEnumMemberName, TSModuleDeclarationName, - }, + ast::{BindingIdentifier, IdentifierReference, TSEnumMemberName, TSModuleDeclarationName}, visit::walk::{walk_ts_enum_member_name, walk_ts_module_declaration_name}, AstKind, Visit, }; @@ -45,35 +42,6 @@ impl<'a> Visit<'a> for Counter { self.references_count += 1; } - #[inline] - fn visit_jsx_member_expression_object(&mut self, it: &JSXMemberExpressionObject<'a>) { - self.nodes_count += 1; - match it { - JSXMemberExpressionObject::MemberExpression(expr) => { - self.visit_jsx_member_expression(expr); - } - JSXMemberExpressionObject::Identifier(_) => { - self.nodes_count += 1; - self.references_count += 1; - } - } - } - - #[inline] - fn visit_jsx_element_name(&mut self, it: &JSXElementName<'a>) { - self.nodes_count += 1; - match it { - JSXElementName::Identifier(ident) => { - self.nodes_count += 1; - if ident.name.chars().next().is_some_and(char::is_uppercase) { - self.references_count += 1; - } - } - JSXElementName::NamespacedName(name) => self.visit_jsx_namespaced_name(name), - JSXElementName::MemberExpression(expr) => self.visit_jsx_member_expression(expr), - } - } - #[inline] fn visit_ts_enum_member_name(&mut self, it: &TSEnumMemberName<'a>) { if !it.is_expression() { diff --git a/crates/oxc_semantic/src/lib.rs b/crates/oxc_semantic/src/lib.rs index 4f66b5ccbb399d..f9ae3a42009c79 100644 --- a/crates/oxc_semantic/src/lib.rs +++ b/crates/oxc_semantic/src/lib.rs @@ -191,7 +191,6 @@ impl<'a> Semantic<'a> { let node = self.nodes.get_node(reference.node_id()); match node.kind() { AstKind::IdentifierReference(id) => id.name.as_str(), - AstKind::JSXIdentifier(id) => id.name.as_str(), _ => unreachable!(), } } diff --git a/crates/oxc_semantic/src/scope.rs b/crates/oxc_semantic/src/scope.rs index 5616612189f090..7a892628bd4c81 100644 --- a/crates/oxc_semantic/src/scope.rs +++ b/crates/oxc_semantic/src/scope.rs @@ -96,29 +96,6 @@ impl ScopeTree { self.root_unresolved_references.values().map(|v| v.iter().copied()) } - /// Delete an unresolved reference. - /// - /// If the `ReferenceId` provided is only reference remaining for this unresolved reference - /// (i.e. this `x` was last `x` in the AST), deletes the key from `root_unresolved_references`. - /// - /// # Panics - /// Panics if there is no unresolved reference for provided `name` and `reference_id`. - #[inline] - pub fn delete_root_unresolved_reference(&mut self, name: &str, reference_id: ReferenceId) { - // It would be better to use `Entry` API to avoid 2 hash table lookups when deleting, - // but `map.entry` requires an owned key to be provided. Currently we use `CompactStr`s as keys - // which are not cheap to construct, so this is best we can do at present. - // TODO: Switch to `Entry` API once we use `&str`s or `Atom`s as keys. - let reference_ids = self.root_unresolved_references.get_mut(name).unwrap(); - if reference_ids.len() == 1 { - assert!(reference_ids[0] == reference_id); - self.root_unresolved_references.remove(name); - } else { - let index = reference_ids.iter().position(|&id| id == reference_id).unwrap(); - reference_ids.swap_remove(index); - } - } - #[inline] pub fn get_flags(&self, scope_id: ScopeId) -> ScopeFlags { self.flags[scope_id] diff --git a/crates/oxc_transformer/src/es2015/arrow_functions.rs b/crates/oxc_transformer/src/es2015/arrow_functions.rs index b04f1fddc5d178..f9b60ce3ce479b 100644 --- a/crates/oxc_transformer/src/es2015/arrow_functions.rs +++ b/crates/oxc_transformer/src/es2015/arrow_functions.rs @@ -142,7 +142,7 @@ impl<'a> Traverse<'a> for ArrowFunctions<'a> { JSXElementName::MemberExpression(member_expr) => { member_expr.get_object_identifier_mut() } - JSXElementName::NamespacedName(_) => return, + JSXElementName::IdentifierReference(_) | JSXElementName::NamespacedName(_) => return, }; if ident.name == "this" { // We can't produce a proper identifier with a `ReferenceId` because `JSXIdentifier` diff --git a/crates/oxc_transformer/src/react/jsx.rs b/crates/oxc_transformer/src/react/jsx.rs index 38616f597988fe..fb680e51675824 100644 --- a/crates/oxc_transformer/src/react/jsx.rs +++ b/crates/oxc_transformer/src/react/jsx.rs @@ -713,6 +713,9 @@ impl<'a> ReactJsx<'a> { self.ctx.ast.expression_from_identifier_reference(ident) } } + JSXElementName::IdentifierReference(ident) => { + self.ast().expression_from_identifier_reference(ident.as_ref().clone()) + } JSXElementName::MemberExpression(member_expr) => { self.transform_jsx_member_expression(member_expr, ctx) } @@ -790,6 +793,9 @@ impl<'a> ReactJsx<'a> { self.ast().expression_from_identifier_reference(ident) } } + JSXMemberExpressionObject::IdentifierReference(ident) => { + self.ast().expression_from_identifier_reference(ident.as_ref().clone()) + } JSXMemberExpressionObject::MemberExpression(expr) => { self.transform_jsx_member_expression(expr, ctx) } diff --git a/crates/oxc_traverse/src/context/ast_operations/gather_node_parts.rs b/crates/oxc_traverse/src/context/ast_operations/gather_node_parts.rs index 64134c7b91bc87..c46584784385e9 100644 --- a/crates/oxc_traverse/src/context/ast_operations/gather_node_parts.rs +++ b/crates/oxc_traverse/src/context/ast_operations/gather_node_parts.rs @@ -461,6 +461,7 @@ impl<'a> GatherNodeParts<'a> for JSXElementName<'a> { fn gather(&self, f: &mut F) { match self { JSXElementName::Identifier(ident) => ident.gather(f), + JSXElementName::IdentifierReference(ident) => ident.gather(f), JSXElementName::NamespacedName(ns) => ns.gather(f), JSXElementName::MemberExpression(expr) => expr.gather(f), } @@ -485,6 +486,7 @@ impl<'a> GatherNodeParts<'a> for JSXMemberExpressionObject<'a> { fn gather(&self, f: &mut F) { match self { JSXMemberExpressionObject::Identifier(ident) => ident.gather(f), + JSXMemberExpressionObject::IdentifierReference(ident) => ident.gather(f), JSXMemberExpressionObject::MemberExpression(expr) => expr.gather(f), } } diff --git a/crates/oxc_traverse/src/generated/walk.rs b/crates/oxc_traverse/src/generated/walk.rs index 8c70b2a6a12eaf..22b5f2b5d28bd8 100644 --- a/crates/oxc_traverse/src/generated/walk.rs +++ b/crates/oxc_traverse/src/generated/walk.rs @@ -13,7 +13,7 @@ clippy::cast_ptr_alignment )] -use std::{cell::Cell, marker::PhantomData}; +use std::cell::Cell; use oxc_allocator::Vec; #[allow(clippy::wildcard_imports)] @@ -37,8 +37,7 @@ pub(crate) unsafe fn walk_program<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx - .push_stack(Ancestor::ProgramHashbang(ancestor::ProgramWithoutHashbang(node, PhantomData))); + ctx.push_stack(Ancestor::ProgramHashbang(ancestor::ProgramWithoutHashbang(node))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_PROGRAM_HASHBANG) as *mut Option) { @@ -57,7 +56,7 @@ pub(crate) unsafe fn walk_program<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_PROGRAM_BODY) as *mut Vec, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_program(&mut *node, ctx); } @@ -236,16 +235,16 @@ pub(crate) unsafe fn walk_array_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_array_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ArrayExpressionElements( - ancestor::ArrayExpressionWithoutElements(node, PhantomData), - )); + ctx.push_stack(Ancestor::ArrayExpressionElements(ancestor::ArrayExpressionWithoutElements( + node, + ))); for item in (*((node as *mut u8).add(ancestor::OFFSET_ARRAY_EXPRESSION_ELEMENTS) as *mut Vec)) .iter_mut() { walk_array_expression_element(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_array_expression(&mut *node, ctx); } @@ -323,8 +322,8 @@ pub(crate) unsafe fn walk_object_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_object_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ObjectExpressionProperties( - ancestor::ObjectExpressionWithoutProperties(node, PhantomData), + ctx.push_stack(Ancestor::ObjectExpressionProperties( + ancestor::ObjectExpressionWithoutProperties(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_OBJECT_EXPRESSION_PROPERTIES) as *mut Vec)) @@ -332,7 +331,7 @@ pub(crate) unsafe fn walk_object_expression<'a, Tr: Traverse<'a>>( { walk_object_property_kind(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_object_expression(&mut *node, ctx); } @@ -359,9 +358,7 @@ pub(crate) unsafe fn walk_object_property<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_object_property(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ObjectPropertyKey( - ancestor::ObjectPropertyWithoutKey(node, PhantomData), - )); + ctx.push_stack(Ancestor::ObjectPropertyKey(ancestor::ObjectPropertyWithoutKey(node))); walk_property_key( traverser, (node as *mut u8).add(ancestor::OFFSET_OBJECT_PROPERTY_KEY) as *mut PropertyKey, @@ -379,7 +376,7 @@ pub(crate) unsafe fn walk_object_property<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::ObjectPropertyInit); walk_expression(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_object_property(&mut *node, ctx); } @@ -448,9 +445,7 @@ pub(crate) unsafe fn walk_template_literal<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_template_literal(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TemplateLiteralQuasis( - ancestor::TemplateLiteralWithoutQuasis(node, PhantomData), - )); + ctx.push_stack(Ancestor::TemplateLiteralQuasis(ancestor::TemplateLiteralWithoutQuasis(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_TEMPLATE_LITERAL_QUASIS) as *mut Vec)) .iter_mut() @@ -464,7 +459,7 @@ pub(crate) unsafe fn walk_template_literal<'a, Tr: Traverse<'a>>( { walk_expression(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_template_literal(&mut *node, ctx); } @@ -474,8 +469,8 @@ pub(crate) unsafe fn walk_tagged_template_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_tagged_template_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TaggedTemplateExpressionTag( - ancestor::TaggedTemplateExpressionWithoutTag(node, PhantomData), + ctx.push_stack(Ancestor::TaggedTemplateExpressionTag( + ancestor::TaggedTemplateExpressionWithoutTag(node), )); walk_expression( traverser, @@ -496,7 +491,7 @@ pub(crate) unsafe fn walk_tagged_template_expression<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TaggedTemplateExpressionTypeParameters); walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_tagged_template_expression(&mut *node, ctx); } @@ -535,8 +530,8 @@ pub(crate) unsafe fn walk_computed_member_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_computed_member_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ComputedMemberExpressionObject( - ancestor::ComputedMemberExpressionWithoutObject(node, PhantomData), + ctx.push_stack(Ancestor::ComputedMemberExpressionObject( + ancestor::ComputedMemberExpressionWithoutObject(node), )); walk_expression( traverser, @@ -551,7 +546,7 @@ pub(crate) unsafe fn walk_computed_member_expression<'a, Tr: Traverse<'a>>( as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_computed_member_expression(&mut *node, ctx); } @@ -561,8 +556,8 @@ pub(crate) unsafe fn walk_static_member_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_static_member_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::StaticMemberExpressionObject( - ancestor::StaticMemberExpressionWithoutObject(node, PhantomData), + ctx.push_stack(Ancestor::StaticMemberExpressionObject( + ancestor::StaticMemberExpressionWithoutObject(node), )); walk_expression( traverser, @@ -576,7 +571,7 @@ pub(crate) unsafe fn walk_static_member_expression<'a, Tr: Traverse<'a>>( as *mut IdentifierName, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_static_member_expression(&mut *node, ctx); } @@ -586,8 +581,8 @@ pub(crate) unsafe fn walk_private_field_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_private_field_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::PrivateFieldExpressionObject( - ancestor::PrivateFieldExpressionWithoutObject(node, PhantomData), + ctx.push_stack(Ancestor::PrivateFieldExpressionObject( + ancestor::PrivateFieldExpressionWithoutObject(node), )); walk_expression( traverser, @@ -601,7 +596,7 @@ pub(crate) unsafe fn walk_private_field_expression<'a, Tr: Traverse<'a>>( as *mut PrivateIdentifier, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_private_field_expression(&mut *node, ctx); } @@ -611,9 +606,7 @@ pub(crate) unsafe fn walk_call_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_call_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::CallExpressionCallee( - ancestor::CallExpressionWithoutCallee(node, PhantomData), - )); + ctx.push_stack(Ancestor::CallExpressionCallee(ancestor::CallExpressionWithoutCallee(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_CALL_EXPRESSION_CALLEE) as *mut Expression, @@ -633,7 +626,7 @@ pub(crate) unsafe fn walk_call_expression<'a, Tr: Traverse<'a>>( { walk_argument(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_call_expression(&mut *node, ctx); } @@ -643,9 +636,7 @@ pub(crate) unsafe fn walk_new_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_new_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::NewExpressionCallee( - ancestor::NewExpressionWithoutCallee(node, PhantomData), - )); + ctx.push_stack(Ancestor::NewExpressionCallee(ancestor::NewExpressionWithoutCallee(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_NEW_EXPRESSION_CALLEE) as *mut Expression, @@ -665,7 +656,7 @@ pub(crate) unsafe fn walk_new_expression<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::NewExpressionTypeParameters); walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_new_expression(&mut *node, ctx); } @@ -675,10 +666,7 @@ pub(crate) unsafe fn walk_meta_property<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_meta_property(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::MetaPropertyMeta(ancestor::MetaPropertyWithoutMeta( - node, - PhantomData, - ))); + ctx.push_stack(Ancestor::MetaPropertyMeta(ancestor::MetaPropertyWithoutMeta(node))); walk_identifier_name( traverser, (node as *mut u8).add(ancestor::OFFSET_META_PROPERTY_META) as *mut IdentifierName, @@ -690,7 +678,7 @@ pub(crate) unsafe fn walk_meta_property<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_META_PROPERTY_PROPERTY) as *mut IdentifierName, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_meta_property(&mut *node, ctx); } @@ -700,15 +688,13 @@ pub(crate) unsafe fn walk_spread_element<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_spread_element(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::SpreadElementArgument( - ancestor::SpreadElementWithoutArgument(node, PhantomData), - )); + ctx.push_stack(Ancestor::SpreadElementArgument(ancestor::SpreadElementWithoutArgument(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_SPREAD_ELEMENT_ARGUMENT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_spread_element(&mut *node, ctx); } @@ -774,16 +760,16 @@ pub(crate) unsafe fn walk_update_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_update_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::UpdateExpressionArgument( - ancestor::UpdateExpressionWithoutArgument(node, PhantomData), - )); + ctx.push_stack(Ancestor::UpdateExpressionArgument(ancestor::UpdateExpressionWithoutArgument( + node, + ))); walk_simple_assignment_target( traverser, (node as *mut u8).add(ancestor::OFFSET_UPDATE_EXPRESSION_ARGUMENT) as *mut SimpleAssignmentTarget, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_update_expression(&mut *node, ctx); } @@ -793,15 +779,15 @@ pub(crate) unsafe fn walk_unary_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_unary_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::UnaryExpressionArgument( - ancestor::UnaryExpressionWithoutArgument(node, PhantomData), - )); + ctx.push_stack(Ancestor::UnaryExpressionArgument(ancestor::UnaryExpressionWithoutArgument( + node, + ))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_UNARY_EXPRESSION_ARGUMENT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_unary_expression(&mut *node, ctx); } @@ -811,9 +797,7 @@ pub(crate) unsafe fn walk_binary_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_binary_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::BinaryExpressionLeft( - ancestor::BinaryExpressionWithoutLeft(node, PhantomData), - )); + ctx.push_stack(Ancestor::BinaryExpressionLeft(ancestor::BinaryExpressionWithoutLeft(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_BINARY_EXPRESSION_LEFT) as *mut Expression, @@ -825,7 +809,7 @@ pub(crate) unsafe fn walk_binary_expression<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_BINARY_EXPRESSION_RIGHT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_binary_expression(&mut *node, ctx); } @@ -835,9 +819,9 @@ pub(crate) unsafe fn walk_private_in_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_private_in_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::PrivateInExpressionLeft( - ancestor::PrivateInExpressionWithoutLeft(node, PhantomData), - )); + ctx.push_stack(Ancestor::PrivateInExpressionLeft(ancestor::PrivateInExpressionWithoutLeft( + node, + ))); walk_private_identifier( traverser, (node as *mut u8).add(ancestor::OFFSET_PRIVATE_IN_EXPRESSION_LEFT) @@ -850,7 +834,7 @@ pub(crate) unsafe fn walk_private_in_expression<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_PRIVATE_IN_EXPRESSION_RIGHT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_private_in_expression(&mut *node, ctx); } @@ -860,9 +844,7 @@ pub(crate) unsafe fn walk_logical_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_logical_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::LogicalExpressionLeft( - ancestor::LogicalExpressionWithoutLeft(node, PhantomData), - )); + ctx.push_stack(Ancestor::LogicalExpressionLeft(ancestor::LogicalExpressionWithoutLeft(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_LOGICAL_EXPRESSION_LEFT) as *mut Expression, @@ -874,7 +856,7 @@ pub(crate) unsafe fn walk_logical_expression<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_LOGICAL_EXPRESSION_RIGHT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_logical_expression(&mut *node, ctx); } @@ -884,8 +866,8 @@ pub(crate) unsafe fn walk_conditional_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_conditional_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ConditionalExpressionTest( - ancestor::ConditionalExpressionWithoutTest(node, PhantomData), + ctx.push_stack(Ancestor::ConditionalExpressionTest( + ancestor::ConditionalExpressionWithoutTest(node), )); walk_expression( traverser, @@ -905,7 +887,7 @@ pub(crate) unsafe fn walk_conditional_expression<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_CONDITIONAL_EXPRESSION_ALTERNATE) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_conditional_expression(&mut *node, ctx); } @@ -915,9 +897,9 @@ pub(crate) unsafe fn walk_assignment_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_assignment_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::AssignmentExpressionLeft( - ancestor::AssignmentExpressionWithoutLeft(node, PhantomData), - )); + ctx.push_stack(Ancestor::AssignmentExpressionLeft(ancestor::AssignmentExpressionWithoutLeft( + node, + ))); walk_assignment_target( traverser, (node as *mut u8).add(ancestor::OFFSET_ASSIGNMENT_EXPRESSION_LEFT) as *mut AssignmentTarget, @@ -929,7 +911,7 @@ pub(crate) unsafe fn walk_assignment_expression<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_ASSIGNMENT_EXPRESSION_RIGHT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_assignment_expression(&mut *node, ctx); } @@ -1016,8 +998,8 @@ pub(crate) unsafe fn walk_array_assignment_target<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_array_assignment_target(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ArrayAssignmentTargetElements( - ancestor::ArrayAssignmentTargetWithoutElements(node, PhantomData), + ctx.push_stack(Ancestor::ArrayAssignmentTargetElements( + ancestor::ArrayAssignmentTargetWithoutElements(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_ARRAY_ASSIGNMENT_TARGET_ELEMENTS) as *mut Vec>)) @@ -1032,7 +1014,7 @@ pub(crate) unsafe fn walk_array_assignment_target<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::ArrayAssignmentTargetRest); walk_assignment_target_rest(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_array_assignment_target(&mut *node, ctx); } @@ -1042,8 +1024,8 @@ pub(crate) unsafe fn walk_object_assignment_target<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_object_assignment_target(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ObjectAssignmentTargetProperties( - ancestor::ObjectAssignmentTargetWithoutProperties(node, PhantomData), + ctx.push_stack(Ancestor::ObjectAssignmentTargetProperties( + ancestor::ObjectAssignmentTargetWithoutProperties(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_OBJECT_ASSIGNMENT_TARGET_PROPERTIES) as *mut Vec)) @@ -1058,7 +1040,7 @@ pub(crate) unsafe fn walk_object_assignment_target<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::ObjectAssignmentTargetRest); walk_assignment_target_rest(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_object_assignment_target(&mut *node, ctx); } @@ -1068,8 +1050,8 @@ pub(crate) unsafe fn walk_assignment_target_rest<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_assignment_target_rest(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::AssignmentTargetRestTarget( - ancestor::AssignmentTargetRestWithoutTarget(node, PhantomData), + ctx.push_stack(Ancestor::AssignmentTargetRestTarget( + ancestor::AssignmentTargetRestWithoutTarget(node), )); walk_assignment_target( traverser, @@ -1077,7 +1059,7 @@ pub(crate) unsafe fn walk_assignment_target_rest<'a, Tr: Traverse<'a>>( as *mut AssignmentTarget, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_assignment_target_rest(&mut *node, ctx); } @@ -1114,8 +1096,8 @@ pub(crate) unsafe fn walk_assignment_target_with_default<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_assignment_target_with_default(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::AssignmentTargetWithDefaultBinding( - ancestor::AssignmentTargetWithDefaultWithoutBinding(node, PhantomData), + ctx.push_stack(Ancestor::AssignmentTargetWithDefaultBinding( + ancestor::AssignmentTargetWithDefaultWithoutBinding(node), )); walk_assignment_target( traverser, @@ -1130,7 +1112,7 @@ pub(crate) unsafe fn walk_assignment_target_with_default<'a, Tr: Traverse<'a>>( as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_assignment_target_with_default(&mut *node, ctx); } @@ -1157,8 +1139,8 @@ pub(crate) unsafe fn walk_assignment_target_property_identifier<'a, Tr: Traverse ctx: &mut TraverseCtx<'a>, ) { traverser.enter_assignment_target_property_identifier(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::AssignmentTargetPropertyIdentifierBinding( - ancestor::AssignmentTargetPropertyIdentifierWithoutBinding(node, PhantomData), + ctx.push_stack(Ancestor::AssignmentTargetPropertyIdentifierBinding( + ancestor::AssignmentTargetPropertyIdentifierWithoutBinding(node), )); walk_identifier_reference( traverser, @@ -1173,7 +1155,7 @@ pub(crate) unsafe fn walk_assignment_target_property_identifier<'a, Tr: Traverse ctx.retag_stack(AncestorType::AssignmentTargetPropertyIdentifierInit); walk_expression(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_assignment_target_property_identifier(&mut *node, ctx); } @@ -1183,8 +1165,8 @@ pub(crate) unsafe fn walk_assignment_target_property_property<'a, Tr: Traverse<' ctx: &mut TraverseCtx<'a>, ) { traverser.enter_assignment_target_property_property(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::AssignmentTargetPropertyPropertyName( - ancestor::AssignmentTargetPropertyPropertyWithoutName(node, PhantomData), + ctx.push_stack(Ancestor::AssignmentTargetPropertyPropertyName( + ancestor::AssignmentTargetPropertyPropertyWithoutName(node), )); walk_property_key( traverser, @@ -1199,7 +1181,7 @@ pub(crate) unsafe fn walk_assignment_target_property_property<'a, Tr: Traverse<' as *mut AssignmentTargetMaybeDefault, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_assignment_target_property_property(&mut *node, ctx); } @@ -1209,8 +1191,8 @@ pub(crate) unsafe fn walk_sequence_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_sequence_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::SequenceExpressionExpressions( - ancestor::SequenceExpressionWithoutExpressions(node, PhantomData), + ctx.push_stack(Ancestor::SequenceExpressionExpressions( + ancestor::SequenceExpressionWithoutExpressions(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_SEQUENCE_EXPRESSION_EXPRESSIONS) as *mut Vec)) @@ -1218,7 +1200,7 @@ pub(crate) unsafe fn walk_sequence_expression<'a, Tr: Traverse<'a>>( { walk_expression(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_sequence_expression(&mut *node, ctx); } @@ -1237,15 +1219,15 @@ pub(crate) unsafe fn walk_await_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_await_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::AwaitExpressionArgument( - ancestor::AwaitExpressionWithoutArgument(node, PhantomData), - )); + ctx.push_stack(Ancestor::AwaitExpressionArgument(ancestor::AwaitExpressionWithoutArgument( + node, + ))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_AWAIT_EXPRESSION_ARGUMENT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_await_expression(&mut *node, ctx); } @@ -1255,15 +1237,15 @@ pub(crate) unsafe fn walk_chain_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_chain_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ChainExpressionExpression( - ancestor::ChainExpressionWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::ChainExpressionExpression( + ancestor::ChainExpressionWithoutExpression(node), )); walk_chain_element( traverser, (node as *mut u8).add(ancestor::OFFSET_CHAIN_EXPRESSION_EXPRESSION) as *mut ChainElement, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_chain_expression(&mut *node, ctx); } @@ -1292,8 +1274,8 @@ pub(crate) unsafe fn walk_parenthesized_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_parenthesized_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ParenthesizedExpressionExpression( - ancestor::ParenthesizedExpressionWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::ParenthesizedExpressionExpression( + ancestor::ParenthesizedExpressionWithoutExpression(node), )); walk_expression( traverser, @@ -1301,7 +1283,7 @@ pub(crate) unsafe fn walk_parenthesized_expression<'a, Tr: Traverse<'a>>( as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_parenthesized_expression(&mut *node, ctx); } @@ -1367,6 +1349,7 @@ pub(crate) unsafe fn walk_statement<'a, Tr: Traverse<'a>>( Statement::VariableDeclaration(_) | Statement::FunctionDeclaration(_) | Statement::ClassDeclaration(_) + | Statement::UsingDeclaration(_) | Statement::TSTypeAliasDeclaration(_) | Statement::TSInterfaceDeclaration(_) | Statement::TSEnumDeclaration(_) @@ -1392,15 +1375,13 @@ pub(crate) unsafe fn walk_directive<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_directive(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::DirectiveExpression( - ancestor::DirectiveWithoutExpression(node, PhantomData), - )); + ctx.push_stack(Ancestor::DirectiveExpression(ancestor::DirectiveWithoutExpression(node))); walk_string_literal( traverser, (node as *mut u8).add(ancestor::OFFSET_DIRECTIVE_EXPRESSION) as *mut StringLiteral, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_directive(&mut *node, ctx); } @@ -1426,15 +1407,13 @@ pub(crate) unsafe fn walk_block_statement<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::BlockStatementBody( - ancestor::BlockStatementWithoutBody(node, PhantomData), - )); + ctx.push_stack(Ancestor::BlockStatementBody(ancestor::BlockStatementWithoutBody(node))); walk_statements( traverser, (node as *mut u8).add(ancestor::OFFSET_BLOCK_STATEMENT_BODY) as *mut Vec, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_block_statement(&mut *node, ctx); } @@ -1453,6 +1432,9 @@ pub(crate) unsafe fn walk_declaration<'a, Tr: Traverse<'a>>( walk_function(traverser, (&mut **node) as *mut _, ctx) } Declaration::ClassDeclaration(node) => walk_class(traverser, (&mut **node) as *mut _, ctx), + Declaration::UsingDeclaration(node) => { + walk_using_declaration(traverser, (&mut **node) as *mut _, ctx) + } Declaration::TSTypeAliasDeclaration(node) => { walk_ts_type_alias_declaration(traverser, (&mut **node) as *mut _, ctx) } @@ -1478,8 +1460,8 @@ pub(crate) unsafe fn walk_variable_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_variable_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::VariableDeclarationDeclarations( - ancestor::VariableDeclarationWithoutDeclarations(node, PhantomData), + ctx.push_stack(Ancestor::VariableDeclarationDeclarations( + ancestor::VariableDeclarationWithoutDeclarations(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_VARIABLE_DECLARATION_DECLARATIONS) as *mut Vec)) @@ -1487,7 +1469,7 @@ pub(crate) unsafe fn walk_variable_declaration<'a, Tr: Traverse<'a>>( { walk_variable_declarator(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_variable_declaration(&mut *node, ctx); } @@ -1497,9 +1479,7 @@ pub(crate) unsafe fn walk_variable_declarator<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_variable_declarator(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::VariableDeclaratorId( - ancestor::VariableDeclaratorWithoutId(node, PhantomData), - )); + ctx.push_stack(Ancestor::VariableDeclaratorId(ancestor::VariableDeclaratorWithoutId(node))); walk_binding_pattern( traverser, (node as *mut u8).add(ancestor::OFFSET_VARIABLE_DECLARATOR_ID) as *mut BindingPattern, @@ -1511,10 +1491,29 @@ pub(crate) unsafe fn walk_variable_declarator<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::VariableDeclaratorInit); walk_expression(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_variable_declarator(&mut *node, ctx); } +pub(crate) unsafe fn walk_using_declaration<'a, Tr: Traverse<'a>>( + traverser: &mut Tr, + node: *mut UsingDeclaration<'a>, + ctx: &mut TraverseCtx<'a>, +) { + traverser.enter_using_declaration(&mut *node, ctx); + ctx.push_stack(Ancestor::UsingDeclarationDeclarations( + ancestor::UsingDeclarationWithoutDeclarations(node), + )); + for item in (*((node as *mut u8).add(ancestor::OFFSET_USING_DECLARATION_DECLARATIONS) + as *mut Vec)) + .iter_mut() + { + walk_variable_declarator(traverser, item as *mut _, ctx); + } + ctx.pop_stack(); + traverser.exit_using_declaration(&mut *node, ctx); +} + pub(crate) unsafe fn walk_empty_statement<'a, Tr: Traverse<'a>>( traverser: &mut Tr, node: *mut EmptyStatement, @@ -1530,15 +1529,15 @@ pub(crate) unsafe fn walk_expression_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_expression_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ExpressionStatementExpression( - ancestor::ExpressionStatementWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::ExpressionStatementExpression( + ancestor::ExpressionStatementWithoutExpression(node), )); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_EXPRESSION_STATEMENT_EXPRESSION) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_expression_statement(&mut *node, ctx); } @@ -1548,8 +1547,7 @@ pub(crate) unsafe fn walk_if_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_if_statement(&mut *node, ctx); - let pop_token = ctx - .push_stack(Ancestor::IfStatementTest(ancestor::IfStatementWithoutTest(node, PhantomData))); + ctx.push_stack(Ancestor::IfStatementTest(ancestor::IfStatementWithoutTest(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_IF_STATEMENT_TEST) as *mut Expression, @@ -1567,7 +1565,7 @@ pub(crate) unsafe fn walk_if_statement<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::IfStatementAlternate); walk_statement(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_if_statement(&mut *node, ctx); } @@ -1577,9 +1575,7 @@ pub(crate) unsafe fn walk_do_while_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_do_while_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::DoWhileStatementBody( - ancestor::DoWhileStatementWithoutBody(node, PhantomData), - )); + ctx.push_stack(Ancestor::DoWhileStatementBody(ancestor::DoWhileStatementWithoutBody(node))); walk_statement( traverser, (node as *mut u8).add(ancestor::OFFSET_DO_WHILE_STATEMENT_BODY) as *mut Statement, @@ -1591,7 +1587,7 @@ pub(crate) unsafe fn walk_do_while_statement<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_DO_WHILE_STATEMENT_TEST) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_do_while_statement(&mut *node, ctx); } @@ -1601,9 +1597,7 @@ pub(crate) unsafe fn walk_while_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_while_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::WhileStatementTest( - ancestor::WhileStatementWithoutTest(node, PhantomData), - )); + ctx.push_stack(Ancestor::WhileStatementTest(ancestor::WhileStatementWithoutTest(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_WHILE_STATEMENT_TEST) as *mut Expression, @@ -1615,7 +1609,7 @@ pub(crate) unsafe fn walk_while_statement<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_WHILE_STATEMENT_BODY) as *mut Statement, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_while_statement(&mut *node, ctx); } @@ -1632,10 +1626,7 @@ pub(crate) unsafe fn walk_for_statement<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::ForStatementInit(ancestor::ForStatementWithoutInit( - node, - PhantomData, - ))); + ctx.push_stack(Ancestor::ForStatementInit(ancestor::ForStatementWithoutInit(node))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_FOR_STATEMENT_INIT) as *mut Option) { @@ -1659,7 +1650,7 @@ pub(crate) unsafe fn walk_for_statement<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_FOR_STATEMENT_BODY) as *mut Statement, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_for_statement(&mut *node, ctx); } @@ -1674,6 +1665,9 @@ pub(crate) unsafe fn walk_for_statement_init<'a, Tr: Traverse<'a>>( ForStatementInit::VariableDeclaration(node) => { walk_variable_declaration(traverser, (&mut **node) as *mut _, ctx) } + ForStatementInit::UsingDeclaration(node) => { + walk_using_declaration(traverser, (&mut **node) as *mut _, ctx) + } ForStatementInit::BooleanLiteral(_) | ForStatementInit::NullLiteral(_) | ForStatementInit::NumericLiteral(_) @@ -1735,9 +1729,7 @@ pub(crate) unsafe fn walk_for_in_statement<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::ForInStatementLeft( - ancestor::ForInStatementWithoutLeft(node, PhantomData), - )); + ctx.push_stack(Ancestor::ForInStatementLeft(ancestor::ForInStatementWithoutLeft(node))); walk_for_statement_left( traverser, (node as *mut u8).add(ancestor::OFFSET_FOR_IN_STATEMENT_LEFT) as *mut ForStatementLeft, @@ -1755,7 +1747,7 @@ pub(crate) unsafe fn walk_for_in_statement<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_FOR_IN_STATEMENT_BODY) as *mut Statement, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_for_in_statement(&mut *node, ctx); } @@ -1770,6 +1762,9 @@ pub(crate) unsafe fn walk_for_statement_left<'a, Tr: Traverse<'a>>( ForStatementLeft::VariableDeclaration(node) => { walk_variable_declaration(traverser, (&mut **node) as *mut _, ctx) } + ForStatementLeft::UsingDeclaration(node) => { + walk_using_declaration(traverser, (&mut **node) as *mut _, ctx) + } ForStatementLeft::AssignmentTargetIdentifier(_) | ForStatementLeft::TSAsExpression(_) | ForStatementLeft::TSSatisfiesExpression(_) @@ -1800,9 +1795,7 @@ pub(crate) unsafe fn walk_for_of_statement<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::ForOfStatementLeft( - ancestor::ForOfStatementWithoutLeft(node, PhantomData), - )); + ctx.push_stack(Ancestor::ForOfStatementLeft(ancestor::ForOfStatementWithoutLeft(node))); walk_for_statement_left( traverser, (node as *mut u8).add(ancestor::OFFSET_FOR_OF_STATEMENT_LEFT) as *mut ForStatementLeft, @@ -1820,7 +1813,7 @@ pub(crate) unsafe fn walk_for_of_statement<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_FOR_OF_STATEMENT_BODY) as *mut Statement, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_for_of_statement(&mut *node, ctx); } @@ -1831,15 +1824,13 @@ pub(crate) unsafe fn walk_continue_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_continue_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ContinueStatementLabel( - ancestor::ContinueStatementWithoutLabel(node, PhantomData), - )); + ctx.push_stack(Ancestor::ContinueStatementLabel(ancestor::ContinueStatementWithoutLabel(node))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_CONTINUE_STATEMENT_LABEL) as *mut Option) { walk_label_identifier(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_continue_statement(&mut *node, ctx); } @@ -1849,15 +1840,13 @@ pub(crate) unsafe fn walk_break_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_break_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::BreakStatementLabel( - ancestor::BreakStatementWithoutLabel(node, PhantomData), - )); + ctx.push_stack(Ancestor::BreakStatementLabel(ancestor::BreakStatementWithoutLabel(node))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_BREAK_STATEMENT_LABEL) as *mut Option) { walk_label_identifier(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_break_statement(&mut *node, ctx); } @@ -1867,15 +1856,15 @@ pub(crate) unsafe fn walk_return_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_return_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ReturnStatementArgument( - ancestor::ReturnStatementWithoutArgument(node, PhantomData), - )); + ctx.push_stack(Ancestor::ReturnStatementArgument(ancestor::ReturnStatementWithoutArgument( + node, + ))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_RETURN_STATEMENT_ARGUMENT) as *mut Option) { walk_expression(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_return_statement(&mut *node, ctx); } @@ -1885,9 +1874,7 @@ pub(crate) unsafe fn walk_with_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_with_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::WithStatementObject( - ancestor::WithStatementWithoutObject(node, PhantomData), - )); + ctx.push_stack(Ancestor::WithStatementObject(ancestor::WithStatementWithoutObject(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_WITH_STATEMENT_OBJECT) as *mut Expression, @@ -1899,7 +1886,7 @@ pub(crate) unsafe fn walk_with_statement<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_WITH_STATEMENT_BODY) as *mut Statement, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_with_statement(&mut *node, ctx); } @@ -1909,8 +1896,8 @@ pub(crate) unsafe fn walk_switch_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_switch_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::SwitchStatementDiscriminant( - ancestor::SwitchStatementWithoutDiscriminant(node, PhantomData), + ctx.push_stack(Ancestor::SwitchStatementDiscriminant( + ancestor::SwitchStatementWithoutDiscriminant(node), )); walk_expression( traverser, @@ -1931,7 +1918,7 @@ pub(crate) unsafe fn walk_switch_statement<'a, Tr: Traverse<'a>>( { walk_switch_case(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_switch_statement(&mut *node, ctx); } @@ -1942,8 +1929,7 @@ pub(crate) unsafe fn walk_switch_case<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_switch_case(&mut *node, ctx); - let pop_token = ctx - .push_stack(Ancestor::SwitchCaseTest(ancestor::SwitchCaseWithoutTest(node, PhantomData))); + ctx.push_stack(Ancestor::SwitchCaseTest(ancestor::SwitchCaseWithoutTest(node))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_SWITCH_CASE_TEST) as *mut Option) { @@ -1955,7 +1941,7 @@ pub(crate) unsafe fn walk_switch_case<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_SWITCH_CASE_CONSEQUENT) as *mut Vec, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_switch_case(&mut *node, ctx); } @@ -1965,9 +1951,7 @@ pub(crate) unsafe fn walk_labeled_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_labeled_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::LabeledStatementLabel( - ancestor::LabeledStatementWithoutLabel(node, PhantomData), - )); + ctx.push_stack(Ancestor::LabeledStatementLabel(ancestor::LabeledStatementWithoutLabel(node))); walk_label_identifier( traverser, (node as *mut u8).add(ancestor::OFFSET_LABELED_STATEMENT_LABEL) as *mut LabelIdentifier, @@ -1979,7 +1963,7 @@ pub(crate) unsafe fn walk_labeled_statement<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_LABELED_STATEMENT_BODY) as *mut Statement, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_labeled_statement(&mut *node, ctx); } @@ -1989,15 +1973,13 @@ pub(crate) unsafe fn walk_throw_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_throw_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ThrowStatementArgument( - ancestor::ThrowStatementWithoutArgument(node, PhantomData), - )); + ctx.push_stack(Ancestor::ThrowStatementArgument(ancestor::ThrowStatementWithoutArgument(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_THROW_STATEMENT_ARGUMENT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_throw_statement(&mut *node, ctx); } @@ -2007,9 +1989,7 @@ pub(crate) unsafe fn walk_try_statement<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_try_statement(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TryStatementBlock( - ancestor::TryStatementWithoutBlock(node, PhantomData), - )); + ctx.push_stack(Ancestor::TryStatementBlock(ancestor::TryStatementWithoutBlock(node))); walk_block_statement( traverser, (&mut **((node as *mut u8).add(ancestor::OFFSET_TRY_STATEMENT_BLOCK) @@ -2028,7 +2008,7 @@ pub(crate) unsafe fn walk_try_statement<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TryStatementFinalizer); walk_block_statement(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_try_statement(&mut *node, ctx); } @@ -2045,10 +2025,7 @@ pub(crate) unsafe fn walk_catch_clause<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::CatchClauseParam(ancestor::CatchClauseWithoutParam( - node, - PhantomData, - ))); + ctx.push_stack(Ancestor::CatchClauseParam(ancestor::CatchClauseWithoutParam(node))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_CATCH_CLAUSE_PARAM) as *mut Option) { @@ -2061,7 +2038,7 @@ pub(crate) unsafe fn walk_catch_clause<'a, Tr: Traverse<'a>>( as *mut Box)) as *mut _, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_catch_clause(&mut *node, ctx); } @@ -2072,15 +2049,13 @@ pub(crate) unsafe fn walk_catch_parameter<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_catch_parameter(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::CatchParameterPattern( - ancestor::CatchParameterWithoutPattern(node, PhantomData), - )); + ctx.push_stack(Ancestor::CatchParameterPattern(ancestor::CatchParameterWithoutPattern(node))); walk_binding_pattern( traverser, (node as *mut u8).add(ancestor::OFFSET_CATCH_PARAMETER_PATTERN) as *mut BindingPattern, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_catch_parameter(&mut *node, ctx); } @@ -2099,9 +2074,7 @@ pub(crate) unsafe fn walk_binding_pattern<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_binding_pattern(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::BindingPatternKind( - ancestor::BindingPatternWithoutKind(node, PhantomData), - )); + ctx.push_stack(Ancestor::BindingPatternKind(ancestor::BindingPatternWithoutKind(node))); walk_binding_pattern_kind( traverser, (node as *mut u8).add(ancestor::OFFSET_BINDING_PATTERN_KIND) as *mut BindingPatternKind, @@ -2114,7 +2087,7 @@ pub(crate) unsafe fn walk_binding_pattern<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::BindingPatternTypeAnnotation); walk_ts_type_annotation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_binding_pattern(&mut *node, ctx); } @@ -2147,9 +2120,7 @@ pub(crate) unsafe fn walk_assignment_pattern<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_assignment_pattern(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::AssignmentPatternLeft( - ancestor::AssignmentPatternWithoutLeft(node, PhantomData), - )); + ctx.push_stack(Ancestor::AssignmentPatternLeft(ancestor::AssignmentPatternWithoutLeft(node))); walk_binding_pattern( traverser, (node as *mut u8).add(ancestor::OFFSET_ASSIGNMENT_PATTERN_LEFT) as *mut BindingPattern, @@ -2161,7 +2132,7 @@ pub(crate) unsafe fn walk_assignment_pattern<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_ASSIGNMENT_PATTERN_RIGHT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_assignment_pattern(&mut *node, ctx); } @@ -2171,9 +2142,9 @@ pub(crate) unsafe fn walk_object_pattern<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_object_pattern(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ObjectPatternProperties( - ancestor::ObjectPatternWithoutProperties(node, PhantomData), - )); + ctx.push_stack(Ancestor::ObjectPatternProperties(ancestor::ObjectPatternWithoutProperties( + node, + ))); for item in (*((node as *mut u8).add(ancestor::OFFSET_OBJECT_PATTERN_PROPERTIES) as *mut Vec)) .iter_mut() @@ -2186,7 +2157,7 @@ pub(crate) unsafe fn walk_object_pattern<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::ObjectPatternRest); walk_binding_rest_element(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_object_pattern(&mut *node, ctx); } @@ -2196,9 +2167,7 @@ pub(crate) unsafe fn walk_binding_property<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_binding_property(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::BindingPropertyKey( - ancestor::BindingPropertyWithoutKey(node, PhantomData), - )); + ctx.push_stack(Ancestor::BindingPropertyKey(ancestor::BindingPropertyWithoutKey(node))); walk_property_key( traverser, (node as *mut u8).add(ancestor::OFFSET_BINDING_PROPERTY_KEY) as *mut PropertyKey, @@ -2210,7 +2179,7 @@ pub(crate) unsafe fn walk_binding_property<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_BINDING_PROPERTY_VALUE) as *mut BindingPattern, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_binding_property(&mut *node, ctx); } @@ -2220,9 +2189,7 @@ pub(crate) unsafe fn walk_array_pattern<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_array_pattern(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ArrayPatternElements( - ancestor::ArrayPatternWithoutElements(node, PhantomData), - )); + ctx.push_stack(Ancestor::ArrayPatternElements(ancestor::ArrayPatternWithoutElements(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_ARRAY_PATTERN_ELEMENTS) as *mut Vec>)) .iter_mut() @@ -2236,7 +2203,7 @@ pub(crate) unsafe fn walk_array_pattern<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::ArrayPatternRest); walk_binding_rest_element(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_array_pattern(&mut *node, ctx); } @@ -2246,8 +2213,8 @@ pub(crate) unsafe fn walk_binding_rest_element<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_binding_rest_element(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::BindingRestElementArgument( - ancestor::BindingRestElementWithoutArgument(node, PhantomData), + ctx.push_stack(Ancestor::BindingRestElementArgument( + ancestor::BindingRestElementWithoutArgument(node), )); walk_binding_pattern( traverser, @@ -2255,7 +2222,7 @@ pub(crate) unsafe fn walk_binding_rest_element<'a, Tr: Traverse<'a>>( as *mut BindingPattern, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_binding_rest_element(&mut *node, ctx); } @@ -2272,8 +2239,7 @@ pub(crate) unsafe fn walk_function<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = - ctx.push_stack(Ancestor::FunctionId(ancestor::FunctionWithoutId(node, PhantomData))); + ctx.push_stack(Ancestor::FunctionId(ancestor::FunctionWithoutId(node))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_FUNCTION_ID) as *mut Option) { @@ -2310,7 +2276,7 @@ pub(crate) unsafe fn walk_function<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::FunctionBody); walk_function_body(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_function(&mut *node, ctx); } @@ -2321,9 +2287,7 @@ pub(crate) unsafe fn walk_formal_parameters<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_formal_parameters(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::FormalParametersItems( - ancestor::FormalParametersWithoutItems(node, PhantomData), - )); + ctx.push_stack(Ancestor::FormalParametersItems(ancestor::FormalParametersWithoutItems(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_FORMAL_PARAMETERS_ITEMS) as *mut Vec)) .iter_mut() @@ -2336,7 +2300,7 @@ pub(crate) unsafe fn walk_formal_parameters<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::FormalParametersRest); walk_binding_rest_element(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_formal_parameters(&mut *node, ctx); } @@ -2346,8 +2310,8 @@ pub(crate) unsafe fn walk_formal_parameter<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_formal_parameter(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::FormalParameterDecorators( - ancestor::FormalParameterWithoutDecorators(node, PhantomData), + ctx.push_stack(Ancestor::FormalParameterDecorators( + ancestor::FormalParameterWithoutDecorators(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_FORMAL_PARAMETER_DECORATORS) as *mut Vec)) @@ -2361,7 +2325,7 @@ pub(crate) unsafe fn walk_formal_parameter<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_FORMAL_PARAMETER_PATTERN) as *mut BindingPattern, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_formal_parameter(&mut *node, ctx); } @@ -2371,9 +2335,7 @@ pub(crate) unsafe fn walk_function_body<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_function_body(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::FunctionBodyDirectives( - ancestor::FunctionBodyWithoutDirectives(node, PhantomData), - )); + ctx.push_stack(Ancestor::FunctionBodyDirectives(ancestor::FunctionBodyWithoutDirectives(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_FUNCTION_BODY_DIRECTIVES) as *mut Vec)) .iter_mut() @@ -2386,7 +2348,7 @@ pub(crate) unsafe fn walk_function_body<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_FUNCTION_BODY_STATEMENTS) as *mut Vec, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_function_body(&mut *node, ctx); } @@ -2403,8 +2365,8 @@ pub(crate) unsafe fn walk_arrow_function_expression<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::ArrowFunctionExpressionTypeParameters( - ancestor::ArrowFunctionExpressionWithoutTypeParameters(node, PhantomData), + ctx.push_stack(Ancestor::ArrowFunctionExpressionTypeParameters( + ancestor::ArrowFunctionExpressionWithoutTypeParameters(node), )); if let Some(field) = &mut *((node as *mut u8) .add(ancestor::OFFSET_ARROW_FUNCTION_EXPRESSION_TYPE_PARAMETERS) @@ -2433,7 +2395,7 @@ pub(crate) unsafe fn walk_arrow_function_expression<'a, Tr: Traverse<'a>>( as *mut Box)) as *mut _, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_arrow_function_expression(&mut *node, ctx); } @@ -2444,15 +2406,15 @@ pub(crate) unsafe fn walk_yield_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_yield_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::YieldExpressionArgument( - ancestor::YieldExpressionWithoutArgument(node, PhantomData), - )); + ctx.push_stack(Ancestor::YieldExpressionArgument(ancestor::YieldExpressionWithoutArgument( + node, + ))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_YIELD_EXPRESSION_ARGUMENT) as *mut Option) { walk_expression(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_yield_expression(&mut *node, ctx); } @@ -2462,8 +2424,7 @@ pub(crate) unsafe fn walk_class<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_class(&mut *node, ctx); - let pop_token = ctx - .push_stack(Ancestor::ClassDecorators(ancestor::ClassWithoutDecorators(node, PhantomData))); + ctx.push_stack(Ancestor::ClassDecorators(ancestor::ClassWithoutDecorators(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_CLASS_DECORATORS) as *mut Vec)) .iter_mut() { @@ -2514,7 +2475,7 @@ pub(crate) unsafe fn walk_class<'a, Tr: Traverse<'a>>( as *mut _, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_class(&mut *node, ctx); } @@ -2525,15 +2486,14 @@ pub(crate) unsafe fn walk_class_body<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_class_body(&mut *node, ctx); - let pop_token = - ctx.push_stack(Ancestor::ClassBodyBody(ancestor::ClassBodyWithoutBody(node, PhantomData))); + ctx.push_stack(Ancestor::ClassBodyBody(ancestor::ClassBodyWithoutBody(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_CLASS_BODY_BODY) as *mut Vec)) .iter_mut() { walk_class_element(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_class_body(&mut *node, ctx); } @@ -2569,8 +2529,8 @@ pub(crate) unsafe fn walk_method_definition<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_method_definition(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::MethodDefinitionDecorators( - ancestor::MethodDefinitionWithoutDecorators(node, PhantomData), + ctx.push_stack(Ancestor::MethodDefinitionDecorators( + ancestor::MethodDefinitionWithoutDecorators(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_METHOD_DEFINITION_DECORATORS) as *mut Vec)) @@ -2591,7 +2551,7 @@ pub(crate) unsafe fn walk_method_definition<'a, Tr: Traverse<'a>>( as *mut Box)) as *mut _, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_method_definition(&mut *node, ctx); } @@ -2601,8 +2561,8 @@ pub(crate) unsafe fn walk_property_definition<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_property_definition(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::PropertyDefinitionDecorators( - ancestor::PropertyDefinitionWithoutDecorators(node, PhantomData), + ctx.push_stack(Ancestor::PropertyDefinitionDecorators( + ancestor::PropertyDefinitionWithoutDecorators(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_PROPERTY_DEFINITION_DECORATORS) as *mut Vec)) @@ -2629,7 +2589,7 @@ pub(crate) unsafe fn walk_property_definition<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::PropertyDefinitionTypeAnnotation); walk_ts_type_annotation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_property_definition(&mut *node, ctx); } @@ -2655,14 +2615,13 @@ pub(crate) unsafe fn walk_static_block<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx - .push_stack(Ancestor::StaticBlockBody(ancestor::StaticBlockWithoutBody(node, PhantomData))); + ctx.push_stack(Ancestor::StaticBlockBody(ancestor::StaticBlockWithoutBody(node))); walk_statements( traverser, (node as *mut u8).add(ancestor::OFFSET_STATIC_BLOCK_BODY) as *mut Vec, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_static_block(&mut *node, ctx); } @@ -2702,8 +2661,8 @@ pub(crate) unsafe fn walk_accessor_property<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_accessor_property(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::AccessorPropertyDecorators( - ancestor::AccessorPropertyWithoutDecorators(node, PhantomData), + ctx.push_stack(Ancestor::AccessorPropertyDecorators( + ancestor::AccessorPropertyWithoutDecorators(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_ACCESSOR_PROPERTY_DECORATORS) as *mut Vec)) @@ -2730,7 +2689,7 @@ pub(crate) unsafe fn walk_accessor_property<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::AccessorPropertyTypeAnnotation); walk_ts_type_annotation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_accessor_property(&mut *node, ctx); } @@ -2740,9 +2699,7 @@ pub(crate) unsafe fn walk_import_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_import_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ImportExpressionSource( - ancestor::ImportExpressionWithoutSource(node, PhantomData), - )); + ctx.push_stack(Ancestor::ImportExpressionSource(ancestor::ImportExpressionWithoutSource(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_IMPORT_EXPRESSION_SOURCE) as *mut Expression, @@ -2755,7 +2712,7 @@ pub(crate) unsafe fn walk_import_expression<'a, Tr: Traverse<'a>>( { walk_expression(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_import_expression(&mut *node, ctx); } @@ -2765,8 +2722,8 @@ pub(crate) unsafe fn walk_import_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_import_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ImportDeclarationSpecifiers( - ancestor::ImportDeclarationWithoutSpecifiers(node, PhantomData), + ctx.push_stack(Ancestor::ImportDeclarationSpecifiers( + ancestor::ImportDeclarationWithoutSpecifiers(node), )); if let Some(field) = &mut *((node as *mut u8) .add(ancestor::OFFSET_IMPORT_DECLARATION_SPECIFIERS) @@ -2789,7 +2746,7 @@ pub(crate) unsafe fn walk_import_declaration<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::ImportDeclarationWithClause); walk_with_clause(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_import_declaration(&mut *node, ctx); } @@ -2819,9 +2776,9 @@ pub(crate) unsafe fn walk_import_specifier<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_import_specifier(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ImportSpecifierImported( - ancestor::ImportSpecifierWithoutImported(node, PhantomData), - )); + ctx.push_stack(Ancestor::ImportSpecifierImported(ancestor::ImportSpecifierWithoutImported( + node, + ))); walk_module_export_name( traverser, (node as *mut u8).add(ancestor::OFFSET_IMPORT_SPECIFIER_IMPORTED) as *mut ModuleExportName, @@ -2833,7 +2790,7 @@ pub(crate) unsafe fn walk_import_specifier<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_IMPORT_SPECIFIER_LOCAL) as *mut BindingIdentifier, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_import_specifier(&mut *node, ctx); } @@ -2843,8 +2800,8 @@ pub(crate) unsafe fn walk_import_default_specifier<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_import_default_specifier(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ImportDefaultSpecifierLocal( - ancestor::ImportDefaultSpecifierWithoutLocal(node, PhantomData), + ctx.push_stack(Ancestor::ImportDefaultSpecifierLocal( + ancestor::ImportDefaultSpecifierWithoutLocal(node), )); walk_binding_identifier( traverser, @@ -2852,7 +2809,7 @@ pub(crate) unsafe fn walk_import_default_specifier<'a, Tr: Traverse<'a>>( as *mut BindingIdentifier, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_import_default_specifier(&mut *node, ctx); } @@ -2862,8 +2819,8 @@ pub(crate) unsafe fn walk_import_namespace_specifier<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_import_namespace_specifier(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ImportNamespaceSpecifierLocal( - ancestor::ImportNamespaceSpecifierWithoutLocal(node, PhantomData), + ctx.push_stack(Ancestor::ImportNamespaceSpecifierLocal( + ancestor::ImportNamespaceSpecifierWithoutLocal(node), )); walk_binding_identifier( traverser, @@ -2871,7 +2828,7 @@ pub(crate) unsafe fn walk_import_namespace_specifier<'a, Tr: Traverse<'a>>( as *mut BindingIdentifier, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_import_namespace_specifier(&mut *node, ctx); } @@ -2881,8 +2838,8 @@ pub(crate) unsafe fn walk_with_clause<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_with_clause(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::WithClauseAttributesKeyword( - ancestor::WithClauseWithoutAttributesKeyword(node, PhantomData), + ctx.push_stack(Ancestor::WithClauseAttributesKeyword( + ancestor::WithClauseWithoutAttributesKeyword(node), )); walk_identifier_name( traverser, @@ -2897,7 +2854,7 @@ pub(crate) unsafe fn walk_with_clause<'a, Tr: Traverse<'a>>( { walk_import_attribute(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_with_clause(&mut *node, ctx); } @@ -2907,9 +2864,7 @@ pub(crate) unsafe fn walk_import_attribute<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_import_attribute(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ImportAttributeKey( - ancestor::ImportAttributeWithoutKey(node, PhantomData), - )); + ctx.push_stack(Ancestor::ImportAttributeKey(ancestor::ImportAttributeWithoutKey(node))); walk_import_attribute_key( traverser, (node as *mut u8).add(ancestor::OFFSET_IMPORT_ATTRIBUTE_KEY) as *mut ImportAttributeKey, @@ -2921,7 +2876,7 @@ pub(crate) unsafe fn walk_import_attribute<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_IMPORT_ATTRIBUTE_VALUE) as *mut StringLiteral, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_import_attribute(&mut *node, ctx); } @@ -2948,8 +2903,8 @@ pub(crate) unsafe fn walk_export_named_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_export_named_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ExportNamedDeclarationDeclaration( - ancestor::ExportNamedDeclarationWithoutDeclaration(node, PhantomData), + ctx.push_stack(Ancestor::ExportNamedDeclarationDeclaration( + ancestor::ExportNamedDeclarationWithoutDeclaration(node), )); if let Some(field) = &mut *((node as *mut u8) .add(ancestor::OFFSET_EXPORT_NAMED_DECLARATION_DECLARATION) @@ -2978,7 +2933,7 @@ pub(crate) unsafe fn walk_export_named_declaration<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::ExportNamedDeclarationWithClause); walk_with_clause(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_export_named_declaration(&mut *node, ctx); } @@ -2988,8 +2943,8 @@ pub(crate) unsafe fn walk_export_default_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_export_default_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ExportDefaultDeclarationDeclaration( - ancestor::ExportDefaultDeclarationWithoutDeclaration(node, PhantomData), + ctx.push_stack(Ancestor::ExportDefaultDeclarationDeclaration( + ancestor::ExportDefaultDeclarationWithoutDeclaration(node), )); walk_export_default_declaration_kind( traverser, @@ -3004,7 +2959,7 @@ pub(crate) unsafe fn walk_export_default_declaration<'a, Tr: Traverse<'a>>( as *mut ModuleExportName, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_export_default_declaration(&mut *node, ctx); } @@ -3014,8 +2969,8 @@ pub(crate) unsafe fn walk_export_all_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_export_all_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ExportAllDeclarationExported( - ancestor::ExportAllDeclarationWithoutExported(node, PhantomData), + ctx.push_stack(Ancestor::ExportAllDeclarationExported( + ancestor::ExportAllDeclarationWithoutExported(node), )); if let Some(field) = &mut *((node as *mut u8) .add(ancestor::OFFSET_EXPORT_ALL_DECLARATION_EXPORTED) @@ -3036,7 +2991,7 @@ pub(crate) unsafe fn walk_export_all_declaration<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::ExportAllDeclarationWithClause); walk_with_clause(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_export_all_declaration(&mut *node, ctx); } @@ -3046,9 +3001,7 @@ pub(crate) unsafe fn walk_export_specifier<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_export_specifier(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::ExportSpecifierLocal( - ancestor::ExportSpecifierWithoutLocal(node, PhantomData), - )); + ctx.push_stack(Ancestor::ExportSpecifierLocal(ancestor::ExportSpecifierWithoutLocal(node))); walk_module_export_name( traverser, (node as *mut u8).add(ancestor::OFFSET_EXPORT_SPECIFIER_LOCAL) as *mut ModuleExportName, @@ -3060,7 +3013,7 @@ pub(crate) unsafe fn walk_export_specifier<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_EXPORT_SPECIFIER_EXPORTED) as *mut ModuleExportName, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_export_specifier(&mut *node, ctx); } @@ -3154,9 +3107,9 @@ pub(crate) unsafe fn walk_jsx_element<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_element(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXElementOpeningElement( - ancestor::JSXElementWithoutOpeningElement(node, PhantomData), - )); + ctx.push_stack(Ancestor::JSXElementOpeningElement(ancestor::JSXElementWithoutOpeningElement( + node, + ))); walk_jsx_opening_element( traverser, (&mut **((node as *mut u8).add(ancestor::OFFSET_JSX_ELEMENT_OPENING_ELEMENT) @@ -3176,7 +3129,7 @@ pub(crate) unsafe fn walk_jsx_element<'a, Tr: Traverse<'a>>( { walk_jsx_child(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_element(&mut *node, ctx); } @@ -3186,9 +3139,7 @@ pub(crate) unsafe fn walk_jsx_opening_element<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_opening_element(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXOpeningElementName( - ancestor::JSXOpeningElementWithoutName(node, PhantomData), - )); + ctx.push_stack(Ancestor::JSXOpeningElementName(ancestor::JSXOpeningElementWithoutName(node))); walk_jsx_element_name( traverser, (node as *mut u8).add(ancestor::OFFSET_JSX_OPENING_ELEMENT_NAME) as *mut JSXElementName, @@ -3208,7 +3159,7 @@ pub(crate) unsafe fn walk_jsx_opening_element<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::JSXOpeningElementTypeParameters); walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_opening_element(&mut *node, ctx); } @@ -3218,15 +3169,13 @@ pub(crate) unsafe fn walk_jsx_closing_element<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_closing_element(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXClosingElementName( - ancestor::JSXClosingElementWithoutName(node, PhantomData), - )); + ctx.push_stack(Ancestor::JSXClosingElementName(ancestor::JSXClosingElementWithoutName(node))); walk_jsx_element_name( traverser, (node as *mut u8).add(ancestor::OFFSET_JSX_CLOSING_ELEMENT_NAME) as *mut JSXElementName, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_closing_element(&mut *node, ctx); } @@ -3236,16 +3185,14 @@ pub(crate) unsafe fn walk_jsx_fragment<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_fragment(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXFragmentChildren( - ancestor::JSXFragmentWithoutChildren(node, PhantomData), - )); + ctx.push_stack(Ancestor::JSXFragmentChildren(ancestor::JSXFragmentWithoutChildren(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_JSX_FRAGMENT_CHILDREN) as *mut Vec)) .iter_mut() { walk_jsx_child(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_fragment(&mut *node, ctx); } @@ -3275,8 +3222,8 @@ pub(crate) unsafe fn walk_jsx_namespaced_name<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_namespaced_name(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXNamespacedNameNamespace( - ancestor::JSXNamespacedNameWithoutNamespace(node, PhantomData), + ctx.push_stack(Ancestor::JSXNamespacedNameNamespace( + ancestor::JSXNamespacedNameWithoutNamespace(node), )); walk_jsx_identifier( traverser, @@ -3289,7 +3236,7 @@ pub(crate) unsafe fn walk_jsx_namespaced_name<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_JSX_NAMESPACED_NAME_PROPERTY) as *mut JSXIdentifier, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_namespaced_name(&mut *node, ctx); } @@ -3299,8 +3246,8 @@ pub(crate) unsafe fn walk_jsx_member_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_member_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXMemberExpressionObject( - ancestor::JSXMemberExpressionWithoutObject(node, PhantomData), + ctx.push_stack(Ancestor::JSXMemberExpressionObject( + ancestor::JSXMemberExpressionWithoutObject(node), )); walk_jsx_member_expression_object( traverser, @@ -3315,7 +3262,7 @@ pub(crate) unsafe fn walk_jsx_member_expression<'a, Tr: Traverse<'a>>( as *mut JSXIdentifier, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_member_expression(&mut *node, ctx); } @@ -3342,8 +3289,8 @@ pub(crate) unsafe fn walk_jsx_expression_container<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_expression_container(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXExpressionContainerExpression( - ancestor::JSXExpressionContainerWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::JSXExpressionContainerExpression( + ancestor::JSXExpressionContainerWithoutExpression(node), )); walk_jsx_expression( traverser, @@ -3351,7 +3298,7 @@ pub(crate) unsafe fn walk_jsx_expression_container<'a, Tr: Traverse<'a>>( as *mut JSXExpression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_expression_container(&mut *node, ctx); } @@ -3445,10 +3392,7 @@ pub(crate) unsafe fn walk_jsx_attribute<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_attribute(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXAttributeName(ancestor::JSXAttributeWithoutName( - node, - PhantomData, - ))); + ctx.push_stack(Ancestor::JSXAttributeName(ancestor::JSXAttributeWithoutName(node))); walk_jsx_attribute_name( traverser, (node as *mut u8).add(ancestor::OFFSET_JSX_ATTRIBUTE_NAME) as *mut JSXAttributeName, @@ -3460,7 +3404,7 @@ pub(crate) unsafe fn walk_jsx_attribute<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::JSXAttributeValue); walk_jsx_attribute_value(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_attribute(&mut *node, ctx); } @@ -3470,15 +3414,15 @@ pub(crate) unsafe fn walk_jsx_spread_attribute<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_spread_attribute(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXSpreadAttributeArgument( - ancestor::JSXSpreadAttributeWithoutArgument(node, PhantomData), + ctx.push_stack(Ancestor::JSXSpreadAttributeArgument( + ancestor::JSXSpreadAttributeWithoutArgument(node), )); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_JSX_SPREAD_ATTRIBUTE_ARGUMENT) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_spread_attribute(&mut *node, ctx); } @@ -3555,15 +3499,15 @@ pub(crate) unsafe fn walk_jsx_spread_child<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_jsx_spread_child(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSXSpreadChildExpression( - ancestor::JSXSpreadChildWithoutExpression(node, PhantomData), - )); + ctx.push_stack(Ancestor::JSXSpreadChildExpression(ancestor::JSXSpreadChildWithoutExpression( + node, + ))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_JSX_SPREAD_CHILD_EXPRESSION) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_jsx_spread_child(&mut *node, ctx); } @@ -3636,9 +3580,7 @@ pub(crate) unsafe fn walk_ts_this_parameter<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_this_parameter(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSThisParameterThis( - ancestor::TSThisParameterWithoutThis(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSThisParameterThis(ancestor::TSThisParameterWithoutThis(node))); walk_identifier_name( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_THIS_PARAMETER_THIS) as *mut IdentifierName, @@ -3651,7 +3593,7 @@ pub(crate) unsafe fn walk_ts_this_parameter<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSThisParameterTypeAnnotation); walk_ts_type_annotation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_this_parameter(&mut *node, ctx); } @@ -3661,9 +3603,7 @@ pub(crate) unsafe fn walk_ts_enum_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_enum_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSEnumDeclarationId( - ancestor::TSEnumDeclarationWithoutId(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSEnumDeclarationId(ancestor::TSEnumDeclarationWithoutId(node))); walk_binding_identifier( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_ENUM_DECLARATION_ID) as *mut BindingIdentifier, @@ -3683,7 +3623,7 @@ pub(crate) unsafe fn walk_ts_enum_declaration<'a, Tr: Traverse<'a>>( { walk_ts_enum_member(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_ts_enum_declaration(&mut *node, ctx); } @@ -3694,8 +3634,7 @@ pub(crate) unsafe fn walk_ts_enum_member<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_enum_member(&mut *node, ctx); - let pop_token = ctx - .push_stack(Ancestor::TSEnumMemberId(ancestor::TSEnumMemberWithoutId(node, PhantomData))); + ctx.push_stack(Ancestor::TSEnumMemberId(ancestor::TSEnumMemberWithoutId(node))); walk_ts_enum_member_name( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_ENUM_MEMBER_ID) as *mut TSEnumMemberName, @@ -3707,7 +3646,7 @@ pub(crate) unsafe fn walk_ts_enum_member<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSEnumMemberInitializer); walk_expression(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_enum_member(&mut *node, ctx); } @@ -3784,15 +3723,15 @@ pub(crate) unsafe fn walk_ts_type_annotation<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_annotation(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeAnnotationTypeAnnotation( - ancestor::TSTypeAnnotationWithoutTypeAnnotation(node, PhantomData), + ctx.push_stack(Ancestor::TSTypeAnnotationTypeAnnotation( + ancestor::TSTypeAnnotationWithoutTypeAnnotation(node), )); walk_ts_type( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_TYPE_ANNOTATION_TYPE_ANNOTATION) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_annotation(&mut *node, ctx); } @@ -3802,15 +3741,13 @@ pub(crate) unsafe fn walk_ts_literal_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_literal_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSLiteralTypeLiteral( - ancestor::TSLiteralTypeWithoutLiteral(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSLiteralTypeLiteral(ancestor::TSLiteralTypeWithoutLiteral(node))); walk_ts_literal( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_LITERAL_TYPE_LITERAL) as *mut TSLiteral, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_literal_type(&mut *node, ctx); } @@ -3967,8 +3904,8 @@ pub(crate) unsafe fn walk_ts_conditional_type<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::TSConditionalTypeCheckType( - ancestor::TSConditionalTypeWithoutCheckType(node, PhantomData), + ctx.push_stack(Ancestor::TSConditionalTypeCheckType( + ancestor::TSConditionalTypeWithoutCheckType(node), )); walk_ts_type( traverser, @@ -3993,7 +3930,7 @@ pub(crate) unsafe fn walk_ts_conditional_type<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_TS_CONDITIONAL_TYPE_FALSE_TYPE) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_ts_conditional_type(&mut *node, ctx); } @@ -4004,16 +3941,13 @@ pub(crate) unsafe fn walk_ts_union_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_union_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSUnionTypeTypes(ancestor::TSUnionTypeWithoutTypes( - node, - PhantomData, - ))); + ctx.push_stack(Ancestor::TSUnionTypeTypes(ancestor::TSUnionTypeWithoutTypes(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_UNION_TYPE_TYPES) as *mut Vec)) .iter_mut() { walk_ts_type(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_union_type(&mut *node, ctx); } @@ -4023,16 +3957,16 @@ pub(crate) unsafe fn walk_ts_intersection_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_intersection_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSIntersectionTypeTypes( - ancestor::TSIntersectionTypeWithoutTypes(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSIntersectionTypeTypes(ancestor::TSIntersectionTypeWithoutTypes( + node, + ))); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_INTERSECTION_TYPE_TYPES) as *mut Vec)) .iter_mut() { walk_ts_type(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_intersection_type(&mut *node, ctx); } @@ -4042,8 +3976,8 @@ pub(crate) unsafe fn walk_ts_parenthesized_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_parenthesized_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSParenthesizedTypeTypeAnnotation( - ancestor::TSParenthesizedTypeWithoutTypeAnnotation(node, PhantomData), + ctx.push_stack(Ancestor::TSParenthesizedTypeTypeAnnotation( + ancestor::TSParenthesizedTypeWithoutTypeAnnotation(node), )); walk_ts_type( traverser, @@ -4051,7 +3985,7 @@ pub(crate) unsafe fn walk_ts_parenthesized_type<'a, Tr: Traverse<'a>>( as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_parenthesized_type(&mut *node, ctx); } @@ -4061,15 +3995,15 @@ pub(crate) unsafe fn walk_ts_type_operator<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_operator(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeOperatorTypeAnnotation( - ancestor::TSTypeOperatorWithoutTypeAnnotation(node, PhantomData), + ctx.push_stack(Ancestor::TSTypeOperatorTypeAnnotation( + ancestor::TSTypeOperatorWithoutTypeAnnotation(node), )); walk_ts_type( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_TYPE_OPERATOR_TYPE_ANNOTATION) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_operator(&mut *node, ctx); } @@ -4079,15 +4013,13 @@ pub(crate) unsafe fn walk_ts_array_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_array_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSArrayTypeElementType( - ancestor::TSArrayTypeWithoutElementType(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSArrayTypeElementType(ancestor::TSArrayTypeWithoutElementType(node))); walk_ts_type( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_ARRAY_TYPE_ELEMENT_TYPE) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_array_type(&mut *node, ctx); } @@ -4097,8 +4029,8 @@ pub(crate) unsafe fn walk_ts_indexed_access_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_indexed_access_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSIndexedAccessTypeObjectType( - ancestor::TSIndexedAccessTypeWithoutObjectType(node, PhantomData), + ctx.push_stack(Ancestor::TSIndexedAccessTypeObjectType( + ancestor::TSIndexedAccessTypeWithoutObjectType(node), )); walk_ts_type( traverser, @@ -4111,7 +4043,7 @@ pub(crate) unsafe fn walk_ts_indexed_access_type<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_TS_INDEXED_ACCESS_TYPE_INDEX_TYPE) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_indexed_access_type(&mut *node, ctx); } @@ -4121,16 +4053,16 @@ pub(crate) unsafe fn walk_ts_tuple_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_tuple_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTupleTypeElementTypes( - ancestor::TSTupleTypeWithoutElementTypes(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSTupleTypeElementTypes(ancestor::TSTupleTypeWithoutElementTypes( + node, + ))); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TUPLE_TYPE_ELEMENT_TYPES) as *mut Vec)) .iter_mut() { walk_ts_tuple_element(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_tuple_type(&mut *node, ctx); } @@ -4140,8 +4072,8 @@ pub(crate) unsafe fn walk_ts_named_tuple_member<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_named_tuple_member(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSNamedTupleMemberElementType( - ancestor::TSNamedTupleMemberWithoutElementType(node, PhantomData), + ctx.push_stack(Ancestor::TSNamedTupleMemberElementType( + ancestor::TSNamedTupleMemberWithoutElementType(node), )); walk_ts_tuple_element( traverser, @@ -4155,7 +4087,7 @@ pub(crate) unsafe fn walk_ts_named_tuple_member<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_TS_NAMED_TUPLE_MEMBER_LABEL) as *mut IdentifierName, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_named_tuple_member(&mut *node, ctx); } @@ -4165,15 +4097,15 @@ pub(crate) unsafe fn walk_ts_optional_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_optional_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSOptionalTypeTypeAnnotation( - ancestor::TSOptionalTypeWithoutTypeAnnotation(node, PhantomData), + ctx.push_stack(Ancestor::TSOptionalTypeTypeAnnotation( + ancestor::TSOptionalTypeWithoutTypeAnnotation(node), )); walk_ts_type( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_OPTIONAL_TYPE_TYPE_ANNOTATION) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_optional_type(&mut *node, ctx); } @@ -4183,15 +4115,15 @@ pub(crate) unsafe fn walk_ts_rest_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_rest_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSRestTypeTypeAnnotation( - ancestor::TSRestTypeWithoutTypeAnnotation(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSRestTypeTypeAnnotation(ancestor::TSRestTypeWithoutTypeAnnotation( + node, + ))); walk_ts_type( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_REST_TYPE_TYPE_ANNOTATION) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_rest_type(&mut *node, ctx); } @@ -4382,9 +4314,9 @@ pub(crate) unsafe fn walk_ts_type_reference<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_reference(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeReferenceTypeName( - ancestor::TSTypeReferenceWithoutTypeName(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSTypeReferenceTypeName(ancestor::TSTypeReferenceWithoutTypeName( + node, + ))); walk_ts_type_name( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_TYPE_REFERENCE_TYPE_NAME) as *mut TSTypeName, @@ -4397,7 +4329,7 @@ pub(crate) unsafe fn walk_ts_type_reference<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSTypeReferenceTypeParameters); walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_reference(&mut *node, ctx); } @@ -4424,9 +4356,7 @@ pub(crate) unsafe fn walk_ts_qualified_name<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_qualified_name(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSQualifiedNameLeft( - ancestor::TSQualifiedNameWithoutLeft(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSQualifiedNameLeft(ancestor::TSQualifiedNameWithoutLeft(node))); walk_ts_type_name( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_QUALIFIED_NAME_LEFT) as *mut TSTypeName, @@ -4438,7 +4368,7 @@ pub(crate) unsafe fn walk_ts_qualified_name<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_TS_QUALIFIED_NAME_RIGHT) as *mut IdentifierName, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_qualified_name(&mut *node, ctx); } @@ -4448,8 +4378,8 @@ pub(crate) unsafe fn walk_ts_type_parameter_instantiation<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_parameter_instantiation(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeParameterInstantiationParams( - ancestor::TSTypeParameterInstantiationWithoutParams(node, PhantomData), + ctx.push_stack(Ancestor::TSTypeParameterInstantiationParams( + ancestor::TSTypeParameterInstantiationWithoutParams(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TYPE_PARAMETER_INSTANTIATION_PARAMS) as *mut Vec)) @@ -4457,7 +4387,7 @@ pub(crate) unsafe fn walk_ts_type_parameter_instantiation<'a, Tr: Traverse<'a>>( { walk_ts_type(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_parameter_instantiation(&mut *node, ctx); } @@ -4467,9 +4397,7 @@ pub(crate) unsafe fn walk_ts_type_parameter<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_parameter(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeParameterName( - ancestor::TSTypeParameterWithoutName(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSTypeParameterName(ancestor::TSTypeParameterWithoutName(node))); walk_binding_identifier( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_TYPE_PARAMETER_NAME) as *mut BindingIdentifier, @@ -4487,7 +4415,7 @@ pub(crate) unsafe fn walk_ts_type_parameter<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSTypeParameterDefault); walk_ts_type(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_parameter(&mut *node, ctx); } @@ -4497,8 +4425,8 @@ pub(crate) unsafe fn walk_ts_type_parameter_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_parameter_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeParameterDeclarationParams( - ancestor::TSTypeParameterDeclarationWithoutParams(node, PhantomData), + ctx.push_stack(Ancestor::TSTypeParameterDeclarationParams( + ancestor::TSTypeParameterDeclarationWithoutParams(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TYPE_PARAMETER_DECLARATION_PARAMS) as *mut Vec)) @@ -4506,7 +4434,7 @@ pub(crate) unsafe fn walk_ts_type_parameter_declaration<'a, Tr: Traverse<'a>>( { walk_ts_type_parameter(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_parameter_declaration(&mut *node, ctx); } @@ -4516,9 +4444,9 @@ pub(crate) unsafe fn walk_ts_type_alias_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_alias_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeAliasDeclarationId( - ancestor::TSTypeAliasDeclarationWithoutId(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSTypeAliasDeclarationId(ancestor::TSTypeAliasDeclarationWithoutId( + node, + ))); walk_binding_identifier( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_TYPE_ALIAS_DECLARATION_ID) @@ -4546,7 +4474,7 @@ pub(crate) unsafe fn walk_ts_type_alias_declaration<'a, Tr: Traverse<'a>>( as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_ts_type_alias_declaration(&mut *node, ctx); } @@ -4557,8 +4485,8 @@ pub(crate) unsafe fn walk_ts_class_implements<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_class_implements(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSClassImplementsExpression( - ancestor::TSClassImplementsWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::TSClassImplementsExpression( + ancestor::TSClassImplementsWithoutExpression(node), )); walk_ts_type_name( traverser, @@ -4572,7 +4500,7 @@ pub(crate) unsafe fn walk_ts_class_implements<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSClassImplementsTypeParameters); walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_class_implements(&mut *node, ctx); } @@ -4582,9 +4510,9 @@ pub(crate) unsafe fn walk_ts_interface_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_interface_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSInterfaceDeclarationId( - ancestor::TSInterfaceDeclarationWithoutId(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSInterfaceDeclarationId(ancestor::TSInterfaceDeclarationWithoutId( + node, + ))); walk_binding_identifier( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_INTERFACE_DECLARATION_ID) @@ -4621,7 +4549,7 @@ pub(crate) unsafe fn walk_ts_interface_declaration<'a, Tr: Traverse<'a>>( as *mut Box)) as *mut _, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_ts_interface_declaration(&mut *node, ctx); } @@ -4632,16 +4560,14 @@ pub(crate) unsafe fn walk_ts_interface_body<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_interface_body(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSInterfaceBodyBody( - ancestor::TSInterfaceBodyWithoutBody(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSInterfaceBodyBody(ancestor::TSInterfaceBodyWithoutBody(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_INTERFACE_BODY_BODY) as *mut Vec)) .iter_mut() { walk_ts_signature(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_interface_body(&mut *node, ctx); } @@ -4651,9 +4577,7 @@ pub(crate) unsafe fn walk_ts_property_signature<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_property_signature(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSPropertySignatureKey( - ancestor::TSPropertySignatureWithoutKey(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSPropertySignatureKey(ancestor::TSPropertySignatureWithoutKey(node))); walk_property_key( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_PROPERTY_SIGNATURE_KEY) as *mut PropertyKey, @@ -4666,7 +4590,7 @@ pub(crate) unsafe fn walk_ts_property_signature<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSPropertySignatureTypeAnnotation); walk_ts_type_annotation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_property_signature(&mut *node, ctx); } @@ -4702,8 +4626,8 @@ pub(crate) unsafe fn walk_ts_index_signature<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_index_signature(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSIndexSignatureParameters( - ancestor::TSIndexSignatureWithoutParameters(node, PhantomData), + ctx.push_stack(Ancestor::TSIndexSignatureParameters( + ancestor::TSIndexSignatureWithoutParameters(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_INDEX_SIGNATURE_PARAMETERS) as *mut Vec)) @@ -4718,7 +4642,7 @@ pub(crate) unsafe fn walk_ts_index_signature<'a, Tr: Traverse<'a>>( as *mut Box)) as *mut _, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_index_signature(&mut *node, ctx); } @@ -4728,8 +4652,8 @@ pub(crate) unsafe fn walk_ts_call_signature_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_call_signature_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSCallSignatureDeclarationThisParam( - ancestor::TSCallSignatureDeclarationWithoutThisParam(node, PhantomData), + ctx.push_stack(Ancestor::TSCallSignatureDeclarationThisParam( + ancestor::TSCallSignatureDeclarationWithoutThisParam(node), )); if let Some(field) = &mut *((node as *mut u8) .add(ancestor::OFFSET_TS_CALL_SIGNATURE_DECLARATION_THIS_PARAM) @@ -4758,7 +4682,7 @@ pub(crate) unsafe fn walk_ts_call_signature_declaration<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSCallSignatureDeclarationTypeParameters); walk_ts_type_parameter_declaration(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_call_signature_declaration(&mut *node, ctx); } @@ -4775,9 +4699,7 @@ pub(crate) unsafe fn walk_ts_method_signature<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::TSMethodSignatureKey( - ancestor::TSMethodSignatureWithoutKey(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSMethodSignatureKey(ancestor::TSMethodSignatureWithoutKey(node))); walk_property_key( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_METHOD_SIGNATURE_KEY) as *mut PropertyKey, @@ -4811,7 +4733,7 @@ pub(crate) unsafe fn walk_ts_method_signature<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSMethodSignatureTypeParameters); walk_ts_type_parameter_declaration(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_ts_method_signature(&mut *node, ctx); } @@ -4829,8 +4751,8 @@ pub(crate) unsafe fn walk_ts_construct_signature_declaration<'a, Tr: Traverse<'a .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::TSConstructSignatureDeclarationParams( - ancestor::TSConstructSignatureDeclarationWithoutParams(node, PhantomData), + ctx.push_stack(Ancestor::TSConstructSignatureDeclarationParams( + ancestor::TSConstructSignatureDeclarationWithoutParams(node), )); walk_formal_parameters( traverser, @@ -4852,7 +4774,7 @@ pub(crate) unsafe fn walk_ts_construct_signature_declaration<'a, Tr: Traverse<'a ctx.retag_stack(AncestorType::TSConstructSignatureDeclarationTypeParameters); walk_ts_type_parameter_declaration(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_ts_construct_signature_declaration(&mut *node, ctx); } @@ -4863,8 +4785,8 @@ pub(crate) unsafe fn walk_ts_index_signature_name<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_index_signature_name(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSIndexSignatureNameTypeAnnotation( - ancestor::TSIndexSignatureNameWithoutTypeAnnotation(node, PhantomData), + ctx.push_stack(Ancestor::TSIndexSignatureNameTypeAnnotation( + ancestor::TSIndexSignatureNameWithoutTypeAnnotation(node), )); walk_ts_type_annotation( traverser, @@ -4872,7 +4794,7 @@ pub(crate) unsafe fn walk_ts_index_signature_name<'a, Tr: Traverse<'a>>( as *mut Box)) as *mut _, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_index_signature_name(&mut *node, ctx); } @@ -4882,8 +4804,8 @@ pub(crate) unsafe fn walk_ts_interface_heritage<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_interface_heritage(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSInterfaceHeritageExpression( - ancestor::TSInterfaceHeritageWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::TSInterfaceHeritageExpression( + ancestor::TSInterfaceHeritageWithoutExpression(node), )); walk_expression( traverser, @@ -4897,7 +4819,7 @@ pub(crate) unsafe fn walk_ts_interface_heritage<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSInterfaceHeritageTypeParameters); walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_interface_heritage(&mut *node, ctx); } @@ -4907,8 +4829,8 @@ pub(crate) unsafe fn walk_ts_type_predicate<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_predicate(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypePredicateParameterName( - ancestor::TSTypePredicateWithoutParameterName(node, PhantomData), + ctx.push_stack(Ancestor::TSTypePredicateParameterName( + ancestor::TSTypePredicateWithoutParameterName(node), )); walk_ts_type_predicate_name( traverser, @@ -4923,7 +4845,7 @@ pub(crate) unsafe fn walk_ts_type_predicate<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSTypePredicateTypeAnnotation); walk_ts_type_annotation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_predicate(&mut *node, ctx); } @@ -4948,9 +4870,7 @@ pub(crate) unsafe fn walk_ts_module_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_module_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSModuleDeclarationId( - ancestor::TSModuleDeclarationWithoutId(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSModuleDeclarationId(ancestor::TSModuleDeclarationWithoutId(node))); walk_ts_module_declaration_name( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_MODULE_DECLARATION_ID) @@ -4970,7 +4890,7 @@ pub(crate) unsafe fn walk_ts_module_declaration<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSModuleDeclarationBody); walk_ts_module_declaration_body(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_ts_module_declaration(&mut *node, ctx); } @@ -5015,9 +4935,9 @@ pub(crate) unsafe fn walk_ts_module_block<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_module_block(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSModuleBlockDirectives( - ancestor::TSModuleBlockWithoutDirectives(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSModuleBlockDirectives(ancestor::TSModuleBlockWithoutDirectives( + node, + ))); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_MODULE_BLOCK_DIRECTIVES) as *mut Vec)) .iter_mut() @@ -5030,7 +4950,7 @@ pub(crate) unsafe fn walk_ts_module_block<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_TS_MODULE_BLOCK_BODY) as *mut Vec, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_module_block(&mut *node, ctx); } @@ -5040,16 +4960,14 @@ pub(crate) unsafe fn walk_ts_type_literal<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_literal(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeLiteralMembers( - ancestor::TSTypeLiteralWithoutMembers(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSTypeLiteralMembers(ancestor::TSTypeLiteralWithoutMembers(node))); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TYPE_LITERAL_MEMBERS) as *mut Vec)) .iter_mut() { walk_ts_signature(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_literal(&mut *node, ctx); } @@ -5059,16 +4977,16 @@ pub(crate) unsafe fn walk_ts_infer_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_infer_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSInferTypeTypeParameter( - ancestor::TSInferTypeWithoutTypeParameter(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSInferTypeTypeParameter(ancestor::TSInferTypeWithoutTypeParameter( + node, + ))); walk_ts_type_parameter( traverser, (&mut **((node as *mut u8).add(ancestor::OFFSET_TS_INFER_TYPE_TYPE_PARAMETER) as *mut Box)) as *mut _, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_infer_type(&mut *node, ctx); } @@ -5078,9 +4996,7 @@ pub(crate) unsafe fn walk_ts_type_query<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_query(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeQueryExprName( - ancestor::TSTypeQueryWithoutExprName(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSTypeQueryExprName(ancestor::TSTypeQueryWithoutExprName(node))); walk_ts_type_query_expr_name( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_TYPE_QUERY_EXPR_NAME) as *mut TSTypeQueryExprName, @@ -5093,7 +5009,7 @@ pub(crate) unsafe fn walk_ts_type_query<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSTypeQueryTypeParameters); walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_query(&mut *node, ctx); } @@ -5120,9 +5036,7 @@ pub(crate) unsafe fn walk_ts_import_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_import_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSImportTypeParameter( - ancestor::TSImportTypeWithoutParameter(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSImportTypeParameter(ancestor::TSImportTypeWithoutParameter(node))); walk_ts_type( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_IMPORT_TYPE_PARAMETER) as *mut TSType, @@ -5147,7 +5061,7 @@ pub(crate) unsafe fn walk_ts_import_type<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSImportTypeTypeParameters); walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_import_type(&mut *node, ctx); } @@ -5157,8 +5071,8 @@ pub(crate) unsafe fn walk_ts_import_attributes<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_import_attributes(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSImportAttributesAttributesKeyword( - ancestor::TSImportAttributesWithoutAttributesKeyword(node, PhantomData), + ctx.push_stack(Ancestor::TSImportAttributesAttributesKeyword( + ancestor::TSImportAttributesWithoutAttributesKeyword(node), )); walk_identifier_name( traverser, @@ -5173,7 +5087,7 @@ pub(crate) unsafe fn walk_ts_import_attributes<'a, Tr: Traverse<'a>>( { walk_ts_import_attribute(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_import_attributes(&mut *node, ctx); } @@ -5183,9 +5097,7 @@ pub(crate) unsafe fn walk_ts_import_attribute<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_import_attribute(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSImportAttributeName( - ancestor::TSImportAttributeWithoutName(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSImportAttributeName(ancestor::TSImportAttributeWithoutName(node))); walk_ts_import_attribute_name( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_IMPORT_ATTRIBUTE_NAME) @@ -5198,7 +5110,7 @@ pub(crate) unsafe fn walk_ts_import_attribute<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_TS_IMPORT_ATTRIBUTE_VALUE) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_import_attribute(&mut *node, ctx); } @@ -5225,9 +5137,9 @@ pub(crate) unsafe fn walk_ts_function_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_function_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSFunctionTypeThisParam( - ancestor::TSFunctionTypeWithoutThisParam(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSFunctionTypeThisParam(ancestor::TSFunctionTypeWithoutThisParam( + node, + ))); if let Some(field) = &mut *((node as *mut u8).add(ancestor::OFFSET_TS_FUNCTION_TYPE_THIS_PARAM) as *mut Option) { @@ -5254,7 +5166,7 @@ pub(crate) unsafe fn walk_ts_function_type<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSFunctionTypeTypeParameters); walk_ts_type_parameter_declaration(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_function_type(&mut *node, ctx); } @@ -5264,9 +5176,9 @@ pub(crate) unsafe fn walk_ts_constructor_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_constructor_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSConstructorTypeParams( - ancestor::TSConstructorTypeWithoutParams(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSConstructorTypeParams(ancestor::TSConstructorTypeWithoutParams( + node, + ))); walk_formal_parameters( traverser, (&mut **((node as *mut u8).add(ancestor::OFFSET_TS_CONSTRUCTOR_TYPE_PARAMS) @@ -5287,7 +5199,7 @@ pub(crate) unsafe fn walk_ts_constructor_type<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSConstructorTypeTypeParameters); walk_ts_type_parameter_declaration(traverser, (&mut **field) as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_constructor_type(&mut *node, ctx); } @@ -5304,8 +5216,8 @@ pub(crate) unsafe fn walk_ts_mapped_type<'a, Tr: Traverse<'a>>( .get() .unwrap(), ); - let pop_token = ctx.push_stack(Ancestor::TSMappedTypeTypeParameter( - ancestor::TSMappedTypeWithoutTypeParameter(node, PhantomData), + ctx.push_stack(Ancestor::TSMappedTypeTypeParameter( + ancestor::TSMappedTypeWithoutTypeParameter(node), )); walk_ts_type_parameter( traverser, @@ -5326,7 +5238,7 @@ pub(crate) unsafe fn walk_ts_mapped_type<'a, Tr: Traverse<'a>>( ctx.retag_stack(AncestorType::TSMappedTypeTypeAnnotation); walk_ts_type(traverser, field as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); ctx.set_current_scope_id(previous_scope_id); traverser.exit_ts_mapped_type(&mut *node, ctx); } @@ -5337,8 +5249,8 @@ pub(crate) unsafe fn walk_ts_template_literal_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_template_literal_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTemplateLiteralTypeQuasis( - ancestor::TSTemplateLiteralTypeWithoutQuasis(node, PhantomData), + ctx.push_stack(Ancestor::TSTemplateLiteralTypeQuasis( + ancestor::TSTemplateLiteralTypeWithoutQuasis(node), )); for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TEMPLATE_LITERAL_TYPE_QUASIS) as *mut Vec)) @@ -5353,7 +5265,7 @@ pub(crate) unsafe fn walk_ts_template_literal_type<'a, Tr: Traverse<'a>>( { walk_ts_type(traverser, item as *mut _, ctx); } - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_template_literal_type(&mut *node, ctx); } @@ -5363,9 +5275,9 @@ pub(crate) unsafe fn walk_ts_as_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_as_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSAsExpressionExpression( - ancestor::TSAsExpressionWithoutExpression(node, PhantomData), - )); + ctx.push_stack(Ancestor::TSAsExpressionExpression(ancestor::TSAsExpressionWithoutExpression( + node, + ))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_AS_EXPRESSION_EXPRESSION) as *mut Expression, @@ -5377,7 +5289,7 @@ pub(crate) unsafe fn walk_ts_as_expression<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_TS_AS_EXPRESSION_TYPE_ANNOTATION) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_as_expression(&mut *node, ctx); } @@ -5387,8 +5299,8 @@ pub(crate) unsafe fn walk_ts_satisfies_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_satisfies_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSSatisfiesExpressionExpression( - ancestor::TSSatisfiesExpressionWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::TSSatisfiesExpressionExpression( + ancestor::TSSatisfiesExpressionWithoutExpression(node), )); walk_expression( traverser, @@ -5403,7 +5315,7 @@ pub(crate) unsafe fn walk_ts_satisfies_expression<'a, Tr: Traverse<'a>>( as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_satisfies_expression(&mut *node, ctx); } @@ -5413,8 +5325,8 @@ pub(crate) unsafe fn walk_ts_type_assertion<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_type_assertion(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSTypeAssertionExpression( - ancestor::TSTypeAssertionWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::TSTypeAssertionExpression( + ancestor::TSTypeAssertionWithoutExpression(node), )); walk_expression( traverser, @@ -5427,7 +5339,7 @@ pub(crate) unsafe fn walk_ts_type_assertion<'a, Tr: Traverse<'a>>( (node as *mut u8).add(ancestor::OFFSET_TS_TYPE_ASSERTION_TYPE_ANNOTATION) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_type_assertion(&mut *node, ctx); } @@ -5437,8 +5349,8 @@ pub(crate) unsafe fn walk_ts_import_equals_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_import_equals_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSImportEqualsDeclarationId( - ancestor::TSImportEqualsDeclarationWithoutId(node, PhantomData), + ctx.push_stack(Ancestor::TSImportEqualsDeclarationId( + ancestor::TSImportEqualsDeclarationWithoutId(node), )); walk_binding_identifier( traverser, @@ -5453,7 +5365,7 @@ pub(crate) unsafe fn walk_ts_import_equals_declaration<'a, Tr: Traverse<'a>>( as *mut TSModuleReference, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_import_equals_declaration(&mut *node, ctx); } @@ -5480,8 +5392,8 @@ pub(crate) unsafe fn walk_ts_external_module_reference<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_external_module_reference(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSExternalModuleReferenceExpression( - ancestor::TSExternalModuleReferenceWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::TSExternalModuleReferenceExpression( + ancestor::TSExternalModuleReferenceWithoutExpression(node), )); walk_string_literal( traverser, @@ -5489,7 +5401,7 @@ pub(crate) unsafe fn walk_ts_external_module_reference<'a, Tr: Traverse<'a>>( as *mut StringLiteral, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_external_module_reference(&mut *node, ctx); } @@ -5499,8 +5411,8 @@ pub(crate) unsafe fn walk_ts_non_null_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_non_null_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSNonNullExpressionExpression( - ancestor::TSNonNullExpressionWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::TSNonNullExpressionExpression( + ancestor::TSNonNullExpressionWithoutExpression(node), )); walk_expression( traverser, @@ -5508,7 +5420,7 @@ pub(crate) unsafe fn walk_ts_non_null_expression<'a, Tr: Traverse<'a>>( as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_non_null_expression(&mut *node, ctx); } @@ -5518,15 +5430,13 @@ pub(crate) unsafe fn walk_decorator<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_decorator(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::DecoratorExpression( - ancestor::DecoratorWithoutExpression(node, PhantomData), - )); + ctx.push_stack(Ancestor::DecoratorExpression(ancestor::DecoratorWithoutExpression(node))); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_DECORATOR_EXPRESSION) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_decorator(&mut *node, ctx); } @@ -5536,15 +5446,15 @@ pub(crate) unsafe fn walk_ts_export_assignment<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_export_assignment(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSExportAssignmentExpression( - ancestor::TSExportAssignmentWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::TSExportAssignmentExpression( + ancestor::TSExportAssignmentWithoutExpression(node), )); walk_expression( traverser, (node as *mut u8).add(ancestor::OFFSET_TS_EXPORT_ASSIGNMENT_EXPRESSION) as *mut Expression, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_export_assignment(&mut *node, ctx); } @@ -5554,8 +5464,8 @@ pub(crate) unsafe fn walk_ts_namespace_export_declaration<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_namespace_export_declaration(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSNamespaceExportDeclarationId( - ancestor::TSNamespaceExportDeclarationWithoutId(node, PhantomData), + ctx.push_stack(Ancestor::TSNamespaceExportDeclarationId( + ancestor::TSNamespaceExportDeclarationWithoutId(node), )); walk_identifier_name( traverser, @@ -5563,7 +5473,7 @@ pub(crate) unsafe fn walk_ts_namespace_export_declaration<'a, Tr: Traverse<'a>>( as *mut IdentifierName, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_namespace_export_declaration(&mut *node, ctx); } @@ -5573,8 +5483,8 @@ pub(crate) unsafe fn walk_ts_instantiation_expression<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_ts_instantiation_expression(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::TSInstantiationExpressionExpression( - ancestor::TSInstantiationExpressionWithoutExpression(node, PhantomData), + ctx.push_stack(Ancestor::TSInstantiationExpressionExpression( + ancestor::TSInstantiationExpressionWithoutExpression(node), )); walk_expression( traverser, @@ -5589,7 +5499,7 @@ pub(crate) unsafe fn walk_ts_instantiation_expression<'a, Tr: Traverse<'a>>( as *mut Box)) as *mut _, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_ts_instantiation_expression(&mut *node, ctx); } @@ -5599,15 +5509,15 @@ pub(crate) unsafe fn walk_js_doc_nullable_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_js_doc_nullable_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSDocNullableTypeTypeAnnotation( - ancestor::JSDocNullableTypeWithoutTypeAnnotation(node, PhantomData), + ctx.push_stack(Ancestor::JSDocNullableTypeTypeAnnotation( + ancestor::JSDocNullableTypeWithoutTypeAnnotation(node), )); walk_ts_type( traverser, (node as *mut u8).add(ancestor::OFFSET_JS_DOC_NULLABLE_TYPE_TYPE_ANNOTATION) as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_js_doc_nullable_type(&mut *node, ctx); } @@ -5617,8 +5527,8 @@ pub(crate) unsafe fn walk_js_doc_non_nullable_type<'a, Tr: Traverse<'a>>( ctx: &mut TraverseCtx<'a>, ) { traverser.enter_js_doc_non_nullable_type(&mut *node, ctx); - let pop_token = ctx.push_stack(Ancestor::JSDocNonNullableTypeTypeAnnotation( - ancestor::JSDocNonNullableTypeWithoutTypeAnnotation(node, PhantomData), + ctx.push_stack(Ancestor::JSDocNonNullableTypeTypeAnnotation( + ancestor::JSDocNonNullableTypeWithoutTypeAnnotation(node), )); walk_ts_type( traverser, @@ -5626,7 +5536,7 @@ pub(crate) unsafe fn walk_js_doc_non_nullable_type<'a, Tr: Traverse<'a>>( as *mut TSType, ctx, ); - ctx.pop_stack(pop_token); + ctx.pop_stack(); traverser.exit_js_doc_non_nullable_type(&mut *node, ctx); } diff --git a/crates/oxc_wasm/src/lib.rs b/crates/oxc_wasm/src/lib.rs index 40af76812fab3b..dadc6abcb95ef8 100644 --- a/crates/oxc_wasm/src/lib.rs +++ b/crates/oxc_wasm/src/lib.rs @@ -5,18 +5,19 @@ mod options; use std::{ cell::{Cell, RefCell}, - path::{Path, PathBuf}, + path::PathBuf, rc::Rc, }; +use options::OxcOptions; use oxc::{ allocator::Allocator, ast::{ast::Program, CommentKind, Trivias, Visit}, codegen::{CodeGenerator, CodegenOptions}, diagnostics::Error, minifier::{CompressOptions, Minifier, MinifierOptions}, - parser::{ParseOptions, Parser, ParserReturn}, - semantic::{ScopeFlags, ScopeId, ScopeTree, SemanticBuilder, SymbolTable}, + parser::{ParseOptions, Parser}, + semantic::{ScopeFlags, ScopeId, Semantic, SemanticBuilder}, span::SourceType, transformer::{TransformOptions, Transformer}, }; @@ -27,8 +28,6 @@ use serde::Serialize; use tsify::Tsify; use wasm_bindgen::prelude::*; -use crate::options::{OxcOptions, OxcRunOptions}; - #[wasm_bindgen(getter_with_clone)] #[derive(Default, Tsify)] #[serde(rename_all = "camelCase")] @@ -147,19 +146,19 @@ impl Oxc { run: run_options, parser: parser_options, linter: linter_options, - transformer: transform_options, codegen: codegen_options, minifier: minifier_options, + type_checking: type_checking_options, } = options; let run_options = run_options.unwrap_or_default(); let parser_options = parser_options.unwrap_or_default(); let _linter_options = linter_options.unwrap_or_default(); - let minifier_options = minifier_options.unwrap_or_default(); let _codegen_options = codegen_options.unwrap_or_default(); - let _transform_options = transform_options.unwrap_or_default(); + let minifier_options = minifier_options.unwrap_or_default(); + let _type_checking_options = type_checking_options.unwrap_or_default(); let allocator = Allocator::default(); - + // let source_text = &self.source_text; let path = PathBuf::from( parser_options.source_filename.clone().unwrap_or_else(|| "test.tsx".to_string()), ); @@ -172,30 +171,31 @@ impl Oxc { let default_parser_options = ParseOptions::default(); let oxc_parser_options = ParseOptions { - parse_regular_expression: true, allow_return_outside_function: parser_options .allow_return_outside_function .unwrap_or(default_parser_options.allow_return_outside_function), preserve_parens: parser_options .preserve_parens .unwrap_or(default_parser_options.preserve_parens), + ..default_parser_options }; - let ParserReturn { mut program, errors, trivias, .. } = - Parser::new(&allocator, source_text, source_type) - .with_options(oxc_parser_options) - .parse(); + let ret = Parser::new(&allocator, source_text, source_type) + .with_options(oxc_parser_options) + .parse(); - self.comments = Self::map_comments(source_text, &trivias); - self.ir = format!("{:#?}", program.body); - self.ast = program.serialize(&self.serializer)?; + self.comments = Self::map_comments(source_text, &ret.trivias); - self.save_diagnostics(errors.into_iter().map(Error::from).collect::>()); + self.save_diagnostics(ret.errors.into_iter().map(Error::from).collect::>()); + + self.ir = format!("{:#?}", ret.program.body); + + let program = allocator.alloc(ret.program); let semantic_ret = SemanticBuilder::new(source_text, source_type) - .with_trivias(trivias.clone()) + .with_cfg(true) + .with_trivias(ret.trivias.clone()) .with_check_syntax_error(true) - .build_module_record(path.clone(), &program) - .build(&program); + .build(program); if run_options.syntax.unwrap_or_default() { self.save_diagnostics( @@ -203,39 +203,85 @@ impl Oxc { ); } - self.run_linter(&run_options, source_text, source_type, &path, &trivias, &program); + let semantic = Rc::new(semantic_ret.semantic); + // Only lint if there are not syntax errors + if run_options.lint.unwrap_or_default() && self.diagnostics.borrow().is_empty() { + let linter_ret = Linter::default().run(&path, Rc::clone(&semantic)); + let diagnostics = linter_ret.into_iter().map(|e| Error::from(e.error)).collect(); + self.save_diagnostics(diagnostics); + } - self.run_prettier(&run_options, source_text, source_type); + self.ast = program.serialize(&self.serializer)?; - let (symbols, scopes) = semantic_ret.semantic.into_symbol_table_and_scope_tree(); + if run_options.prettier_format.unwrap_or_default() + || run_options.prettier_ir.unwrap_or_default() + { + let ret = Parser::new(&allocator, source_text, source_type) + .with_options(ParseOptions { preserve_parens: false, ..oxc_parser_options }) + .parse(); - if run_options.scope.unwrap_or_default() || run_options.symbol.unwrap_or_default() { - if run_options.scope.unwrap_or_default() { - self.scope_text = Self::get_scope_text(&program, &symbols, &scopes); + let mut prettier = Prettier::new( + &allocator, + source_text, + ret.trivias.clone(), + PrettierOptions::default(), + ); + + if run_options.prettier_format.unwrap_or_default() { + self.prettier_formatted_text = prettier.build(&ret.program); } - if run_options.symbol.unwrap_or_default() { - self.symbols = symbols.serialize(&self.serializer)?; + + if run_options.prettier_ir.unwrap_or_default() { + let prettier_doc = prettier.doc(&ret.program).to_string(); + self.prettier_ir_text = { + let ret = Parser::new(&allocator, &prettier_doc, SourceType::default()).parse(); + Prettier::new( + &allocator, + &prettier_doc, + ret.trivias, + PrettierOptions::default(), + ) + .build(&ret.program) + }; } } if run_options.transform.unwrap_or_default() { + let (symbols, scopes) = SemanticBuilder::new(source_text, source_type) + .build(program) + .semantic + .into_symbol_table_and_scope_tree(); let options = TransformOptions::default(); let result = Transformer::new( &allocator, &path, source_type, source_text, - trivias.clone(), + ret.trivias.clone(), options, ) - .build_with_symbols_and_scopes(symbols, scopes, &mut program); + .build_with_symbols_and_scopes(symbols, scopes, program); if !result.errors.is_empty() { - self.save_diagnostics( - result.errors.into_iter().map(Error::from).collect::>(), - ); + let errors = result.errors.into_iter().map(Error::from).collect::>(); + self.save_diagnostics(errors); + } + } + + if run_options.scope.unwrap_or_default() || run_options.symbol.unwrap_or_default() { + let semantic = SemanticBuilder::new(source_text, source_type) + .build_module_record(PathBuf::new(), program) + .build(program) + .semantic; + if run_options.scope.unwrap_or_default() { + self.scope_text = Self::get_scope_text(program, &semantic); + } + if run_options.symbol.unwrap_or_default() { + self.symbols = semantic.symbols().serialize(&self.serializer)?; } } + let program = allocator.alloc(program); + if minifier_options.compress.unwrap_or_default() || minifier_options.mangle.unwrap_or_default() { @@ -257,7 +303,7 @@ impl Oxc { CompressOptions::all_false() }, }; - Minifier::new(options).build(&allocator, &mut program); + Minifier::new(options).build(&allocator, program); } self.codegen_text = CodeGenerator::new() @@ -265,88 +311,23 @@ impl Oxc { minify: minifier_options.whitespace.unwrap_or_default(), ..CodegenOptions::default() }) - .build(&program) + .build(program) .source_text; Ok(()) } - fn run_linter( - &mut self, - run_options: &OxcRunOptions, - source_text: &str, - source_type: SourceType, - path: &Path, - trivias: &Trivias, - program: &Program, - ) { - // Only lint if there are no syntax errors - if run_options.lint.unwrap_or_default() && self.diagnostics.borrow().is_empty() { - let semantic_ret = SemanticBuilder::new(source_text, source_type) - .with_cfg(true) - .with_trivias(trivias.clone()) - .build_module_record(path.to_path_buf(), program) - .build(program); - let semantic = Rc::new(semantic_ret.semantic); - let linter_ret = Linter::default().run(path, Rc::clone(&semantic)); - let diagnostics = linter_ret.into_iter().map(|e| Error::from(e.error)).collect(); - self.save_diagnostics(diagnostics); - } - } - - fn run_prettier( - &mut self, - run_options: &OxcRunOptions, - source_text: &str, - source_type: SourceType, - ) { - let allocator = Allocator::default(); - if run_options.prettier_format.unwrap_or_default() - || run_options.prettier_ir.unwrap_or_default() - { - let ret = Parser::new(&allocator, source_text, source_type) - .with_options(ParseOptions { preserve_parens: false, ..ParseOptions::default() }) - .parse(); - - let mut prettier = Prettier::new( - &allocator, - source_text, - ret.trivias.clone(), - PrettierOptions::default(), - ); - - if run_options.prettier_format.unwrap_or_default() { - self.prettier_formatted_text = prettier.build(&ret.program); - } - - if run_options.prettier_ir.unwrap_or_default() { - let prettier_doc = prettier.doc(&ret.program).to_string(); - self.prettier_ir_text = { - let ret = Parser::new(&allocator, &prettier_doc, SourceType::default()).parse(); - Prettier::new( - &allocator, - &prettier_doc, - ret.trivias, - PrettierOptions::default(), - ) - .build(&ret.program) - }; - } - } - } - - fn get_scope_text(program: &Program<'_>, symbols: &SymbolTable, scopes: &ScopeTree) -> String { - struct ScopesTextWriter<'s> { - symbols: &'s SymbolTable, - scopes: &'s ScopeTree, + fn get_scope_text<'a>(program: &Program<'a>, semantic: &Semantic<'a>) -> String { + struct ScopesTextWriter<'a, 's> { + semantic: &'s Semantic<'a>, scope_text: String, indent: usize, space: String, } - impl<'s> ScopesTextWriter<'s> { - fn new(symbols: &'s SymbolTable, scopes: &'s ScopeTree) -> Self { - Self { symbols, scopes, scope_text: String::new(), indent: 0, space: String::new() } + impl<'a, 's> ScopesTextWriter<'a, 's> { + fn new(semantic: &'s Semantic<'a>) -> Self { + Self { semantic, scope_text: String::new(), indent: 0, space: String::new() } } fn write_line>(&mut self, line: S) { @@ -367,17 +348,17 @@ impl Oxc { } } - impl<'a, 's> Visit<'a> for ScopesTextWriter<'s> { + impl<'a, 's> Visit<'a> for ScopesTextWriter<'a, 's> { fn enter_scope(&mut self, flags: ScopeFlags, scope_id: &Cell>) { let scope_id = scope_id.get().unwrap(); self.write_line(format!("Scope {} ({flags:?}) {{", scope_id.index())); self.indent_in(); - let bindings = self.scopes.get_bindings(scope_id); + let bindings = self.semantic.scopes().get_bindings(scope_id); if !bindings.is_empty() { self.write_line("Bindings: {"); bindings.iter().for_each(|(name, &symbol_id)| { - let symbol_flags = self.symbols.get_flags(symbol_id); + let symbol_flags = self.semantic.symbols().get_flags(symbol_id); self.write_line(format!(" {name} ({symbol_id:?} {symbol_flags:?})",)); }); self.write_line("}"); @@ -390,7 +371,7 @@ impl Oxc { } } - let mut writer = ScopesTextWriter::new(symbols, scopes); + let mut writer = ScopesTextWriter::new(semantic); writer.visit_program(program); writer.scope_text } diff --git a/tasks/coverage/semantic_babel.snap b/tasks/coverage/semantic_babel.snap index 8e0ed8f63ea3d8..455bfd713226b2 100644 --- a/tasks/coverage/semantic_babel.snap +++ b/tasks/coverage/semantic_babel.snap @@ -1598,10 +1598,7 @@ after transform: ["Generator"] rebuilt : [] tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/tsx/brace-is-block/input.tsx -semantic error: Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(2), ReferenceId(3)] -rebuilt : SymbolId(2): [ReferenceId(2)] -Unresolved references mismatch: +semantic error: Unresolved references mismatch: after transform: ["D", "T"] rebuilt : ["D"] @@ -1724,7 +1721,7 @@ rebuilt : ["C"] tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/type-arguments/tsx/input.ts semantic error: Unresolved reference IDs mismatch for "C": -after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(2), ReferenceId(3), ReferenceId(6)] +after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(2)] rebuilt : [ReferenceId(1), ReferenceId(4)] tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/type-arguments/whitespace/input.ts diff --git a/tasks/coverage/semantic_misc.snap b/tasks/coverage/semantic_misc.snap index ff5993806cf655..628e8f63b983b4 100644 --- a/tasks/coverage/semantic_misc.snap +++ b/tasks/coverage/semantic_misc.snap @@ -1,6 +1,6 @@ semantic_misc Summary: AST Parsed : 27/27 (100.00%) -Positive Passed: 14/27 (51.85%) +Positive Passed: 15/27 (55.56%) tasks/coverage/misc/pass/oxc-1288.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["from"] @@ -11,11 +11,6 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["infer", "target", "type"] rebuilt : ScopeId(0): [] -tasks/coverage/misc/pass/oxc-1740.tsx -semantic error: Unresolved reference IDs mismatch for "Bar": -after transform: [ReferenceId(1), ReferenceId(5)] -rebuilt : [ReferenceId(2)] - tasks/coverage/misc/pass/oxc-2087.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["Helpers"] @@ -171,9 +166,9 @@ rebuilt : ScopeId(0): [] tasks/coverage/misc/pass/swc-8243.tsx semantic error: Unresolved reference IDs mismatch for "Baz": -after transform: [ReferenceId(3), ReferenceId(4), ReferenceId(5)] +after transform: [ReferenceId(3), ReferenceId(4)] rebuilt : [ReferenceId(4)] Unresolved reference IDs mismatch for "Bar": -after transform: [ReferenceId(1), ReferenceId(2), ReferenceId(8)] +after transform: [ReferenceId(1), ReferenceId(2)] rebuilt : [ReferenceId(2)] diff --git a/tasks/coverage/semantic_typescript.snap b/tasks/coverage/semantic_typescript.snap index 9b5a5171ffae49..bbe003ec675f86 100644 --- a/tasks/coverage/semantic_typescript.snap +++ b/tasks/coverage/semantic_typescript.snap @@ -2,7 +2,7 @@ commit: d8086f14 semantic_typescript Summary: AST Parsed : 6456/6456 (100.00%) -Positive Passed: 3444/6456 (53.35%) +Positive Passed: 3450/6456 (53.44%) tasks/coverage/typescript/tests/cases/compiler/2dArrays.ts semantic error: Symbol reference IDs mismatch: after transform: SymbolId(0): [ReferenceId(1)] @@ -1202,17 +1202,11 @@ Bindings mismatch: after transform: ScopeId(20): ["C", "P1", "P2", "a"] rebuilt : ScopeId(13): ["C", "a"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(28), ReferenceId(32), ReferenceId(33), ReferenceId(36), ReferenceId(38), ReferenceId(43), ReferenceId(46), ReferenceId(49)] +after transform: SymbolId(0): [ReferenceId(28), ReferenceId(32), ReferenceId(33), ReferenceId(36), ReferenceId(38), ReferenceId(42), ReferenceId(44), ReferenceId(46)] rebuilt : SymbolId(1): [ReferenceId(24), ReferenceId(28), ReferenceId(31)] Symbol reference IDs mismatch: -after transform: SymbolId(29): [ReferenceId(30), ReferenceId(31), ReferenceId(42)] +after transform: SymbolId(29): [ReferenceId(30), ReferenceId(31)] rebuilt : SymbolId(25): [ReferenceId(25)] -Symbol reference IDs mismatch: -after transform: SymbolId(32): [ReferenceId(35), ReferenceId(45)] -rebuilt : SymbolId(28): [ReferenceId(29)] -Symbol reference IDs mismatch: -after transform: SymbolId(36): [ReferenceId(40), ReferenceId(48)] -rebuilt : SymbolId(30): [ReferenceId(32)] tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop1.ts semantic error: Bindings mismatch: @@ -3798,9 +3792,6 @@ rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime", "a", "y"] Unresolved references mismatch: after transform: ["App4", "JSX", "app", "app2", "app3", "foo", "require", "undefined"] rebuilt : ["App4", "app", "app2", "app3", "foo", "require", "undefined"] -Unresolved reference IDs mismatch for "App4": -after transform: [ReferenceId(50), ReferenceId(52)] -rebuilt : [ReferenceId(12)] tasks/coverage/typescript/tests/cases/compiler/contextualTypingOfTooShortOverloads.ts semantic error: Bindings mismatch: @@ -3863,22 +3854,19 @@ tasks/coverage/typescript/tests/cases/compiler/contextuallyTypedJsxAttribute.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["Elements", "Props", "_jsxFileName", "_reactJsxRuntime"] rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime"] -Unresolved reference IDs mismatch for "Test": -after transform: [ReferenceId(7), ReferenceId(8), ReferenceId(9), ReferenceId(10), ReferenceId(13)] -rebuilt : [ReferenceId(2), ReferenceId(4), ReferenceId(6)] tasks/coverage/typescript/tests/cases/compiler/contextuallyTypedJsxChildren.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["DropdownMenu", "React", "_jsxFileName"] rebuilt : ScopeId(0): ["React", "_jsxFileName"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(6), ReferenceId(15), ReferenceId(18), ReferenceId(19), ReferenceId(22), ReferenceId(25), ReferenceId(26)] +after transform: SymbolId(0): [ReferenceId(6), ReferenceId(14), ReferenceId(17), ReferenceId(18), ReferenceId(20), ReferenceId(23), ReferenceId(24)] rebuilt : SymbolId(1): [ReferenceId(0), ReferenceId(3), ReferenceId(5), ReferenceId(8), ReferenceId(10), ReferenceId(12)] Reference symbol mismatch: -after transform: ReferenceId(14): Some("DropdownMenu") +after transform: ReferenceId(8): Some("DropdownMenu") rebuilt : ReferenceId(1): None Reference symbol mismatch: -after transform: ReferenceId(21): Some("DropdownMenu") +after transform: ReferenceId(11): Some("DropdownMenu") rebuilt : ReferenceId(9): None Unresolved references mismatch: after transform: ["DropdownMenu", "JSX"] @@ -9845,9 +9833,6 @@ rebuilt : ScopeId(0): ["Component", "React", "_jsxFileName", "v1"] Bindings mismatch: after transform: ScopeId(2): ["T", "props"] rebuilt : ScopeId(1): ["props"] -Symbol reference IDs mismatch: -after transform: SymbolId(6): [ReferenceId(7), ReferenceId(12)] -rebuilt : SymbolId(2): [ReferenceId(3)] tasks/coverage/typescript/tests/cases/compiler/genericInheritedDefaultConstructors.ts semantic error: Bindings mismatch: @@ -12760,9 +12745,6 @@ rebuilt : ScopeId(0): ["MyComponent", "_jsxFileName", "_reactJsxRuntime"] Bindings mismatch: after transform: ScopeId(15): ["T"] rebuilt : ScopeId(1): [] -Symbol reference IDs mismatch: -after transform: SymbolId(17): [ReferenceId(8), ReferenceId(9)] -rebuilt : SymbolId(2): [ReferenceId(3)] Unresolved references mismatch: after transform: ["Component", "Readonly", "require"] rebuilt : ["Component", "require"] @@ -12772,10 +12754,10 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["App", "Props", "React", "Tab", "TabLayout", "_jsxFileName"] rebuilt : ScopeId(0): ["App", "React", "TabLayout", "_jsxFileName"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(3), ReferenceId(7), ReferenceId(10), ReferenceId(12), ReferenceId(14)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(3), ReferenceId(7), ReferenceId(9), ReferenceId(11), ReferenceId(13)] rebuilt : SymbolId(1): [ReferenceId(0), ReferenceId(2), ReferenceId(3), ReferenceId(6), ReferenceId(8)] Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(4), ReferenceId(5), ReferenceId(9)] +after transform: SymbolId(3): [ReferenceId(4), ReferenceId(5)] rebuilt : SymbolId(2): [ReferenceId(4)] tasks/coverage/typescript/tests/cases/compiler/jsxComplexSignatureHasApplicabilityError.tsx @@ -12786,13 +12768,13 @@ Bindings mismatch: after transform: ScopeId(6): ["WrappedComponent", "WrappedProps"] rebuilt : ScopeId(1): ["WrappedComponent"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(17), ReferenceId(19), ReferenceId(44), ReferenceId(50), ReferenceId(54), ReferenceId(82), ReferenceId(85), ReferenceId(88), ReferenceId(102), ReferenceId(180), ReferenceId(195), ReferenceId(206), ReferenceId(209), ReferenceId(233), ReferenceId(236), ReferenceId(241)] +after transform: SymbolId(0): [ReferenceId(17), ReferenceId(19), ReferenceId(44), ReferenceId(50), ReferenceId(54), ReferenceId(82), ReferenceId(85), ReferenceId(88), ReferenceId(102), ReferenceId(180), ReferenceId(195), ReferenceId(206), ReferenceId(209), ReferenceId(233), ReferenceId(236), ReferenceId(240)] rebuilt : SymbolId(1): [ReferenceId(0)] Unresolved references mismatch: after transform: ["Array", "Exclude", "HTMLAnchorElement", "HTMLDivElement", "HTMLInputElement", "JSX", "Pick", "Promise", "ReactSelectClass", "undefined"] rebuilt : ["ReactSelectClass", "undefined"] Unresolved reference IDs mismatch for "ReactSelectClass": -after transform: [ReferenceId(22), ReferenceId(196), ReferenceId(240)] +after transform: [ReferenceId(22), ReferenceId(196)] rebuilt : [ReferenceId(1)] tasks/coverage/typescript/tests/cases/compiler/jsxContainsOnlyTriviaWhiteSpacesNotCountedAsChild.tsx @@ -12800,7 +12782,7 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["JSX", "NoticeList", "Props", "_jsxFileName", "_reactJsxRuntime"] rebuilt : ScopeId(0): ["NoticeList", "_jsxFileName", "_reactJsxRuntime"] Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(1), ReferenceId(2), ReferenceId(3), ReferenceId(4), ReferenceId(5), ReferenceId(8)] +after transform: SymbolId(3): [ReferenceId(1), ReferenceId(2), ReferenceId(3), ReferenceId(4)] rebuilt : SymbolId(2): [ReferenceId(2), ReferenceId(5)] tasks/coverage/typescript/tests/cases/compiler/jsxElementClassTooManyParams.tsx @@ -12810,9 +12792,6 @@ rebuilt : ScopeId(0): ["ElemClass", "_jsxFileName", "_reactJsxRuntime", " Bindings mismatch: after transform: ScopeId(9): ["T"] rebuilt : ScopeId(1): [] -Symbol reference IDs mismatch: -after transform: SymbolId(10): [ReferenceId(6), ReferenceId(8)] -rebuilt : SymbolId(2): [ReferenceId(3)] Unresolved references mismatch: after transform: ["JSX", "require"] rebuilt : ["require"] @@ -12875,7 +12854,7 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["Props", "React", "Wrapper", "_jsxFileName", "_reactJsxRuntime", "element"] rebuilt : ScopeId(0): ["Wrapper", "_jsxFileName", "_reactJsxRuntime", "element"] Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(3), ReferenceId(4), ReferenceId(9)] +after transform: SymbolId(2): [ReferenceId(3), ReferenceId(4)] rebuilt : SymbolId(2): [ReferenceId(5)] tasks/coverage/typescript/tests/cases/compiler/jsxFactoryAndJsxFragmentFactory.tsx @@ -12976,9 +12955,6 @@ rebuilt : ReferenceId(4): None Unresolved references mismatch: after transform: ["GenericComponent", "Omit", "omit", "require"] rebuilt : ["GenericComponent", "omit", "otherProps", "require"] -Unresolved reference IDs mismatch for "GenericComponent": -after transform: [ReferenceId(11), ReferenceId(14)] -rebuilt : [ReferenceId(2)] tasks/coverage/typescript/tests/cases/compiler/jsxHasLiteralType.tsx semantic error: Bindings mismatch: @@ -12987,9 +12963,6 @@ rebuilt : ScopeId(0): ["MyComponent", "React", "_jsxFileName", "m"] Bindings mismatch: after transform: ScopeId(2): ["P"] rebuilt : ScopeId(1): [] -Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(4), ReferenceId(6)] -rebuilt : SymbolId(2): [ReferenceId(2)] tasks/coverage/typescript/tests/cases/compiler/jsxInExtendsClause.tsx semantic error: Bindings mismatch: @@ -13013,9 +12986,6 @@ rebuilt : ScopeId(1): ["props"] Bindings mismatch: after transform: ScopeId(2): ["T", "el"] rebuilt : ScopeId(2): ["el"] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(5), ReferenceId(10)] -rebuilt : SymbolId(2): [ReferenceId(3)] Unresolved references mismatch: after transform: ["JSX"] rebuilt : [] @@ -13030,7 +13000,7 @@ rebuilt : ["require"] tasks/coverage/typescript/tests/cases/compiler/jsxIntrinsicUnions.tsx semantic error: Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(1), ReferenceId(2), ReferenceId(4)] +after transform: SymbolId(1): [ReferenceId(1), ReferenceId(2)] rebuilt : SymbolId(2): [ReferenceId(2)] tasks/coverage/typescript/tests/cases/compiler/jsxLibraryManagedAttributesUnusedGeneric.tsx @@ -13038,10 +13008,10 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["Comp", "React", "_jsxFileName", "jsx"] rebuilt : ScopeId(0): ["React", "_jsxFileName"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(7)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(6)] rebuilt : SymbolId(1): [ReferenceId(0)] Reference symbol mismatch: -after transform: ReferenceId(6): Some("Comp") +after transform: ReferenceId(4): Some("Comp") rebuilt : ReferenceId(1): None Unresolved references mismatch: after transform: [] @@ -13096,7 +13066,7 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["React", "Repro", "Select", "_jsxFileName", "_reactJsxRuntime"] rebuilt : ScopeId(0): ["Repro", "Select", "_jsxFileName", "_reactJsxRuntime"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(2), ReferenceId(3), ReferenceId(7)] +after transform: SymbolId(0): [ReferenceId(2), ReferenceId(3)] rebuilt : SymbolId(0): [ReferenceId(4)] Unresolved references mismatch: after transform: ["Parameters", "Partial", "require"] @@ -13111,9 +13081,6 @@ tasks/coverage/typescript/tests/cases/compiler/jsxSpreadFirstUnionNoErrors.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["Info", "InfoProps", "React", "_jsxFileName", "a", "b", "c", "infoProps"] rebuilt : ScopeId(0): ["Info", "React", "_jsxFileName", "a", "b", "c"] -Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(3), ReferenceId(4), ReferenceId(6), ReferenceId(13), ReferenceId(16), ReferenceId(19)] -rebuilt : SymbolId(2): [ReferenceId(7), ReferenceId(10), ReferenceId(13)] Reference symbol mismatch: after transform: ReferenceId(7): Some("infoProps") rebuilt : ReferenceId(14): None @@ -13121,11 +13088,6 @@ Unresolved references mismatch: after transform: [] rebuilt : ["infoProps"] -tasks/coverage/typescript/tests/cases/compiler/jsxViaImport.2.tsx -semantic error: Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(1), ReferenceId(2)] -rebuilt : SymbolId(0): [ReferenceId(2)] - tasks/coverage/typescript/tests/cases/compiler/keyRemappingKeyofResult.ts semantic error: Bindings mismatch: after transform: ScopeId(0): ["Okay", "Oops", "Orig", "Remapped", "f", "g", "sym", "x"] @@ -19032,11 +18994,6 @@ tasks/coverage/typescript/tests/cases/compiler/reactHOCSpreadprops.tsx semantic error: `import lib = require(...);` is only supported when compiling modules to CommonJS. Please consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option, or add @babel/plugin-transform-modules-commonjs to your Babel config. -tasks/coverage/typescript/tests/cases/compiler/reactImportDropped.ts -semantic error: Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(3)] -rebuilt : SymbolId(1): [ReferenceId(1)] - tasks/coverage/typescript/tests/cases/compiler/reactNamespaceImportPresevation.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["_jsx", "_jsxFileName", "foo", "myReactLib"] @@ -19047,25 +19004,25 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["Bar", "_Bar", "_jsxFileName", "foo", "myReactLib", "x"] rebuilt : ScopeId(0): ["_jsxFileName"] Reference symbol mismatch: -after transform: ReferenceId(10): Some("Bar") +after transform: ReferenceId(0): Some("Bar") rebuilt : ReferenceId(3): None Reference symbol mismatch: after transform: ReferenceId(1): Some("x") rebuilt : ReferenceId(4): None Reference symbol mismatch: -after transform: ReferenceId(15): Some("Bar") +after transform: ReferenceId(2): Some("Bar") rebuilt : ReferenceId(9): None Reference symbol mismatch: after transform: ReferenceId(3): Some("x") rebuilt : ReferenceId(10): None Reference symbol mismatch: -after transform: ReferenceId(18): Some("Bar") +after transform: ReferenceId(4): Some("Bar") rebuilt : ReferenceId(13): None Reference symbol mismatch: after transform: ReferenceId(5): Some("x") rebuilt : ReferenceId(14): None Reference symbol mismatch: -after transform: ReferenceId(21): Some("_Bar") +after transform: ReferenceId(18): Some("_Bar") rebuilt : ReferenceId(17): None Reference symbol mismatch: after transform: ReferenceId(6): Some("x") @@ -19079,25 +19036,16 @@ semantic error: Bindings mismatch: after transform: ScopeId(1): ["Inner", "P"] rebuilt : ScopeId(1): ["Inner"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(2), ReferenceId(4), ReferenceId(9)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(2), ReferenceId(4), ReferenceId(8)] rebuilt : SymbolId(1): [ReferenceId(0), ReferenceId(1)] -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(6), ReferenceId(8)] -rebuilt : SymbolId(3): [ReferenceId(2)] tasks/coverage/typescript/tests/cases/compiler/reactSFCAndFunctionResolvable.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["Checkbox", "OtherRadio", "Radio", "RandomComponent", "React", "_jsxFileName", "condition1", "condition2", "condition3"] rebuilt : ScopeId(0): ["RandomComponent", "React", "_jsxFileName"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1), ReferenceId(2), ReferenceId(3), ReferenceId(15), ReferenceId(18)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1), ReferenceId(2), ReferenceId(3), ReferenceId(14), ReferenceId(16)] rebuilt : SymbolId(1): [ReferenceId(7), ReferenceId(10)] -Symbol reference IDs mismatch: -after transform: SymbolId(8): [ReferenceId(11), ReferenceId(14)] -rebuilt : SymbolId(3): [ReferenceId(8)] -Symbol reference IDs mismatch: -after transform: SymbolId(9): [ReferenceId(12), ReferenceId(17)] -rebuilt : SymbolId(4): [ReferenceId(11)] Reference symbol mismatch: after transform: ReferenceId(4): Some("condition1") rebuilt : ReferenceId(0): None @@ -19128,10 +19076,10 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["React", "Tag", "_jsxFileName", "children", "classes", "rest"] rebuilt : ScopeId(0): ["React", "_jsxFileName", "children", "classes", "rest"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(8)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(7)] rebuilt : SymbolId(1): [ReferenceId(0)] Reference symbol mismatch: -after transform: ReferenceId(7): Some("Tag") +after transform: ReferenceId(1): Some("Tag") rebuilt : ReferenceId(1): None Unresolved references mismatch: after transform: [] @@ -19142,10 +19090,10 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["React", "Tag", "_jsxFileName", "children", "classes", "rest"] rebuilt : ScopeId(0): ["React", "_jsxFileName", "children", "classes", "rest"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1), ReferenceId(10)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1), ReferenceId(9)] rebuilt : SymbolId(1): [ReferenceId(0)] Reference symbol mismatch: -after transform: ReferenceId(9): Some("Tag") +after transform: ReferenceId(3): Some("Tag") rebuilt : ReferenceId(1): None Unresolved references mismatch: after transform: ["HTMLElement"] @@ -20067,9 +20015,6 @@ rebuilt : ScopeId(1): [] Bindings mismatch: after transform: ScopeId(2): ["T", "obj"] rebuilt : ScopeId(2): ["obj"] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(2), ReferenceId(4), ReferenceId(6)] -rebuilt : SymbolId(2): [ReferenceId(1), ReferenceId(3)] tasks/coverage/typescript/tests/cases/compiler/reuseInnerModuleMember.ts semantic error: Bindings mismatch: @@ -23166,9 +23111,6 @@ tasks/coverage/typescript/tests/cases/compiler/tsxAttributeQuickinfoTypesSameAsO semantic error: Bindings mismatch: after transform: ScopeId(0): ["Foo", "JSX", "_jsxFileName", "_reactJsxRuntime"] rebuilt : ScopeId(0): ["Foo", "_jsxFileName", "_reactJsxRuntime"] -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(1), ReferenceId(2), ReferenceId(5)] -rebuilt : SymbolId(2): [ReferenceId(4), ReferenceId(6)] tasks/coverage/typescript/tests/cases/compiler/tsxAttributesHasInferrableIndex.tsx semantic error: Bindings mismatch: @@ -23181,7 +23123,7 @@ Symbol redeclarations mismatch: after transform: SymbolId(2): [Span { start: 243, end: 256 }] rebuilt : SymbolId(1): [] Symbol reference IDs mismatch: -after transform: SymbolId(8): [ReferenceId(5), ReferenceId(6), ReferenceId(8)] +after transform: SymbolId(8): [ReferenceId(5), ReferenceId(6)] rebuilt : SymbolId(5): [ReferenceId(2)] Unresolved references mismatch: after transform: ["Date", "React"] @@ -23205,9 +23147,6 @@ rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime"] Unresolved references mismatch: after transform: ["Comp", "JSX", "parseInt", "require", "true", "undefined"] rebuilt : ["Comp", "parseInt", "require", "undefined"] -Unresolved reference IDs mismatch for "Comp": -after transform: [ReferenceId(6), ReferenceId(9), ReferenceId(11), ReferenceId(14), ReferenceId(16), ReferenceId(19), ReferenceId(22), ReferenceId(25)] -rebuilt : [ReferenceId(2), ReferenceId(7), ReferenceId(11), ReferenceId(16)] tasks/coverage/typescript/tests/cases/compiler/tsxFragmentChildrenCheck.ts semantic error: Bindings mismatch: @@ -23227,9 +23166,6 @@ rebuilt : ScopeId(0): ["ShouldInferFromData", "_jsxFileName", "_reactJsxR Bindings mismatch: after transform: ScopeId(6): ["T", "props"] rebuilt : ScopeId(1): ["props"] -Symbol reference IDs mismatch: -after transform: SymbolId(8): [ReferenceId(10), ReferenceId(11), ReferenceId(13), ReferenceId(15), ReferenceId(16), ReferenceId(18), ReferenceId(22), ReferenceId(25), ReferenceId(28)] -rebuilt : SymbolId(2): [ReferenceId(3), ReferenceId(4), ReferenceId(6), ReferenceId(9), ReferenceId(12), ReferenceId(16)] Unresolved references mismatch: after transform: ["JSX", "require"] rebuilt : ["require"] @@ -23239,14 +23175,11 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["ButtonProps", "CustomButton", "CustomButtonProps", "React", "_jsxFileName"] rebuilt : ScopeId(0): ["CustomButton", "React", "_jsxFileName"] Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(3), ReferenceId(7), ReferenceId(13)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(3), ReferenceId(7), ReferenceId(12)] rebuilt : SymbolId(1): [ReferenceId(0)] Unresolved references mismatch: after transform: ["Button", "HTMLButtonElement"] rebuilt : ["Button"] -Unresolved reference IDs mismatch for "Button": -after transform: [ReferenceId(9), ReferenceId(12)] -rebuilt : [ReferenceId(1)] tasks/coverage/typescript/tests/cases/compiler/tsxResolveExternalModuleExportsTypes.ts semantic error: Bindings mismatch: @@ -23257,28 +23190,16 @@ tasks/coverage/typescript/tests/cases/compiler/tsxStatelessComponentDefaultProps semantic error: Bindings mismatch: after transform: ScopeId(0): ["BackButton", "Props", "React", "_jsxFileName", "a"] rebuilt : ScopeId(0): ["BackButton", "React", "_jsxFileName", "a"] -Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(1), ReferenceId(2), ReferenceId(6)] -rebuilt : SymbolId(2): [ReferenceId(2), ReferenceId(4)] tasks/coverage/typescript/tests/cases/compiler/tsxUnionMemberChecksFilterDataProps.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["React", "ReactElement", "RootHappy", "RootNotHappy", "_jsxFileName"] rebuilt : ScopeId(0): ["React", "RootHappy", "RootNotHappy", "_jsxFileName"] -Unresolved reference IDs mismatch for "NotHappy": -after transform: [ReferenceId(2), ReferenceId(5)] -rebuilt : [ReferenceId(1)] -Unresolved reference IDs mismatch for "Happy": -after transform: [ReferenceId(3), ReferenceId(8)] -rebuilt : [ReferenceId(4)] tasks/coverage/typescript/tests/cases/compiler/tsxUnionSpread.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["AnimalComponent", "AnimalInfo", "CatInfo", "DogInfo", "JSX", "_jsxFileName", "_reactJsxRuntime", "component", "component2", "getProps", "props", "props2"] rebuilt : ScopeId(0): ["AnimalComponent", "_jsxFileName", "_reactJsxRuntime", "component", "component2", "getProps", "props", "props2"] -Symbol reference IDs mismatch: -after transform: SymbolId(5): [ReferenceId(8), ReferenceId(11), ReferenceId(13), ReferenceId(16)] -rebuilt : SymbolId(2): [ReferenceId(4), ReferenceId(8)] Unresolved references mismatch: after transform: ["JSX", "require", "undefined"] rebuilt : ["require", "undefined"] @@ -23717,11 +23638,8 @@ rebuilt : ScopeId(0): ["React", "_jsxFileName", "_reactJsxRuntime"] Unresolved references mismatch: after transform: ["JSX", "T", "require"] rebuilt : ["T", "require"] -Unresolved reference IDs mismatch for "T": -after transform: [ReferenceId(9), ReferenceId(11)] -rebuilt : [ReferenceId(3)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(14)] +after transform: [ReferenceId(13)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/compiler/typeLiteralCallback.ts @@ -34999,13 +34917,13 @@ Bindings mismatch: after transform: ScopeId(0): ["Comp", "Prop", "React", "_jsxFileName", "_reactJsxRuntime", "k", "k1", "k2"] rebuilt : ScopeId(0): ["Comp", "React", "_jsxFileName", "_reactJsxRuntime", "k", "k1", "k2"] Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(3), ReferenceId(4), ReferenceId(5), ReferenceId(6), ReferenceId(7), ReferenceId(10), ReferenceId(13), ReferenceId(18)] +after transform: SymbolId(2): [ReferenceId(3), ReferenceId(4), ReferenceId(5), ReferenceId(6), ReferenceId(7)] rebuilt : SymbolId(3): [ReferenceId(6), ReferenceId(9), ReferenceId(12)] Unresolved references mismatch: after transform: ["JSX", "require"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(21)] +after transform: [ReferenceId(18)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty10.tsx @@ -35013,7 +34931,7 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["Button", "JSX", "_jsxFileName", "_reactJsxRuntime", "k1", "k2", "k3", "k4"] rebuilt : ScopeId(0): ["Button", "_jsxFileName", "_reactJsxRuntime", "k1", "k2", "k3", "k4"] Symbol reference IDs mismatch: -after transform: SymbolId(4): [ReferenceId(1), ReferenceId(2), ReferenceId(21)] +after transform: SymbolId(4): [ReferenceId(1), ReferenceId(2)] rebuilt : SymbolId(2): [ReferenceId(19)] tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty11.tsx @@ -35021,7 +34939,7 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["Button", "JSX", "_jsxFileName", "_reactJsxRuntime", "k1", "k2", "k3", "k4"] rebuilt : ScopeId(0): ["Button", "_jsxFileName", "_reactJsxRuntime", "k1", "k2", "k3", "k4"] Symbol reference IDs mismatch: -after transform: SymbolId(4): [ReferenceId(1), ReferenceId(2), ReferenceId(21)] +after transform: SymbolId(4): [ReferenceId(1), ReferenceId(2)] rebuilt : SymbolId(2): [ReferenceId(19)] tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty12.tsx @@ -35034,7 +34952,7 @@ Symbol reference IDs mismatch: after transform: SymbolId(2): [ReferenceId(0)] rebuilt : SymbolId(3): [] Symbol reference IDs mismatch: -after transform: SymbolId(5): [ReferenceId(4), ReferenceId(5), ReferenceId(6), ReferenceId(9), ReferenceId(14)] +after transform: SymbolId(5): [ReferenceId(4), ReferenceId(5), ReferenceId(6)] rebuilt : SymbolId(5): [ReferenceId(5), ReferenceId(8)] Reference symbol mismatch: after transform: ReferenceId(1): Some("React") @@ -35043,7 +34961,7 @@ Reference symbol mismatch: after transform: ReferenceId(7): Some("React") rebuilt : ReferenceId(12): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(19)] +after transform: [ReferenceId(17)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty16.tsx @@ -35056,10 +34974,10 @@ Unresolved references mismatch: after transform: ["Foo", "JSX", "require", "true"] rebuilt : ["Foo", "require"] Unresolved reference IDs mismatch for "Foo": -after transform: [ReferenceId(3), ReferenceId(4), ReferenceId(5), ReferenceId(6), ReferenceId(7), ReferenceId(8), ReferenceId(9), ReferenceId(12), ReferenceId(15), ReferenceId(18)] +after transform: [ReferenceId(3), ReferenceId(4), ReferenceId(5), ReferenceId(6), ReferenceId(7), ReferenceId(8)] rebuilt : [ReferenceId(5), ReferenceId(8), ReferenceId(11), ReferenceId(14)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(23)] +after transform: [ReferenceId(19)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty3.tsx @@ -35069,7 +34987,7 @@ Bindings mismatch: after transform: ScopeId(0): ["FetchUser", "IFetchUserProps", "IUser", "React", "UserName0", "UserName1", "_jsxFileName", "_reactJsxRuntime"] rebuilt : ScopeId(0): ["FetchUser", "React", "UserName0", "UserName1", "_jsxFileName", "_reactJsxRuntime"] Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(4), ReferenceId(5), ReferenceId(7), ReferenceId(8), ReferenceId(10), ReferenceId(15)] +after transform: SymbolId(3): [ReferenceId(4), ReferenceId(5), ReferenceId(7), ReferenceId(8)] rebuilt : SymbolId(3): [ReferenceId(4), ReferenceId(10)] Reference symbol mismatch: after transform: ReferenceId(2): Some("React") @@ -35078,7 +34996,7 @@ Unresolved references mismatch: after transform: ["JSX", "require"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(20)] +after transform: [ReferenceId(18)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty6.tsx @@ -35088,13 +35006,7 @@ Bindings mismatch: after transform: ScopeId(0): ["AnotherButton", "Button", "Comp", "Prop", "React", "_jsxFileName", "_reactJsxRuntime", "k1", "k2", "k3", "k4"] rebuilt : ScopeId(0): ["AnotherButton", "Button", "Comp", "React", "_jsxFileName", "_reactJsxRuntime", "k1", "k2", "k3", "k4"] Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(7), ReferenceId(11), ReferenceId(15), ReferenceId(19), ReferenceId(26), ReferenceId(35), ReferenceId(44), ReferenceId(53)] -rebuilt : SymbolId(3): [ReferenceId(13), ReferenceId(22), ReferenceId(31), ReferenceId(40)] -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(8), ReferenceId(12), ReferenceId(16), ReferenceId(29), ReferenceId(38), ReferenceId(47)] -rebuilt : SymbolId(4): [ReferenceId(16), ReferenceId(25), ReferenceId(34)] -Symbol reference IDs mismatch: -after transform: SymbolId(5): [ReferenceId(5), ReferenceId(6), ReferenceId(9), ReferenceId(10), ReferenceId(13), ReferenceId(14), ReferenceId(17), ReferenceId(18), ReferenceId(32), ReferenceId(41), ReferenceId(50), ReferenceId(56)] +after transform: SymbolId(5): [ReferenceId(5), ReferenceId(6), ReferenceId(9), ReferenceId(10), ReferenceId(13), ReferenceId(14), ReferenceId(17), ReferenceId(18)] rebuilt : SymbolId(6): [ReferenceId(11), ReferenceId(20), ReferenceId(29), ReferenceId(38)] Reference symbol mismatch: after transform: ReferenceId(2): Some("React") @@ -35103,7 +35015,7 @@ Unresolved references mismatch: after transform: ["JSX", "require"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(59)] +after transform: [ReferenceId(48)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty8.tsx @@ -35113,13 +35025,7 @@ Bindings mismatch: after transform: ScopeId(0): ["AnotherButton", "Button", "Comp", "Prop", "React", "_jsxFileName", "_reactJsxRuntime", "k1", "k2", "k3", "k4"] rebuilt : ScopeId(0): ["AnotherButton", "Button", "Comp", "React", "_jsxFileName", "_reactJsxRuntime", "k1", "k2", "k3", "k4"] Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(7), ReferenceId(11), ReferenceId(15), ReferenceId(19), ReferenceId(26), ReferenceId(35), ReferenceId(44), ReferenceId(53)] -rebuilt : SymbolId(3): [ReferenceId(13), ReferenceId(22), ReferenceId(31), ReferenceId(40)] -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(8), ReferenceId(12), ReferenceId(16), ReferenceId(29), ReferenceId(38), ReferenceId(47)] -rebuilt : SymbolId(4): [ReferenceId(16), ReferenceId(25), ReferenceId(34)] -Symbol reference IDs mismatch: -after transform: SymbolId(5): [ReferenceId(5), ReferenceId(6), ReferenceId(9), ReferenceId(10), ReferenceId(13), ReferenceId(14), ReferenceId(17), ReferenceId(18), ReferenceId(32), ReferenceId(41), ReferenceId(50), ReferenceId(56)] +after transform: SymbolId(5): [ReferenceId(5), ReferenceId(6), ReferenceId(9), ReferenceId(10), ReferenceId(13), ReferenceId(14), ReferenceId(17), ReferenceId(18)] rebuilt : SymbolId(6): [ReferenceId(11), ReferenceId(20), ReferenceId(29), ReferenceId(38)] Reference symbol mismatch: after transform: ReferenceId(2): Some("React") @@ -35128,7 +35034,7 @@ Unresolved references mismatch: after transform: ["JSX", "require"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(59)] +after transform: [ReferenceId(48)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxChildrenProperty9.tsx @@ -35148,9 +35054,6 @@ rebuilt : ScopeId(0): ["C", "_jsxFileName", "_reactJsxRuntime", "x", "y"] Bindings mismatch: after transform: ScopeId(5): ["T"] rebuilt : ScopeId(1): [] -Symbol reference IDs mismatch: -after transform: SymbolId(4): [ReferenceId(6), ReferenceId(7), ReferenceId(8)] -rebuilt : SymbolId(2): [ReferenceId(2), ReferenceId(4)] Unresolved references mismatch: after transform: ["Component", "Readonly", "require"] rebuilt : ["Component", "require"] @@ -35162,9 +35065,6 @@ rebuilt : ScopeId(0): ["AsyncLoader", "React", "_jsxFileName", "load", "l Bindings mismatch: after transform: ScopeId(3): ["TResult"] rebuilt : ScopeId(1): [] -Symbol reference IDs mismatch: -after transform: SymbolId(4): [ReferenceId(12), ReferenceId(16)] -rebuilt : SymbolId(2): [ReferenceId(2)] Unresolved references mismatch: after transform: ["Exclude", "Promise", "true"] rebuilt : [] @@ -35173,9 +35073,6 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/checkJsxUnionSFXContextual semantic error: Bindings mismatch: after transform: ScopeId(0): ["ComponentWithUnion", "HereIsTheError", "PM", "PS", "React", "_jsxFileName"] rebuilt : ScopeId(0): ["ComponentWithUnion", "HereIsTheError", "React", "_jsxFileName"] -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(3), ReferenceId(6), ReferenceId(12)] -rebuilt : SymbolId(2): [ReferenceId(3), ReferenceId(7)] Unresolved references mismatch: after transform: ["console", "true"] rebuilt : ["console"] @@ -35225,7 +35122,7 @@ Symbol redeclarations mismatch: after transform: SymbolId(9): [Span { start: 537, end: 538 }] rebuilt : SymbolId(2): [] Reference symbol mismatch: -after transform: ReferenceId(44): Some("Component") +after transform: ReferenceId(0): Some("Component") rebuilt : ReferenceId(11): None Reference symbol mismatch: after transform: ReferenceId(2): Some("foo") @@ -35234,52 +35131,52 @@ Reference symbol mismatch: after transform: ReferenceId(3): Some("bar") rebuilt : ReferenceId(15): None Reference symbol mismatch: -after transform: ReferenceId(51): Some("Composite") +after transform: ReferenceId(4): Some("Composite") rebuilt : ReferenceId(21): None Reference symbol mismatch: -after transform: ReferenceId(57): Some("Composite") +after transform: ReferenceId(6): Some("Composite") rebuilt : ReferenceId(24): None Reference symbol mismatch: -after transform: ReferenceId(54): Some("Composite2") +after transform: ReferenceId(8): Some("Composite2") rebuilt : ReferenceId(26): None Reference symbol mismatch: -after transform: ReferenceId(78): Some("Component") +after transform: ReferenceId(9): Some("Component") rebuilt : ReferenceId(48): None Reference symbol mismatch: -after transform: ReferenceId(81): Some("Namespace") +after transform: ReferenceId(10): Some("Namespace") rebuilt : ReferenceId(51): None Reference symbol mismatch: -after transform: ReferenceId(84): Some("Namespace") +after transform: ReferenceId(11): Some("Namespace") rebuilt : ReferenceId(54): None Reference symbol mismatch: -after transform: ReferenceId(87): Some("Component") +after transform: ReferenceId(12): Some("Component") rebuilt : ReferenceId(57): None Reference symbol mismatch: -after transform: ReferenceId(90): Some("Component") +after transform: ReferenceId(14): Some("Component") rebuilt : ReferenceId(61): None Reference symbol mismatch: -after transform: ReferenceId(95): Some("Component") +after transform: ReferenceId(15): Some("Component") rebuilt : ReferenceId(66): None Reference symbol mismatch: after transform: ReferenceId(16): Some("y") rebuilt : ReferenceId(67): None Reference symbol mismatch: -after transform: ReferenceId(100): Some("Component") +after transform: ReferenceId(17): Some("Component") rebuilt : ReferenceId(72): None Reference symbol mismatch: -after transform: ReferenceId(103): Some("Component") +after transform: ReferenceId(19): Some("Component") rebuilt : ReferenceId(76): None Reference symbol mismatch: -after transform: ReferenceId(106): Some("Component") +after transform: ReferenceId(21): Some("Component") rebuilt : ReferenceId(80): None Reference symbol mismatch: -after transform: ReferenceId(109): Some("Component") +after transform: ReferenceId(23): Some("Component") rebuilt : ReferenceId(84): None Reference symbol mismatch: after transform: ReferenceId(24): Some("y") rebuilt : ReferenceId(85): None Reference symbol mismatch: -after transform: ReferenceId(115): Some("Component") +after transform: ReferenceId(25): Some("Component") rebuilt : ReferenceId(88): None Reference symbol mismatch: after transform: ReferenceId(26): Some("z") @@ -35288,10 +35185,10 @@ Reference symbol mismatch: after transform: ReferenceId(27): Some("z") rebuilt : ReferenceId(90): None Reference symbol mismatch: -after transform: ReferenceId(112): Some("Child") +after transform: ReferenceId(29): Some("Child") rebuilt : ReferenceId(92): None Reference symbol mismatch: -after transform: ReferenceId(118): Some("Component") +after transform: ReferenceId(30): Some("Component") rebuilt : ReferenceId(96): None Reference symbol mismatch: after transform: ReferenceId(31): Some("z") @@ -35315,7 +35212,7 @@ rebuilt : ScopeId(0): [] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxAttributeResolution13.tsx semantic error: Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1), ReferenceId(2)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1)] rebuilt : SymbolId(2): [ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxAttributeResolution16.tsx @@ -35324,14 +35221,11 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["Address", "AddressComp", "AmericanAddress", "CanadianAddress", "Properties", "React", "_jsxFileName", "_reactJsxRuntime", "a"] rebuilt : ScopeId(0): ["AddressComp", "React", "_jsxFileName", "_reactJsxRuntime", "a"] -Symbol reference IDs mismatch: -after transform: SymbolId(5): [ReferenceId(6), ReferenceId(7)] -rebuilt : SymbolId(3): [ReferenceId(4)] Reference symbol mismatch: after transform: ReferenceId(4): Some("React") rebuilt : ReferenceId(2): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(10)] +after transform: [ReferenceId(9)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxAttributeResolution8.tsx @@ -35359,14 +35253,11 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["Poisoned", "Prop", "React", "_jsxFileName", "_reactJsxRuntime", "p"] rebuilt : ScopeId(0): ["Poisoned", "React", "_jsxFileName", "_reactJsxRuntime", "p"] -Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(2), ReferenceId(5)] -rebuilt : SymbolId(3): [ReferenceId(6)] Reference symbol mismatch: after transform: ReferenceId(0): Some("React") rebuilt : ReferenceId(2): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(8)] +after transform: [ReferenceId(7)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDefaultAttributesResolution2.tsx @@ -35375,9 +35266,6 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["Poisoned", "Prop", "React", "_jsxFileName", "_reactJsxRuntime", "p"] rebuilt : ScopeId(0): ["Poisoned", "React", "_jsxFileName", "_reactJsxRuntime", "p"] -Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(3), ReferenceId(6)] -rebuilt : SymbolId(3): [ReferenceId(6)] Reference symbol mismatch: after transform: ReferenceId(1): Some("React") rebuilt : ReferenceId(2): Some("React") @@ -35385,12 +35273,12 @@ Unresolved references mismatch: after transform: ["require", "true"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(9)] +after transform: [ReferenceId(8)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName1.tsx semantic error: Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1), ReferenceId(2)] +after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1)] rebuilt : SymbolId(2): [ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName4.tsx @@ -35398,31 +35286,23 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["CustomTag", "JSX", "_jsxFileName", "_reactJsxRuntime"] rebuilt : ScopeId(0): ["CustomTag", "_jsxFileName", "_reactJsxRuntime"] Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(0), ReferenceId(1), ReferenceId(2)] +after transform: SymbolId(3): [ReferenceId(0), ReferenceId(1)] rebuilt : SymbolId(2): [ReferenceId(2)] -tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName5.tsx -semantic error: Unresolved references mismatch: -after transform: ["this"] -rebuilt : [] - tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName6.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["JSX", "_jsxFileName", "_reactJsxRuntime", "foo", "t"] rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime", "foo", "t"] -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(0), ReferenceId(1)] -rebuilt : SymbolId(2): [ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName8.tsx -semantic error: Unresolved references mismatch: -after transform: ["this"] -rebuilt : [] +semantic error: Unresolved reference IDs mismatch for "this": +after transform: [ReferenceId(1), ReferenceId(2)] +rebuilt : [ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName9.tsx -semantic error: Unresolved references mismatch: -after transform: ["this"] -rebuilt : [] +semantic error: Unresolved reference IDs mismatch for "this": +after transform: [ReferenceId(1), ReferenceId(2)] +rebuilt : [ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxElementResolution.tsx semantic error: Missing SymbolId: Dotted @@ -35440,9 +35320,6 @@ rebuilt : ScopeId(3): [SymbolId(5), SymbolId(6)] Scope flags mismatch: after transform: ScopeId(5): ScopeFlags(StrictMode | Function) rebuilt : ScopeId(3): ScopeFlags(Function) -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(0), ReferenceId(6)] -rebuilt : SymbolId(3): [ReferenceId(10)] Symbol flags mismatch: after transform: SymbolId(5): SymbolFlags(Export | Class) rebuilt : SymbolId(6): SymbolFlags(Class) @@ -35450,7 +35327,7 @@ Symbol reference IDs mismatch: after transform: SymbolId(5): [] rebuilt : SymbolId(6): [ReferenceId(2)] Reference symbol mismatch: -after transform: ReferenceId(9): Some("Dotted") +after transform: ReferenceId(1): Some("Dotted") rebuilt : ReferenceId(13): Some("Dotted") tasks/coverage/typescript/tests/cases/conformance/jsx/tsxElementResolution13.tsx @@ -35540,26 +35417,21 @@ Unresolved references mismatch: after transform: [] rebuilt : ["React", "__proto__"] -tasks/coverage/typescript/tests/cases/conformance/jsx/tsxExternalModuleEmit1.tsx -semantic error: Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(1), ReferenceId(2)] -rebuilt : SymbolId(1): [ReferenceId(2)] - tasks/coverage/typescript/tests/cases/conformance/jsx/tsxExternalModuleEmit2.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["Foo", "Main", "React", "_jsxFileName"] rebuilt : ScopeId(0): ["Main", "_jsxFileName"] Reference symbol mismatch: -after transform: ReferenceId(8): Some("React") +after transform: ReferenceId(7): Some("React") rebuilt : ReferenceId(0): None Reference symbol mismatch: -after transform: ReferenceId(7): Some("Foo") +after transform: ReferenceId(0): Some("Foo") rebuilt : ReferenceId(1): None Reference symbol mismatch: -after transform: ReferenceId(11): Some("React") +after transform: ReferenceId(9): Some("React") rebuilt : ReferenceId(4): None Reference symbol mismatch: -after transform: ReferenceId(10): Some("Foo") +after transform: ReferenceId(3): Some("Foo") rebuilt : ReferenceId(5): None Unresolved references mismatch: after transform: [] @@ -35660,16 +35532,16 @@ Bindings mismatch: after transform: ScopeId(5): ["Component", "T", "U"] rebuilt : ScopeId(5): ["Component"] Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(4), ReferenceId(6), ReferenceId(21)] +after transform: SymbolId(3): [ReferenceId(4), ReferenceId(6)] rebuilt : SymbolId(4): [ReferenceId(3)] Symbol reference IDs mismatch: -after transform: SymbolId(7): [ReferenceId(11), ReferenceId(13), ReferenceId(24)] +after transform: SymbolId(7): [ReferenceId(11), ReferenceId(13)] rebuilt : SymbolId(7): [ReferenceId(7)] Symbol reference IDs mismatch: -after transform: SymbolId(12): [ReferenceId(18), ReferenceId(20), ReferenceId(27)] +after transform: SymbolId(12): [ReferenceId(18), ReferenceId(20)] rebuilt : SymbolId(10): [ReferenceId(11)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(30)] +after transform: [ReferenceId(27)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType2.tsx @@ -35682,10 +35554,10 @@ Bindings mismatch: after transform: ScopeId(1): ["Component", "T"] rebuilt : ScopeId(1): ["Component"] Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(4), ReferenceId(6), ReferenceId(7)] +after transform: SymbolId(3): [ReferenceId(4), ReferenceId(6)] rebuilt : SymbolId(4): [ReferenceId(3)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(10)] +after transform: [ReferenceId(9)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType3.tsx @@ -35700,9 +35572,6 @@ rebuilt : ScopeId(1): [] Bindings mismatch: after transform: ScopeId(3): ["U"] rebuilt : ScopeId(3): [] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(4), ReferenceId(7)] -rebuilt : SymbolId(3): [ReferenceId(7)] Reference symbol mismatch: after transform: ReferenceId(0): Some("React") rebuilt : ReferenceId(2): Some("React") @@ -35710,7 +35579,7 @@ Reference symbol mismatch: after transform: ReferenceId(2): Some("React") rebuilt : ReferenceId(5): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(10)] +after transform: [ReferenceId(9)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType4.tsx @@ -35725,9 +35594,6 @@ rebuilt : ScopeId(1): [] Bindings mismatch: after transform: ScopeId(3): ["U"] rebuilt : ScopeId(3): [] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(4), ReferenceId(7)] -rebuilt : SymbolId(3): [ReferenceId(7)] Reference symbol mismatch: after transform: ReferenceId(0): Some("React") rebuilt : ReferenceId(2): Some("React") @@ -35735,7 +35601,7 @@ Reference symbol mismatch: after transform: ReferenceId(2): Some("React") rebuilt : ReferenceId(5): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(10)] +after transform: [ReferenceId(9)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType5.tsx @@ -35750,9 +35616,6 @@ rebuilt : ScopeId(1): [] Bindings mismatch: after transform: ScopeId(3): ["U"] rebuilt : ScopeId(3): [] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(5), ReferenceId(8)] -rebuilt : SymbolId(3): [ReferenceId(7)] Reference symbol mismatch: after transform: ReferenceId(0): Some("React") rebuilt : ReferenceId(2): Some("React") @@ -35760,7 +35623,7 @@ Reference symbol mismatch: after transform: ReferenceId(2): Some("React") rebuilt : ReferenceId(5): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(11)] +after transform: [ReferenceId(10)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType6.tsx @@ -35775,9 +35638,6 @@ rebuilt : ScopeId(1): [] Bindings mismatch: after transform: ScopeId(3): ["U"] rebuilt : ScopeId(3): [] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(5), ReferenceId(8)] -rebuilt : SymbolId(3): [ReferenceId(7)] Reference symbol mismatch: after transform: ReferenceId(0): Some("React") rebuilt : ReferenceId(2): Some("React") @@ -35785,7 +35645,7 @@ Reference symbol mismatch: after transform: ReferenceId(2): Some("React") rebuilt : ReferenceId(5): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(11)] +after transform: [ReferenceId(10)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType7.tsx @@ -35803,11 +35663,8 @@ rebuilt : ScopeId(2): ["props"] Unresolved references mismatch: after transform: ["Component", "JSX", "require"] rebuilt : ["Component", "require"] -Unresolved reference IDs mismatch for "Component": -after transform: [ReferenceId(3), ReferenceId(6), ReferenceId(8), ReferenceId(11)] -rebuilt : [ReferenceId(3), ReferenceId(7)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(14)] +after transform: [ReferenceId(12)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType8.tsx @@ -35825,11 +35682,8 @@ rebuilt : ScopeId(2): ["props"] Unresolved references mismatch: after transform: ["Component", "JSX", "require"] rebuilt : ["Component", "require"] -Unresolved reference IDs mismatch for "Component": -after transform: [ReferenceId(3), ReferenceId(6), ReferenceId(8), ReferenceId(11)] -rebuilt : [ReferenceId(3), ReferenceId(7)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(14)] +after transform: [ReferenceId(12)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxGenericAttributesType9.tsx @@ -35841,9 +35695,6 @@ rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3) Bindings mismatch: after transform: ScopeId(1): ["Ctor", "P"] rebuilt : ScopeId(1): ["Ctor"] -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(5), ReferenceId(6)] -rebuilt : SymbolId(4): [ReferenceId(4)] Reference symbol mismatch: after transform: ReferenceId(2): Some("React") rebuilt : ReferenceId(2): Some("React") @@ -35851,7 +35702,7 @@ Unresolved references mismatch: after transform: ["JSX", "require"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(9)] +after transform: [ReferenceId(8)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxInArrowFunction.tsx @@ -35877,9 +35728,6 @@ tasks/coverage/typescript/tests/cases/conformance/jsx/tsxOpeningClosingNames.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["A", "JSX", "_jsxFileName", "_reactJsxRuntime"] rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime"] -Reference symbol mismatch: -after transform: ReferenceId(2): Some("A") -rebuilt : ReferenceId(2): None Unresolved reference IDs mismatch for "A": after transform: [ReferenceId(0), ReferenceId(1)] rebuilt : [ReferenceId(2)] @@ -35901,11 +35749,6 @@ Please consider using `import lib from '...';` alongside Typescript's --allowSyn `import lib = require(...);` is only supported when compiling modules to CommonJS. Please consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option, or add @babel/plugin-transform-modules-commonjs to your Babel config. -tasks/coverage/typescript/tests/cases/conformance/jsx/tsxPreserveEmit2.tsx -semantic error: Symbol reference IDs mismatch: -after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1)] -rebuilt : SymbolId(2): [ReferenceId(2)] - tasks/coverage/typescript/tests/cases/conformance/jsx/tsxPreserveEmit3.tsx semantic error: Bindings mismatch: after transform: ScopeId(0): ["JSX"] @@ -35917,11 +35760,8 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["Prop", "React", "_jsxFileName", "_reactJsxRuntime", "x"] rebuilt : ScopeId(0): ["React", "_jsxFileName", "_reactJsxRuntime", "x"] -Unresolved reference IDs mismatch for "MyComp": -after transform: [ReferenceId(4), ReferenceId(5)] -rebuilt : [ReferenceId(3)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(8)] +after transform: [ReferenceId(7)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter2.tsx @@ -35930,11 +35770,8 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["Prop", "React", "_jsxFileName", "_reactJsxRuntime", "x", "x1"] rebuilt : ScopeId(0): ["React", "_jsxFileName", "_reactJsxRuntime", "x", "x1"] -Unresolved reference IDs mismatch for "MyComp": -after transform: [ReferenceId(4), ReferenceId(5), ReferenceId(6), ReferenceId(9)] -rebuilt : [ReferenceId(3), ReferenceId(6)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(12)] +after transform: [ReferenceId(10)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxReactEmit1.tsx @@ -36036,34 +35873,34 @@ semantic error: Bindings mismatch: after transform: ScopeId(0): ["Bar", "Foo", "JSX", "React", "_jsxFileName", "baz"] rebuilt : ScopeId(0): ["_jsxFileName"] Reference symbol mismatch: -after transform: ReferenceId(21): Some("React") +after transform: ReferenceId(16): Some("React") rebuilt : ReferenceId(0): None Reference symbol mismatch: -after transform: ReferenceId(8): Some("Foo") +after transform: ReferenceId(0): Some("Foo") rebuilt : ReferenceId(1): None Reference symbol mismatch: -after transform: ReferenceId(11): Some("React") +after transform: ReferenceId(9): Some("React") rebuilt : ReferenceId(3): None Reference symbol mismatch: -after transform: ReferenceId(10): Some("Bar") +after transform: ReferenceId(2): Some("Bar") rebuilt : ReferenceId(4): None Reference symbol mismatch: -after transform: ReferenceId(14): Some("React") +after transform: ReferenceId(11): Some("React") rebuilt : ReferenceId(6): None Reference symbol mismatch: -after transform: ReferenceId(13): Some("Bar") +after transform: ReferenceId(4): Some("Bar") rebuilt : ReferenceId(7): None Reference symbol mismatch: -after transform: ReferenceId(17): Some("React") +after transform: ReferenceId(13): Some("React") rebuilt : ReferenceId(9): None Reference symbol mismatch: -after transform: ReferenceId(16): Some("Bar") +after transform: ReferenceId(5): Some("Bar") rebuilt : ReferenceId(10): None Reference symbol mismatch: -after transform: ReferenceId(20): Some("React") +after transform: ReferenceId(15): Some("React") rebuilt : ReferenceId(12): None Reference symbol mismatch: -after transform: ReferenceId(19): Some("Bar") +after transform: ReferenceId(6): Some("Bar") rebuilt : ReferenceId(13): None Unresolved references mismatch: after transform: [] @@ -36203,14 +36040,8 @@ Missing ReferenceId: require Binding symbols mismatch: after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6), SymbolId(7), SymbolId(8)] rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(5), SymbolId(7), SymbolId(8)] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(0), ReferenceId(2)] -rebuilt : SymbolId(3): [ReferenceId(3)] -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(1), ReferenceId(5)] -rebuilt : SymbolId(5): [ReferenceId(6)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(8)] +after transform: [ReferenceId(6)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSfcReturnNullStrictNullChecks.tsx @@ -36219,14 +36050,8 @@ Missing ReferenceId: require Binding symbols mismatch: after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(5), SymbolId(6), SymbolId(7), SymbolId(8)] rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(5), SymbolId(7), SymbolId(8)] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(0), ReferenceId(2)] -rebuilt : SymbolId(3): [ReferenceId(3)] -Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(1), ReferenceId(5)] -rebuilt : SymbolId(5): [ReferenceId(6)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(8)] +after transform: [ReferenceId(6)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution1.tsx @@ -36235,14 +36060,11 @@ Missing ReferenceId: require Binding symbols mismatch: after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6)] rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(4), SymbolId(5), SymbolId(6)] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(1), ReferenceId(3), ReferenceId(6), ReferenceId(9)] -rebuilt : SymbolId(3): [ReferenceId(6), ReferenceId(10)] Reference symbol mismatch: after transform: ReferenceId(0): Some("React") rebuilt : ReferenceId(2): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(12)] +after transform: [ReferenceId(10)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution11.tsx @@ -36251,9 +36073,6 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["OverWriteAttr", "Prop", "React", "_jsxFileName", "_reactJsxRuntime", "anyobj", "obj", "obj1", "obj3", "x", "x1", "x2", "x3", "x4", "x5"] rebuilt : ScopeId(0): ["OverWriteAttr", "React", "_jsxFileName", "_reactJsxRuntime", "anyobj", "obj", "obj1", "obj3", "x", "x1", "x2", "x3", "x4", "x5"] -Symbol reference IDs mismatch: -after transform: SymbolId(5): [ReferenceId(4), ReferenceId(7), ReferenceId(10), ReferenceId(12), ReferenceId(14), ReferenceId(15), ReferenceId(19), ReferenceId(22), ReferenceId(25), ReferenceId(28), ReferenceId(31), ReferenceId(34)] -rebuilt : SymbolId(6): [ReferenceId(6), ReferenceId(11), ReferenceId(16), ReferenceId(20), ReferenceId(24), ReferenceId(27)] Reference symbol mismatch: after transform: ReferenceId(2): Some("React") rebuilt : ReferenceId(2): Some("React") @@ -36261,7 +36080,7 @@ Unresolved references mismatch: after transform: ["require", "true"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(37)] +after transform: [ReferenceId(31)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution13.tsx @@ -36270,11 +36089,8 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["AnotherComponentProps", "ChildComponent", "Component", "ComponentProps", "React", "_jsxFileName", "_reactJsxRuntime"] rebuilt : ScopeId(0): ["ChildComponent", "Component", "React", "_jsxFileName", "_reactJsxRuntime"] -Symbol reference IDs mismatch: -after transform: SymbolId(6): [ReferenceId(2), ReferenceId(4), ReferenceId(8), ReferenceId(11)] -rebuilt : SymbolId(6): [ReferenceId(4), ReferenceId(8)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(16)] +after transform: [ReferenceId(14)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution15.tsx @@ -36283,11 +36099,8 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["AnotherComponent", "AnotherComponentProps", "Component", "ComponentProps", "React", "_jsxFileName", "_reactJsxRuntime"] rebuilt : ScopeId(0): ["AnotherComponent", "Component", "React", "_jsxFileName", "_reactJsxRuntime"] -Symbol reference IDs mismatch: -after transform: SymbolId(5): [ReferenceId(1), ReferenceId(5)] -rebuilt : SymbolId(5): [ReferenceId(3)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(10)] +after transform: [ReferenceId(9)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution3.tsx @@ -36296,14 +36109,11 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["Poisoned", "PoisonedProp", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "p", "y"] rebuilt : ScopeId(0): ["Poisoned", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "p", "y"] -Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(2), ReferenceId(4), ReferenceId(7), ReferenceId(10)] -rebuilt : SymbolId(3): [ReferenceId(6), ReferenceId(10)] Reference symbol mismatch: after transform: ReferenceId(0): Some("React") rebuilt : ReferenceId(2): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(13)] +after transform: [ReferenceId(11)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution7.tsx @@ -36312,9 +36122,6 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["React", "TextComponent", "TextProps", "_jsxFileName", "_reactJsxRuntime", "textPropsFalse", "textPropsTrue", "y1", "y2"] rebuilt : ScopeId(0): ["React", "TextComponent", "_jsxFileName", "_reactJsxRuntime", "textPropsFalse", "textPropsTrue", "y1", "y2"] -Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(4), ReferenceId(7), ReferenceId(11), ReferenceId(14)] -rebuilt : SymbolId(3): [ReferenceId(6), ReferenceId(10)] Reference symbol mismatch: after transform: ReferenceId(1): Some("React") rebuilt : ReferenceId(2): Some("React") @@ -36322,7 +36129,7 @@ Unresolved references mismatch: after transform: ["require", "true"] rebuilt : ["require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(17)] +after transform: [ReferenceId(15)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution8.tsx @@ -36331,14 +36138,11 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["OverWriteAttr", "Prop", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "obj1", "obj3", "x", "x1"] rebuilt : ScopeId(0): ["OverWriteAttr", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "obj1", "obj3", "x", "x1"] -Symbol reference IDs mismatch: -after transform: SymbolId(5): [ReferenceId(2), ReferenceId(5), ReferenceId(10), ReferenceId(13)] -rebuilt : SymbolId(6): [ReferenceId(6), ReferenceId(11)] Reference symbol mismatch: after transform: ReferenceId(0): Some("React") rebuilt : ReferenceId(2): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(16)] +after transform: [ReferenceId(14)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution9.tsx @@ -36347,14 +36151,11 @@ Missing ReferenceId: require Bindings mismatch: after transform: ScopeId(0): ["Opt", "OptionProp", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "obj1", "p", "y", "y1", "y2", "y3"] rebuilt : ScopeId(0): ["Opt", "React", "_jsxFileName", "_reactJsxRuntime", "obj", "obj1", "p", "y", "y1", "y2", "y3"] -Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(4), ReferenceId(5), ReferenceId(7), ReferenceId(9), ReferenceId(11), ReferenceId(14), ReferenceId(17), ReferenceId(20), ReferenceId(23), ReferenceId(26)] -rebuilt : SymbolId(3): [ReferenceId(6), ReferenceId(9), ReferenceId(13), ReferenceId(17), ReferenceId(21)] Reference symbol mismatch: after transform: ReferenceId(0): Some("React") rebuilt : ReferenceId(2): Some("React") Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(29)] +after transform: [ReferenceId(24)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxSpreadChildren.tsx @@ -36373,11 +36174,8 @@ rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3) Unresolved references mismatch: after transform: ["JSX", "OneThing", "require"] rebuilt : ["OneThing", "require"] -Unresolved reference IDs mismatch for "OneThing": -after transform: [ReferenceId(2), ReferenceId(3), ReferenceId(5), ReferenceId(6), ReferenceId(9), ReferenceId(11), ReferenceId(13), ReferenceId(16), ReferenceId(17), ReferenceId(18), ReferenceId(20), ReferenceId(23), ReferenceId(26), ReferenceId(29), ReferenceId(32), ReferenceId(35), ReferenceId(38), ReferenceId(41), ReferenceId(44), ReferenceId(47)] -rebuilt : [ReferenceId(3), ReferenceId(6), ReferenceId(10), ReferenceId(13), ReferenceId(18), ReferenceId(22), ReferenceId(26), ReferenceId(31), ReferenceId(34), ReferenceId(37)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(50)] +after transform: [ReferenceId(40)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload3.tsx @@ -36387,12 +36185,6 @@ rebuilt : ScopeId(0): ["_jsxFileName", "_reactJsxRuntime", "obj2", "three Unresolved references mismatch: after transform: ["JSX", "ThreeThing", "ZeroThingOrTwoThing", "require"] rebuilt : ["ThreeThing", "ZeroThingOrTwoThing", "require"] -Unresolved reference IDs mismatch for "ThreeThing": -after transform: [ReferenceId(15), ReferenceId(16), ReferenceId(17), ReferenceId(34), ReferenceId(37), ReferenceId(40)] -rebuilt : [ReferenceId(20), ReferenceId(23), ReferenceId(26)] -Unresolved reference IDs mismatch for "ZeroThingOrTwoThing": -after transform: [ReferenceId(3), ReferenceId(4), ReferenceId(5), ReferenceId(7), ReferenceId(9), ReferenceId(19), ReferenceId(22), ReferenceId(25), ReferenceId(28), ReferenceId(31)] -rebuilt : [ReferenceId(2), ReferenceId(5), ReferenceId(8), ReferenceId(12), ReferenceId(16)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload6.tsx semantic error: Missing SymbolId: React @@ -36401,13 +36193,13 @@ Bindings mismatch: after transform: ScopeId(0): ["ButtonProps", "ClickableProps", "HyphenProps", "LinkProps", "MainButton", "React", "_jsxFileName", "_reactJsxRuntime", "b0", "b1", "b10", "b11", "b12", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "obj", "obj1", "obj2"] rebuilt : ScopeId(0): ["MainButton", "React", "_jsxFileName", "_reactJsxRuntime", "b0", "b1", "b10", "b11", "b12", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "obj", "obj1", "obj2"] Symbol reference IDs mismatch: -after transform: SymbolId(11): [ReferenceId(19), ReferenceId(20), ReferenceId(21), ReferenceId(22), ReferenceId(23), ReferenceId(25), ReferenceId(27), ReferenceId(29), ReferenceId(31), ReferenceId(33), ReferenceId(35), ReferenceId(36), ReferenceId(37), ReferenceId(38), ReferenceId(39), ReferenceId(40), ReferenceId(41), ReferenceId(42), ReferenceId(43), ReferenceId(46), ReferenceId(49), ReferenceId(52), ReferenceId(55), ReferenceId(58), ReferenceId(61), ReferenceId(64), ReferenceId(67), ReferenceId(70), ReferenceId(73), ReferenceId(76), ReferenceId(79)] +after transform: SymbolId(11): [ReferenceId(19), ReferenceId(20), ReferenceId(21), ReferenceId(22), ReferenceId(23), ReferenceId(25), ReferenceId(27), ReferenceId(29), ReferenceId(31), ReferenceId(33), ReferenceId(35), ReferenceId(36), ReferenceId(37), ReferenceId(38), ReferenceId(39), ReferenceId(40), ReferenceId(41), ReferenceId(42)] rebuilt : SymbolId(6): [ReferenceId(7), ReferenceId(10), ReferenceId(13), ReferenceId(17), ReferenceId(21), ReferenceId(25), ReferenceId(29), ReferenceId(33), ReferenceId(37), ReferenceId(40), ReferenceId(43), ReferenceId(46), ReferenceId(49)] Unresolved references mismatch: after transform: ["JSX", "console", "require"] rebuilt : ["console", "require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(82)] +after transform: [ReferenceId(69)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionComponentWithDefaultTypeParameter1.tsx @@ -36419,11 +36211,8 @@ rebuilt : ScopeId(0): ["MyComponent", "React", "_jsxFileName", "_reactJsx Bindings mismatch: after transform: ScopeId(2): ["T", "attr"] rebuilt : ScopeId(1): ["attr"] -Symbol reference IDs mismatch: -after transform: SymbolId(2): [ReferenceId(2), ReferenceId(3), ReferenceId(6), ReferenceId(9)] -rebuilt : SymbolId(3): [ReferenceId(5), ReferenceId(8)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(12)] +after transform: [ReferenceId(10)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionComponents3.tsx @@ -36432,14 +36221,8 @@ Missing ReferenceId: require Binding symbols mismatch: after transform: ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(3), SymbolId(4), SymbolId(6), SymbolId(8), SymbolId(9)] rebuilt : ScopeId(0): [SymbolId(0), SymbolId(1), SymbolId(2), SymbolId(3), SymbolId(5), SymbolId(6), SymbolId(8)] -Symbol reference IDs mismatch: -after transform: SymbolId(1): [ReferenceId(0), ReferenceId(6)] -rebuilt : SymbolId(3): [ReferenceId(5)] -Symbol reference IDs mismatch: -after transform: SymbolId(4): [ReferenceId(3), ReferenceId(13)] -rebuilt : SymbolId(6): [ReferenceId(13)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(18)] +after transform: [ReferenceId(16)] rebuilt : [ReferenceId(0), ReferenceId(1)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments1.tsx @@ -36454,17 +36237,8 @@ rebuilt : ScopeId(1): ["a0", "a1", "key1", "value"] Unresolved references mismatch: after transform: ["Array", "ComponentWithTwoAttributes", "InferParamComponent", "JSX", "Link", "require"] rebuilt : ["ComponentWithTwoAttributes", "InferParamComponent", "Link", "require"] -Unresolved reference IDs mismatch for "Link": -after transform: [ReferenceId(13), ReferenceId(15), ReferenceId(30), ReferenceId(33)] -rebuilt : [ReferenceId(14), ReferenceId(18)] -Unresolved reference IDs mismatch for "ComponentWithTwoAttributes": -after transform: [ReferenceId(5), ReferenceId(8), ReferenceId(24), ReferenceId(28)] -rebuilt : [ReferenceId(4), ReferenceId(9)] -Unresolved reference IDs mismatch for "InferParamComponent": -after transform: [ReferenceId(23), ReferenceId(36)] -rebuilt : [ReferenceId(22)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(39), ReferenceId(40)] +after transform: [ReferenceId(34), ReferenceId(35)] rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments3.tsx @@ -36479,15 +36253,9 @@ rebuilt : ScopeId(1): ["a0", "a1", "a2", "a3", "a4", "a5", "a6", "arg1", Unresolved references mismatch: after transform: ["JSX", "Link", "OverloadComponent", "require"] rebuilt : ["Link", "OverloadComponent", "require"] -Unresolved reference IDs mismatch for "Link": -after transform: [ReferenceId(27), ReferenceId(29), ReferenceId(51), ReferenceId(54)] -rebuilt : [ReferenceId(32), ReferenceId(36)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(57)] +after transform: [ReferenceId(48)] rebuilt : [ReferenceId(0), ReferenceId(1)] -Unresolved reference IDs mismatch for "OverloadComponent": -after transform: [ReferenceId(8), ReferenceId(10), ReferenceId(12), ReferenceId(14), ReferenceId(16), ReferenceId(17), ReferenceId(20), ReferenceId(30), ReferenceId(33), ReferenceId(36), ReferenceId(39), ReferenceId(42), ReferenceId(45), ReferenceId(48)] -rebuilt : [ReferenceId(3), ReferenceId(7), ReferenceId(11), ReferenceId(15), ReferenceId(19), ReferenceId(22), ReferenceId(27)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments5.tsx semantic error: Missing SymbolId: React @@ -36505,17 +36273,8 @@ Unresolved references mismatch: after transform: ["Component", "ComponentSpecific", "ComponentSpecific1", "JSX", "require"] rebuilt : ["Component", "ComponentSpecific", "ComponentSpecific1", "require"] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(38)] +after transform: [ReferenceId(32)] rebuilt : [ReferenceId(0), ReferenceId(1)] -Unresolved reference IDs mismatch for "Component": -after transform: [ReferenceId(3), ReferenceId(5), ReferenceId(20), ReferenceId(23)] -rebuilt : [ReferenceId(3), ReferenceId(7)] -Unresolved reference IDs mismatch for "ComponentSpecific": -after transform: [ReferenceId(12), ReferenceId(16), ReferenceId(18), ReferenceId(26), ReferenceId(32), ReferenceId(35)] -rebuilt : [ReferenceId(11), ReferenceId(19), ReferenceId(23)] -Unresolved reference IDs mismatch for "ComponentSpecific1": -after transform: [ReferenceId(14), ReferenceId(29)] -rebuilt : [ReferenceId(15)] tasks/coverage/typescript/tests/cases/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.tsx semantic error: Missing SymbolId: React @@ -36527,17 +36286,12 @@ Bindings mismatch: after transform: ScopeId(3): ["T"] rebuilt : ScopeId(1): [] Symbol reference IDs mismatch: -after transform: SymbolId(3): [ReferenceId(0), ReferenceId(1), ReferenceId(2), ReferenceId(3), ReferenceId(4), ReferenceId(5), ReferenceId(6), ReferenceId(7), ReferenceId(8), ReferenceId(10), ReferenceId(12), ReferenceId(13), ReferenceId(14), ReferenceId(15), ReferenceId(16), ReferenceId(17), ReferenceId(18), ReferenceId(19), ReferenceId(20), ReferenceId(21), ReferenceId(22), ReferenceId(23), ReferenceId(24), ReferenceId(25), ReferenceId(26), ReferenceId(27), ReferenceId(28), ReferenceId(30), ReferenceId(31), ReferenceId(33), ReferenceId(34), ReferenceId(37), ReferenceId(40), ReferenceId(43), ReferenceId(46), ReferenceId(49), ReferenceId(52), ReferenceId(55), ReferenceId(58), ReferenceId(61), ReferenceId(64), ReferenceId(67), ReferenceId(70), ReferenceId(73), ReferenceId(76), ReferenceId(79), ReferenceId(82), ReferenceId(85), ReferenceId(88), ReferenceId(91)] +after transform: SymbolId(3): [ReferenceId(0), ReferenceId(1), ReferenceId(2), ReferenceId(3), ReferenceId(4), ReferenceId(5), ReferenceId(6), ReferenceId(7), ReferenceId(8), ReferenceId(10), ReferenceId(12), ReferenceId(13), ReferenceId(14), ReferenceId(15), ReferenceId(16), ReferenceId(17), ReferenceId(18), ReferenceId(19), ReferenceId(20), ReferenceId(21), ReferenceId(22), ReferenceId(23), ReferenceId(24), ReferenceId(25), ReferenceId(26), ReferenceId(27), ReferenceId(28), ReferenceId(30), ReferenceId(31), ReferenceId(33)] rebuilt : SymbolId(3): [ReferenceId(5), ReferenceId(8), ReferenceId(11), ReferenceId(14), ReferenceId(17), ReferenceId(20), ReferenceId(23), ReferenceId(26), ReferenceId(29), ReferenceId(32), ReferenceId(35), ReferenceId(38), ReferenceId(41), ReferenceId(44), ReferenceId(47), ReferenceId(50), ReferenceId(53), ReferenceId(56), ReferenceId(59), ReferenceId(62)] Unresolved reference IDs mismatch for "require": -after transform: [ReferenceId(96)] +after transform: [ReferenceId(76)] rebuilt : [ReferenceId(0), ReferenceId(1)] -tasks/coverage/typescript/tests/cases/conformance/jsx/tsxTypeErrors.tsx -semantic error: Symbol reference IDs mismatch: -after transform: SymbolId(5): [ReferenceId(1), ReferenceId(2), ReferenceId(11), ReferenceId(14)] -rebuilt : SymbolId(7): [ReferenceId(11), ReferenceId(14)] - tasks/coverage/typescript/tests/cases/conformance/jsx/tsxUnionElementType5.tsx semantic error: `import lib = require(...);` is only supported when compiling modules to CommonJS. Please consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option, or add @babel/plugin-transform-modules-commonjs to your Babel config. @@ -42527,12 +42281,6 @@ rebuilt : ScopeId(1): ["animations", "style"] Bindings mismatch: after transform: ScopeId(17): ["T", "props"] rebuilt : ScopeId(7): ["props"] -Symbol reference IDs mismatch: -after transform: SymbolId(8): [ReferenceId(19), ReferenceId(20), ReferenceId(21), ReferenceId(34), ReferenceId(37), ReferenceId(40)] -rebuilt : SymbolId(2): [ReferenceId(4), ReferenceId(7), ReferenceId(10)] -Symbol reference IDs mismatch: -after transform: SymbolId(17): [ReferenceId(26), ReferenceId(28), ReferenceId(30), ReferenceId(45), ReferenceId(48), ReferenceId(51)] -rebuilt : SymbolId(8): [ReferenceId(15), ReferenceId(19), ReferenceId(23)] Unresolved references mismatch: after transform: ["Partial", "Record", "require"] rebuilt : ["require"] diff --git a/tasks/transform_conformance/babel.snap.md b/tasks/transform_conformance/babel.snap.md index f915117d25f9bf..5ab03fc3a6a115 100644 --- a/tasks/transform_conformance/babel.snap.md +++ b/tasks/transform_conformance/babel.snap.md @@ -1,9 +1,10 @@ commit: 12619ffe -Passed: 292/1015 +Passed: 317/1015 # All Passed: * babel-plugin-transform-optional-catch-binding +* babel-preset-react * babel-plugin-transform-react-display-name * babel-plugin-transform-react-jsx-self * babel-plugin-transform-react-jsx-source @@ -2132,7 +2133,7 @@ failed to resolve query: failed to parse the rest of input: ...'' -# babel-plugin-transform-typescript (45/151) +# babel-plugin-transform-typescript (46/151) * cast/as-expression/input.ts x Unresolved references mismatch: | after transform: ["T", "x"] @@ -4817,102 +4818,31 @@ TS(18010) | rebuilt : ["f"] -* type-arguments/tsx/input.ts - x Unresolved reference IDs mismatch for "C": - | after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(2)] - | rebuilt : [ReferenceId(0), ReferenceId(1), ReferenceId(2)] - - - -# babel-preset-react (4/9) -* preset-options/development/input.js - x Unresolved reference IDs mismatch for "Foo": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] - - -* preset-options/development-runtime-automatic/input.js - x Unresolved reference IDs mismatch for "Foo": - | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(2)] - - -* preset-options/empty-options/input.js - x Unresolved reference IDs mismatch for "Foo": - | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(2)] - - -* preset-options/runtime-automatic/input.js - x Unresolved reference IDs mismatch for "Foo": - | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(2)] - - -* preset-options/runtime-classic/input.js - x Unresolved reference IDs mismatch for "Foo": - | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(1)] - - - -# babel-plugin-transform-react-jsx (100/144) -* react/adds-appropriate-newlines-when-using-spread-attribute/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] - +# babel-plugin-transform-react-jsx (119/144) * react/arrow-functions/input.js - x Unresolved references mismatch: - | after transform: ["React", "this"] - | rebuilt : ["React"] - - -* react/assignment/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] * react/dont-coerce-expression-containers/input.js x Unresolved reference IDs mismatch for "Text": - | after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(2)] + | after transform: [ReferenceId(0), ReferenceId(1)] | rebuilt : [ReferenceId(1)] * react/honor-custom-jsx-comment/input.js x Unresolved reference IDs mismatch for "Foo": - | after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(4)] + | after transform: [ReferenceId(0), ReferenceId(1)] | rebuilt : [ReferenceId(1)] * react/honor-custom-jsx-comment-if-jsx-pragma-option-set/input.js x Unresolved reference IDs mismatch for "Foo": - | after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(4)] + | after transform: [ReferenceId(0), ReferenceId(1)] | rebuilt : [ReferenceId(1)] * react/honor-custom-jsx-pragma-option/input.js x Unresolved reference IDs mismatch for "Foo": - | after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(4)] - | rebuilt : [ReferenceId(1)] - - -* react/should-allow-constructor-as-prop/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(1)] - - -* react/should-allow-deeper-js-namespacing/input.js - x Unresolved reference IDs mismatch for "Namespace": - | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(1)] - - -* react/should-allow-js-namespacing/input.js - x Unresolved reference IDs mismatch for "Namespace": | after transform: [ReferenceId(0), ReferenceId(1)] | rebuilt : [ReferenceId(1)] @@ -4920,17 +4850,9 @@ TS(18010) * react/should-avoid-wrapping-in-extra-parens-if-not-needed/input.js x Unresolved reference IDs mismatch for "Composite": | after transform: [ReferenceId(2), ReferenceId(3), ReferenceId(5), - | ReferenceId(6), ReferenceId(12), ReferenceId(14)] + | ReferenceId(6)] | rebuilt : [ReferenceId(6), ReferenceId(9)] - x Unresolved reference IDs mismatch for "Composite2": - | after transform: [ReferenceId(7), ReferenceId(15)] - | rebuilt : [ReferenceId(11)] - - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(8)] - | rebuilt : [ReferenceId(2)] - * react/should-disallow-valueless-key/input.js ! Please provide an explicit key value. Using "key" as a shorthand for @@ -4952,22 +4874,10 @@ TS(18010) `---- -* react/should-handle-attributed-elements/input.js - x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(2), ReferenceId(5)] - | rebuilt : SymbolId(0): [ReferenceId(4)] - - * react/should-have-correct-comma-in-nested-children/input.js x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(6)] - | rebuilt : [ReferenceId(4)] - - -* react/should-not-add-quotes-to-identifier-names/input.js - x Unresolved reference IDs mismatch for "F": | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(1)] + | rebuilt : [ReferenceId(4)] * react/should-throw-error-namespaces-if-not-flag/input.js @@ -4981,51 +4891,18 @@ TS(18010) * react/this-tag-name/input.js - x Unresolved references mismatch: - | after transform: ["React", "this"] - | rebuilt : ["React"] + x Unresolved reference IDs mismatch for "this": + | after transform: [ReferenceId(0), ReferenceId(1)] + | rebuilt : [ReferenceId(1)] * react/weird-symbols/input.js x Unresolved reference IDs mismatch for "Text": - | after transform: [ReferenceId(1), ReferenceId(2), ReferenceId(3)] + | after transform: [ReferenceId(1), ReferenceId(2)] | rebuilt : [ReferenceId(2)] -* react/wraps-props-in-react-spread-for-first-spread-attributes/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] - - -* react/wraps-props-in-react-spread-for-last-spread-attributes/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] - - -* react/wraps-props-in-react-spread-for-middle-spread-attributes/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] - - -* react-automatic/adds-appropriate-newlines-when-using-spread-attribute/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] - - * react-automatic/arrow-functions/input.js - x Unresolved references mismatch: - | after transform: ["this"] - | rebuilt : [] - - -* react-automatic/assignment/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] * react-automatic/does-not-add-source-self-automatic/input.mjs @@ -5033,49 +4910,22 @@ transform-react-jsx: unknown field `autoImport`, expected one of `runtime`, `dev * react-automatic/dont-coerce-expression-containers/input.js x Unresolved reference IDs mismatch for "Text": - | after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(2)] + | after transform: [ReferenceId(0), ReferenceId(1)] | rebuilt : [ReferenceId(1)] * react-automatic/handle-fragments-with-key/input.js x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1), - | ReferenceId(2)] + | after transform: SymbolId(0): [ReferenceId(0), ReferenceId(1)] | rebuilt : SymbolId(0): [ReferenceId(1)] -* react-automatic/should-allow-constructor-as-prop/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(1)] - - -* react-automatic/should-allow-deeper-js-namespacing/input.js - x Unresolved reference IDs mismatch for "Namespace": - | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(1)] - - -* react-automatic/should-allow-js-namespacing/input.js - x Unresolved reference IDs mismatch for "Namespace": - | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(1)] - - * react-automatic/should-avoid-wrapping-in-extra-parens-if-not-needed/input.js x Unresolved reference IDs mismatch for "Composite": | after transform: [ReferenceId(2), ReferenceId(3), ReferenceId(5), - | ReferenceId(6), ReferenceId(12), ReferenceId(16)] + | ReferenceId(6)] | rebuilt : [ReferenceId(6), ReferenceId(9)] - x Unresolved reference IDs mismatch for "Composite2": - | after transform: [ReferenceId(7), ReferenceId(14)] - | rebuilt : [ReferenceId(11)] - - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(8)] - | rebuilt : [ReferenceId(2)] - * react-automatic/should-disallow-valueless-key/input.js ! Please provide an explicit key value. Using "key" as a shorthand for @@ -5097,22 +4947,10 @@ transform-react-jsx: unknown field `autoImport`, expected one of `runtime`, `dev `---- -* react-automatic/should-handle-attributed-elements/input.js - x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(2), ReferenceId(5)] - | rebuilt : SymbolId(2): [ReferenceId(4)] - - * react-automatic/should-have-correct-comma-in-nested-children/input.js x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(7)] - | rebuilt : [ReferenceId(4)] - - -* react-automatic/should-not-add-quotes-to-identifier-names/input.js - x Unresolved reference IDs mismatch for "F": | after transform: [ReferenceId(0), ReferenceId(1)] - | rebuilt : [ReferenceId(1)] + | rebuilt : [ReferenceId(4)] * react-automatic/should-throw-error-namespaces-if-not-flag/input.js @@ -5126,41 +4964,21 @@ transform-react-jsx: unknown field `autoImport`, expected one of `runtime`, `dev * react-automatic/this-tag-name/input.js - x Unresolved references mismatch: - | after transform: ["this"] - | rebuilt : [] + x Unresolved reference IDs mismatch for "this": + | after transform: [ReferenceId(0), ReferenceId(1)] + | rebuilt : [ReferenceId(1)] * react-automatic/weird-symbols/input.js x Unresolved reference IDs mismatch for "Text": - | after transform: [ReferenceId(1), ReferenceId(2), ReferenceId(3)] + | after transform: [ReferenceId(1), ReferenceId(2)] | rebuilt : [ReferenceId(2)] -* react-automatic/wraps-props-in-react-spread-for-last-spread-attributes/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] - - -* react-automatic/wraps-props-in-react-spread-for-middle-spread-attributes/input.js - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] - - * spread-transform/transform-to-babel-extend/input.js - x Output mismatch - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(1)] * spread-transform/transform-to-object-assign/input.js - x Output mismatch - x Unresolved reference IDs mismatch for "Component": - | after transform: [ReferenceId(0), ReferenceId(2)] - | rebuilt : [ReferenceId(2)] @@ -5183,7 +5001,7 @@ transform-react-jsx: unknown field `autoImport`, expected one of `runtime`, `dev * cross-platform/handle-fragments-with-key/input.js x Unresolved reference IDs mismatch for "React": - | after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(2)] + | after transform: [ReferenceId(0), ReferenceId(1)] | rebuilt : [ReferenceId(2)] diff --git a/tasks/transform_conformance/oxc.snap.md b/tasks/transform_conformance/oxc.snap.md index 4ccf5b80f070b9..99c466c937afa9 100644 --- a/tasks/transform_conformance/oxc.snap.md +++ b/tasks/transform_conformance/oxc.snap.md @@ -324,28 +324,12 @@ Passed: 10/37 * refresh/does-not-consider-require-like-methods-to-be-hocs/input.jsx x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(6), ReferenceId(12)] - | rebuilt : SymbolId(2): [ReferenceId(8)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(1): [ReferenceId(7), ReferenceId(14)] - | rebuilt : SymbolId(3): [ReferenceId(10)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(2): [ReferenceId(8), ReferenceId(16)] - | rebuilt : SymbolId(4): [ReferenceId(12)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(3): [ReferenceId(9), ReferenceId(18)] - | rebuilt : SymbolId(5): [ReferenceId(14)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(5): [ReferenceId(10), ReferenceId(21), - | ReferenceId(22)] + | after transform: SymbolId(5): [ReferenceId(10), ReferenceId(17), + | ReferenceId(18)] | rebuilt : SymbolId(7): [ReferenceId(15), ReferenceId(18)] x Reference symbol mismatch: - | after transform: ReferenceId(21): Some("_c") + | after transform: ReferenceId(17): Some("_c") | rebuilt : ReferenceId(17): None x Unresolved references mismatch: @@ -641,99 +625,57 @@ Passed: 10/37 * refresh/registers-identifiers-used-in-jsx-at-definition-site/input.jsx x Output mismatch x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(5), ReferenceId(7), - | ReferenceId(8), ReferenceId(9), ReferenceId(19), ReferenceId(21), - | ReferenceId(34)] - | rebuilt : SymbolId(0): [ReferenceId(9), ReferenceId(13), - | ReferenceId(14), ReferenceId(17), ReferenceId(37), ReferenceId(41)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(2): [ReferenceId(16), ReferenceId(23), - | ReferenceId(48)] - | rebuilt : SymbolId(4): [ReferenceId(3), ReferenceId(31)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(3): [ReferenceId(11), ReferenceId(25), - | ReferenceId(38)] - | rebuilt : SymbolId(5): [ReferenceId(6), ReferenceId(21)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(4): [ReferenceId(12), ReferenceId(40)] - | rebuilt : SymbolId(6): [ReferenceId(23)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(5): [ReferenceId(13), ReferenceId(42)] - | rebuilt : SymbolId(7): [ReferenceId(25)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(7): [ReferenceId(14), ReferenceId(44)] - | rebuilt : SymbolId(9): [ReferenceId(27)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(8): [ReferenceId(15), ReferenceId(46)] - | rebuilt : SymbolId(10): [ReferenceId(29)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(9): [ReferenceId(17), ReferenceId(50)] - | rebuilt : SymbolId(11): [ReferenceId(33)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(11): [ReferenceId(10), ReferenceId(31), - | ReferenceId(36)] - | rebuilt : SymbolId(13): [ReferenceId(19), ReferenceId(39)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(13): [ReferenceId(22), ReferenceId(53), - | ReferenceId(54)] + | after transform: SymbolId(13): [ReferenceId(22), ReferenceId(44), + | ReferenceId(45)] | rebuilt : SymbolId(15): [ReferenceId(2), ReferenceId(45)] x Symbol reference IDs mismatch: - | after transform: SymbolId(14): [ReferenceId(24), ReferenceId(55), - | ReferenceId(56)] + | after transform: SymbolId(14): [ReferenceId(24), ReferenceId(46), + | ReferenceId(47)] | rebuilt : SymbolId(16): [ReferenceId(5), ReferenceId(47)] x Symbol reference IDs mismatch: - | after transform: SymbolId(15): [ReferenceId(26), ReferenceId(57), - | ReferenceId(58)] + | after transform: SymbolId(15): [ReferenceId(26), ReferenceId(48), + | ReferenceId(49)] | rebuilt : SymbolId(17): [ReferenceId(11), ReferenceId(49)] x Symbol reference IDs mismatch: - | after transform: SymbolId(16): [ReferenceId(28), ReferenceId(59), - | ReferenceId(60)] + | after transform: SymbolId(16): [ReferenceId(28), ReferenceId(50), + | ReferenceId(51)] | rebuilt : SymbolId(18): [ReferenceId(34), ReferenceId(51)] x Symbol reference IDs mismatch: - | after transform: SymbolId(17): [ReferenceId(30), ReferenceId(61), - | ReferenceId(62)] + | after transform: SymbolId(17): [ReferenceId(30), ReferenceId(52), + | ReferenceId(53)] | rebuilt : SymbolId(19): [ReferenceId(38), ReferenceId(53)] x Symbol reference IDs mismatch: - | after transform: SymbolId(18): [ReferenceId(32), ReferenceId(63), - | ReferenceId(64)] + | after transform: SymbolId(18): [ReferenceId(32), ReferenceId(54), + | ReferenceId(55)] | rebuilt : SymbolId(20): [ReferenceId(42), ReferenceId(55)] x Reference symbol mismatch: - | after transform: ReferenceId(53): Some("_c") + | after transform: ReferenceId(44): Some("_c") | rebuilt : ReferenceId(44): None x Reference symbol mismatch: - | after transform: ReferenceId(55): Some("_c2") + | after transform: ReferenceId(46): Some("_c2") | rebuilt : ReferenceId(46): None x Reference symbol mismatch: - | after transform: ReferenceId(57): Some("_c3") + | after transform: ReferenceId(48): Some("_c3") | rebuilt : ReferenceId(48): None x Reference symbol mismatch: - | after transform: ReferenceId(59): Some("_c4") + | after transform: ReferenceId(50): Some("_c4") | rebuilt : ReferenceId(50): None x Reference symbol mismatch: - | after transform: ReferenceId(61): Some("_c5") + | after transform: ReferenceId(52): Some("_c5") | rebuilt : ReferenceId(52): None x Reference symbol mismatch: - | after transform: ReferenceId(63): Some("_c6") + | after transform: ReferenceId(54): Some("_c6") | rebuilt : ReferenceId(54): None x Unresolved references mismatch: @@ -997,35 +939,30 @@ Passed: 10/37 * refresh/registers-top-level-exported-function-declarations/input.jsx x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(1), ReferenceId(5), - | ReferenceId(11)] - | rebuilt : SymbolId(1): [ReferenceId(3), ReferenceId(5)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(7): [ReferenceId(4), ReferenceId(14), - | ReferenceId(15)] + | after transform: SymbolId(7): [ReferenceId(4), ReferenceId(13), + | ReferenceId(14)] | rebuilt : SymbolId(8): [ReferenceId(2), ReferenceId(14)] x Symbol reference IDs mismatch: - | after transform: SymbolId(8): [ReferenceId(6), ReferenceId(16), - | ReferenceId(17)] + | after transform: SymbolId(8): [ReferenceId(6), ReferenceId(15), + | ReferenceId(16)] | rebuilt : SymbolId(9): [ReferenceId(6), ReferenceId(16)] x Symbol reference IDs mismatch: - | after transform: SymbolId(9): [ReferenceId(8), ReferenceId(18), - | ReferenceId(19)] + | after transform: SymbolId(9): [ReferenceId(8), ReferenceId(17), + | ReferenceId(18)] | rebuilt : SymbolId(10): [ReferenceId(9), ReferenceId(18)] x Reference symbol mismatch: - | after transform: ReferenceId(14): Some("_c") + | after transform: ReferenceId(13): Some("_c") | rebuilt : ReferenceId(13): None x Reference symbol mismatch: - | after transform: ReferenceId(16): Some("_c2") + | after transform: ReferenceId(15): Some("_c2") | rebuilt : ReferenceId(15): None x Reference symbol mismatch: - | after transform: ReferenceId(18): Some("_c3") + | after transform: ReferenceId(17): Some("_c3") | rebuilt : ReferenceId(17): None x Unresolved references mismatch: @@ -1035,27 +972,21 @@ Passed: 10/37 * refresh/registers-top-level-exported-named-arrow-functions/input.jsx x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(1), ReferenceId(2), - | ReferenceId(4), ReferenceId(8), ReferenceId(10)] - | rebuilt : SymbolId(1): [ReferenceId(3), ReferenceId(5), - | ReferenceId(9)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(4): [ReferenceId(3), ReferenceId(12), - | ReferenceId(13)] + | after transform: SymbolId(4): [ReferenceId(3), ReferenceId(10), + | ReferenceId(11)] | rebuilt : SymbolId(5): [ReferenceId(2), ReferenceId(11)] x Symbol reference IDs mismatch: - | after transform: SymbolId(5): [ReferenceId(5), ReferenceId(14), - | ReferenceId(15)] + | after transform: SymbolId(5): [ReferenceId(5), ReferenceId(12), + | ReferenceId(13)] | rebuilt : SymbolId(6): [ReferenceId(6), ReferenceId(13)] x Reference symbol mismatch: - | after transform: ReferenceId(12): Some("_c") + | after transform: ReferenceId(10): Some("_c") | rebuilt : ReferenceId(10): None x Reference symbol mismatch: - | after transform: ReferenceId(14): Some("_c2") + | after transform: ReferenceId(12): Some("_c2") | rebuilt : ReferenceId(12): None x Unresolved references mismatch: @@ -1065,26 +996,21 @@ Passed: 10/37 * refresh/registers-top-level-function-declarations/input.jsx x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(1), ReferenceId(3), - | ReferenceId(7)] - | rebuilt : SymbolId(1): [ReferenceId(3), ReferenceId(5)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(3): [ReferenceId(2), ReferenceId(9), - | ReferenceId(10)] + | after transform: SymbolId(3): [ReferenceId(2), ReferenceId(8), + | ReferenceId(9)] | rebuilt : SymbolId(4): [ReferenceId(2), ReferenceId(9)] x Symbol reference IDs mismatch: - | after transform: SymbolId(4): [ReferenceId(4), ReferenceId(11), - | ReferenceId(12)] + | after transform: SymbolId(4): [ReferenceId(4), ReferenceId(10), + | ReferenceId(11)] | rebuilt : SymbolId(5): [ReferenceId(6), ReferenceId(11)] x Reference symbol mismatch: - | after transform: ReferenceId(9): Some("_c") + | after transform: ReferenceId(8): Some("_c") | rebuilt : ReferenceId(8): None x Reference symbol mismatch: - | after transform: ReferenceId(11): Some("_c2") + | after transform: ReferenceId(10): Some("_c2") | rebuilt : ReferenceId(10): None x Unresolved references mismatch: @@ -1094,35 +1020,30 @@ Passed: 10/37 * refresh/registers-top-level-variable-declarations-with-arrow-functions/input.jsx x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(1), ReferenceId(3), - | ReferenceId(9)] - | rebuilt : SymbolId(1): [ReferenceId(3), ReferenceId(5)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(5): [ReferenceId(2), ReferenceId(12), - | ReferenceId(13)] + | after transform: SymbolId(5): [ReferenceId(2), ReferenceId(11), + | ReferenceId(12)] | rebuilt : SymbolId(6): [ReferenceId(2), ReferenceId(12)] x Symbol reference IDs mismatch: - | after transform: SymbolId(6): [ReferenceId(4), ReferenceId(14), - | ReferenceId(15)] + | after transform: SymbolId(6): [ReferenceId(4), ReferenceId(13), + | ReferenceId(14)] | rebuilt : SymbolId(7): [ReferenceId(6), ReferenceId(14)] x Symbol reference IDs mismatch: - | after transform: SymbolId(7): [ReferenceId(6), ReferenceId(16), - | ReferenceId(17)] + | after transform: SymbolId(7): [ReferenceId(6), ReferenceId(15), + | ReferenceId(16)] | rebuilt : SymbolId(8): [ReferenceId(9), ReferenceId(16)] x Reference symbol mismatch: - | after transform: ReferenceId(12): Some("_c") + | after transform: ReferenceId(11): Some("_c") | rebuilt : ReferenceId(11): None x Reference symbol mismatch: - | after transform: ReferenceId(14): Some("_c2") + | after transform: ReferenceId(13): Some("_c2") | rebuilt : ReferenceId(13): None x Reference symbol mismatch: - | after transform: ReferenceId(16): Some("_c3") + | after transform: ReferenceId(15): Some("_c3") | rebuilt : ReferenceId(15): None x Unresolved references mismatch: @@ -1132,26 +1053,21 @@ Passed: 10/37 * refresh/registers-top-level-variable-declarations-with-function-expressions/input.jsx x Symbol reference IDs mismatch: - | after transform: SymbolId(0): [ReferenceId(1), ReferenceId(3), - | ReferenceId(7)] - | rebuilt : SymbolId(1): [ReferenceId(3), ReferenceId(5)] - - x Symbol reference IDs mismatch: - | after transform: SymbolId(7): [ReferenceId(2), ReferenceId(9), - | ReferenceId(10)] + | after transform: SymbolId(7): [ReferenceId(2), ReferenceId(8), + | ReferenceId(9)] | rebuilt : SymbolId(8): [ReferenceId(2), ReferenceId(9)] x Symbol reference IDs mismatch: - | after transform: SymbolId(8): [ReferenceId(4), ReferenceId(11), - | ReferenceId(12)] + | after transform: SymbolId(8): [ReferenceId(4), ReferenceId(10), + | ReferenceId(11)] | rebuilt : SymbolId(9): [ReferenceId(6), ReferenceId(11)] x Reference symbol mismatch: - | after transform: ReferenceId(9): Some("_c") + | after transform: ReferenceId(8): Some("_c") | rebuilt : ReferenceId(8): None x Reference symbol mismatch: - | after transform: ReferenceId(11): Some("_c2") + | after transform: ReferenceId(10): Some("_c2") | rebuilt : ReferenceId(10): None x Unresolved references mismatch: @@ -1261,21 +1177,21 @@ Passed: 10/37 * refresh/uses-custom-identifiers-for-refresh-reg-and-refresh-sig/input.jsx x Symbol reference IDs mismatch: - | after transform: SymbolId(3): [ReferenceId(7), ReferenceId(8), - | ReferenceId(10)] + | after transform: SymbolId(3): [ReferenceId(6), ReferenceId(7), + | ReferenceId(9)] | rebuilt : SymbolId(1): [ReferenceId(1), ReferenceId(6)] x Symbol reference IDs mismatch: - | after transform: SymbolId(1): [ReferenceId(3), ReferenceId(11), - | ReferenceId(12)] + | after transform: SymbolId(1): [ReferenceId(3), ReferenceId(10), + | ReferenceId(11)] | rebuilt : SymbolId(3): [ReferenceId(8), ReferenceId(11)] x Reference symbol mismatch: - | after transform: ReferenceId(7): Some("_s") + | after transform: ReferenceId(6): Some("_s") | rebuilt : ReferenceId(0): None x Reference symbol mismatch: - | after transform: ReferenceId(11): Some("_c") + | after transform: ReferenceId(10): Some("_c") | rebuilt : ReferenceId(10): None x Unresolved references mismatch: @@ -1283,10 +1199,6 @@ Passed: 10/37 | rebuilt : ["Foo", "X", "import.meta.refreshReg", | "import.meta.refreshSig", "useContext"] - x Unresolved reference IDs mismatch for "Foo": - | after transform: [ReferenceId(2), ReferenceId(5)] - | rebuilt : [ReferenceId(5)] - * refresh/uses-original-function-declaration-if-it-get-reassigned/input.jsx x Symbol reference IDs mismatch: