diff --git a/.github/generated/ast_changes_watch_list.yml b/.github/generated/ast_changes_watch_list.yml index 9bcbddf6d7f85..ead1e6756bed8 100644 --- a/.github/generated/ast_changes_watch_list.yml +++ b/.github/generated/ast_changes_watch_list.yml @@ -13,10 +13,12 @@ src: - 'crates/oxc_ast/src/generated/ast_kind.rs' - 'crates/oxc_ast/src/generated/derive_clone_in.rs' - 'crates/oxc_ast/src/generated/derive_content_eq.rs' + - 'crates/oxc_ast/src/generated/derive_dummy.rs' - 'crates/oxc_ast/src/generated/derive_estree.rs' - 'crates/oxc_ast/src/generated/derive_get_address.rs' - 'crates/oxc_ast/src/generated/derive_get_span.rs' - 'crates/oxc_ast/src/generated/derive_get_span_mut.rs' + - 'crates/oxc_ast/src/generated/derive_take_in.rs' - 'crates/oxc_ast/src/generated/get_id.rs' - 'crates/oxc_ast/src/serialize.rs' - 'crates/oxc_ast_macros/src/generated/mod.rs' @@ -31,12 +33,14 @@ src: - 'crates/oxc_regular_expression/src/generated/derive_estree.rs' - 'crates/oxc_regular_expression/src/generated/derive_get_address.rs' - 'crates/oxc_span/src/generated/assert_layouts.rs' + - 'crates/oxc_span/src/generated/derive_dummy.rs' - 'crates/oxc_span/src/generated/derive_estree.rs' - 'crates/oxc_span/src/source_type/mod.rs' - 'crates/oxc_span/src/span.rs' - 'crates/oxc_syntax/src/generated/assert_layouts.rs' - 'crates/oxc_syntax/src/generated/derive_clone_in.rs' - 'crates/oxc_syntax/src/generated/derive_content_eq.rs' + - 'crates/oxc_syntax/src/generated/derive_dummy.rs' - 'crates/oxc_syntax/src/generated/derive_estree.rs' - 'crates/oxc_syntax/src/lib.rs' - 'crates/oxc_syntax/src/module_record.rs' diff --git a/crates/oxc_allocator/src/lib.rs b/crates/oxc_allocator/src/lib.rs index 963689874d1f2..ce3621b3bf2fa 100644 --- a/crates/oxc_allocator/src/lib.rs +++ b/crates/oxc_allocator/src/lib.rs @@ -24,6 +24,7 @@ mod convert; mod from_raw_parts; pub mod hash_map; pub mod string; +mod take_in; mod vec; mod vec2; @@ -34,4 +35,5 @@ pub use clone_in::CloneIn; pub use convert::{FromIn, IntoIn}; pub use hash_map::HashMap; pub use string::String; +pub use take_in::{Dummy, TakeIn}; pub use vec::Vec; diff --git a/crates/oxc_allocator/src/take_in.rs b/crates/oxc_allocator/src/take_in.rs new file mode 100644 index 0000000000000..d26ad25225916 --- /dev/null +++ b/crates/oxc_allocator/src/take_in.rs @@ -0,0 +1,138 @@ +use std::{cell::Cell, mem, num}; + +use crate::{Allocator, Box, Vec}; + +/// A trait to replace an existing AST node with a dummy. +pub trait TakeIn<'a>: Dummy<'a> { + /// Replace node with a dummy. + #[must_use] + fn take_in(&mut self, allocator: &'a Allocator) -> Self { + let dummy = Dummy::dummy(allocator); + mem::replace(self, dummy) + } +} + +impl<'a, T> TakeIn<'a> for Vec<'a, T> {} + +/// A trait to create a dummy AST node. +pub trait Dummy<'a>: Sized { + /// Create a dummy node. + fn dummy(allocator: &'a Allocator) -> Self; +} + +impl<'a, T> Dummy<'a> for Option { + /// Create a dummy [`Option`]. + #[expect(clippy::inline_always)] + #[inline(always)] + fn dummy(_allocator: &'a Allocator) -> Self { + None + } +} + +impl<'a, T: Dummy<'a>> Dummy<'a> for Box<'a, T> { + /// Create a dummy [`Box`]. + #[inline] + fn dummy(allocator: &'a Allocator) -> Self { + Box::new_in(Dummy::dummy(allocator), allocator) + } +} + +impl<'a, T> Dummy<'a> for Vec<'a, T> { + /// Create a dummy [`Vec`]. + #[inline] + fn dummy(allocator: &'a Allocator) -> Self { + Vec::new_in(allocator) + } +} + +impl<'a, T: Dummy<'a>> Dummy<'a> for Cell { + /// Create a dummy [`Cell`]. + #[expect(clippy::inline_always)] + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Cell::new(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for () { + #[inline(always)] + fn dummy(_allocator: &'a Allocator) {} +} + +impl<'a> Dummy<'a> for bool { + #[expect(clippy::inline_always)] + #[inline(always)] + fn dummy(_allocator: &'a Allocator) -> Self { + false + } +} + +impl<'a> Dummy<'a> for &'a str { + #[expect(clippy::inline_always)] + #[inline(always)] + fn dummy(_allocator: &'a Allocator) -> Self { + "" + } +} + +macro_rules! dummy_impl_int { + ($ty:ident) => { + impl<'a> Dummy<'a> for $ty { + #[inline(always)] + fn dummy(_allocator: &'a Allocator) -> Self { + 0 + } + } + }; +} + +dummy_impl_int!(u8); +dummy_impl_int!(u16); +dummy_impl_int!(u32); +dummy_impl_int!(u64); +dummy_impl_int!(u128); +dummy_impl_int!(usize); +dummy_impl_int!(i8); +dummy_impl_int!(i16); +dummy_impl_int!(i32); +dummy_impl_int!(i64); +dummy_impl_int!(i128); +dummy_impl_int!(isize); + +macro_rules! dummy_impl_float { + ($ty:ident) => { + impl<'a> Dummy<'a> for $ty { + #[inline(always)] + fn dummy(_allocator: &'a Allocator) -> Self { + 0.0 + } + } + }; +} + +dummy_impl_float!(f32); +dummy_impl_float!(f64); + +macro_rules! dummy_impl_non_zero { + ($ty:ident) => { + impl<'a> Dummy<'a> for num::$ty { + #[inline(always)] + fn dummy(_allocator: &'a Allocator) -> Self { + Self::MIN + } + } + }; +} + +dummy_impl_non_zero!(NonZeroU8); +dummy_impl_non_zero!(NonZeroU16); +dummy_impl_non_zero!(NonZeroU32); +dummy_impl_non_zero!(NonZeroU64); +dummy_impl_non_zero!(NonZeroU128); +dummy_impl_non_zero!(NonZeroUsize); +dummy_impl_non_zero!(NonZeroI8); +dummy_impl_non_zero!(NonZeroI16); +dummy_impl_non_zero!(NonZeroI32); +dummy_impl_non_zero!(NonZeroI64); +dummy_impl_non_zero!(NonZeroI128); +dummy_impl_non_zero!(NonZeroIsize); diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index ad1ca827bd4ee..6aa13557e1f32 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -6,7 +6,7 @@ use std::cell::Cell; -use oxc_allocator::{Box, CloneIn, GetAddress, Vec}; +use oxc_allocator::{Box, CloneIn, Dummy, GetAddress, TakeIn, Vec}; use oxc_ast_macros::ast; use oxc_estree::ESTree; use oxc_span::{Atom, ContentEq, GetSpan, GetSpanMut, SourceType, Span}; @@ -29,7 +29,7 @@ use super::{macros::inherit_variants, *}; strict_if = self.source_type.is_strict() || self.has_use_strict_directive(), )] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(field_order(span, directives, source_type, hashbang))] pub struct Program<'a> { pub span: Span, @@ -55,7 +55,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum Expression<'a> { /// See [`BooleanLiteral`] for AST node details. BooleanLiteral(Box<'a, BooleanLiteral>) = 0, @@ -208,7 +208,7 @@ pub use match_expression; /// digits, `$`, or `_`. #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "Identifier", add_fields(decorators = TsEmptyArray, optional = TsFalse, typeAnnotation = TsNull) @@ -226,7 +226,7 @@ pub struct IdentifierName<'a> { /// See: [13.1 Identifiers](https://tc39.es/ecma262/#sec-identifiers) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "Identifier", add_fields(decorators = TsEmptyArray, optional = TsFalse, typeAnnotation = TsNull) @@ -252,7 +252,7 @@ pub struct IdentifierReference<'a> { /// See: [13.1 Identifiers](https://tc39.es/ecma262/#sec-identifiers) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "Identifier", add_fields(decorators = TsEmptyArray, optional = TsFalse, typeAnnotation = TsNull) @@ -278,7 +278,7 @@ pub struct BindingIdentifier<'a> { /// See: [13.1 Identifiers](https://tc39.es/ecma262/#sec-identifiers) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "Identifier")] pub struct LabelIdentifier<'a> { pub span: Span, @@ -291,7 +291,7 @@ pub struct LabelIdentifier<'a> { /// Represents a `this` expression, which is a reference to the current object. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ThisExpression { pub span: Span, } @@ -301,7 +301,7 @@ pub struct ThisExpression { /// Represents an array literal, which can include elements, spread elements, or null values. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ArrayExpression<'a> { pub span: Span, pub elements: Vec<'a, ArrayExpressionElement<'a>>, @@ -319,7 +319,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub enum ArrayExpressionElement<'a> { /// `...[3, 4]` in `const array = [1, 2, ...[3, 4], null];` SpreadElement(Box<'a, SpreadElement<'a>>) = 64, @@ -339,7 +339,7 @@ pub enum ArrayExpressionElement<'a> { /// Serialized as `null` in JSON AST. See `serialize.rs`. #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(via = ElisionConverter)] pub struct Elision { pub span: Span, @@ -353,7 +353,7 @@ pub struct Elision { /// If the object literal has a trailing comma, `trailing_comma` contains the span of that comma. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ObjectExpression<'a> { pub span: Span, /// Properties declared in the object @@ -365,7 +365,7 @@ pub struct ObjectExpression<'a> { /// Represents a property in an object literal. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum ObjectPropertyKind<'a> { /// `a: 1` in `const obj = { a: 1 };` ObjectProperty(Box<'a, ObjectProperty<'a>>) = 0, @@ -378,7 +378,7 @@ pub enum ObjectPropertyKind<'a> { /// Represents a property in an object literal. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "Property", field_order(span, method, shorthand, computed, key, value, kind))] pub struct ObjectProperty<'a> { pub span: Span, @@ -398,7 +398,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum PropertyKey<'a> { /// `a` in `const obj = { a: 1 }; obj.a;` StaticIdentifier(Box<'a, IdentifierName<'a>>) = 64, @@ -412,7 +412,7 @@ pub enum PropertyKey<'a> { /// Represents the kind of property in an object literal or class. #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum PropertyKind { /// `a: 1` in `const obj = { a: 1 };` Init = 0, @@ -427,7 +427,7 @@ pub enum PropertyKind { /// Represents a template literal, which can include quasi elements and expression elements. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(field_order(span, expressions, quasis))] pub struct TemplateLiteral<'a> { pub span: Span, @@ -440,7 +440,7 @@ pub struct TemplateLiteral<'a> { /// Represents a tagged template expression, which can include a tag and a quasi. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TaggedTemplateExpression<'a> { pub span: Span, pub tag: Expression<'a>, @@ -454,7 +454,7 @@ pub struct TaggedTemplateExpression<'a> { /// Represents a quasi element in a template literal. #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TemplateElement<'a> { pub span: Span, pub value: TemplateElementValue<'a>, @@ -464,7 +464,7 @@ pub struct TemplateElement<'a> { /// See [template-strings-cooked-vs-raw](https://exploringjs.com/js/book/ch_template-literals.html#template-strings-cooked-vs-raw) #[ast] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, ContentEq, ESTree)] #[estree(no_type)] pub struct TemplateElementValue<'a> { /// A raw interpretation where backslashes do not have special meaning. @@ -484,7 +484,7 @@ pub struct TemplateElementValue<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum MemberExpression<'a> { /// `ar[0]` in `const ar = [1, 2]; ar[0];` ComputedMemberExpression(Box<'a, ComputedMemberExpression<'a>>) = 48, @@ -510,7 +510,7 @@ pub use match_member_expression; /// Represents a computed member access expression, which can include an object and an expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "MemberExpression", add_fields(computed = True), @@ -529,7 +529,7 @@ pub struct ComputedMemberExpression<'a> { /// Represents a static member access expression, which can include an object and a property. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "MemberExpression", add_fields(computed = False), @@ -547,7 +547,7 @@ pub struct StaticMemberExpression<'a> { /// Represents a private field access expression, which can include an object and a private identifier. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "MemberExpression", add_fields(computed = False), @@ -579,7 +579,7 @@ pub struct PrivateFieldExpression<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct CallExpression<'a> { pub span: Span, pub callee: Expression<'a>, @@ -607,7 +607,7 @@ pub struct CallExpression<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct NewExpression<'a> { pub span: Span, pub callee: Expression<'a>, @@ -625,7 +625,7 @@ pub struct NewExpression<'a> { /// Represents a meta property. The following syntaxes are supported. `import.meta`, `new.target`. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct MetaProperty<'a> { pub span: Span, pub meta: IdentifierName<'a>, @@ -637,7 +637,7 @@ pub struct MetaProperty<'a> { /// Represents a spread element, which can include an argument. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct SpreadElement<'a> { pub span: Span, /// The expression being spread. @@ -652,7 +652,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum Argument<'a> { /// `...[1, 2]` in `const arr = [...[1, 2]];` SpreadElement(Box<'a, SpreadElement<'a>>) = 64, @@ -667,7 +667,7 @@ pub enum Argument<'a> { /// The following syntaxes are supported: `++a`, `a++`, `--a`, `a--`. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct UpdateExpression<'a> { pub span: Span, pub operator: UpdateOperator, @@ -681,7 +681,7 @@ pub struct UpdateExpression<'a> { /// The following syntaxes are supported: `+a`, `-a`, `~a`, `!a`, `delete a`, `void a`, `typeof a`. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(add_fields(prefix = True), field_order(span, operator, prefix, argument))] pub struct UnaryExpression<'a> { pub span: Span, @@ -694,7 +694,7 @@ pub struct UnaryExpression<'a> { /// Represents a binary expression, which include a left expression, an operator, and a right expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct BinaryExpression<'a> { pub span: Span, pub left: Expression<'a>, @@ -705,7 +705,7 @@ pub struct BinaryExpression<'a> { /// `#brand in obj` in `class Foo { #brand; static isFoo(obj) { return #brand in obj; } }`. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "BinaryExpression", add_fields(operator = In), @@ -723,7 +723,7 @@ pub struct PrivateInExpression<'a> { /// The following syntaxes are supported: `||`, `&&` and `??`. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct LogicalExpression<'a> { pub span: Span, pub left: Expression<'a>, @@ -736,7 +736,7 @@ pub struct LogicalExpression<'a> { /// Represents a conditional expression, which includes a test, a consequent, and an alternate. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ConditionalExpression<'a> { pub span: Span, pub test: Expression<'a>, @@ -749,7 +749,7 @@ pub struct ConditionalExpression<'a> { /// Represents an assignment expression, which includes an operator, a target, and an expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct AssignmentExpression<'a> { pub span: Span, pub operator: AssignmentOperator, @@ -766,7 +766,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum AssignmentTarget<'a> { // `SimpleAssignmentTarget` variants added here by `inherit_variants!` macro @inherit SimpleAssignmentTarget @@ -783,7 +783,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum SimpleAssignmentTarget<'a> { AssignmentTargetIdentifier(Box<'a, IdentifierReference<'a>>) = 0, TSAsExpression(Box<'a, TSAsExpression<'a>>) = 1, @@ -833,7 +833,7 @@ pub use match_simple_assignment_target; #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum AssignmentTargetPattern<'a> { ArrayAssignmentTarget(Box<'a, ArrayAssignmentTarget<'a>>) = 8, ObjectAssignmentTarget(Box<'a, ObjectAssignmentTarget<'a>>) = 9, @@ -853,7 +853,7 @@ pub use match_assignment_target_pattern; /// Represents an array assignment target, which can include elements and a rest element. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "ArrayPattern")] pub struct ArrayAssignmentTarget<'a> { pub span: Span, @@ -869,7 +869,7 @@ pub struct ArrayAssignmentTarget<'a> { /// Represents an object assignment target, which can include properties and a rest element. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "ObjectPattern")] pub struct ObjectAssignmentTarget<'a> { pub span: Span, @@ -883,7 +883,7 @@ pub struct ObjectAssignmentTarget<'a> { /// Represents a rest element in an array assignment target, which can include a target. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "RestElement")] pub struct AssignmentTargetRest<'a> { pub span: Span, @@ -899,7 +899,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum AssignmentTargetMaybeDefault<'a> { AssignmentTargetWithDefault(Box<'a, AssignmentTargetWithDefault<'a>>) = 16, // `AssignmentTarget` variants added here by `inherit_variants!` macro @@ -909,7 +909,7 @@ pub enum AssignmentTargetMaybeDefault<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "AssignmentPattern")] pub struct AssignmentTargetWithDefault<'a> { pub span: Span, @@ -921,7 +921,7 @@ pub struct AssignmentTargetWithDefault<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum AssignmentTargetProperty<'a> { AssignmentTargetPropertyIdentifier(Box<'a, AssignmentTargetPropertyIdentifier<'a>>) = 0, AssignmentTargetPropertyProperty(Box<'a, AssignmentTargetPropertyProperty<'a>>) = 1, @@ -933,7 +933,7 @@ pub enum AssignmentTargetProperty<'a> { /// and an optional init expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "Property", add_fields(method = False, shorthand = True, computed = False, kind = Init), @@ -952,7 +952,7 @@ pub struct AssignmentTargetPropertyIdentifier<'a> { /// Represents an assignment target property property, which includes a name and a binding. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "Property", add_fields(method = False, shorthand = False, kind = Init), @@ -983,7 +983,7 @@ pub struct AssignmentTargetPropertyProperty<'a> { /// Represents a sequence expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct SequenceExpression<'a> { pub span: Span, pub expressions: Vec<'a, Expression<'a>>, @@ -994,7 +994,7 @@ pub struct SequenceExpression<'a> { /// Represents a super expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct Super { pub span: Span, } @@ -1004,7 +1004,7 @@ pub struct Super { /// Represents an await expression, which can include an argument. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct AwaitExpression<'a> { pub span: Span, pub argument: Expression<'a>, @@ -1015,7 +1015,7 @@ pub struct AwaitExpression<'a> { /// Represents a chain expression, which can include an expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ChainExpression<'a> { pub span: Span, pub expression: ChainElement<'a>, @@ -1029,7 +1029,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum ChainElement<'a> { CallExpression(Box<'a, CallExpression<'a>>) = 0, /// `foo?.baz!` or `foo?.[bar]!` @@ -1044,7 +1044,7 @@ pub enum ChainElement<'a> { /// Represents a parenthesized expression, which can include an expression. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ParenthesizedExpression<'a> { pub span: Span, pub expression: Expression<'a>, @@ -1059,7 +1059,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum Statement<'a> { // Statements BlockStatement(Box<'a, BlockStatement<'a>>) = 0, @@ -1092,7 +1092,7 @@ pub enum Statement<'a> { /// Represents a directive statement, which can include a string literal. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "ExpressionStatement")] pub struct Directive<'a> { pub span: Span, @@ -1107,7 +1107,7 @@ pub struct Directive<'a> { /// Represents a hashbang directive, which can include a value. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct Hashbang<'a> { pub span: Span, pub value: Atom<'a>, @@ -1119,7 +1119,7 @@ pub struct Hashbang<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct BlockStatement<'a> { pub span: Span, pub body: Vec<'a, Statement<'a>>, @@ -1129,7 +1129,7 @@ pub struct BlockStatement<'a> { /// Declarations and the Variable Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum Declaration<'a> { VariableDeclaration(Box<'a, VariableDeclaration<'a>>) = 32, #[visit(args(flags = ScopeFlags::Function))] @@ -1164,7 +1164,7 @@ pub use match_declaration; /// Represents a variable declaration, which can include a kind, declarations, and modifiers. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(field_order(span, declarations, kind, declare))] pub struct VariableDeclaration<'a> { pub span: Span, @@ -1176,7 +1176,7 @@ pub struct VariableDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum VariableDeclarationKind { Var = 0, Let = 1, @@ -1196,7 +1196,7 @@ pub enum VariableDeclarationKind { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct VariableDeclarator<'a> { pub span: Span, #[estree(skip)] @@ -1210,7 +1210,7 @@ pub struct VariableDeclarator<'a> { /// Empty Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct EmptyStatement { pub span: Span, } @@ -1218,7 +1218,7 @@ pub struct EmptyStatement { /// Expression Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(add_fields(directive = ExpressionStatementDirective))] // Only in TS AST pub struct ExpressionStatement<'a> { pub span: Span, @@ -1228,7 +1228,7 @@ pub struct ExpressionStatement<'a> { /// If Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct IfStatement<'a> { pub span: Span, pub test: Expression<'a>, @@ -1239,7 +1239,7 @@ pub struct IfStatement<'a> { /// Do-While Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct DoWhileStatement<'a> { pub span: Span, pub body: Statement<'a>, @@ -1249,7 +1249,7 @@ pub struct DoWhileStatement<'a> { /// While Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct WhileStatement<'a> { pub span: Span, pub test: Expression<'a>, @@ -1260,7 +1260,7 @@ pub struct WhileStatement<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ForStatement<'a> { pub span: Span, pub init: Option>, @@ -1278,7 +1278,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum ForStatementInit<'a> { VariableDeclaration(Box<'a, VariableDeclaration<'a>>) = 64, // `Expression` variants added here by `inherit_variants!` macro @@ -1290,7 +1290,7 @@ pub enum ForStatementInit<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ForInStatement<'a> { pub span: Span, pub left: ForStatementLeft<'a>, @@ -1307,7 +1307,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum ForStatementLeft<'a> { VariableDeclaration(Box<'a, VariableDeclaration<'a>>) = 16, // `AssignmentTarget` variants added here by `inherit_variants!` macro @@ -1318,7 +1318,7 @@ pub enum ForStatementLeft<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ForOfStatement<'a> { pub span: Span, pub r#await: bool, @@ -1331,7 +1331,7 @@ pub struct ForOfStatement<'a> { /// Continue Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ContinueStatement<'a> { pub span: Span, pub label: Option>, @@ -1340,7 +1340,7 @@ pub struct ContinueStatement<'a> { /// Break Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct BreakStatement<'a> { pub span: Span, pub label: Option>, @@ -1349,7 +1349,7 @@ pub struct BreakStatement<'a> { /// Return Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ReturnStatement<'a> { pub span: Span, pub argument: Option>, @@ -1358,7 +1358,7 @@ pub struct ReturnStatement<'a> { /// With Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct WithStatement<'a> { pub span: Span, pub object: Expression<'a>, @@ -1369,7 +1369,7 @@ pub struct WithStatement<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct SwitchStatement<'a> { pub span: Span, pub discriminant: Expression<'a>, @@ -1380,7 +1380,7 @@ pub struct SwitchStatement<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(field_order(span, consequent, test))] pub struct SwitchCase<'a> { pub span: Span, @@ -1391,7 +1391,7 @@ pub struct SwitchCase<'a> { /// Labelled Statement #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(field_order(span, body, label))] pub struct LabeledStatement<'a> { pub span: Span, @@ -1408,7 +1408,7 @@ pub struct LabeledStatement<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ThrowStatement<'a> { pub span: Span, /// The expression being thrown, e.g. `err` in `throw err;` @@ -1432,7 +1432,7 @@ pub struct ThrowStatement<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TryStatement<'a> { pub span: Span, /// Statements in the `try` block @@ -1458,7 +1458,7 @@ pub struct TryStatement<'a> { #[ast(visit)] #[scope(flags = ScopeFlags::CatchClause)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct CatchClause<'a> { pub span: Span, /// The caught error parameter, e.g. `e` in `catch (e) {}` @@ -1483,7 +1483,7 @@ pub struct CatchClause<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(no_type, ts_alias = "BindingPattern")] pub struct CatchParameter<'a> { #[estree(skip)] @@ -1502,7 +1502,7 @@ pub struct CatchParameter<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct DebuggerStatement { pub span: Span, } @@ -1511,7 +1511,7 @@ pub struct DebuggerStatement { /// * #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(no_type)] pub struct BindingPattern<'a> { // estree(flatten) the attributes because estree has no `BindingPattern` @@ -1529,7 +1529,7 @@ pub struct BindingPattern<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum BindingPatternKind<'a> { /// `const a = 1` BindingIdentifier(Box<'a, BindingIdentifier<'a>>) = 0, @@ -1546,7 +1546,7 @@ pub enum BindingPatternKind<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(add_fields(decorators = TsEmptyArray))] pub struct AssignmentPattern<'a> { pub span: Span, @@ -1556,7 +1556,7 @@ pub struct AssignmentPattern<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ObjectPattern<'a> { pub span: Span, pub properties: Vec<'a, BindingProperty<'a>>, @@ -1566,7 +1566,7 @@ pub struct ObjectPattern<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "Property", add_fields(method = False, kind = Init), @@ -1582,7 +1582,7 @@ pub struct BindingProperty<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(add_fields(decorators = TsEmptyArray, optional = TsFalse, typeAnnotation = TsNull))] pub struct ArrayPattern<'a> { pub span: Span, @@ -1602,7 +1602,7 @@ pub struct ArrayPattern<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "RestElement")] pub struct BindingRestElement<'a> { pub span: Span, @@ -1652,7 +1652,7 @@ pub struct BindingRestElement<'a> { strict_if = self.has_use_strict_directive(), )] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] // https://github.com/estree/estree/blob/master/es5.md#patterns // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/cd61c555bfc93e985b313263a42ed78074570d08/types/estree/index.d.ts#L411 #[estree( @@ -1729,7 +1729,7 @@ pub struct Function<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] #[estree(no_rename_variants)] pub enum FunctionType { FunctionDeclaration = 0, @@ -1742,7 +1742,7 @@ pub enum FunctionType { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( via = FormalParametersConverter, add_ts_def = " @@ -1765,7 +1765,7 @@ pub struct FormalParameters<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] // Pluralize as `FormalParameterList` to avoid naming clash with `FormalParameters`. #[plural(FormalParameterList)] #[estree(no_type)] @@ -1789,7 +1789,7 @@ pub struct FormalParameter<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] #[estree(no_rename_variants, no_ts_def)] pub enum FormalParameterKind { /// @@ -1805,7 +1805,7 @@ pub enum FormalParameterKind { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "BlockStatement")] pub struct FunctionBody<'a> { pub span: Span, @@ -1822,7 +1822,7 @@ pub struct FunctionBody<'a> { strict_if = self.has_use_strict_directive(), )] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( add_fields(id = Null, generator = False), field_order(span, id, expression, generator, r#async, params, body, type_parameters, return_type), @@ -1851,7 +1851,7 @@ pub struct ArrowFunctionExpression<'a> { /// Generator Function Definitions #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct YieldExpression<'a> { pub span: Span, pub delegate: bool, @@ -1862,7 +1862,7 @@ pub struct YieldExpression<'a> { #[ast(visit)] #[scope(flags = ScopeFlags::StrictMode)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[rustfmt::skip] #[estree(field_order( r#type, span, id, super_class, body, @@ -1941,7 +1941,7 @@ pub struct Class<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] #[estree(no_rename_variants)] pub enum ClassType { /// Class declaration statement @@ -1959,7 +1959,7 @@ pub enum ClassType { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ClassBody<'a> { pub span: Span, pub body: Vec<'a, ClassElement<'a>>, @@ -1985,7 +1985,7 @@ pub struct ClassBody<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum ClassElement<'a> { StaticBlock(Box<'a, StaticBlock<'a>>) = 0, /// Class Methods @@ -2007,7 +2007,7 @@ pub enum ClassElement<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[rustfmt::skip] #[estree(field_order( r#type, span, r#static, computed, key, kind, value, @@ -2042,7 +2042,7 @@ pub struct MethodDefinition<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] #[estree(no_rename_variants)] pub enum MethodDefinitionType { MethodDefinition = 0, @@ -2051,7 +2051,7 @@ pub enum MethodDefinitionType { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[rustfmt::skip] #[estree(field_order( r#type, span, r#static, computed, key, value, @@ -2144,7 +2144,7 @@ pub struct PropertyDefinition<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] #[estree(no_rename_variants)] pub enum PropertyDefinitionType { PropertyDefinition = 0, @@ -2153,7 +2153,7 @@ pub enum PropertyDefinitionType { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum MethodDefinitionKind { /// Class constructor Constructor = 0, @@ -2170,7 +2170,7 @@ pub enum MethodDefinitionKind { /// See: [MDN - Private class fields](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields) #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct PrivateIdentifier<'a> { pub span: Span, pub name: Atom<'a>, @@ -2192,7 +2192,7 @@ pub struct PrivateIdentifier<'a> { #[ast(visit)] #[scope(flags = ScopeFlags::ClassStaticBlock)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct StaticBlock<'a> { pub span: Span, pub body: Vec<'a, Statement<'a>>, @@ -2224,7 +2224,7 @@ pub struct StaticBlock<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum ModuleDeclaration<'a> { /// `import hello from './world.js';` /// `import * as t from './world.js';` @@ -2259,7 +2259,7 @@ pub use match_module_declaration; #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] #[estree(no_rename_variants)] pub enum AccessorPropertyType { AccessorProperty = 0, @@ -2276,7 +2276,7 @@ pub enum AccessorPropertyType { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[rustfmt::skip] #[estree(field_order( r#type, span, key, value, computed, r#static, @@ -2326,7 +2326,7 @@ pub struct AccessorProperty<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ImportExpression<'a> { pub span: Span, pub source: Expression<'a>, @@ -2338,7 +2338,7 @@ pub struct ImportExpression<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ImportDeclaration<'a> { pub span: Span, /// `None` for `import 'foo'`, `Some([])` for `import {} from 'foo'` @@ -2362,7 +2362,7 @@ pub struct ImportDeclaration<'a> { /// #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum ImportPhase { Source = 0, Defer = 1, @@ -2370,7 +2370,7 @@ pub enum ImportPhase { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum ImportDeclarationSpecifier<'a> { /// import {imported} from "source" /// import {imported as local} from "source" @@ -2385,7 +2385,7 @@ pub enum ImportDeclarationSpecifier<'a> { // import {imported as local} from "source" #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ImportSpecifier<'a> { pub span: Span, pub imported: ModuleExportName<'a>, @@ -2414,7 +2414,7 @@ pub struct ImportSpecifier<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ImportDefaultSpecifier<'a> { pub span: Span, /// The name of the imported symbol. @@ -2429,7 +2429,7 @@ pub struct ImportDefaultSpecifier<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ImportNamespaceSpecifier<'a> { pub span: Span, pub local: BindingIdentifier<'a>, @@ -2437,7 +2437,7 @@ pub struct ImportNamespaceSpecifier<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(no_ts_def)] pub struct WithClause<'a> { pub span: Span, @@ -2447,7 +2447,7 @@ pub struct WithClause<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ImportAttribute<'a> { pub span: Span, pub key: ImportAttributeKey<'a>, @@ -2456,7 +2456,7 @@ pub struct ImportAttribute<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub enum ImportAttributeKey<'a> { Identifier(IdentifierName<'a>) = 0, StringLiteral(StringLiteral<'a>) = 1, @@ -2475,7 +2475,7 @@ pub enum ImportAttributeKey<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ExportNamedDeclaration<'a> { pub span: Span, pub declaration: Option>, @@ -2500,7 +2500,7 @@ pub struct ExportNamedDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ExportDefaultDeclaration<'a> { pub span: Span, #[estree(skip)] @@ -2519,7 +2519,7 @@ pub struct ExportDefaultDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ExportAllDeclaration<'a> { pub span: Span, /// If this declaration is re-named @@ -2545,7 +2545,7 @@ pub struct ExportAllDeclaration<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct ExportSpecifier<'a> { pub span: Span, pub local: ModuleExportName<'a>, @@ -2562,7 +2562,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum ExportDefaultDeclarationKind<'a> { #[visit(args(flags = ScopeFlags::Function))] FunctionDeclaration(Box<'a, Function<'a>>) = 64, @@ -2584,7 +2584,7 @@ pub enum ExportDefaultDeclarationKind<'a> { /// * #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub enum ModuleExportName<'a> { IdentifierName(IdentifierName<'a>) = 0, /// For `local` in `ExportSpecifier`: `foo` in `export { foo }` @@ -2596,7 +2596,7 @@ pub enum ModuleExportName<'a> { /// See: [runtime.h](https://github.com/v8/v8/blob/5fe0aa3bc79c0a9d3ad546b79211f07105f09585/src/runtime/runtime.h#L43) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct V8IntrinsicExpression<'a> { pub span: Span, pub name: IdentifierName<'a>, diff --git a/crates/oxc_ast/src/ast/jsx.rs b/crates/oxc_ast/src/ast/jsx.rs index 01b2dc26eb37b..f3f8f278c7a53 100644 --- a/crates/oxc_ast/src/ast/jsx.rs +++ b/crates/oxc_ast/src/ast/jsx.rs @@ -4,7 +4,7 @@ // They are purely markers for codegen used in `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates. // Read [`macro@oxc_ast_macros::ast`] for more information. -use oxc_allocator::{Box, CloneIn, GetAddress, Vec}; +use oxc_allocator::{Box, CloneIn, Dummy, GetAddress, TakeIn, Vec}; use oxc_ast_macros::ast; use oxc_estree::ESTree; use oxc_span::{Atom, ContentEq, GetSpan, GetSpanMut, Span}; @@ -32,7 +32,7 @@ use super::{inherit_variants, js::*, literal::*, ts::*}; /// See: [JSX Syntax](https://facebook.github.io/jsx/) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXElement<'a> { /// Node location in source code pub span: Span, @@ -61,7 +61,7 @@ pub struct JSXElement<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(field_order(span, attributes, name, self_closing, type_arguments))] pub struct JSXOpeningElement<'a> { /// Node location in source code @@ -96,7 +96,7 @@ pub struct JSXOpeningElement<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXClosingElement<'a> { /// Node location in source code pub span: Span, @@ -114,7 +114,7 @@ pub struct JSXClosingElement<'a> { /// See: [`React.Fragment`](https://react.dev/reference/react/Fragment) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXFragment<'a> { /// Node location in source code pub span: Span, @@ -129,7 +129,7 @@ pub struct JSXFragment<'a> { /// JSX Opening Fragment (`<>`) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(add_fields(attributes = JSXOpeningFragmentAttributes, selfClosing = False))] pub struct JSXOpeningFragment { /// Node location in source code @@ -139,7 +139,7 @@ pub struct JSXOpeningFragment { /// JSX Closing Fragment (``) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXClosingFragment { /// Node location in source code pub span: Span, @@ -148,7 +148,7 @@ pub struct JSXClosingFragment { /// JSX Element Name #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum JSXElementName<'a> { /// `
` Identifier(Box<'a, JSXIdentifier<'a>>) = 0, @@ -173,7 +173,7 @@ pub enum JSXElementName<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXNamespacedName<'a> { /// Node location in source code pub span: Span, @@ -200,7 +200,7 @@ pub struct JSXNamespacedName<'a> { /// [`member expression`]: JSXMemberExpressionObject::MemberExpression #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXMemberExpression<'a> { /// Node location in source code pub span: Span, @@ -228,7 +228,7 @@ pub struct JSXMemberExpression<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum JSXMemberExpressionObject<'a> { /// `` #[estree(via = JSXElementIdentifierReference)] @@ -255,7 +255,7 @@ pub enum JSXMemberExpressionObject<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXExpressionContainer<'a> { /// Node location in source code pub span: Span, @@ -272,7 +272,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub enum JSXExpression<'a> { /// An empty expression /// @@ -290,7 +290,7 @@ pub enum JSXExpression<'a> { /// An empty JSX expression (`{}`) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXEmptyExpression { /// Node location in source code pub span: Span, @@ -309,7 +309,7 @@ pub struct JSXEmptyExpression { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum JSXAttributeItem<'a> { /// A `key="value"` attribute Attribute(Box<'a, JSXAttribute<'a>>) = 0, @@ -330,7 +330,7 @@ pub enum JSXAttributeItem<'a> { /// // name ^^^ ^^^^ value #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXAttribute<'a> { /// Node location in source code pub span: Span, @@ -351,7 +351,7 @@ pub struct JSXAttribute<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXSpreadAttribute<'a> { /// Node location in source code pub span: Span, @@ -376,7 +376,7 @@ pub struct JSXSpreadAttribute<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum JSXAttributeName<'a> { /// An attribute name without a namespace prefix, e.g. `foo` in `foo="bar"`. Identifier(Box<'a, JSXIdentifier<'a>>) = 0, @@ -404,7 +404,7 @@ pub enum JSXAttributeName<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum JSXAttributeValue<'a> { /// `` StringLiteral(Box<'a, StringLiteral<'a>>) = 0, @@ -423,7 +423,7 @@ pub enum JSXAttributeValue<'a> { /// [`IdentifierName`]: super::IdentifierName #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXIdentifier<'a> { /// Node location in source code pub span: Span, @@ -439,7 +439,7 @@ pub struct JSXIdentifier<'a> { /// Part of a [`JSXElement`]. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum JSXChild<'a> { /// `Some Text` Text(Box<'a, JSXText<'a>>) = 0, @@ -458,7 +458,7 @@ pub enum JSXChild<'a> { /// Variant of [`JSXChild`] that represents an object spread (`{...expression}`). #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXSpreadChild<'a> { /// Node location in source code pub span: Span, @@ -478,7 +478,7 @@ pub struct JSXSpreadChild<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSXText<'a> { /// Node location in source code pub span: Span, diff --git a/crates/oxc_ast/src/ast/literal.rs b/crates/oxc_ast/src/ast/literal.rs index 3911784fa7683..fc4a695e1a6eb 100644 --- a/crates/oxc_ast/src/ast/literal.rs +++ b/crates/oxc_ast/src/ast/literal.rs @@ -7,7 +7,7 @@ use std::hash::Hash; use bitflags::bitflags; -use oxc_allocator::{Box, CloneIn}; +use oxc_allocator::{Box, CloneIn, Dummy, TakeIn}; use oxc_ast_macros::ast; use oxc_estree::ESTree; use oxc_regular_expression::ast::Pattern; @@ -19,7 +19,7 @@ use oxc_syntax::number::{BigintBase, NumberBase}; /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "Literal", add_fields(raw = BooleanLiteralRaw))] pub struct BooleanLiteral { /// Node location in source code @@ -33,7 +33,7 @@ pub struct BooleanLiteral { /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "Literal", add_fields(value = Null, raw = NullLiteralRaw))] pub struct NullLiteral { /// Node location in source code @@ -45,7 +45,7 @@ pub struct NullLiteral { /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, ContentEq, GetSpan, GetSpanMut, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, ContentEq, GetSpan, GetSpanMut, ESTree)] #[estree(rename = "Literal")] pub struct NumericLiteral<'a> { /// Node location in source code @@ -68,7 +68,7 @@ pub struct NumericLiteral<'a> { /// #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, ContentEq, GetSpan, GetSpanMut, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, ContentEq, GetSpan, GetSpanMut, ESTree)] #[estree(rename = "Literal")] pub struct StringLiteral<'a> { /// Node location in source code @@ -93,7 +93,7 @@ pub struct StringLiteral<'a> { /// BigInt literal #[ast(visit)] #[derive(Debug, Clone)] -#[generate_derive(CloneIn, ContentEq, GetSpan, GetSpanMut, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, ContentEq, GetSpan, GetSpanMut, ESTree)] #[estree( rename = "Literal", add_fields(value = BigIntLiteralValue, bigint = BigIntLiteralBigint), @@ -116,7 +116,7 @@ pub struct BigIntLiteral<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, ContentEq, GetSpan, GetSpanMut, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, ContentEq, GetSpan, GetSpanMut, ESTree)] #[estree( rename = "Literal", add_fields(value = RegExpLiteralValue), @@ -140,7 +140,7 @@ pub struct RegExpLiteral<'a> { /// #[ast] #[derive(Debug)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, ContentEq, ESTree)] #[estree(no_type)] pub struct RegExp<'a> { /// The regex pattern between the slashes @@ -154,7 +154,7 @@ pub struct RegExp<'a> { /// This pattern may or may not be parsed. #[ast] #[derive(Debug)] -#[generate_derive(CloneIn, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, ESTree)] #[estree(via = RegExpPatternConverter)] pub enum RegExpPattern<'a> { /// Unparsed pattern. Contains string slice of the pattern. diff --git a/crates/oxc_ast/src/ast/ts.rs b/crates/oxc_ast/src/ast/ts.rs index 30671bce13f0e..bed0f3cd4287f 100644 --- a/crates/oxc_ast/src/ast/ts.rs +++ b/crates/oxc_ast/src/ast/ts.rs @@ -10,7 +10,7 @@ use std::cell::Cell; -use oxc_allocator::{Box, CloneIn, GetAddress, Vec}; +use oxc_allocator::{Box, CloneIn, Dummy, GetAddress, TakeIn, Vec}; use oxc_ast_macros::ast; use oxc_estree::ESTree; use oxc_span::{Atom, ContentEq, GetSpan, GetSpanMut, Span}; @@ -30,7 +30,7 @@ use super::{inherit_variants, js::*, literal::*}; /// * [TypeScript Handbook - `this` parameters](https://www.typescriptlang.org/docs/handbook/2/functions.html#this-parameters) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree( rename = "Identifier", add_fields(name = This, decorators = EmptyArray, optional = False), @@ -67,7 +67,7 @@ pub struct TSThisParameter<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSEnumDeclaration<'a> { pub span: Span, pub id: BindingIdentifier<'a>, @@ -98,7 +98,7 @@ pub struct TSEnumDeclaration<'a> { /// * [TypeScript Handbook - Enums](https://www.typescriptlang.org/docs/handbook/enums.html) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSEnumMember<'a> { pub span: Span, pub id: TSEnumMemberName<'a>, @@ -108,7 +108,7 @@ pub struct TSEnumMember<'a> { /// TS Enum Member Name #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum TSEnumMemberName<'a> { Identifier(Box<'a, IdentifierName<'a>>) = 0, String(Box<'a, StringLiteral<'a>>) = 1, @@ -128,7 +128,7 @@ pub enum TSEnumMemberName<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeAnnotation<'a> { /// starts at the `:` token and ends at the end of the type annotation pub span: Span, @@ -152,7 +152,7 @@ pub struct TSTypeAnnotation<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSLiteralType<'a> { pub span: Span, pub literal: TSLiteral<'a>, @@ -161,7 +161,7 @@ pub struct TSLiteralType<'a> { /// A literal in a [`TSLiteralType`]. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum TSLiteral<'a> { BooleanLiteral(Box<'a, BooleanLiteral>) = 0, NumericLiteral(Box<'a, NumericLiteral<'a>>) = 1, @@ -184,7 +184,7 @@ pub enum TSLiteral<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum TSType<'a> { // Keyword TSAnyKeyword(Box<'a, TSAnyKeyword>) = 0, @@ -291,7 +291,7 @@ pub use match_ts_type; flags = ScopeFlags::TsConditional, )] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSConditionalType<'a> { pub span: Span, /// The type before `extends` in the test expression. @@ -318,7 +318,7 @@ pub struct TSConditionalType<'a> { /// * [TypeScript Handbook - Union Types](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes-func.html#unions) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSUnionType<'a> { pub span: Span, /// The types in the union. @@ -340,7 +340,7 @@ pub struct TSUnionType<'a> { /// * [TypeScript Handbook - Intersection Types](https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSIntersectionType<'a> { pub span: Span, pub types: Vec<'a, TSType<'a>>, @@ -357,7 +357,7 @@ pub struct TSIntersectionType<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSParenthesizedType<'a> { pub span: Span, pub type_annotation: TSType<'a>, @@ -374,7 +374,7 @@ pub struct TSParenthesizedType<'a> { /// * [TypeScript Handbook - Keyof Types](https://www.typescriptlang.org/docs/handbook/2/keyof-types.html) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeOperator<'a> { pub span: Span, pub operator: TSTypeOperatorOperator, @@ -385,7 +385,7 @@ pub struct TSTypeOperator<'a> { /// Operator in a [`TSTypeOperator`]. #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum TSTypeOperatorOperator { Keyof = 0, Unique = 1, @@ -405,7 +405,7 @@ pub enum TSTypeOperatorOperator { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSArrayType<'a> { pub span: Span, pub element_type: TSType<'a>, @@ -424,7 +424,7 @@ pub struct TSArrayType<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSIndexedAccessType<'a> { pub span: Span, pub object_type: TSType<'a>, @@ -442,7 +442,7 @@ pub struct TSIndexedAccessType<'a> { /// #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTupleType<'a> { pub span: Span, pub element_types: Vec<'a, TSTupleElement<'a>>, @@ -460,7 +460,7 @@ pub struct TSTupleType<'a> { /// * [TypeScript Handbook - Tuple Types](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSNamedTupleMember<'a> { pub span: Span, pub element_type: TSTupleElement<'a>, @@ -479,7 +479,7 @@ pub struct TSNamedTupleMember<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSOptionalType<'a> { pub span: Span, pub type_annotation: TSType<'a>, @@ -495,7 +495,7 @@ pub struct TSOptionalType<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSRestType<'a> { pub span: Span, pub type_annotation: TSType<'a>, @@ -511,7 +511,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum TSTupleElement<'a> { // Discriminants start at 64, so that `TSTupleElement::is_ts_type` is a single // bitwise AND operation on the discriminant (`discriminant & 63 != 0`). @@ -533,7 +533,7 @@ pub enum TSTupleElement<'a> { /// * [TypeScript Handbook - Any Type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSAnyKeyword { pub span: Span, } @@ -549,7 +549,7 @@ pub struct TSAnyKeyword { /// * [TypeScript Handbook - Everyday Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#the-primitives-string-number-and-boolean) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSStringKeyword { pub span: Span, } @@ -565,7 +565,7 @@ pub struct TSStringKeyword { /// * [TypeScript Handbook - Everyday Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#the-primitives-string-number-and-boolean) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSBooleanKeyword { pub span: Span, } @@ -581,7 +581,7 @@ pub struct TSBooleanKeyword { /// * [TypeScript Handbook - Everyday Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#the-primitives-string-number-and-boolean) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSNumberKeyword { pub span: Span, } @@ -598,7 +598,7 @@ pub struct TSNumberKeyword { /// * [TypeScript Handbook - Advanced Topics](https://www.typescriptlang.org/docs/handbook/type-compatibility.html#advanced-topics) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSNeverKeyword { pub span: Span, } @@ -615,7 +615,7 @@ pub struct TSNeverKeyword { /// * [microsoft/TypeScript #40580](https://github.com/microsoft/TypeScript/pull/40580) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSIntrinsicKeyword { pub span: Span, } @@ -633,7 +633,7 @@ pub struct TSIntrinsicKeyword { /// * [TypeScript Handbook - Advanced Topics](https://www.typescriptlang.org/docs/handbook/type-compatibility.html#advanced-topics) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSUnknownKeyword { pub span: Span, } @@ -650,7 +650,7 @@ pub struct TSUnknownKeyword { /// * [TypeScript Handbook - Everyday Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#null-and-undefined) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSNullKeyword { pub span: Span, } @@ -669,42 +669,42 @@ pub struct TSNullKeyword { /// * [TypeScript Handbook - Everyday Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#null-and-undefined) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSUndefinedKeyword { pub span: Span, } #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSVoidKeyword { pub span: Span, } #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSSymbolKeyword { pub span: Span, } #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSThisType { pub span: Span, } #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSObjectKeyword { pub span: Span, } #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSBigIntKeyword { pub span: Span, } @@ -719,7 +719,7 @@ pub struct TSBigIntKeyword { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeReference<'a> { pub span: Span, pub type_name: TSTypeName<'a>, @@ -731,7 +731,7 @@ pub struct TSTypeReference<'a> { /// NamespaceName . IdentifierReference #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum TSTypeName<'a> { IdentifierReference(Box<'a, IdentifierReference<'a>>) = 0, QualifiedName(Box<'a, TSQualifiedName<'a>>) = 1, @@ -756,7 +756,7 @@ pub use match_ts_type_name; /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSQualifiedName<'a> { pub span: Span, pub left: TSTypeName<'a>, @@ -765,7 +765,7 @@ pub struct TSQualifiedName<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeParameterInstantiation<'a> { pub span: Span, pub params: Vec<'a, TSType<'a>>, @@ -790,7 +790,7 @@ pub struct TSTypeParameterInstantiation<'a> { /// * [TypeScript Handbook - Variance Annotations](https://www.typescriptlang.org/docs/handbook/2/generics.html#variance-annotations) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeParameter<'a> { pub span: Span, /// The name of the parameter, e.g. `T` in `type Foo = ...`. @@ -809,7 +809,7 @@ pub struct TSTypeParameter<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeParameterDeclaration<'a> { pub span: Span, pub params: Vec<'a, TSTypeParameter<'a>>, @@ -826,7 +826,7 @@ pub struct TSTypeParameterDeclaration<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeAliasDeclaration<'a> { pub span: Span, /// Type alias's identifier, e.g. `Foo` in `type Foo = number`. @@ -840,7 +840,7 @@ pub struct TSTypeAliasDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum TSAccessibility { Private = 0, Protected = 1, @@ -859,7 +859,7 @@ pub enum TSAccessibility { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSClassImplements<'a> { pub span: Span, pub expression: TSTypeName<'a>, @@ -884,7 +884,7 @@ pub struct TSClassImplements<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSInterfaceDeclaration<'a> { pub span: Span, /// The identifier (name) of the interface. @@ -904,7 +904,7 @@ pub struct TSInterfaceDeclaration<'a> { /// Body of a [`TSInterfaceDeclaration`]. #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSInterfaceBody<'a> { pub span: Span, pub body: Vec<'a, TSSignature<'a>>, @@ -927,7 +927,7 @@ pub struct TSInterfaceBody<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSPropertySignature<'a> { pub span: Span, pub computed: bool, @@ -939,7 +939,7 @@ pub struct TSPropertySignature<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum TSSignature<'a> { TSIndexSignature(Box<'a, TSIndexSignature<'a>>) = 0, TSPropertySignature(Box<'a, TSPropertySignature<'a>>) = 1, @@ -961,7 +961,7 @@ pub enum TSSignature<'a> { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(add_fields(accessibility = Null))] pub struct TSIndexSignature<'a> { pub span: Span, @@ -973,7 +973,7 @@ pub struct TSIndexSignature<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSCallSignatureDeclaration<'a> { pub span: Span, pub type_parameters: Option>>, @@ -985,7 +985,7 @@ pub struct TSCallSignatureDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum TSMethodSignatureKind { Method = 0, Get = 1, @@ -1006,7 +1006,7 @@ pub enum TSMethodSignatureKind { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSMethodSignature<'a> { pub span: Span, pub key: PropertyKey<'a>, @@ -1024,7 +1024,7 @@ pub struct TSMethodSignature<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSConstructSignatureDeclaration<'a> { pub span: Span, pub type_parameters: Option>>, @@ -1035,7 +1035,7 @@ pub struct TSConstructSignatureDeclaration<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(rename = "Identifier", add_fields(decorators = EmptyArray, optional = False))] pub struct TSIndexSignatureName<'a> { pub span: Span, @@ -1046,7 +1046,7 @@ pub struct TSIndexSignatureName<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSInterfaceHeritage<'a> { pub span: Span, pub expression: Expression<'a>, @@ -1075,7 +1075,7 @@ pub struct TSInterfaceHeritage<'a> { /// * [TypeScript Handbook - Assertion Functions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypePredicate<'a> { pub span: Span, /// The identifier the predicate operates on @@ -1092,7 +1092,7 @@ pub struct TSTypePredicate<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub enum TSTypePredicateName<'a> { Identifier(Box<'a, IdentifierName<'a>>) = 0, This(TSThisType) = 1, @@ -1130,7 +1130,7 @@ pub enum TSTypePredicateName<'a> { strict_if = self.body.as_ref().is_some_and(TSModuleDeclarationBody::has_use_strict_directive), )] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] #[estree(add_fields(global = TSModuleDeclarationGlobal))] pub struct TSModuleDeclaration<'a> { pub span: Span, @@ -1160,7 +1160,7 @@ pub struct TSModuleDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum TSModuleDeclarationKind { /// `declare global {}` Global = 0, @@ -1192,7 +1192,7 @@ pub enum TSModuleDeclarationKind { /// ``` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub enum TSModuleDeclarationName<'a> { Identifier(BindingIdentifier<'a>) = 0, StringLiteral(StringLiteral<'a>) = 1, @@ -1200,7 +1200,7 @@ pub enum TSModuleDeclarationName<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum TSModuleDeclarationBody<'a> { TSModuleDeclaration(Box<'a, TSModuleDeclaration<'a>>) = 0, TSModuleBlock(Box<'a, TSModuleBlock<'a>>) = 1, @@ -1209,7 +1209,7 @@ pub enum TSModuleDeclarationBody<'a> { // See serializer in serialize.rs #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSModuleBlock<'a> { pub span: Span, #[estree(rename = "body")] @@ -1220,7 +1220,7 @@ pub struct TSModuleBlock<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeLiteral<'a> { pub span: Span, pub members: Vec<'a, TSSignature<'a>>, @@ -1241,7 +1241,7 @@ pub struct TSTypeLiteral<'a> { /// * [TypeScript Handbook - Inferring With Conditional Types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#inferring-within-conditional-types) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSInferType<'a> { pub span: Span, /// The type bound when the @@ -1259,7 +1259,7 @@ pub struct TSInferType<'a> { /// * [TypeScript Handbook - Typeof Type Operator](https://www.typescriptlang.org/docs/handbook/2/typeof-types.html) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeQuery<'a> { pub span: Span, pub expr_name: TSTypeQueryExprName<'a>, @@ -1274,7 +1274,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum TSTypeQueryExprName<'a> { TSImportType(Box<'a, TSImportType<'a>>) = 2, // `TSTypeName` variants added here by `inherit_variants!` macro @@ -1284,7 +1284,7 @@ pub enum TSTypeQueryExprName<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSImportType<'a> { pub span: Span, pub argument: TSType<'a>, @@ -1306,7 +1306,7 @@ pub struct TSImportType<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSFunctionType<'a> { pub span: Span, /// Generic type parameters @@ -1338,7 +1338,7 @@ pub struct TSFunctionType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSConstructorType<'a> { pub span: Span, pub r#abstract: bool, @@ -1371,7 +1371,7 @@ pub struct TSConstructorType<'a> { #[ast(visit)] #[scope] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSMappedType<'a> { pub span: Span, /// Key type parameter, e.g. `P` in `[P in keyof T]`. @@ -1407,7 +1407,7 @@ pub struct TSMappedType<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum TSMappedTypeModifierOperator { /// e.g. `?` in `{ [P in K]?: T }` True = 0, @@ -1434,7 +1434,7 @@ pub enum TSMappedTypeModifierOperator { /// * [TypeScript Handbook - Template Literal Types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html#handbook-content) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTemplateLiteralType<'a> { pub span: Span, /// The string parts of the template literal. @@ -1445,7 +1445,7 @@ pub struct TSTemplateLiteralType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSAsExpression<'a> { pub span: Span, pub expression: Expression<'a>, @@ -1466,7 +1466,7 @@ pub struct TSAsExpression<'a> { /// * [TypeScript Handbook - The `satisfies` Operator](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#the-satisfies-operator) #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSSatisfiesExpression<'a> { pub span: Span, /// The value expression being constrained. @@ -1477,7 +1477,7 @@ pub struct TSSatisfiesExpression<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSTypeAssertion<'a> { pub span: Span, pub expression: Expression<'a>, @@ -1486,7 +1486,7 @@ pub struct TSTypeAssertion<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSImportEqualsDeclaration<'a> { pub span: Span, pub id: BindingIdentifier<'a>, @@ -1502,7 +1502,7 @@ inherit_variants! { /// [`ast` module docs]: `super` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)] pub enum TSModuleReference<'a> { ExternalModuleReference(Box<'a, TSExternalModuleReference<'a>>) = 2, // `TSTypeName` variants added here by `inherit_variants!` macro @@ -1512,7 +1512,7 @@ pub enum TSModuleReference<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSExternalModuleReference<'a> { pub span: Span, pub expression: StringLiteral<'a>, @@ -1520,7 +1520,7 @@ pub struct TSExternalModuleReference<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSNonNullExpression<'a> { pub span: Span, pub expression: Expression<'a>, @@ -1552,7 +1552,7 @@ pub struct TSNonNullExpression<'a> { /// [`CallExpression`]: crate::ast::js::CallExpression #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct Decorator<'a> { pub span: Span, pub expression: Expression<'a>, @@ -1563,7 +1563,7 @@ pub struct Decorator<'a> { /// `export = foo` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSExportAssignment<'a> { pub span: Span, pub expression: Expression<'a>, @@ -1574,7 +1574,7 @@ pub struct TSExportAssignment<'a> { /// `export as namespace foo` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSNamespaceExportDeclaration<'a> { pub span: Span, pub id: IdentifierName<'a>, @@ -1582,7 +1582,7 @@ pub struct TSNamespaceExportDeclaration<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct TSInstantiationExpression<'a> { pub span: Span, pub expression: Expression<'a>, @@ -1592,7 +1592,7 @@ pub struct TSInstantiationExpression<'a> { /// See [TypeScript - Type-Only Imports and Exports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum ImportOrExportKind { /// `import { foo } from './foo'`; Value = 0, @@ -1605,7 +1605,7 @@ pub enum ImportOrExportKind { /// `type foo = ty?` or `type foo = ?ty` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSDocNullableType<'a> { pub span: Span, pub type_annotation: TSType<'a>, @@ -1616,7 +1616,7 @@ pub struct JSDocNullableType<'a> { /// `type foo = ty!` or `type foo = !ty` #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSDocNonNullableType<'a> { pub span: Span, pub type_annotation: TSType<'a>, @@ -1625,7 +1625,7 @@ pub struct JSDocNonNullableType<'a> { #[ast(visit)] #[derive(Debug)] -#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)] pub struct JSDocUnknownType { pub span: Span, } diff --git a/crates/oxc_ast/src/ast_builder_impl.rs b/crates/oxc_ast/src/ast_builder_impl.rs index 44ec41e8519be..b77ca269efa08 100644 --- a/crates/oxc_ast/src/ast_builder_impl.rs +++ b/crates/oxc_ast/src/ast_builder_impl.rs @@ -1,8 +1,8 @@ #![warn(missing_docs)] -use std::{borrow::Cow, mem}; +use std::borrow::Cow; -use oxc_allocator::{Allocator, Box, FromIn, IntoIn, String, Vec}; +use oxc_allocator::{Allocator, Box, FromIn, IntoIn, String, TakeIn, Vec}; use oxc_span::{Atom, SPAN, Span}; use oxc_syntax::{number::NumberBase, operator::UnaryOperator, scope::ScopeId}; @@ -101,121 +101,82 @@ impl<'a> AstBuilder<'a> { } } - /// Moves the expression out by replacing it with an [`Expression::NullLiteral`]. + /// Replace [`Expression`] with a dummy node, and return the original. #[inline] pub fn move_expression(self, expr: &mut Expression<'a>) -> Expression<'a> { - let null_expr = self.expression_null_literal(SPAN); - mem::replace(expr, null_expr) + expr.take_in(self.allocator) } - /// Moves the statement out by replacing it with a [`Statement::EmptyStatement`]. + /// Replace [`Statement`] with a dummy node, and return the original. #[inline] pub fn move_statement(self, stmt: &mut Statement<'a>) -> Statement<'a> { - let empty_stmt = self.empty_statement(SPAN); - mem::replace(stmt, Statement::EmptyStatement(self.alloc(empty_stmt))) + stmt.take_in(self.allocator) } - /// Moves the assignment target out by replacing it with a dummy - /// [`AssignmentTarget::AssignmentTargetIdentifier`] with no name and an empty [`Span`]. + /// Replace [`AssignmentTarget`] with a dummy node, and return the original. #[inline] pub fn move_assignment_target(self, target: &mut AssignmentTarget<'a>) -> AssignmentTarget<'a> { - let dummy = - self.simple_assignment_target_assignment_target_identifier(SPAN, Atom::from("")); - mem::replace(target, dummy.into()) + target.take_in(self.allocator) } - /// Moves the property key out by replacing it with a [`PropertyKey::NullLiteral`]. + /// Replace [`PropertyKey`] with a dummy node, and return the original. + #[inline] pub fn move_property_key(self, key: &mut PropertyKey<'a>) -> PropertyKey<'a> { - let null_expr = PropertyKey::from(self.expression_null_literal(SPAN)); - mem::replace(key, null_expr) + key.take_in(self.allocator) } - /// Move a declaration out by replacing it with an empty [`Declaration::VariableDeclaration`]. + /// Replace [`Declaration`] with a dummy node, and return the original. #[inline] pub fn move_declaration(self, decl: &mut Declaration<'a>) -> Declaration<'a> { - let empty_decl = - self.declaration_variable(SPAN, VariableDeclarationKind::Var, self.vec(), false); - mem::replace(decl, empty_decl) + decl.take_in(self.allocator) } - /// Move a variable declaration out by replacing it with an empty [`VariableDeclaration`]. + /// Replace [`VariableDeclaration`] with a dummy node, and return the original. #[inline] pub fn move_variable_declaration( self, decl: &mut VariableDeclaration<'a>, ) -> VariableDeclaration<'a> { - let empty_decl = - self.variable_declaration(SPAN, VariableDeclarationKind::Var, self.vec(), false); - mem::replace(decl, empty_decl) + decl.take_in(self.allocator) } - /// Move a formal parameters out by replacing it with an empty [`FormalParameters`]. + /// Replace [`FormalParameters`] with a dummy node, and return the original. #[inline] pub fn move_formal_parameters(self, params: &mut FormalParameters<'a>) -> FormalParameters<'a> { - let empty_params = self.formal_parameters(SPAN, params.kind, self.vec(), NONE); - mem::replace(params, empty_params) + params.take_in(self.allocator) } - /// Move a function body out by replacing it with an empty [`FunctionBody`]. + /// Replace [`FunctionBody`] with a dummy node, and return the original. #[inline] pub fn move_function_body(self, body: &mut FunctionBody<'a>) -> FunctionBody<'a> { - let empty_body = self.function_body(SPAN, self.vec(), self.vec()); - mem::replace(body, empty_body) + body.take_in(self.allocator) } - /// Move a function out by replacing it with an empty [`Function`]. + /// Replace [`Function`] with a dummy node, and return the original. #[inline] pub fn move_function(self, function: &mut Function<'a>) -> Function<'a> { - let params = - self.formal_parameters(SPAN, FormalParameterKind::FormalParameter, self.vec(), NONE); - let empty_function = self.function( - SPAN, - FunctionType::FunctionDeclaration, - None, - false, - false, - false, - NONE, - NONE, - params, - NONE, - NONE, - ); - mem::replace(function, empty_function) + function.take_in(self.allocator) } - /// Move a class out by replacing it with an empty [`Class`]. + /// Replace [`Class`] with a dummy node, and return the original. + #[inline] pub fn move_class(self, class: &mut Class<'a>) -> Class<'a> { - let empty_class = self.class( - SPAN, - ClassType::ClassDeclaration, - self.vec(), - None, - NONE, - None, - NONE, - None, - self.class_body(SPAN, self.vec()), - false, - false, - ); - mem::replace(class, empty_class) + class.take_in(self.allocator) } - /// Move an array element out by replacing it with an [`ArrayExpressionElement::Elision`]. + /// Replace [`ArrayExpressionElement`] with a dummy node, and return the original. + #[inline] pub fn move_array_expression_element( self, element: &mut ArrayExpressionElement<'a>, ) -> ArrayExpressionElement<'a> { - let elision = self.array_expression_element_elision(SPAN); - mem::replace(element, elision) + element.take_in(self.allocator) } - /// Take the contents of a arena-allocated [`Vec`], leaving an empty [`Vec`] in its place. - /// This is akin to [`std::mem::take`]. + /// Replace [`Vec`] with an empty [`Vec`], and return the original. #[inline] pub fn move_vec(self, vec: &mut Vec<'a, T>) -> Vec<'a, T> { - mem::replace(vec, self.vec()) + vec.take_in(self.allocator) } /* ---------- Constructors ---------- */ diff --git a/crates/oxc_ast/src/ast_impl/literal.rs b/crates/oxc_ast/src/ast_impl/literal.rs index 2753f35d2900b..69c7535feebf4 100644 --- a/crates/oxc_ast/src/ast_impl/literal.rs +++ b/crates/oxc_ast/src/ast_impl/literal.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, fmt}; -use oxc_allocator::CloneIn; +use oxc_allocator::{Allocator, CloneIn, Dummy}; use oxc_data_structures::inline_string::InlineString; use oxc_regular_expression::ast::Pattern; use oxc_span::ContentEq; @@ -213,11 +213,22 @@ impl ContentEq for RegExpFlags { impl<'alloc> CloneIn<'alloc> for RegExpFlags { type Cloned = Self; - fn clone_in(&self, _: &'alloc oxc_allocator::Allocator) -> Self::Cloned { + fn clone_in(&self, _: &'alloc Allocator) -> Self::Cloned { *self } } +impl<'a> Dummy<'a> for RegExpFlags { + /// Create a dummy [`RegExpFlags`]. + /// + /// Does not allocate any data into arena. + #[expect(clippy::inline_always)] + #[inline(always)] + fn dummy(_: &'a Allocator) -> Self { + RegExpFlags::empty() + } +} + impl TryFrom for RegExpFlags { type Error = char; diff --git a/crates/oxc_ast/src/generated/derive_dummy.rs b/crates/oxc_ast/src/generated/derive_dummy.rs new file mode 100644 index 0000000000000..b113c775cb348 --- /dev/null +++ b/crates/oxc_ast/src/generated/derive_dummy.rs @@ -0,0 +1,2861 @@ +// Auto-generated code, DO NOT EDIT DIRECTLY! +// To edit this generated file you have to edit `tasks/ast_tools/src/derives/dummy.rs` + +#![allow(unused_variables, clippy::inline_always)] + +use oxc_allocator::{Allocator, Dummy}; + +use crate::ast::js::*; +use crate::ast::jsx::*; +use crate::ast::literal::*; +use crate::ast::ts::*; + +impl<'a> Dummy<'a> for Program<'a> { + /// Create a dummy [`Program`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + source_type: Dummy::dummy(allocator), + source_text: Dummy::dummy(allocator), + comments: Dummy::dummy(allocator), + hashbang: Dummy::dummy(allocator), + directives: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for Expression<'a> { + /// Create a dummy [`Expression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::NullLiteral(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for IdentifierName<'a> { + /// Create a dummy [`IdentifierName`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), name: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for IdentifierReference<'a> { + /// Create a dummy [`IdentifierReference`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + name: Dummy::dummy(allocator), + reference_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for BindingIdentifier<'a> { + /// Create a dummy [`BindingIdentifier`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + name: Dummy::dummy(allocator), + symbol_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for LabelIdentifier<'a> { + /// Create a dummy [`LabelIdentifier`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), name: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for ThisExpression { + /// Create a dummy [`ThisExpression`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for ArrayExpression<'a> { + /// Create a dummy [`ArrayExpression`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + elements: Dummy::dummy(allocator), + trailing_comma: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ArrayExpressionElement<'a> { + /// Create a dummy [`ArrayExpressionElement`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self::Elision(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for Elision { + /// Create a dummy [`Elision`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for ObjectExpression<'a> { + /// Create a dummy [`ObjectExpression`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + properties: Dummy::dummy(allocator), + trailing_comma: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ObjectPropertyKind<'a> { + /// Create a dummy [`ObjectPropertyKind`]. + /// + /// Has cost of making 2 allocations (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::SpreadProperty(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for ObjectProperty<'a> { + /// Create a dummy [`ObjectProperty`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + kind: Dummy::dummy(allocator), + key: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + method: Dummy::dummy(allocator), + shorthand: Dummy::dummy(allocator), + computed: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for PropertyKey<'a> { + /// Create a dummy [`PropertyKey`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::NullLiteral(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for PropertyKind { + /// Create a dummy [`PropertyKind`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Init + } +} + +impl<'a> Dummy<'a> for TemplateLiteral<'a> { + /// Create a dummy [`TemplateLiteral`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + quasis: Dummy::dummy(allocator), + expressions: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TaggedTemplateExpression<'a> { + /// Create a dummy [`TaggedTemplateExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + tag: Dummy::dummy(allocator), + quasi: Dummy::dummy(allocator), + type_arguments: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TemplateElement<'a> { + /// Create a dummy [`TemplateElement`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + tail: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TemplateElementValue<'a> { + /// Create a dummy [`TemplateElementValue`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { raw: Dummy::dummy(allocator), cooked: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for MemberExpression<'a> { + /// Create a dummy [`MemberExpression`]. + /// + /// Has cost of making 2 allocations (64 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::StaticMemberExpression(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for ComputedMemberExpression<'a> { + /// Create a dummy [`ComputedMemberExpression`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + object: Dummy::dummy(allocator), + expression: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for StaticMemberExpression<'a> { + /// Create a dummy [`StaticMemberExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + object: Dummy::dummy(allocator), + property: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for PrivateFieldExpression<'a> { + /// Create a dummy [`PrivateFieldExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + object: Dummy::dummy(allocator), + field: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for CallExpression<'a> { + /// Create a dummy [`CallExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + callee: Dummy::dummy(allocator), + type_arguments: Dummy::dummy(allocator), + arguments: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + pure: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for NewExpression<'a> { + /// Create a dummy [`NewExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + callee: Dummy::dummy(allocator), + arguments: Dummy::dummy(allocator), + type_arguments: Dummy::dummy(allocator), + pure: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for MetaProperty<'a> { + /// Create a dummy [`MetaProperty`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + meta: Dummy::dummy(allocator), + property: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for SpreadElement<'a> { + /// Create a dummy [`SpreadElement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), argument: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for Argument<'a> { + /// Create a dummy [`Argument`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::NullLiteral(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for UpdateExpression<'a> { + /// Create a dummy [`UpdateExpression`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + operator: Dummy::dummy(allocator), + prefix: Dummy::dummy(allocator), + argument: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for UnaryExpression<'a> { + /// Create a dummy [`UnaryExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + operator: Dummy::dummy(allocator), + argument: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for BinaryExpression<'a> { + /// Create a dummy [`BinaryExpression`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + left: Dummy::dummy(allocator), + operator: Dummy::dummy(allocator), + right: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for PrivateInExpression<'a> { + /// Create a dummy [`PrivateInExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + left: Dummy::dummy(allocator), + right: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for LogicalExpression<'a> { + /// Create a dummy [`LogicalExpression`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + left: Dummy::dummy(allocator), + operator: Dummy::dummy(allocator), + right: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ConditionalExpression<'a> { + /// Create a dummy [`ConditionalExpression`]. + /// + /// Has cost of making 3 allocations (24 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + test: Dummy::dummy(allocator), + consequent: Dummy::dummy(allocator), + alternate: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for AssignmentExpression<'a> { + /// Create a dummy [`AssignmentExpression`]. + /// + /// Has cost of making 2 allocations (40 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + operator: Dummy::dummy(allocator), + left: Dummy::dummy(allocator), + right: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for AssignmentTarget<'a> { + /// Create a dummy [`AssignmentTarget`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::AssignmentTargetIdentifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for SimpleAssignmentTarget<'a> { + /// Create a dummy [`SimpleAssignmentTarget`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::AssignmentTargetIdentifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for AssignmentTargetPattern<'a> { + /// Create a dummy [`AssignmentTargetPattern`]. + /// + /// Has cost of making 1 allocation (64 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::ObjectAssignmentTarget(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for ArrayAssignmentTarget<'a> { + /// Create a dummy [`ArrayAssignmentTarget`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + elements: Dummy::dummy(allocator), + rest: Dummy::dummy(allocator), + trailing_comma: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ObjectAssignmentTarget<'a> { + /// Create a dummy [`ObjectAssignmentTarget`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + properties: Dummy::dummy(allocator), + rest: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for AssignmentTargetRest<'a> { + /// Create a dummy [`AssignmentTargetRest`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), target: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for AssignmentTargetMaybeDefault<'a> { + /// Create a dummy [`AssignmentTargetMaybeDefault`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::AssignmentTargetIdentifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for AssignmentTargetWithDefault<'a> { + /// Create a dummy [`AssignmentTargetWithDefault`]. + /// + /// Has cost of making 2 allocations (40 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + binding: Dummy::dummy(allocator), + init: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for AssignmentTargetProperty<'a> { + /// Create a dummy [`AssignmentTargetProperty`]. + /// + /// Has cost of making 1 allocation (56 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::AssignmentTargetPropertyIdentifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for AssignmentTargetPropertyIdentifier<'a> { + /// Create a dummy [`AssignmentTargetPropertyIdentifier`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + binding: Dummy::dummy(allocator), + init: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for AssignmentTargetPropertyProperty<'a> { + /// Create a dummy [`AssignmentTargetPropertyProperty`]. + /// + /// Has cost of making 2 allocations (40 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + name: Dummy::dummy(allocator), + binding: Dummy::dummy(allocator), + computed: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for SequenceExpression<'a> { + /// Create a dummy [`SequenceExpression`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expressions: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for Super { + /// Create a dummy [`Super`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for AwaitExpression<'a> { + /// Create a dummy [`AwaitExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), argument: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for ChainExpression<'a> { + /// Create a dummy [`ChainExpression`]. + /// + /// Has cost of making 2 allocations (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expression: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for ChainElement<'a> { + /// Create a dummy [`ChainElement`]. + /// + /// Has cost of making 2 allocations (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::TSNonNullExpression(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for ParenthesizedExpression<'a> { + /// Create a dummy [`ParenthesizedExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expression: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for Statement<'a> { + /// Create a dummy [`Statement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::DebuggerStatement(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for Directive<'a> { + /// Create a dummy [`Directive`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + expression: Dummy::dummy(allocator), + directive: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for Hashbang<'a> { + /// Create a dummy [`Hashbang`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), value: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for BlockStatement<'a> { + /// Create a dummy [`BlockStatement`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for Declaration<'a> { + /// Create a dummy [`Declaration`]. + /// + /// Has cost of making 1 allocation (56 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::VariableDeclaration(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for VariableDeclaration<'a> { + /// Create a dummy [`VariableDeclaration`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + kind: Dummy::dummy(allocator), + declarations: Dummy::dummy(allocator), + declare: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for VariableDeclarationKind { + /// Create a dummy [`VariableDeclarationKind`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Var + } +} + +impl<'a> Dummy<'a> for VariableDeclarator<'a> { + /// Create a dummy [`VariableDeclarator`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + kind: Dummy::dummy(allocator), + id: Dummy::dummy(allocator), + init: Dummy::dummy(allocator), + definite: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for EmptyStatement { + /// Create a dummy [`EmptyStatement`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for ExpressionStatement<'a> { + /// Create a dummy [`ExpressionStatement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expression: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for IfStatement<'a> { + /// Create a dummy [`IfStatement`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + test: Dummy::dummy(allocator), + consequent: Dummy::dummy(allocator), + alternate: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for DoWhileStatement<'a> { + /// Create a dummy [`DoWhileStatement`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + test: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for WhileStatement<'a> { + /// Create a dummy [`WhileStatement`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + test: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ForStatement<'a> { + /// Create a dummy [`ForStatement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + init: Dummy::dummy(allocator), + test: Dummy::dummy(allocator), + update: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ForStatementInit<'a> { + /// Create a dummy [`ForStatementInit`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::NullLiteral(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for ForInStatement<'a> { + /// Create a dummy [`ForInStatement`]. + /// + /// Has cost of making 3 allocations (48 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + left: Dummy::dummy(allocator), + right: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ForStatementLeft<'a> { + /// Create a dummy [`ForStatementLeft`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::AssignmentTargetIdentifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for ForOfStatement<'a> { + /// Create a dummy [`ForOfStatement`]. + /// + /// Has cost of making 3 allocations (48 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + r#await: Dummy::dummy(allocator), + left: Dummy::dummy(allocator), + right: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ContinueStatement<'a> { + /// Create a dummy [`ContinueStatement`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), label: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for BreakStatement<'a> { + /// Create a dummy [`BreakStatement`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), label: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for ReturnStatement<'a> { + /// Create a dummy [`ReturnStatement`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), argument: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for WithStatement<'a> { + /// Create a dummy [`WithStatement`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + object: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for SwitchStatement<'a> { + /// Create a dummy [`SwitchStatement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + discriminant: Dummy::dummy(allocator), + cases: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for SwitchCase<'a> { + /// Create a dummy [`SwitchCase`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + test: Dummy::dummy(allocator), + consequent: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for LabeledStatement<'a> { + /// Create a dummy [`LabeledStatement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + label: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ThrowStatement<'a> { + /// Create a dummy [`ThrowStatement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), argument: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TryStatement<'a> { + /// Create a dummy [`TryStatement`]. + /// + /// Has cost of making 1 allocation (48 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + block: Dummy::dummy(allocator), + handler: Dummy::dummy(allocator), + finalizer: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for CatchClause<'a> { + /// Create a dummy [`CatchClause`]. + /// + /// Has cost of making 1 allocation (48 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + param: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for CatchParameter<'a> { + /// Create a dummy [`CatchParameter`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), pattern: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for DebuggerStatement { + /// Create a dummy [`DebuggerStatement`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for BindingPattern<'a> { + /// Create a dummy [`BindingPattern`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + kind: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for BindingPatternKind<'a> { + /// Create a dummy [`BindingPatternKind`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::BindingIdentifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for AssignmentPattern<'a> { + /// Create a dummy [`AssignmentPattern`]. + /// + /// Has cost of making 2 allocations (40 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + left: Dummy::dummy(allocator), + right: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ObjectPattern<'a> { + /// Create a dummy [`ObjectPattern`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + properties: Dummy::dummy(allocator), + rest: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for BindingProperty<'a> { + /// Create a dummy [`BindingProperty`]. + /// + /// Has cost of making 2 allocations (40 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + key: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + shorthand: Dummy::dummy(allocator), + computed: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ArrayPattern<'a> { + /// Create a dummy [`ArrayPattern`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + elements: Dummy::dummy(allocator), + rest: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for BindingRestElement<'a> { + /// Create a dummy [`BindingRestElement`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), argument: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for Function<'a> { + /// Create a dummy [`Function`]. + /// + /// Has cost of making 1 allocation (56 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + r#type: Dummy::dummy(allocator), + id: Dummy::dummy(allocator), + generator: Dummy::dummy(allocator), + r#async: Dummy::dummy(allocator), + declare: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + this_param: Dummy::dummy(allocator), + params: Dummy::dummy(allocator), + return_type: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + pure: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for FunctionType { + /// Create a dummy [`FunctionType`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::FunctionDeclaration + } +} + +impl<'a> Dummy<'a> for FormalParameters<'a> { + /// Create a dummy [`FormalParameters`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + kind: Dummy::dummy(allocator), + items: Dummy::dummy(allocator), + rest: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for FormalParameter<'a> { + /// Create a dummy [`FormalParameter`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + decorators: Dummy::dummy(allocator), + pattern: Dummy::dummy(allocator), + accessibility: Dummy::dummy(allocator), + readonly: Dummy::dummy(allocator), + r#override: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for FormalParameterKind { + /// Create a dummy [`FormalParameterKind`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::FormalParameter + } +} + +impl<'a> Dummy<'a> for FunctionBody<'a> { + /// Create a dummy [`FunctionBody`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + directives: Dummy::dummy(allocator), + statements: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ArrowFunctionExpression<'a> { + /// Create a dummy [`ArrowFunctionExpression`]. + /// + /// Has cost of making 2 allocations (128 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + expression: Dummy::dummy(allocator), + r#async: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + params: Dummy::dummy(allocator), + return_type: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + pure: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for YieldExpression<'a> { + /// Create a dummy [`YieldExpression`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + delegate: Dummy::dummy(allocator), + argument: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for Class<'a> { + /// Create a dummy [`Class`]. + /// + /// Has cost of making 1 allocation (40 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + r#type: Dummy::dummy(allocator), + decorators: Dummy::dummy(allocator), + id: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + super_class: Dummy::dummy(allocator), + super_type_arguments: Dummy::dummy(allocator), + implements: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + r#abstract: Dummy::dummy(allocator), + declare: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ClassType { + /// Create a dummy [`ClassType`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::ClassDeclaration + } +} + +impl<'a> Dummy<'a> for ClassBody<'a> { + /// Create a dummy [`ClassBody`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), body: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for ClassElement<'a> { + /// Create a dummy [`ClassElement`]. + /// + /// Has cost of making 1 allocation (48 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::StaticBlock(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for MethodDefinition<'a> { + /// Create a dummy [`MethodDefinition`]. + /// + /// Has cost of making 3 allocations (168 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + r#type: Dummy::dummy(allocator), + decorators: Dummy::dummy(allocator), + key: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + kind: Dummy::dummy(allocator), + computed: Dummy::dummy(allocator), + r#static: Dummy::dummy(allocator), + r#override: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + accessibility: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for MethodDefinitionType { + /// Create a dummy [`MethodDefinitionType`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::MethodDefinition + } +} + +impl<'a> Dummy<'a> for PropertyDefinition<'a> { + /// Create a dummy [`PropertyDefinition`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + r#type: Dummy::dummy(allocator), + decorators: Dummy::dummy(allocator), + key: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + computed: Dummy::dummy(allocator), + r#static: Dummy::dummy(allocator), + declare: Dummy::dummy(allocator), + r#override: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + definite: Dummy::dummy(allocator), + readonly: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + accessibility: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for PropertyDefinitionType { + /// Create a dummy [`PropertyDefinitionType`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::PropertyDefinition + } +} + +impl<'a> Dummy<'a> for MethodDefinitionKind { + /// Create a dummy [`MethodDefinitionKind`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Constructor + } +} + +impl<'a> Dummy<'a> for PrivateIdentifier<'a> { + /// Create a dummy [`PrivateIdentifier`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), name: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for StaticBlock<'a> { + /// Create a dummy [`StaticBlock`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ModuleDeclaration<'a> { + /// Create a dummy [`ModuleDeclaration`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::TSNamespaceExportDeclaration(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for AccessorPropertyType { + /// Create a dummy [`AccessorPropertyType`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::AccessorProperty + } +} + +impl<'a> Dummy<'a> for AccessorProperty<'a> { + /// Create a dummy [`AccessorProperty`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + r#type: Dummy::dummy(allocator), + decorators: Dummy::dummy(allocator), + key: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + computed: Dummy::dummy(allocator), + r#static: Dummy::dummy(allocator), + definite: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + accessibility: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ImportExpression<'a> { + /// Create a dummy [`ImportExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + source: Dummy::dummy(allocator), + options: Dummy::dummy(allocator), + phase: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ImportDeclaration<'a> { + /// Create a dummy [`ImportDeclaration`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + specifiers: Dummy::dummy(allocator), + source: Dummy::dummy(allocator), + phase: Dummy::dummy(allocator), + with_clause: Dummy::dummy(allocator), + import_kind: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ImportPhase { + /// Create a dummy [`ImportPhase`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Source + } +} + +impl<'a> Dummy<'a> for ImportDeclarationSpecifier<'a> { + /// Create a dummy [`ImportDeclarationSpecifier`]. + /// + /// Has cost of making 1 allocation (40 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::ImportDefaultSpecifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for ImportSpecifier<'a> { + /// Create a dummy [`ImportSpecifier`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + imported: Dummy::dummy(allocator), + local: Dummy::dummy(allocator), + import_kind: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ImportDefaultSpecifier<'a> { + /// Create a dummy [`ImportDefaultSpecifier`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), local: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for ImportNamespaceSpecifier<'a> { + /// Create a dummy [`ImportNamespaceSpecifier`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), local: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for WithClause<'a> { + /// Create a dummy [`WithClause`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + attributes_keyword: Dummy::dummy(allocator), + with_entries: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ImportAttribute<'a> { + /// Create a dummy [`ImportAttribute`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + key: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ImportAttributeKey<'a> { + /// Create a dummy [`ImportAttributeKey`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self::Identifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for ExportNamedDeclaration<'a> { + /// Create a dummy [`ExportNamedDeclaration`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + declaration: Dummy::dummy(allocator), + specifiers: Dummy::dummy(allocator), + source: Dummy::dummy(allocator), + export_kind: Dummy::dummy(allocator), + with_clause: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ExportDefaultDeclaration<'a> { + /// Create a dummy [`ExportDefaultDeclaration`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + exported: Dummy::dummy(allocator), + declaration: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ExportAllDeclaration<'a> { + /// Create a dummy [`ExportAllDeclaration`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + exported: Dummy::dummy(allocator), + source: Dummy::dummy(allocator), + with_clause: Dummy::dummy(allocator), + export_kind: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ExportSpecifier<'a> { + /// Create a dummy [`ExportSpecifier`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + local: Dummy::dummy(allocator), + exported: Dummy::dummy(allocator), + export_kind: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ExportDefaultDeclarationKind<'a> { + /// Create a dummy [`ExportDefaultDeclarationKind`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::NullLiteral(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for ModuleExportName<'a> { + /// Create a dummy [`ModuleExportName`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self::IdentifierName(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for V8IntrinsicExpression<'a> { + /// Create a dummy [`V8IntrinsicExpression`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + name: Dummy::dummy(allocator), + arguments: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for BooleanLiteral { + /// Create a dummy [`BooleanLiteral`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), value: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for NullLiteral { + /// Create a dummy [`NullLiteral`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for NumericLiteral<'a> { + /// Create a dummy [`NumericLiteral`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + raw: Dummy::dummy(allocator), + base: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for StringLiteral<'a> { + /// Create a dummy [`StringLiteral`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + raw: Dummy::dummy(allocator), + lossy: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for BigIntLiteral<'a> { + /// Create a dummy [`BigIntLiteral`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + raw: Dummy::dummy(allocator), + base: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for RegExpLiteral<'a> { + /// Create a dummy [`RegExpLiteral`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + regex: Dummy::dummy(allocator), + raw: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for RegExp<'a> { + /// Create a dummy [`RegExp`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { pattern: Dummy::dummy(allocator), flags: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for RegExpPattern<'a> { + /// Create a dummy [`RegExpPattern`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self::Raw(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for JSXElement<'a> { + /// Create a dummy [`JSXElement`]. + /// + /// Has cost of making 2 allocations (80 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + opening_element: Dummy::dummy(allocator), + closing_element: Dummy::dummy(allocator), + children: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for JSXOpeningElement<'a> { + /// Create a dummy [`JSXOpeningElement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + self_closing: Dummy::dummy(allocator), + name: Dummy::dummy(allocator), + attributes: Dummy::dummy(allocator), + type_arguments: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for JSXClosingElement<'a> { + /// Create a dummy [`JSXClosingElement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), name: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for JSXFragment<'a> { + /// Create a dummy [`JSXFragment`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + opening_fragment: Dummy::dummy(allocator), + closing_fragment: Dummy::dummy(allocator), + children: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for JSXOpeningFragment { + /// Create a dummy [`JSXOpeningFragment`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for JSXClosingFragment { + /// Create a dummy [`JSXClosingFragment`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for JSXElementName<'a> { + /// Create a dummy [`JSXElementName`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::ThisExpression(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for JSXNamespacedName<'a> { + /// Create a dummy [`JSXNamespacedName`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + namespace: Dummy::dummy(allocator), + name: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for JSXMemberExpression<'a> { + /// Create a dummy [`JSXMemberExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + object: Dummy::dummy(allocator), + property: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for JSXMemberExpressionObject<'a> { + /// Create a dummy [`JSXMemberExpressionObject`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::ThisExpression(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for JSXExpressionContainer<'a> { + /// Create a dummy [`JSXExpressionContainer`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expression: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for JSXExpression<'a> { + /// Create a dummy [`JSXExpression`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self::EmptyExpression(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for JSXEmptyExpression { + /// Create a dummy [`JSXEmptyExpression`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for JSXAttributeItem<'a> { + /// Create a dummy [`JSXAttributeItem`]. + /// + /// Has cost of making 2 allocations (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::SpreadAttribute(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for JSXAttribute<'a> { + /// Create a dummy [`JSXAttribute`]. + /// + /// Has cost of making 1 allocation (24 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + name: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for JSXSpreadAttribute<'a> { + /// Create a dummy [`JSXSpreadAttribute`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), argument: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for JSXAttributeName<'a> { + /// Create a dummy [`JSXAttributeName`]. + /// + /// Has cost of making 1 allocation (24 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::Identifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for JSXAttributeValue<'a> { + /// Create a dummy [`JSXAttributeValue`]. + /// + /// Has cost of making 1 allocation (24 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::ExpressionContainer(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for JSXIdentifier<'a> { + /// Create a dummy [`JSXIdentifier`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), name: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for JSXChild<'a> { + /// Create a dummy [`JSXChild`]. + /// + /// Has cost of making 1 allocation (24 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::ExpressionContainer(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for JSXSpreadChild<'a> { + /// Create a dummy [`JSXSpreadChild`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expression: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for JSXText<'a> { + /// Create a dummy [`JSXText`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + value: Dummy::dummy(allocator), + raw: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSThisParameter<'a> { + /// Create a dummy [`TSThisParameter`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + this_span: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSEnumDeclaration<'a> { + /// Create a dummy [`TSEnumDeclaration`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + id: Dummy::dummy(allocator), + members: Dummy::dummy(allocator), + r#const: Dummy::dummy(allocator), + declare: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSEnumMember<'a> { + /// Create a dummy [`TSEnumMember`]. + /// + /// Has cost of making 1 allocation (24 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + id: Dummy::dummy(allocator), + initializer: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSEnumMemberName<'a> { + /// Create a dummy [`TSEnumMemberName`]. + /// + /// Has cost of making 1 allocation (24 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::Identifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSTypeAnnotation<'a> { + /// Create a dummy [`TSTypeAnnotation`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), type_annotation: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSLiteralType<'a> { + /// Create a dummy [`TSLiteralType`]. + /// + /// Has cost of making 1 allocation (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), literal: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSLiteral<'a> { + /// Create a dummy [`TSLiteral`]. + /// + /// Has cost of making 1 allocation (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::BooleanLiteral(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSType<'a> { + /// Create a dummy [`TSType`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::TSAnyKeyword(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSConditionalType<'a> { + /// Create a dummy [`TSConditionalType`]. + /// + /// Has cost of making 4 allocations (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + check_type: Dummy::dummy(allocator), + extends_type: Dummy::dummy(allocator), + true_type: Dummy::dummy(allocator), + false_type: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSUnionType<'a> { + /// Create a dummy [`TSUnionType`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), types: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSIntersectionType<'a> { + /// Create a dummy [`TSIntersectionType`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), types: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSParenthesizedType<'a> { + /// Create a dummy [`TSParenthesizedType`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), type_annotation: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSTypeOperator<'a> { + /// Create a dummy [`TSTypeOperator`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + operator: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTypeOperatorOperator { + /// Create a dummy [`TSTypeOperatorOperator`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Keyof + } +} + +impl<'a> Dummy<'a> for TSArrayType<'a> { + /// Create a dummy [`TSArrayType`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), element_type: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSIndexedAccessType<'a> { + /// Create a dummy [`TSIndexedAccessType`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + object_type: Dummy::dummy(allocator), + index_type: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTupleType<'a> { + /// Create a dummy [`TSTupleType`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), element_types: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSNamedTupleMember<'a> { + /// Create a dummy [`TSNamedTupleMember`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + element_type: Dummy::dummy(allocator), + label: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSOptionalType<'a> { + /// Create a dummy [`TSOptionalType`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), type_annotation: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSRestType<'a> { + /// Create a dummy [`TSRestType`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), type_annotation: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSTupleElement<'a> { + /// Create a dummy [`TSTupleElement`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::TSAnyKeyword(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSAnyKeyword { + /// Create a dummy [`TSAnyKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSStringKeyword { + /// Create a dummy [`TSStringKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSBooleanKeyword { + /// Create a dummy [`TSBooleanKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSNumberKeyword { + /// Create a dummy [`TSNumberKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSNeverKeyword { + /// Create a dummy [`TSNeverKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSIntrinsicKeyword { + /// Create a dummy [`TSIntrinsicKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSUnknownKeyword { + /// Create a dummy [`TSUnknownKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSNullKeyword { + /// Create a dummy [`TSNullKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSUndefinedKeyword { + /// Create a dummy [`TSUndefinedKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSVoidKeyword { + /// Create a dummy [`TSVoidKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSSymbolKeyword { + /// Create a dummy [`TSSymbolKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSThisType { + /// Create a dummy [`TSThisType`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSObjectKeyword { + /// Create a dummy [`TSObjectKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSBigIntKeyword { + /// Create a dummy [`TSBigIntKeyword`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSTypeReference<'a> { + /// Create a dummy [`TSTypeReference`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + type_name: Dummy::dummy(allocator), + type_arguments: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTypeName<'a> { + /// Create a dummy [`TSTypeName`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::IdentifierReference(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSQualifiedName<'a> { + /// Create a dummy [`TSQualifiedName`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + left: Dummy::dummy(allocator), + right: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTypeParameterInstantiation<'a> { + /// Create a dummy [`TSTypeParameterInstantiation`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), params: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSTypeParameter<'a> { + /// Create a dummy [`TSTypeParameter`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + name: Dummy::dummy(allocator), + constraint: Dummy::dummy(allocator), + default: Dummy::dummy(allocator), + r#in: Dummy::dummy(allocator), + out: Dummy::dummy(allocator), + r#const: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTypeParameterDeclaration<'a> { + /// Create a dummy [`TSTypeParameterDeclaration`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), params: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSTypeAliasDeclaration<'a> { + /// Create a dummy [`TSTypeAliasDeclaration`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + id: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + declare: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSAccessibility { + /// Create a dummy [`TSAccessibility`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Private + } +} + +impl<'a> Dummy<'a> for TSClassImplements<'a> { + /// Create a dummy [`TSClassImplements`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + expression: Dummy::dummy(allocator), + type_arguments: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSInterfaceDeclaration<'a> { + /// Create a dummy [`TSInterfaceDeclaration`]. + /// + /// Has cost of making 1 allocation (40 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + id: Dummy::dummy(allocator), + extends: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + declare: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSInterfaceBody<'a> { + /// Create a dummy [`TSInterfaceBody`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), body: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSPropertySignature<'a> { + /// Create a dummy [`TSPropertySignature`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + computed: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + readonly: Dummy::dummy(allocator), + key: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSSignature<'a> { + /// Create a dummy [`TSSignature`]. + /// + /// Has cost of making 2 allocations (48 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::TSPropertySignature(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSIndexSignature<'a> { + /// Create a dummy [`TSIndexSignature`]. + /// + /// Has cost of making 2 allocations (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + parameters: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + readonly: Dummy::dummy(allocator), + r#static: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSCallSignatureDeclaration<'a> { + /// Create a dummy [`TSCallSignatureDeclaration`]. + /// + /// Has cost of making 1 allocation (56 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + this_param: Dummy::dummy(allocator), + params: Dummy::dummy(allocator), + return_type: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSMethodSignatureKind { + /// Create a dummy [`TSMethodSignatureKind`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Method + } +} + +impl<'a> Dummy<'a> for TSMethodSignature<'a> { + /// Create a dummy [`TSMethodSignature`]. + /// + /// Has cost of making 2 allocations (64 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + key: Dummy::dummy(allocator), + computed: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + kind: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + this_param: Dummy::dummy(allocator), + params: Dummy::dummy(allocator), + return_type: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSConstructSignatureDeclaration<'a> { + /// Create a dummy [`TSConstructSignatureDeclaration`]. + /// + /// Has cost of making 1 allocation (56 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + params: Dummy::dummy(allocator), + return_type: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSIndexSignatureName<'a> { + /// Create a dummy [`TSIndexSignatureName`]. + /// + /// Has cost of making 2 allocations (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + name: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSInterfaceHeritage<'a> { + /// Create a dummy [`TSInterfaceHeritage`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + expression: Dummy::dummy(allocator), + type_arguments: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTypePredicate<'a> { + /// Create a dummy [`TSTypePredicate`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + parameter_name: Dummy::dummy(allocator), + asserts: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTypePredicateName<'a> { + /// Create a dummy [`TSTypePredicateName`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self::This(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSModuleDeclaration<'a> { + /// Create a dummy [`TSModuleDeclaration`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + id: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + kind: Dummy::dummy(allocator), + declare: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSModuleDeclarationKind { + /// Create a dummy [`TSModuleDeclarationKind`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Global + } +} + +impl<'a> Dummy<'a> for TSModuleDeclarationName<'a> { + /// Create a dummy [`TSModuleDeclarationName`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self::Identifier(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSModuleDeclarationBody<'a> { + /// Create a dummy [`TSModuleDeclarationBody`]. + /// + /// Has cost of making 1 allocation (72 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::TSModuleBlock(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSModuleBlock<'a> { + /// Create a dummy [`TSModuleBlock`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + directives: Dummy::dummy(allocator), + body: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTypeLiteral<'a> { + /// Create a dummy [`TSTypeLiteral`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), members: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSInferType<'a> { + /// Create a dummy [`TSInferType`]. + /// + /// Has cost of making 1 allocation (80 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), type_parameter: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSTypeQuery<'a> { + /// Create a dummy [`TSTypeQuery`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + expr_name: Dummy::dummy(allocator), + type_arguments: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTypeQueryExprName<'a> { + /// Create a dummy [`TSTypeQueryExprName`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::IdentifierReference(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSImportType<'a> { + /// Create a dummy [`TSImportType`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + argument: Dummy::dummy(allocator), + options: Dummy::dummy(allocator), + qualifier: Dummy::dummy(allocator), + type_arguments: Dummy::dummy(allocator), + is_type_of: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSFunctionType<'a> { + /// Create a dummy [`TSFunctionType`]. + /// + /// Has cost of making 3 allocations (88 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + this_param: Dummy::dummy(allocator), + params: Dummy::dummy(allocator), + return_type: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSConstructorType<'a> { + /// Create a dummy [`TSConstructorType`]. + /// + /// Has cost of making 3 allocations (88 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + r#abstract: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + params: Dummy::dummy(allocator), + return_type: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSMappedType<'a> { + /// Create a dummy [`TSMappedType`]. + /// + /// Has cost of making 1 allocation (80 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + type_parameter: Dummy::dummy(allocator), + name_type: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + optional: Dummy::dummy(allocator), + readonly: Dummy::dummy(allocator), + scope_id: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSMappedTypeModifierOperator { + /// Create a dummy [`TSMappedTypeModifierOperator`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::True + } +} + +impl<'a> Dummy<'a> for TSTemplateLiteralType<'a> { + /// Create a dummy [`TSTemplateLiteralType`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + quasis: Dummy::dummy(allocator), + types: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSAsExpression<'a> { + /// Create a dummy [`TSAsExpression`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + expression: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSSatisfiesExpression<'a> { + /// Create a dummy [`TSSatisfiesExpression`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + expression: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSTypeAssertion<'a> { + /// Create a dummy [`TSTypeAssertion`]. + /// + /// Has cost of making 2 allocations (16 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + expression: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSImportEqualsDeclaration<'a> { + /// Create a dummy [`TSImportEqualsDeclaration`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + id: Dummy::dummy(allocator), + module_reference: Dummy::dummy(allocator), + import_kind: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for TSModuleReference<'a> { + /// Create a dummy [`TSModuleReference`]. + /// + /// Has cost of making 1 allocation (32 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self::IdentifierReference(Dummy::dummy(allocator)) + } +} + +impl<'a> Dummy<'a> for TSExternalModuleReference<'a> { + /// Create a dummy [`TSExternalModuleReference`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expression: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSNonNullExpression<'a> { + /// Create a dummy [`TSNonNullExpression`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expression: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for Decorator<'a> { + /// Create a dummy [`Decorator`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expression: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSExportAssignment<'a> { + /// Create a dummy [`TSExportAssignment`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), expression: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSNamespaceExportDeclaration<'a> { + /// Create a dummy [`TSNamespaceExportDeclaration`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator), id: Dummy::dummy(allocator) } + } +} + +impl<'a> Dummy<'a> for TSInstantiationExpression<'a> { + /// Create a dummy [`TSInstantiationExpression`]. + /// + /// Has cost of making 2 allocations (48 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + expression: Dummy::dummy(allocator), + type_parameters: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for ImportOrExportKind { + /// Create a dummy [`ImportOrExportKind`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Value + } +} + +impl<'a> Dummy<'a> for JSDocNullableType<'a> { + /// Create a dummy [`JSDocNullableType`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + postfix: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for JSDocNonNullableType<'a> { + /// Create a dummy [`JSDocNonNullableType`]. + /// + /// Has cost of making 1 allocation (8 bytes). + fn dummy(allocator: &'a Allocator) -> Self { + Self { + span: Dummy::dummy(allocator), + type_annotation: Dummy::dummy(allocator), + postfix: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for JSDocUnknownType { + /// Create a dummy [`JSDocUnknownType`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { span: Dummy::dummy(allocator) } + } +} diff --git a/crates/oxc_ast/src/generated/derive_take_in.rs b/crates/oxc_ast/src/generated/derive_take_in.rs new file mode 100644 index 0000000000000..1080a18ffcdc6 --- /dev/null +++ b/crates/oxc_ast/src/generated/derive_take_in.rs @@ -0,0 +1,469 @@ +// Auto-generated code, DO NOT EDIT DIRECTLY! +// To edit this generated file you have to edit `tasks/ast_tools/src/derives/take_in.rs` + +#![allow(clippy::needless_lifetimes)] + +use oxc_allocator::TakeIn; + +use crate::ast::js::*; +use crate::ast::jsx::*; +use crate::ast::literal::*; +use crate::ast::ts::*; + +impl<'a> TakeIn<'a> for Program<'a> {} + +impl<'a> TakeIn<'a> for Expression<'a> {} + +impl<'a> TakeIn<'a> for IdentifierName<'a> {} + +impl<'a> TakeIn<'a> for IdentifierReference<'a> {} + +impl<'a> TakeIn<'a> for BindingIdentifier<'a> {} + +impl<'a> TakeIn<'a> for LabelIdentifier<'a> {} + +impl<'a> TakeIn<'a> for ThisExpression {} + +impl<'a> TakeIn<'a> for ArrayExpression<'a> {} + +impl<'a> TakeIn<'a> for ArrayExpressionElement<'a> {} + +impl<'a> TakeIn<'a> for Elision {} + +impl<'a> TakeIn<'a> for ObjectExpression<'a> {} + +impl<'a> TakeIn<'a> for ObjectPropertyKind<'a> {} + +impl<'a> TakeIn<'a> for ObjectProperty<'a> {} + +impl<'a> TakeIn<'a> for PropertyKey<'a> {} + +impl<'a> TakeIn<'a> for TemplateLiteral<'a> {} + +impl<'a> TakeIn<'a> for TaggedTemplateExpression<'a> {} + +impl<'a> TakeIn<'a> for TemplateElement<'a> {} + +impl<'a> TakeIn<'a> for TemplateElementValue<'a> {} + +impl<'a> TakeIn<'a> for MemberExpression<'a> {} + +impl<'a> TakeIn<'a> for ComputedMemberExpression<'a> {} + +impl<'a> TakeIn<'a> for StaticMemberExpression<'a> {} + +impl<'a> TakeIn<'a> for PrivateFieldExpression<'a> {} + +impl<'a> TakeIn<'a> for CallExpression<'a> {} + +impl<'a> TakeIn<'a> for NewExpression<'a> {} + +impl<'a> TakeIn<'a> for MetaProperty<'a> {} + +impl<'a> TakeIn<'a> for SpreadElement<'a> {} + +impl<'a> TakeIn<'a> for Argument<'a> {} + +impl<'a> TakeIn<'a> for UpdateExpression<'a> {} + +impl<'a> TakeIn<'a> for UnaryExpression<'a> {} + +impl<'a> TakeIn<'a> for BinaryExpression<'a> {} + +impl<'a> TakeIn<'a> for PrivateInExpression<'a> {} + +impl<'a> TakeIn<'a> for LogicalExpression<'a> {} + +impl<'a> TakeIn<'a> for ConditionalExpression<'a> {} + +impl<'a> TakeIn<'a> for AssignmentExpression<'a> {} + +impl<'a> TakeIn<'a> for AssignmentTarget<'a> {} + +impl<'a> TakeIn<'a> for SimpleAssignmentTarget<'a> {} + +impl<'a> TakeIn<'a> for AssignmentTargetPattern<'a> {} + +impl<'a> TakeIn<'a> for ArrayAssignmentTarget<'a> {} + +impl<'a> TakeIn<'a> for ObjectAssignmentTarget<'a> {} + +impl<'a> TakeIn<'a> for AssignmentTargetRest<'a> {} + +impl<'a> TakeIn<'a> for AssignmentTargetMaybeDefault<'a> {} + +impl<'a> TakeIn<'a> for AssignmentTargetWithDefault<'a> {} + +impl<'a> TakeIn<'a> for AssignmentTargetProperty<'a> {} + +impl<'a> TakeIn<'a> for AssignmentTargetPropertyIdentifier<'a> {} + +impl<'a> TakeIn<'a> for AssignmentTargetPropertyProperty<'a> {} + +impl<'a> TakeIn<'a> for SequenceExpression<'a> {} + +impl<'a> TakeIn<'a> for Super {} + +impl<'a> TakeIn<'a> for AwaitExpression<'a> {} + +impl<'a> TakeIn<'a> for ChainExpression<'a> {} + +impl<'a> TakeIn<'a> for ChainElement<'a> {} + +impl<'a> TakeIn<'a> for ParenthesizedExpression<'a> {} + +impl<'a> TakeIn<'a> for Statement<'a> {} + +impl<'a> TakeIn<'a> for Directive<'a> {} + +impl<'a> TakeIn<'a> for Hashbang<'a> {} + +impl<'a> TakeIn<'a> for BlockStatement<'a> {} + +impl<'a> TakeIn<'a> for Declaration<'a> {} + +impl<'a> TakeIn<'a> for VariableDeclaration<'a> {} + +impl<'a> TakeIn<'a> for VariableDeclarator<'a> {} + +impl<'a> TakeIn<'a> for EmptyStatement {} + +impl<'a> TakeIn<'a> for ExpressionStatement<'a> {} + +impl<'a> TakeIn<'a> for IfStatement<'a> {} + +impl<'a> TakeIn<'a> for DoWhileStatement<'a> {} + +impl<'a> TakeIn<'a> for WhileStatement<'a> {} + +impl<'a> TakeIn<'a> for ForStatement<'a> {} + +impl<'a> TakeIn<'a> for ForStatementInit<'a> {} + +impl<'a> TakeIn<'a> for ForInStatement<'a> {} + +impl<'a> TakeIn<'a> for ForStatementLeft<'a> {} + +impl<'a> TakeIn<'a> for ForOfStatement<'a> {} + +impl<'a> TakeIn<'a> for ContinueStatement<'a> {} + +impl<'a> TakeIn<'a> for BreakStatement<'a> {} + +impl<'a> TakeIn<'a> for ReturnStatement<'a> {} + +impl<'a> TakeIn<'a> for WithStatement<'a> {} + +impl<'a> TakeIn<'a> for SwitchStatement<'a> {} + +impl<'a> TakeIn<'a> for SwitchCase<'a> {} + +impl<'a> TakeIn<'a> for LabeledStatement<'a> {} + +impl<'a> TakeIn<'a> for ThrowStatement<'a> {} + +impl<'a> TakeIn<'a> for TryStatement<'a> {} + +impl<'a> TakeIn<'a> for CatchClause<'a> {} + +impl<'a> TakeIn<'a> for CatchParameter<'a> {} + +impl<'a> TakeIn<'a> for DebuggerStatement {} + +impl<'a> TakeIn<'a> for BindingPattern<'a> {} + +impl<'a> TakeIn<'a> for BindingPatternKind<'a> {} + +impl<'a> TakeIn<'a> for AssignmentPattern<'a> {} + +impl<'a> TakeIn<'a> for ObjectPattern<'a> {} + +impl<'a> TakeIn<'a> for BindingProperty<'a> {} + +impl<'a> TakeIn<'a> for ArrayPattern<'a> {} + +impl<'a> TakeIn<'a> for BindingRestElement<'a> {} + +impl<'a> TakeIn<'a> for Function<'a> {} + +impl<'a> TakeIn<'a> for FormalParameters<'a> {} + +impl<'a> TakeIn<'a> for FormalParameter<'a> {} + +impl<'a> TakeIn<'a> for FunctionBody<'a> {} + +impl<'a> TakeIn<'a> for ArrowFunctionExpression<'a> {} + +impl<'a> TakeIn<'a> for YieldExpression<'a> {} + +impl<'a> TakeIn<'a> for Class<'a> {} + +impl<'a> TakeIn<'a> for ClassBody<'a> {} + +impl<'a> TakeIn<'a> for ClassElement<'a> {} + +impl<'a> TakeIn<'a> for MethodDefinition<'a> {} + +impl<'a> TakeIn<'a> for PropertyDefinition<'a> {} + +impl<'a> TakeIn<'a> for PrivateIdentifier<'a> {} + +impl<'a> TakeIn<'a> for StaticBlock<'a> {} + +impl<'a> TakeIn<'a> for ModuleDeclaration<'a> {} + +impl<'a> TakeIn<'a> for AccessorProperty<'a> {} + +impl<'a> TakeIn<'a> for ImportExpression<'a> {} + +impl<'a> TakeIn<'a> for ImportDeclaration<'a> {} + +impl<'a> TakeIn<'a> for ImportDeclarationSpecifier<'a> {} + +impl<'a> TakeIn<'a> for ImportSpecifier<'a> {} + +impl<'a> TakeIn<'a> for ImportDefaultSpecifier<'a> {} + +impl<'a> TakeIn<'a> for ImportNamespaceSpecifier<'a> {} + +impl<'a> TakeIn<'a> for WithClause<'a> {} + +impl<'a> TakeIn<'a> for ImportAttribute<'a> {} + +impl<'a> TakeIn<'a> for ImportAttributeKey<'a> {} + +impl<'a> TakeIn<'a> for ExportNamedDeclaration<'a> {} + +impl<'a> TakeIn<'a> for ExportDefaultDeclaration<'a> {} + +impl<'a> TakeIn<'a> for ExportAllDeclaration<'a> {} + +impl<'a> TakeIn<'a> for ExportSpecifier<'a> {} + +impl<'a> TakeIn<'a> for ExportDefaultDeclarationKind<'a> {} + +impl<'a> TakeIn<'a> for ModuleExportName<'a> {} + +impl<'a> TakeIn<'a> for V8IntrinsicExpression<'a> {} + +impl<'a> TakeIn<'a> for BooleanLiteral {} + +impl<'a> TakeIn<'a> for NullLiteral {} + +impl<'a> TakeIn<'a> for NumericLiteral<'a> {} + +impl<'a> TakeIn<'a> for StringLiteral<'a> {} + +impl<'a> TakeIn<'a> for BigIntLiteral<'a> {} + +impl<'a> TakeIn<'a> for RegExpLiteral<'a> {} + +impl<'a> TakeIn<'a> for RegExp<'a> {} + +impl<'a> TakeIn<'a> for RegExpPattern<'a> {} + +impl<'a> TakeIn<'a> for JSXElement<'a> {} + +impl<'a> TakeIn<'a> for JSXOpeningElement<'a> {} + +impl<'a> TakeIn<'a> for JSXClosingElement<'a> {} + +impl<'a> TakeIn<'a> for JSXFragment<'a> {} + +impl<'a> TakeIn<'a> for JSXOpeningFragment {} + +impl<'a> TakeIn<'a> for JSXClosingFragment {} + +impl<'a> TakeIn<'a> for JSXElementName<'a> {} + +impl<'a> TakeIn<'a> for JSXNamespacedName<'a> {} + +impl<'a> TakeIn<'a> for JSXMemberExpression<'a> {} + +impl<'a> TakeIn<'a> for JSXMemberExpressionObject<'a> {} + +impl<'a> TakeIn<'a> for JSXExpressionContainer<'a> {} + +impl<'a> TakeIn<'a> for JSXExpression<'a> {} + +impl<'a> TakeIn<'a> for JSXEmptyExpression {} + +impl<'a> TakeIn<'a> for JSXAttributeItem<'a> {} + +impl<'a> TakeIn<'a> for JSXAttribute<'a> {} + +impl<'a> TakeIn<'a> for JSXSpreadAttribute<'a> {} + +impl<'a> TakeIn<'a> for JSXAttributeName<'a> {} + +impl<'a> TakeIn<'a> for JSXAttributeValue<'a> {} + +impl<'a> TakeIn<'a> for JSXIdentifier<'a> {} + +impl<'a> TakeIn<'a> for JSXChild<'a> {} + +impl<'a> TakeIn<'a> for JSXSpreadChild<'a> {} + +impl<'a> TakeIn<'a> for JSXText<'a> {} + +impl<'a> TakeIn<'a> for TSThisParameter<'a> {} + +impl<'a> TakeIn<'a> for TSEnumDeclaration<'a> {} + +impl<'a> TakeIn<'a> for TSEnumMember<'a> {} + +impl<'a> TakeIn<'a> for TSEnumMemberName<'a> {} + +impl<'a> TakeIn<'a> for TSTypeAnnotation<'a> {} + +impl<'a> TakeIn<'a> for TSLiteralType<'a> {} + +impl<'a> TakeIn<'a> for TSLiteral<'a> {} + +impl<'a> TakeIn<'a> for TSType<'a> {} + +impl<'a> TakeIn<'a> for TSConditionalType<'a> {} + +impl<'a> TakeIn<'a> for TSUnionType<'a> {} + +impl<'a> TakeIn<'a> for TSIntersectionType<'a> {} + +impl<'a> TakeIn<'a> for TSParenthesizedType<'a> {} + +impl<'a> TakeIn<'a> for TSTypeOperator<'a> {} + +impl<'a> TakeIn<'a> for TSArrayType<'a> {} + +impl<'a> TakeIn<'a> for TSIndexedAccessType<'a> {} + +impl<'a> TakeIn<'a> for TSTupleType<'a> {} + +impl<'a> TakeIn<'a> for TSNamedTupleMember<'a> {} + +impl<'a> TakeIn<'a> for TSOptionalType<'a> {} + +impl<'a> TakeIn<'a> for TSRestType<'a> {} + +impl<'a> TakeIn<'a> for TSTupleElement<'a> {} + +impl<'a> TakeIn<'a> for TSAnyKeyword {} + +impl<'a> TakeIn<'a> for TSStringKeyword {} + +impl<'a> TakeIn<'a> for TSBooleanKeyword {} + +impl<'a> TakeIn<'a> for TSNumberKeyword {} + +impl<'a> TakeIn<'a> for TSNeverKeyword {} + +impl<'a> TakeIn<'a> for TSIntrinsicKeyword {} + +impl<'a> TakeIn<'a> for TSUnknownKeyword {} + +impl<'a> TakeIn<'a> for TSNullKeyword {} + +impl<'a> TakeIn<'a> for TSUndefinedKeyword {} + +impl<'a> TakeIn<'a> for TSVoidKeyword {} + +impl<'a> TakeIn<'a> for TSSymbolKeyword {} + +impl<'a> TakeIn<'a> for TSThisType {} + +impl<'a> TakeIn<'a> for TSObjectKeyword {} + +impl<'a> TakeIn<'a> for TSBigIntKeyword {} + +impl<'a> TakeIn<'a> for TSTypeReference<'a> {} + +impl<'a> TakeIn<'a> for TSTypeName<'a> {} + +impl<'a> TakeIn<'a> for TSQualifiedName<'a> {} + +impl<'a> TakeIn<'a> for TSTypeParameterInstantiation<'a> {} + +impl<'a> TakeIn<'a> for TSTypeParameter<'a> {} + +impl<'a> TakeIn<'a> for TSTypeParameterDeclaration<'a> {} + +impl<'a> TakeIn<'a> for TSTypeAliasDeclaration<'a> {} + +impl<'a> TakeIn<'a> for TSClassImplements<'a> {} + +impl<'a> TakeIn<'a> for TSInterfaceDeclaration<'a> {} + +impl<'a> TakeIn<'a> for TSInterfaceBody<'a> {} + +impl<'a> TakeIn<'a> for TSPropertySignature<'a> {} + +impl<'a> TakeIn<'a> for TSSignature<'a> {} + +impl<'a> TakeIn<'a> for TSIndexSignature<'a> {} + +impl<'a> TakeIn<'a> for TSCallSignatureDeclaration<'a> {} + +impl<'a> TakeIn<'a> for TSMethodSignature<'a> {} + +impl<'a> TakeIn<'a> for TSConstructSignatureDeclaration<'a> {} + +impl<'a> TakeIn<'a> for TSIndexSignatureName<'a> {} + +impl<'a> TakeIn<'a> for TSInterfaceHeritage<'a> {} + +impl<'a> TakeIn<'a> for TSTypePredicate<'a> {} + +impl<'a> TakeIn<'a> for TSTypePredicateName<'a> {} + +impl<'a> TakeIn<'a> for TSModuleDeclaration<'a> {} + +impl<'a> TakeIn<'a> for TSModuleDeclarationName<'a> {} + +impl<'a> TakeIn<'a> for TSModuleDeclarationBody<'a> {} + +impl<'a> TakeIn<'a> for TSModuleBlock<'a> {} + +impl<'a> TakeIn<'a> for TSTypeLiteral<'a> {} + +impl<'a> TakeIn<'a> for TSInferType<'a> {} + +impl<'a> TakeIn<'a> for TSTypeQuery<'a> {} + +impl<'a> TakeIn<'a> for TSTypeQueryExprName<'a> {} + +impl<'a> TakeIn<'a> for TSImportType<'a> {} + +impl<'a> TakeIn<'a> for TSFunctionType<'a> {} + +impl<'a> TakeIn<'a> for TSConstructorType<'a> {} + +impl<'a> TakeIn<'a> for TSMappedType<'a> {} + +impl<'a> TakeIn<'a> for TSTemplateLiteralType<'a> {} + +impl<'a> TakeIn<'a> for TSAsExpression<'a> {} + +impl<'a> TakeIn<'a> for TSSatisfiesExpression<'a> {} + +impl<'a> TakeIn<'a> for TSTypeAssertion<'a> {} + +impl<'a> TakeIn<'a> for TSImportEqualsDeclaration<'a> {} + +impl<'a> TakeIn<'a> for TSModuleReference<'a> {} + +impl<'a> TakeIn<'a> for TSExternalModuleReference<'a> {} + +impl<'a> TakeIn<'a> for TSNonNullExpression<'a> {} + +impl<'a> TakeIn<'a> for Decorator<'a> {} + +impl<'a> TakeIn<'a> for TSExportAssignment<'a> {} + +impl<'a> TakeIn<'a> for TSNamespaceExportDeclaration<'a> {} + +impl<'a> TakeIn<'a> for TSInstantiationExpression<'a> {} + +impl<'a> TakeIn<'a> for JSDocNullableType<'a> {} + +impl<'a> TakeIn<'a> for JSDocNonNullableType<'a> {} + +impl<'a> TakeIn<'a> for JSDocUnknownType {} diff --git a/crates/oxc_ast/src/lib.rs b/crates/oxc_ast/src/lib.rs index 22c44f2058dfd..b9880889f5faa 100644 --- a/crates/oxc_ast/src/lib.rs +++ b/crates/oxc_ast/src/lib.rs @@ -60,11 +60,13 @@ mod generated { pub mod ast_kind; pub mod derive_clone_in; pub mod derive_content_eq; + pub mod derive_dummy; #[cfg(feature = "serialize")] pub mod derive_estree; pub mod derive_get_address; pub mod derive_get_span; pub mod derive_get_span_mut; + pub mod derive_take_in; pub mod get_id; } diff --git a/crates/oxc_ast_macros/src/generated/mod.rs b/crates/oxc_ast_macros/src/generated/mod.rs index cdef52ace962b..4397c56c9b70d 100644 --- a/crates/oxc_ast_macros/src/generated/mod.rs +++ b/crates/oxc_ast_macros/src/generated/mod.rs @@ -7,6 +7,8 @@ use quote::quote; pub fn get_trait_crate_and_generics(trait_name: &str) -> (TokenStream, TokenStream) { match trait_name { "CloneIn" => (quote!(::oxc_allocator::CloneIn), quote!(< 'static >)), + "Dummy" => (quote!(::oxc_allocator::Dummy), quote!(< 'static >)), + "TakeIn" => (quote!(::oxc_allocator::TakeIn), quote!(< 'static >)), "GetAddress" => (quote!(::oxc_allocator::GetAddress), TokenStream::new()), "GetSpan" => (quote!(::oxc_span::GetSpan), TokenStream::new()), "GetSpanMut" => (quote!(::oxc_span::GetSpanMut), TokenStream::new()), diff --git a/crates/oxc_parser/src/cursor.rs b/crates/oxc_parser/src/cursor.rs index 8bdda5f59ef36..9411b9c62d1b3 100644 --- a/crates/oxc_parser/src/cursor.rs +++ b/crates/oxc_parser/src/cursor.rs @@ -282,13 +282,12 @@ impl<'a> ParserImpl<'a> { } pub(crate) fn rewind(&mut self, checkpoint: ParserCheckpoint<'a>) { - let ParserCheckpoint { lexer, cur_token, prev_span_end, errors_pos: errors_lens } = - checkpoint; + let ParserCheckpoint { lexer, cur_token, prev_span_end, errors_pos } = checkpoint; self.lexer.rewind(lexer); self.token = cur_token; self.prev_token_end = prev_span_end; - self.errors.truncate(errors_lens); + self.errors.truncate(errors_pos); } /// # Errors diff --git a/crates/oxc_span/src/atom.rs b/crates/oxc_span/src/atom.rs index 12f953967e325..e9fe82321533a 100644 --- a/crates/oxc_span/src/atom.rs +++ b/crates/oxc_span/src/atom.rs @@ -4,7 +4,7 @@ use std::{ ops::Deref, }; -use oxc_allocator::{Allocator, CloneIn, FromIn}; +use oxc_allocator::{Allocator, CloneIn, Dummy, FromIn}; #[cfg(feature = "serialize")] use oxc_estree::{ESTree, Serializer as ESTreeSerializer}; #[cfg(feature = "serialize")] @@ -71,6 +71,15 @@ impl<'new_alloc> CloneIn<'new_alloc> for Atom<'_> { } } +impl<'a> Dummy<'a> for Atom<'a> { + /// Create a dummy [`Atom`]. + #[expect(clippy::inline_always)] + #[inline(always)] + fn dummy(_allocator: &'a Allocator) -> Self { + Atom::empty() + } +} + impl<'alloc> FromIn<'alloc, &Atom<'alloc>> for Atom<'alloc> { fn from_in(s: &Atom<'alloc>, _: &'alloc Allocator) -> Self { *s diff --git a/crates/oxc_span/src/generated/derive_dummy.rs b/crates/oxc_span/src/generated/derive_dummy.rs new file mode 100644 index 0000000000000..0dfd3bd2e9c5f --- /dev/null +++ b/crates/oxc_span/src/generated/derive_dummy.rs @@ -0,0 +1,51 @@ +// Auto-generated code, DO NOT EDIT DIRECTLY! +// To edit this generated file you have to edit `tasks/ast_tools/src/derives/dummy.rs` + +#![allow(unused_variables, clippy::inline_always)] + +use oxc_allocator::{Allocator, Dummy}; + +use crate::source_type::*; + +impl<'a> Dummy<'a> for SourceType { + /// Create a dummy [`SourceType`]. + /// + /// Does not allocate any data into arena. + fn dummy(allocator: &'a Allocator) -> Self { + Self { + language: Dummy::dummy(allocator), + module_kind: Dummy::dummy(allocator), + variant: Dummy::dummy(allocator), + } + } +} + +impl<'a> Dummy<'a> for Language { + /// Create a dummy [`Language`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::JavaScript + } +} + +impl<'a> Dummy<'a> for ModuleKind { + /// Create a dummy [`ModuleKind`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Script + } +} + +impl<'a> Dummy<'a> for LanguageVariant { + /// Create a dummy [`LanguageVariant`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Standard + } +} diff --git a/crates/oxc_span/src/lib.rs b/crates/oxc_span/src/lib.rs index 813497418794b..d8fdbaea95116 100644 --- a/crates/oxc_span/src/lib.rs +++ b/crates/oxc_span/src/lib.rs @@ -23,6 +23,7 @@ pub use crate::{ mod generated { #[cfg(debug_assertions)] pub mod assert_layouts; + mod derive_dummy; #[cfg(feature = "serialize")] pub mod derive_estree; } diff --git a/crates/oxc_span/src/source_type/mod.rs b/crates/oxc_span/src/source_type/mod.rs index 75fd6a234da0a..73c25e819d8af 100644 --- a/crates/oxc_span/src/source_type/mod.rs +++ b/crates/oxc_span/src/source_type/mod.rs @@ -1,6 +1,6 @@ use std::{hash::Hash, path::Path}; -use oxc_allocator::{Allocator, CloneIn}; +use oxc_allocator::{Allocator, CloneIn, Dummy}; use oxc_ast_macros::ast; use oxc_estree::ESTree; @@ -12,7 +12,7 @@ pub use error::UnknownExtension; /// Source Type for JavaScript vs TypeScript / Script vs Module / JSX #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(ESTree)] +#[generate_derive(Dummy, ESTree)] #[estree(no_type, flatten)] pub struct SourceType { /// JavaScript or TypeScript, default JavaScript @@ -31,6 +31,7 @@ pub struct SourceType { /// JavaScript or TypeScript #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[generate_derive(Dummy)] pub enum Language { /// Indicates a JavaScript or JSX file JavaScript = 0, @@ -43,7 +44,7 @@ pub enum Language { /// Script or Module #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(ESTree)] +#[generate_derive(Dummy, ESTree)] pub enum ModuleKind { /// Regular JS script or CommonJS file Script = 0, @@ -63,6 +64,7 @@ pub enum ModuleKind { /// JSX for JavaScript and TypeScript #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[generate_derive(Dummy)] pub enum LanguageVariant { /// Standard JavaScript or TypeScript without any language extensions. Stage /// 3 proposals do not count as language extensions. diff --git a/crates/oxc_span/src/span.rs b/crates/oxc_span/src/span.rs index 386d0d2e036b2..bebd5ed35bee3 100644 --- a/crates/oxc_span/src/span.rs +++ b/crates/oxc_span/src/span.rs @@ -8,7 +8,7 @@ use miette::{LabeledSpan, SourceOffset, SourceSpan}; #[cfg(feature = "serialize")] use serde::{Serialize, Serializer as SerdeSerializer, ser::SerializeMap}; -use oxc_allocator::{Allocator, CloneIn}; +use oxc_allocator::{Allocator, CloneIn, Dummy}; use oxc_ast_macros::ast; use oxc_estree::ESTree; @@ -545,6 +545,15 @@ impl<'a> CloneIn<'a> for Span { } } +impl<'a> Dummy<'a> for Span { + /// Create a dummy [`Span`]. + #[expect(clippy::inline_always)] + #[inline(always)] + fn dummy(_allocator: &'a Allocator) -> Self { + SPAN + } +} + #[cfg(feature = "serialize")] impl Serialize for Span { fn serialize(&self, serializer: S) -> Result { diff --git a/crates/oxc_syntax/src/generated/derive_dummy.rs b/crates/oxc_syntax/src/generated/derive_dummy.rs new file mode 100644 index 0000000000000..029098bcf530b --- /dev/null +++ b/crates/oxc_syntax/src/generated/derive_dummy.rs @@ -0,0 +1,79 @@ +// Auto-generated code, DO NOT EDIT DIRECTLY! +// To edit this generated file you have to edit `tasks/ast_tools/src/derives/dummy.rs` + +#![allow(unused_variables, clippy::inline_always)] + +use oxc_allocator::{Allocator, Dummy}; + +use crate::number::*; +use crate::operator::*; + +impl<'a> Dummy<'a> for NumberBase { + /// Create a dummy [`NumberBase`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Float + } +} + +impl<'a> Dummy<'a> for BigintBase { + /// Create a dummy [`BigintBase`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Decimal + } +} + +impl<'a> Dummy<'a> for AssignmentOperator { + /// Create a dummy [`AssignmentOperator`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Assign + } +} + +impl<'a> Dummy<'a> for BinaryOperator { + /// Create a dummy [`BinaryOperator`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Equality + } +} + +impl<'a> Dummy<'a> for LogicalOperator { + /// Create a dummy [`LogicalOperator`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Or + } +} + +impl<'a> Dummy<'a> for UnaryOperator { + /// Create a dummy [`UnaryOperator`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::UnaryPlus + } +} + +impl<'a> Dummy<'a> for UpdateOperator { + /// Create a dummy [`UpdateOperator`]. + /// + /// Does not allocate any data into arena. + #[inline(always)] + fn dummy(allocator: &'a Allocator) -> Self { + Self::Increment + } +} diff --git a/crates/oxc_syntax/src/lib.rs b/crates/oxc_syntax/src/lib.rs index 04a120876878a..ac60130701e6f 100644 --- a/crates/oxc_syntax/src/lib.rs +++ b/crates/oxc_syntax/src/lib.rs @@ -26,6 +26,7 @@ mod generated { pub mod assert_layouts; mod derive_clone_in; mod derive_content_eq; + mod derive_dummy; #[cfg(feature = "serialize")] mod derive_estree; } diff --git a/crates/oxc_syntax/src/number.rs b/crates/oxc_syntax/src/number.rs index 22246c50bb935..d531277bcba40 100644 --- a/crates/oxc_syntax/src/number.rs +++ b/crates/oxc_syntax/src/number.rs @@ -1,11 +1,12 @@ #![expect(missing_docs)] // fixme -use oxc_allocator::CloneIn; + +use oxc_allocator::{CloneIn, Dummy}; use oxc_ast_macros::ast; use oxc_span::ContentEq; #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn, ContentEq)] +#[generate_derive(CloneIn, Dummy, ContentEq)] pub enum NumberBase { Float = 0, Decimal = 1, @@ -22,7 +23,7 @@ impl NumberBase { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn, ContentEq)] +#[generate_derive(CloneIn, Dummy, ContentEq)] pub enum BigintBase { Decimal = 0, Binary = 1, diff --git a/crates/oxc_syntax/src/operator.rs b/crates/oxc_syntax/src/operator.rs index 3b65cf0043400..2eede2b4e33dc 100644 --- a/crates/oxc_syntax/src/operator.rs +++ b/crates/oxc_syntax/src/operator.rs @@ -2,7 +2,7 @@ //! //! Not all operators are punctuation - some, such as `delete`, are keywords. -use oxc_allocator::CloneIn; +use oxc_allocator::{CloneIn, Dummy}; use oxc_ast_macros::ast; use oxc_estree::ESTree; use oxc_span::ContentEq; @@ -15,7 +15,7 @@ use crate::precedence::{GetPrecedence, Precedence}; /// - [13.15 Assignment Operators](https://tc39.es/ecma262/#sec-assignment-operators) #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum AssignmentOperator { /// `=` #[estree(rename = "=")] @@ -159,7 +159,7 @@ impl AssignmentOperator { /// - [12.10 Binary Logical Operators](https://tc39.es/ecma262/#sec-binary-logical-operators) #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum BinaryOperator { /// `==` #[estree(rename = "==")] @@ -416,7 +416,7 @@ impl GetPrecedence for BinaryOperator { /// Logical binary operators #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum LogicalOperator { /// `||` #[estree(rename = "||")] @@ -496,7 +496,7 @@ impl GetPrecedence for LogicalOperator { /// - [12.5 Unary Operators](https://tc39.es/ecma262/#sec-unary-operators) #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum UnaryOperator { /// `+` #[estree(rename = "+")] @@ -576,7 +576,7 @@ impl UnaryOperator { /// Unary update operators. #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[generate_derive(CloneIn, ContentEq, ESTree)] +#[generate_derive(CloneIn, Dummy, ContentEq, ESTree)] pub enum UpdateOperator { /// `++` #[estree(rename = "++")] diff --git a/tasks/ast_tools/src/derives/dummy.rs b/tasks/ast_tools/src/derives/dummy.rs new file mode 100644 index 0000000000000..85f7fd48f52f2 --- /dev/null +++ b/tasks/ast_tools/src/derives/dummy.rs @@ -0,0 +1,263 @@ +//! Derive for `Dummy` trait. + +use std::borrow::Cow; + +use proc_macro2::TokenStream; +use quote::quote; + +use crate::{ + codegen::Codegen, + schema::{ + Def, EnumDef, Schema, StructDef, TypeDef, TypeId, + extensions::{ + dummy::{Alloc, MinVariant}, + layout::GetLayout, + }, + }, + utils::format_cow, +}; + +use super::{Derive, StructOrEnum, define_derive}; + +/// Derive for `Dummy` trait. +pub struct DeriveDummy; + +define_derive!(DeriveDummy); + +impl Derive for DeriveDummy { + fn trait_name(&self) -> &'static str { + "Dummy" + } + + fn trait_has_lifetime(&self) -> bool { + true + } + + fn crate_name(&self) -> &'static str { + "oxc_allocator" + } + + fn prelude(&self) -> TokenStream { + quote! { + #![allow(unused_variables, clippy::inline_always)] + + ///@@line_break + use oxc_allocator::{Allocator, Dummy}; + } + } + + /// Initialize `dummy.alloc` on structs and enums + fn prepare(&self, schema: &mut Schema, _codegen: &Codegen) { + for type_id in schema.types.indices() { + let alloc = calculate_alloc(type_id, schema); + assert!(alloc != Alloc::NOT_CALCULATED); + } + } + + fn derive(&self, type_def: StructOrEnum, schema: &Schema) -> TokenStream { + match type_def { + StructOrEnum::Struct(struct_def) => generate_impl_for_struct(struct_def, schema), + StructOrEnum::Enum(enum_def) => generate_impl_for_enum(enum_def, schema), + } + } +} + +/// Calculate number and size of allocations required to construct a dummy for a type. +/// +/// Before calculation, set `alloc` to [`Alloc::CALCULATING`]. +/// If `calculate_alloc` is called again for that type, it returns [`Alloc::NOT_CALCULATED`], +/// which indicates the type has a circular dependency. +/// This should only happen while calculating the cost of an enum. That variant will not be chosen. +fn calculate_alloc(type_id: TypeId, schema: &mut Schema) -> Alloc { + let type_def = &mut schema.types[type_id]; + #[expect(clippy::match_same_arms)] + match type_def { + TypeDef::Struct(struct_def) => { + let alloc = &mut struct_def.dummy.alloc; + if *alloc == Alloc::NOT_CALCULATED { + *alloc = Alloc::CALCULATING; + calculate_alloc_for_struct(type_id, schema) + } else if *alloc == Alloc::CALCULATING { + Alloc::NOT_CALCULATED + } else { + *alloc + } + } + TypeDef::Enum(enum_def) => { + let alloc = &mut enum_def.dummy.alloc; + if *alloc == Alloc::NOT_CALCULATED { + *alloc = Alloc::CALCULATING; + calculate_alloc_for_enum(type_id, schema) + } else if *alloc == Alloc::CALCULATING { + Alloc::NOT_CALCULATED + } else { + *alloc + } + } + // Primitives own no further allocation beyond themselves + TypeDef::Primitive(_) => Alloc::ZERO, + // `Option`s are `None` in dummy nodes + TypeDef::Option(_) => Alloc::ZERO, + // `Box`es have cost of the inner type plus an allocation of the type itself + TypeDef::Box(box_def) => { + let inner_type_id = box_def.inner_type_id; + let mut alloc = calculate_alloc(inner_type_id, schema); + if alloc != Alloc::NOT_CALCULATED { + let inner_type = &schema.types[inner_type_id]; + alloc.bytes_64 += inner_type.layout_64().size; + alloc.bytes_32 += inner_type.layout_32().size; + alloc.count += 1; + } + alloc + } + // `Vec`s are empty in dummy nodes + TypeDef::Vec(_) => Alloc::ZERO, + // `Cell`s only own allocations if their inner type does + TypeDef::Cell(cell_def) => calculate_alloc(cell_def.inner_type_id, schema), + } +} + +/// Calculate number and size of allocations required to construct a dummy for a struct. +/// +/// Equals the total of allocations for all the struct's fields. +fn calculate_alloc_for_struct(type_id: TypeId, schema: &mut Schema) -> Alloc { + let mut alloc = Alloc::ZERO; + for field_index in schema.struct_def(type_id).field_indices() { + let field_type_id = schema.struct_def(type_id).fields[field_index].type_id; + let field_alloc = calculate_alloc(field_type_id, schema); + if field_alloc == Alloc::NOT_CALCULATED { + alloc = field_alloc; + break; + } + alloc.bytes_64 += field_alloc.bytes_64; + alloc.bytes_32 += field_alloc.bytes_32; + alloc.count += field_alloc.count; + } + + schema.struct_def_mut(type_id).dummy.alloc = alloc; + + alloc +} + +/// Calculate number and size of allocations required to construct a dummy for an enum. +/// +/// Select the enum variant which has the lowest allocation cost. +/// +/// Choice is made on these criteria, in order: +/// * Smallest number of bytes allocated on 64-bit systems. +/// * Smallest number of bytes allocated on 32-bit systems. +/// * Smallest number of individual allocations. +/// +/// Record both the allocation cost, and which variant has the smallest cost. +fn calculate_alloc_for_enum(type_id: TypeId, schema: &mut Schema) -> Alloc { + // All `#[ast]` enums are `#[repr(u8)]` or `#[repr(C, u8)]` so cannot have 0 variants + let mut alloc = Alloc::NOT_CALCULATED; + let mut min_variant = MinVariant::default(); + + // Own variants + for variant_index in schema.enum_def(type_id).variant_indices() { + let variant_type_id = schema.enum_def(type_id).variants[variant_index].field_type_id; + if let Some(variant_type_id) = variant_type_id { + let variant_alloc = calculate_alloc(variant_type_id, schema); + if variant_alloc < alloc { + alloc = variant_alloc; + min_variant = MinVariant::Own(variant_index); + } + } else { + alloc = Alloc::ZERO; + min_variant = MinVariant::Own(variant_index); + break; + } + } + + // Inherited variants + for inherits_index in schema.enum_def(type_id).inherits_indices() { + let inherits_type_id = schema.enum_def(type_id).inherits[inherits_index]; + let inherits_alloc = calculate_alloc_for_enum(inherits_type_id, schema); + if inherits_alloc < alloc { + alloc = inherits_alloc; + min_variant = schema.enum_def(inherits_type_id).dummy.min_variant; + if let MinVariant::Own(variant_index) = min_variant { + min_variant = MinVariant::Inherited(inherits_type_id, variant_index); + } + } + } + + let dummy = &mut schema.enum_def_mut(type_id).dummy; + dummy.alloc = alloc; + dummy.min_variant = min_variant; + + alloc +} + +/// Generate `Dummy` impl for struct. +fn generate_impl_for_struct(struct_def: &StructDef, schema: &Schema) -> TokenStream { + let fields = struct_def.fields.iter().map(|field| { + let field_ident = field.ident(); + quote!(#field_ident: Dummy::dummy(allocator)) + }); + + let value = quote! { + Self { + #(#fields),* + } + }; + + generate_impl(struct_def.name(), &struct_def.ty(schema), &value, struct_def.dummy.alloc, false) +} + +/// Generate `Dummy` impl for enum. +fn generate_impl_for_enum(enum_def: &EnumDef, schema: &Schema) -> TokenStream { + let variant = match enum_def.dummy.min_variant { + MinVariant::Own(variant_index) => &enum_def.variants[variant_index], + MinVariant::Inherited(inherited_type_id, variant_index) => { + &schema.enum_def(inherited_type_id).variants[variant_index] + } + }; + + let variant_ident = variant.ident(); + let (value, should_inline) = if variant.field_type(schema).is_some() { + (quote!( Self::#variant_ident(Dummy::dummy(allocator)) ), false) + } else { + (quote!( Self::#variant_ident ), true) + }; + + generate_impl( + enum_def.name(), + &enum_def.ty(schema), + &value, + enum_def.dummy.alloc, + should_inline, + ) +} + +/// Generate `Dummy` impl for a type. +fn generate_impl( + name: &str, + ty: &TokenStream, + value: &TokenStream, + alloc: Alloc, + should_inline: bool, +) -> TokenStream { + let comment1 = format!(" Create a dummy [`{name}`]."); + let comment2 = if alloc.bytes_64 == 0 { + Cow::Borrowed(" Does not allocate any data into arena.") + } else { + let s = if alloc.count > 1 { "s" } else { "" }; + format_cow!(" Has cost of making {} allocation{s} ({} bytes).", alloc.count, alloc.bytes_64) + }; + + let inline = if should_inline { quote!( #[inline(always)] ) } else { quote!() }; + + quote! { + impl<'a> Dummy<'a> for #ty { + #[doc = #comment1] + #[doc = ""] + #[doc = #comment2] + #inline + fn dummy(allocator: &'a Allocator) -> Self { + #value + } + } + } +} diff --git a/tasks/ast_tools/src/derives/mod.rs b/tasks/ast_tools/src/derives/mod.rs index dd190941ed6e4..285b6eb2289e3 100644 --- a/tasks/ast_tools/src/derives/mod.rs +++ b/tasks/ast_tools/src/derives/mod.rs @@ -16,15 +16,19 @@ use crate::{ mod clone_in; mod content_eq; +mod dummy; pub mod estree; mod get_address; mod get_span; +mod take_in; pub use clone_in::DeriveCloneIn; pub use content_eq::DeriveContentEq; +pub use dummy::DeriveDummy; pub use estree::DeriveESTree; pub use get_address::DeriveGetAddress; pub use get_span::{DeriveGetSpan, DeriveGetSpanMut}; +pub use take_in::DeriveTakeIn; /// Trait to define a derive. pub trait Derive: Runner { diff --git a/tasks/ast_tools/src/derives/take_in.rs b/tasks/ast_tools/src/derives/take_in.rs new file mode 100644 index 0000000000000..6667f5837005c --- /dev/null +++ b/tasks/ast_tools/src/derives/take_in.rs @@ -0,0 +1,43 @@ +//! Derive for `TakeIn` trait. + +use proc_macro2::TokenStream; +use quote::quote; + +use crate::schema::{Def, Schema}; + +use super::{Derive, StructOrEnum, define_derive}; + +/// Derive for `TakeIn` trait. +pub struct DeriveTakeIn; + +define_derive!(DeriveTakeIn); + +impl Derive for DeriveTakeIn { + fn trait_name(&self) -> &'static str { + "TakeIn" + } + + fn trait_has_lifetime(&self) -> bool { + true + } + + fn crate_name(&self) -> &'static str { + "oxc_allocator" + } + + fn prelude(&self) -> TokenStream { + quote! { + #![allow(clippy::needless_lifetimes)] + + ///@@line_break + use oxc_allocator::TakeIn; + } + } + + fn derive(&self, type_def: StructOrEnum, schema: &Schema) -> TokenStream { + let ty = type_def.ty(schema); + quote! { + impl<'a> TakeIn<'a> for #ty {} + } + } +} diff --git a/tasks/ast_tools/src/main.rs b/tasks/ast_tools/src/main.rs index e354fee28229c..3dfe814ff1bf6 100644 --- a/tasks/ast_tools/src/main.rs +++ b/tasks/ast_tools/src/main.rs @@ -249,6 +249,8 @@ const AST_CHANGES_WATCH_LIST_PATH: &str = ".github/generated/ast_changes_watch_l /// Derives (for use with `#[generate_derive]`) const DERIVES: &[&(dyn Derive + Sync)] = &[ &derives::DeriveCloneIn, + &derives::DeriveDummy, + &derives::DeriveTakeIn, &derives::DeriveGetAddress, &derives::DeriveGetSpan, &derives::DeriveGetSpanMut, diff --git a/tasks/ast_tools/src/schema/defs/enum.rs b/tasks/ast_tools/src/schema/defs/enum.rs index c64293e9fffbc..71d2b62fa1b6a 100644 --- a/tasks/ast_tools/src/schema/defs/enum.rs +++ b/tasks/ast_tools/src/schema/defs/enum.rs @@ -13,6 +13,7 @@ use super::{ ast_builder::AstBuilderType, clone_in::CloneInType, content_eq::ContentEqType, + dummy::DummyEnum, estree::{ESTreeEnum, ESTreeEnumVariant}, kind::Kind, layout::{GetLayout, Layout}, @@ -43,6 +44,7 @@ pub struct EnumDef { pub kind: Kind, pub layout: Layout, pub clone_in: CloneInType, + pub dummy: DummyEnum, pub content_eq: ContentEqType, pub estree: ESTreeEnum, } @@ -77,6 +79,7 @@ impl EnumDef { kind: Kind::default(), layout: Layout::default(), clone_in: CloneInType::default(), + dummy: DummyEnum::default(), content_eq: ContentEqType::default(), estree: ESTreeEnum::default(), } diff --git a/tasks/ast_tools/src/schema/defs/struct.rs b/tasks/ast_tools/src/schema/defs/struct.rs index 5f3d5a8f0491b..d5f56f446c403 100644 --- a/tasks/ast_tools/src/schema/defs/struct.rs +++ b/tasks/ast_tools/src/schema/defs/struct.rs @@ -12,6 +12,7 @@ use super::{ ast_builder::{AstBuilderStructField, AstBuilderType}, clone_in::{CloneInStructField, CloneInType}, content_eq::{ContentEqStructField, ContentEqType}, + dummy::DummyStruct, estree::{ESTreeStruct, ESTreeStructField}, kind::Kind, layout::{Layout, Offset}, @@ -39,6 +40,7 @@ pub struct StructDef { pub layout: Layout, pub span: SpanStruct, pub clone_in: CloneInType, + pub dummy: DummyStruct, pub content_eq: ContentEqType, pub estree: ESTreeStruct, } @@ -72,6 +74,7 @@ impl StructDef { layout: Layout::default(), span: SpanStruct::default(), clone_in: CloneInType::default(), + dummy: DummyStruct::default(), content_eq: ContentEqType::default(), estree: ESTreeStruct::default(), } diff --git a/tasks/ast_tools/src/schema/extensions/dummy.rs b/tasks/ast_tools/src/schema/extensions/dummy.rs new file mode 100644 index 0000000000000..4e63f60bdea2b --- /dev/null +++ b/tasks/ast_tools/src/schema/extensions/dummy.rs @@ -0,0 +1,61 @@ +use super::super::TypeId; + +/// Details for `Dummy` derive on a struct. +#[derive(Clone, Copy, Default, Debug)] +pub struct DummyStruct { + /// Details of allocations a dummy enum of this type requires + pub alloc: Alloc, +} + +/// Details for `Dummy` derive on an enum. +#[derive(Clone, Copy, Default, Debug)] +pub struct DummyEnum { + /// Details of allocations a dummy enum of this type requires + pub alloc: Alloc, + /// Variant which allocates minimum number of bytes + pub min_variant: MinVariant, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] +pub struct Alloc { + /// Number of bytes a dummy of this type allocates on 64-bit system + pub bytes_64: u32, + /// Number of bytes a dummy of this type allocates on 32-bit system + pub bytes_32: u32, + /// Number of allocations a dummy of this type requires to construct + pub count: u32, +} + +impl Alloc { + /// [`Alloc`] representing zero cost. + pub const ZERO: Self = Self { bytes_64: 0, bytes_32: 0, count: 0 }; + + /// Sentinel value for [`Alloc`], indicating that it's not been calculated yet. + pub const NOT_CALCULATED: Self = Self { bytes_64: u32::MAX, bytes_32: 0, count: 0 }; + + /// Sentinel value for [`Alloc`], indicating that it currently being calculated. + /// Used for preventing infinite cycles. + pub const CALCULATING: Self = Self { bytes_64: 0, bytes_32: u32::MAX, count: 0 }; +} + +impl Default for Alloc { + fn default() -> Self { + Self::NOT_CALCULATED + } +} + +/// Which variant of an enum is the cheapest to generate a dummy for. +#[derive(Clone, Copy, Debug)] +pub enum MinVariant { + /// Own variant index + Own(usize), + /// Inherited variant - `TypeId` of the inherited enum and variant index + Inherited(TypeId, usize), +} + +impl Default for MinVariant { + fn default() -> Self { + // Dummy value + MinVariant::Own(0) + } +} diff --git a/tasks/ast_tools/src/schema/mod.rs b/tasks/ast_tools/src/schema/mod.rs index 1febcfdbc17a8..2b6fc91894701 100644 --- a/tasks/ast_tools/src/schema/mod.rs +++ b/tasks/ast_tools/src/schema/mod.rs @@ -18,6 +18,7 @@ pub mod extensions { pub mod ast_builder; pub mod clone_in; pub mod content_eq; + pub mod dummy; pub mod estree; pub mod kind; pub mod layout; diff --git a/tasks/coverage/snapshots/estree_typescript.snap b/tasks/coverage/snapshots/estree_typescript.snap index 93d503ee64990..eb21d02bbadf6 100644 --- a/tasks/coverage/snapshots/estree_typescript.snap +++ b/tasks/coverage/snapshots/estree_typescript.snap @@ -2,7 +2,7 @@ commit: 15392346 estree_typescript Summary: AST Parsed : 10623/10725 (99.05%) -Positive Passed: 3363/10725 (31.36%) +Positive Passed: 3622/10725 (33.77%) Mismatch: tasks/coverage/typescript/tests/cases/compiler/APISample_Watch.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/APISample_WatchWithDefaults.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/APISample_WatchWithOwnWatchHost.ts @@ -19,8 +19,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/DeclarationErrorsNoEmit Mismatch: tasks/coverage/typescript/tests/cases/compiler/ExportAssignment7.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/ExportAssignment8.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/SystemModuleForStatementNoInitializer.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/abstractClassInLocalScope.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/abstractClassInLocalScopeIsAbstract.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/abstractInterfaceIdentifierName.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/abstractPropertyBasics.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/abstractPropertyInConstructor.ts @@ -33,7 +31,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/accessorDeclarationEmit Mismatch: tasks/coverage/typescript/tests/cases/compiler/accessorInferredReturnTypeErrorInReturnStatement.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/accessorWithRestParam.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/addMoreOverloadsToBaseSignature.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/aliasInstantiationExpressionGenericIntersectionNoCrash1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/aliasOfGenericFunctionWithRestBehavedSameAsUnaliased.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/aliasOnMergedModuleInterface.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/aliasUsageInAccessorsOfClass.ts @@ -124,14 +121,12 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayConcat3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayConcatMap.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayDestructuringInSwitch1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayDestructuringInSwitch2.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayEvery.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayFakeFlatNoCrashInferenceDeclarations.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayFilter.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayFind.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayFrom.ts Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/arrayFromAsync.ts `await` is only allowed within async functions and at the top levels of modules -Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayIndexWithArrayFails.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayLiteralComments.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayLiteralContextualType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/arrayLiteralInNonVarArgParameter.ts @@ -233,15 +228,12 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/assignmentToPare Cannot assign to this expression Mismatch: tasks/coverage/typescript/tests/cases/compiler/assignmentToReferenceTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncArrowInClassES5.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncFunctionContextuallyTypedReturns.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncFunctionReturnExpressionErrorSpans.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncFunctionReturnType.2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncFunctionReturnType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncFunctionTempVariableScoping.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncFunctionsAcrossFiles.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncFunctionsAndStrictNullChecks.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncIIFE.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncImportNestedYield.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncIteratorExtraParameters.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/asyncYieldStarContextualType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/augmentExportEquals1.ts @@ -310,11 +302,8 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/bind2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/bindingPatternCannotBeOnlyInferenceSource.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/bindingPatternContextualTypeDoesNotCauseWidening.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/bindingPatternOmittedExpressionNesting.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/binopAssignmentShouldHaveType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/blockScopedBindingCaptureThisInFunction.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/blockScopedBindingUsedBeforeDef.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/blockScopedBindingsInDownlevelGenerator.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/blockScopedBindingsReassignedInLoop1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/blockScopedBindingsReassignedInLoop2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/blockScopedBindingsReassignedInLoop3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/blockScopedBindingsReassignedInLoop6.ts @@ -343,13 +332,11 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/cachedModuleResolution3 Mismatch: tasks/coverage/typescript/tests/cases/compiler/cachedModuleResolution4.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/cachedModuleResolution5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/callOfConditionalTypeWithConcreteBranches.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/callOnInstance.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/callbacksDontShareTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/callsOnComplexSignatures.tsx Mismatch: tasks/coverage/typescript/tests/cases/compiler/cannotIndexGenericWritingError.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/captureThisInSuperCall.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop12.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop13.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop1_ES6.ts @@ -359,8 +346,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop3 Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop3_ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop4.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop4_ES6.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop5.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop5_ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop6_ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedLetConstInLoop7.ts @@ -373,7 +358,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedParametersInIni Mismatch: tasks/coverage/typescript/tests/cases/compiler/capturedShorthandPropertyAssignmentNoCheck.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/caseInsensitiveFileSystemWithCapsImportTypeDeclarations.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/castExpressionParentheses.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/castParentheses.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/castTest.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/cf.ts @@ -440,7 +424,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/classExpressionWithStat Mismatch: tasks/coverage/typescript/tests/cases/compiler/classExpressionWithStaticProperties3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/classExpressionWithStaticPropertiesES62.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/classExpressionWithStaticPropertiesES63.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/classExpressionWithStaticPropertiesES64.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/classExtendingAbstractClassWithMemberCalledTheSameAsItsOwnTypeParam.ts tasks/coverage/typescript/tests/cases/compiler/classExtendingAny.ts Unexpected estree file content error: 1 != 2 @@ -538,7 +521,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/collisionThisExpression Mismatch: tasks/coverage/typescript/tests/cases/compiler/collisionThisExpressionAndNameResolution.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/collisionThisExpressionAndParameter.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/collisionThisExpressionAndPropertyNameAsConstuctorParameter.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/commaOperator1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/commaOperatorInConditionalExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/commaOperatorLeftSideUnused.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentEmitAtEndOfFile1.ts @@ -580,7 +562,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentOnInterface1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentOnParameter1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentOnParameter2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentOnParameter3.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentOnParenthesizedExpressionOpenParen1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentOnSignature1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentWithUnreasonableIndentationLevel01.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/commentsAfterCaseClauses1.ts @@ -650,9 +631,7 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/computerPropertiesInES5 Mismatch: tasks/coverage/typescript/tests/cases/compiler/concatClassAndString.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/conditionalEqualityOnLiteralObjects.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/conditionalEqualityTestingNullability.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/conditionalExpression1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/conditionalExpressions2.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/conditionalReturnExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/conditionalTypeAnyUnion.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/conditionalTypeAssignabilityWhenDeferred.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/conditionalTypeBasedContextualTypeReturnTypeWidening.ts @@ -672,9 +651,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/consistentAliasVsNonAli Mismatch: tasks/coverage/typescript/tests/cases/compiler/constDeclarationShadowedByVarDeclaration.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/constDeclarationShadowedByVarDeclaration2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/constDeclarationShadowedByVarDeclaration3.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/constDeclarations-access2.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/constDeclarations-access3.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/constDeclarations-access4.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/constDeclarations-access5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/constDeclarations-ambient.ts Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/constDeclarations-errors.ts @@ -770,8 +746,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypeIterableU Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypeLogicalOr.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypeObjectSpreadExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypeOfIndexedAccessParameter.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypeOnYield1.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypeOnYield2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypeSelfReferencing.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypeShouldBeLiteral.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypesNegatedTypeLikeConstraintInGenericMappedType1.ts @@ -798,7 +772,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTyping35.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTyping36.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTyping37.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTyping4.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTyping41.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTyping5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTyping6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTyping7.ts @@ -813,7 +786,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypingOfObjec Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypingOfObjectLiterals2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypingOfOptionalMembers.tsx Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypingOfTooShortOverloads.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypingWithGenericAndNonGenericSignature.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextualTypingWithGenericSignature.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextuallyTypeAsyncFunctionReturnTypeFromUnion.ts @@ -833,7 +805,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextuallyTypedSymbol Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextuallyTypingOrOperator.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextuallyTypingOrOperator2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contextuallyTypingRestParameters.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/continueInLoopsWithCapturedBlockScopedBindings1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/continueLabel.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/continueNotInIterationStatement4.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/continueStatementInternalComments.ts @@ -846,21 +817,17 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/continueTarget6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contravariantInferenceAndTypeGuard.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contravariantOnlyInferenceFromAnnotatedFunction.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/contravariantOnlyInferenceWithAnnotatedOptionalParameter.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/contravariantTypeAliasInference.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowAliasedDiscriminants.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowAnalysisOnBareThisKeyword.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowArrays.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowAutoAccessor1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowBreakContinueWithLabel.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowCaching.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowCommaExpressionAssertionWithinTernary.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowCommaExpressionFunctionCall.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowDestructuringLoop.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowDestructuringParameters.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowDestructuringVariablesInTryCatch.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowFavorAssertedTypeThroughTypePredicate.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowForCatchAndFinally.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowForCompoundAssignmentToThisMember.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowForIndexSignatures.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowForStatementContinueIntoIncrementor1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/controlFlowInitializedDestructuringVariables.ts @@ -930,12 +897,9 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileOptionalInterfa Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFilePrivateMethodOverloads.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileRegressionTests.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileRestParametersOfFunctionAndFunctionType.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileTypeAnnotationArrayType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileTypeAnnotationParenType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileTypeAnnotationUnionType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declFileTypeofEnum.ts @@ -961,7 +925,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitBindingP Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitBindingPatternsFunctionExpr.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitBindingPatternsUnused.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitBundlePreservesHasNoDefaultLibDirective.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitBundleWithAmbientReferences.ts tasks/coverage/typescript/tests/cases/compiler/declarationEmitBundlerConditions.ts Unexpected estree file content error: 3 != 4 @@ -1025,12 +988,10 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitExpandoW Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitExportAliasVisibiilityMarking.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitExportAssignedNamespaceNoTripleSlashTypesReference.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitExpressionInExtends3.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitExpressionInExtends5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitExpressionInExtends6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitExpressionInExtends7.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitExpressionWithNonlocalPrivateUniqueSymbol.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitFBoundedTypeParams.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitFirstTypeArgumentGenericFunctionType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitForDefaultExportClassExtendingExpression01.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitForGlobalishSpecifierSymlink.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitForGlobalishSpecifierSymlink2.ts @@ -1054,7 +1015,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitInferred Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitInferredTypeAlias9.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitInferredUndefinedPropFromFunctionInArray.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitInlinedDistributiveConditional.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitInterfaceWithNonEntityNameExpressionHeritage.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitInvalidReference.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitInvalidReference2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitInvalidReferenceAllowJs.ts @@ -1083,7 +1043,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitNameConf Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitNameConflictsWithAlias.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitNamespaceMergedWithInterfaceNestedFunction.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitNestedAnonymousMappedType.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitNestedGenerics.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitNoInvalidCommentReuse1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitNoInvalidCommentReuse2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/declarationEmitNoInvalidCommentReuse3.ts @@ -1243,7 +1202,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/defaultNamedExportWithT Mismatch: tasks/coverage/typescript/tests/cases/compiler/defaultNamedExportWithType3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/defaultNamedExportWithType4.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/defaultOfAnyInStrictNullChecks.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/defaultParameterAddsUndefinedWithStrictNullChecks.ts tasks/coverage/typescript/tests/cases/compiler/defaultPropsEmptyCurlyBecomesAnyForJs.ts Unexpected estree file content error: 2 != 3 @@ -1297,7 +1255,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/destructuringWithNumber Mismatch: tasks/coverage/typescript/tests/cases/compiler/detachedCommentAtStartOfLambdaFunction1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/detachedCommentAtStartOfLambdaFunction2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/didYouMeanStringLiteral.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/discriminableUnionWithIntersectedMembers.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/discriminantElementAccessCheck.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/discriminantNarrowingCouldBeCircular.ts @@ -1345,7 +1302,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/doWhileUnreachableCode. Mismatch: tasks/coverage/typescript/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2015.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/doYouNeedToChangeYourTargetLibraryES2023.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/doesNotNarrowUnionOfConstructorsWithInstanceof.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/dottedModuleName2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/dottedNamesInSystem.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/dottedSymbolResolution1.ts @@ -1543,21 +1499,12 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/errorsOnUnionsOfOverlap Mismatch: tasks/coverage/typescript/tests/cases/compiler/errorsWithInvokablesInUnions01.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es2015modulekind.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es2015modulekindWithES6Target.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/es2017basicAsync.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es2018ObjectAssign.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionArrayLiterals.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionBinaryExpressions.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionCallExpressions.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionConditionals.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionDoStatements.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionElementAccess.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionForInStatements.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionForOfStatements.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionLongObjectLiteral.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionNestedLoops.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionNewExpressions.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionObjectLiterals.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionPropertyAccess.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-asyncFunctionWhileStatements.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-commonjs.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/es5-commonjs2.ts @@ -1659,7 +1606,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/esModuleIntersectionCra Mismatch: tasks/coverage/typescript/tests/cases/compiler/esNextWeakRefs_IterableWeakMap.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/escapedIdentifiers.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/escapedReservedCompilerNamedIdentifier.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/evalAfter0.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/evalOrArgumentsInDeclarationFunctions.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/eventEmitterPatternWithRecordOfFunction.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/evolvingArrayTypeInAssert.ts @@ -1817,7 +1763,6 @@ tasks/coverage/typescript/tests/cases/compiler/extendsUntypedModule.ts Unexpected estree file content error: 1 != 3 Mismatch: tasks/coverage/typescript/tests/cases/compiler/externalModuleAssignToVar.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/externalModuleExportingGenericClass.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/externalModuleImmutableBindings.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/externalModuleQualification.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/externalModuleReferenceDoubleUnderscore1.ts @@ -1854,7 +1799,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/forLoopEndingMultilineC Mismatch: tasks/coverage/typescript/tests/cases/compiler/forLoopWithDestructuringDoesNotElideFollowingStatement.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/forOfStringConstituents.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/forOfTransformsExpression.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/forwardDeclaredCommonTypes01.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/forwardRefInEnum.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/forwardRefInTypeDeclaration.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/freshLiteralInference.ts @@ -1909,12 +1853,9 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionSignatureAssign Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionSubtypingOfVarArgs.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionSubtypingOfVarArgs2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionToFunctionWithPropError.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionTypeArgumentArityErrors.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionTypeArgumentArrayAssignment.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionWithAnyReturnTypeAndNoReturnExpression.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionWithDefaultParameterWithNoStatements12.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionWithDefaultParameterWithNoStatements15.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionWithDefaultParameterWithNoStatements4.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/functionsWithImplicitReturnTypeAssignableToUndefined.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/funduleUsedAcrossFileBoundary.ts @@ -1991,7 +1932,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericOverloadSignatur Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericPrototypeProperty2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericRecursiveImplicitConstructorErrors2.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericRestArgs.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericRestTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericReturnTypeFromGetter1.ts @@ -2002,7 +1942,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericSpecializations3 Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericTemplateOverloadResolution.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericTupleWithSimplifiableElements.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericTypeArgumentInference1.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericTypeAssertions3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericTypeAssertions5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericTypeParameterEquivalence2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts @@ -2036,7 +1975,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/gettersAndSetters.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/gettersAndSettersTypesAgree.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/globalIsContextualKeyword.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/globalThisCapture.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/grammarAmbiguities1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/higherOrderMappedIndexLookupInference.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/homomorphicMappedTypeIntersectionAssignability.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/homomorphicMappedTypeNesting.ts @@ -2164,7 +2102,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/importedModuleAddToGlob Mismatch: tasks/coverage/typescript/tests/cases/compiler/importedModuleClassNameClash.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/importsInAmbientModules2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/importsInAmbientModules3.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/inDoesNotOperateOnPrimitiveTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inKeywordAndIntersection.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inKeywordAndUnknown.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inKeywordTypeguard.ts @@ -2206,7 +2143,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/indexedAccessConstraint Mismatch: tasks/coverage/typescript/tests/cases/compiler/indexedAccessImplicitlyAny.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/indexedAccessKeyofNestedSimplifiedSubstituteUnwrapped.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/indexedAccessNormalization.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/indexedAccessPrivateMemberOfGenericConstraint.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/indexedAccessRelation.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/indexedAccessRetainsIndexSignature.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/indexedAccessToThisTypeOnIntersection01.ts @@ -2276,7 +2212,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/inferredRestTypeFixedOn Mismatch: tasks/coverage/typescript/tests/cases/compiler/inferredReturnTypeIncorrectReuse1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inferrenceInfiniteLoopWithSubtyping.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inferringAnyFunctionType1.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/inferringAnyFunctionType3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inferringAnyFunctionType5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/infiniteConstraints.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/infiniteExpandingTypeThroughInheritanceInstantiation.ts @@ -2306,9 +2241,7 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/inheritedStringIndexers Mismatch: tasks/coverage/typescript/tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/initializePropertiesWithRenamedLet.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/initializedParameterBeforeNonoptionalNotOptional.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/initializerWithThisPropertyAccess.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/initializersInAmbientEnums.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/inlineConditionalHasSimilarAssignability.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inlineMappedTypeModifierDeclarationEmit.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inlineSourceMap2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inlinedAliasAssignableToConstraintSameAsAlias.ts @@ -2321,7 +2254,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/instanceSubtypeCheck1.t Mismatch: tasks/coverage/typescript/tests/cases/compiler/instanceofNarrowReadonlyArray.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/instanceofOnInstantiationExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/instanceofTypeAliasToGenericClass.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/instanceofWithPrimitiveUnion.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/instanceofWithStructurallyIdenticalTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/instantiateContextualTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/instantiateContextuallyTypedGenericThis.ts @@ -2422,7 +2354,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/intersectionTypeInferen Mismatch: tasks/coverage/typescript/tests/cases/compiler/intersectionTypeNormalization.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/intersectionTypeWithLeadingOperator.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/intersectionType_useDefineForClassFields.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/intersectionWithConflictingPrivates.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/intersectionWithConstructSignaturePrototypeResult.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/intersectionsAndOptionalProperties.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/intersectionsAndOptionalProperties2.ts @@ -2660,7 +2591,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/jsxNamespaceNoElementCh Mismatch: tasks/coverage/typescript/tests/cases/compiler/jsxNamespacePrefixIntrinsics.tsx Mismatch: tasks/coverage/typescript/tests/cases/compiler/jsxNamespaceReexports.tsx Mismatch: tasks/coverage/typescript/tests/cases/compiler/jsxNamespacedNameNotComparedToNonMatchingIndexSignature.tsx -Mismatch: tasks/coverage/typescript/tests/cases/compiler/jsxNestedWithinTernaryParsesCorrectly.tsx Mismatch: tasks/coverage/typescript/tests/cases/compiler/jsxPartialSpread.tsx Mismatch: tasks/coverage/typescript/tests/cases/compiler/jsxPropsAsIdentifierNames.tsx Mismatch: tasks/coverage/typescript/tests/cases/compiler/jsxSpreadFirstUnionNoErrors.tsx @@ -2674,7 +2604,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/keyofObjectWithGlobalSy Mismatch: tasks/coverage/typescript/tests/cases/compiler/keywordExpressionInternalComments.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/keywordField.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/knockout.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/lambdaExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/lambdaParamTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/lambdaParameterWithTupleArgsHasCorrectAssignability.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/lambdaPropSelf.ts @@ -2684,7 +2613,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/lastPropertyInLiteralWi Mismatch: tasks/coverage/typescript/tests/cases/compiler/lateBoundConstraintTypeChecksCorrectly.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/lateBoundDestructuringImplicitAnyError.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/lateBoundFunctionMemberAssignmentDeclarations.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/letDeclarations-access.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/letDeclarations-es5-1.ts Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/letDeclarations-invalidContexts.ts Expected a semicolon or an implicit semicolon after a statement, but found none @@ -2704,7 +2632,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/letInVarDeclOfForIn_ES5 Mismatch: tasks/coverage/typescript/tests/cases/compiler/letInVarDeclOfForIn_ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/letInVarDeclOfForOf_ES5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/letInVarDeclOfForOf_ES6.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/letShadowedByNameInNestedScope.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/libCompileChecks.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/libTypeScriptOverrideSimple.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/libTypeScriptOverrideSimpleConfig.ts @@ -2718,7 +2645,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/library_RegExpExecArray Mismatch: tasks/coverage/typescript/tests/cases/compiler/library_StringSlice.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/lift.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/limitDeepInstantiations.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/listFailure.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/literalIntersectionYieldsLiteral.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/literalWideningWithCompoundLikeAssignments.ts @@ -2806,7 +2732,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/missingCommaInTemplateS Mismatch: tasks/coverage/typescript/tests/cases/compiler/missingDomElements.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/missingFunctionImplementation.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/missingImportAfterModuleImport.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/missingSemicolonInModuleSpecifier.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/missingTypeArguments3.ts Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/misspelledNewMetaProperty.ts The only valid meta property for new is new.target @@ -3012,14 +2937,11 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/mutuallyRecursiveGeneri Mismatch: tasks/coverage/typescript/tests/cases/compiler/mutuallyRecursiveInference.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/mutuallyRecursiveInterfaceDeclaration.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/nameCollisionsInPropertyAssignments.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/namedFunctionExpressionCall.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/namedFunctionExpressionCallErrors.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/namedImportNonExistentName.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/namespaceDisambiguationInUnion.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/namespaceMergedWithFunctionWithOverloadsUsage.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/namespaceMergedWithImportAliasNoCrash.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/namespaceNotMergedWithFunctionDefaultExport.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/nanEquality.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/narrowByBooleanComparison.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/narrowByClauseExpressionInSwitchTrue1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/narrowByClauseExpressionInSwitchTrue2.ts @@ -3070,14 +2992,11 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/nestedLoopTypeGuards.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/nestedLoops.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/nestedObjectRest.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/nestedRecursiveArraysOrObjectsError01.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/nestedRecursiveLambda.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/nestedSuperCallEmit.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/nestedThisContainer.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/nestedTypeVariableInfersLiteral.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/neverAsDiscriminantType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/newAbstractInstance2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/newFunctionImplicitAny.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/newLexicalEnvironmentForConvertedLoop.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/newNamesInGlobalAugmentations1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/noAsConstNameLookup.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/noCheckDoesNotReportError.ts @@ -3257,8 +3176,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/optionalParamAssignment Mismatch: tasks/coverage/typescript/tests/cases/compiler/optionalParameterInDestructuringWithInitializer.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/optionalParameterProperty.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/optionalParameterRetainsNull.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/optionalParamterAndVariableDeclaration.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/optionalPropertiesInClasses.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/optionalPropertiesTest.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/optionalTupleElementsAndUndefined.ts @@ -3316,13 +3233,8 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/parameterReferenceInIni Mismatch: tasks/coverage/typescript/tests/cases/compiler/paramsOnlyHaveLiteralTypesWhenAppropriatelyContextualized.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/paramterDestrcuturingDeclaration.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/parenthesisDoesNotBlockAliasSymbolCreation.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/parenthesizedArrowExpressionASI.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/parenthesizedAsyncArrowFunction.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/parenthesizedExpressionInternalComments.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/parenthesizedSatisfiesExpressionWithComments.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/parseArrowFunctionWithFunctionReturnType.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/parseCommaSeparatedNewlineNumber.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/parseCommaSeparatedNewlineString.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/parseEntityNameWithReservedWord.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/parseInvalidNonNullableTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/parseInvalidNullableTypes.ts @@ -3437,7 +3349,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/propertiesAndIndexers.t Mismatch: tasks/coverage/typescript/tests/cases/compiler/propertiesAndIndexers2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/propertyAccess1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/propertyAccessExpressionInnerComments.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/propertyAccessOnObjectLiteral.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/propertyAssignment.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/propertyIdentityWithPrivacyMismatch.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/propertyNamesWithStringLiteral.ts @@ -3465,7 +3376,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/reachabilityChecks4.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/reachabilityChecks5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/reachabilityChecks6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/reachabilityChecks7.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/reachabilityChecks8.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx Mismatch: tasks/coverage/typescript/tests/cases/compiler/reactHOCSpreadprops.tsx tasks/coverage/typescript/tests/cases/compiler/reactImportDropped.ts @@ -3485,12 +3395,8 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/readonlyMembers.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/readonlyPropertySubtypeRelationDirected.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/readonlyTupleAndArrayElaboration.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/reboundBaseClassSymbol.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/rectype.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveArrayNotCircular.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveBaseCheck2.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveBaseCheck3.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveBaseCheck4.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveBaseCheck5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveBaseCheck6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveClassBaseType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveClassReferenceTest.ts @@ -3507,14 +3413,12 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveExportAssignme Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveFieldSetting.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveGenericTypeHierarchy.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveIdenticalAssignment.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveIdenticalOverloadResolution.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveInferenceBug.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveInheritance.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveInheritance3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveInheritanceGeneric.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveLetConst.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveMods.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveNamedLambdaCall.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/recursiveObjectLiteral.ts tasks/coverage/typescript/tests/cases/compiler/recursiveResolveDeclaredMembers.ts Unexpected estree file content error: 1 != 2 @@ -3564,21 +3468,7 @@ Unexpected estree file content error: 1 != 3 Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireEmitSemicolon.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfAnEmptyFile1.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFile.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileNonRelative.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithAlwaysStrictWithoutErrors.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithAmd.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithDeclaration.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithEmptyObjectWithErrors.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithErrors.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithNoContent.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithSourceMap.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithTraillingComma.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithoutAllowJs.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithoutExtension.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithoutExtensionResolvesToTs.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithoutOutDir.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/requireOfJsonFileWithoutResolveJsonModule.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/requiredInitializedParameter1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/requiredInitializedParameter2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/requiredInitializedParameter3.ts @@ -3618,7 +3508,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/restUnion2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/restUnion3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/returnInConstructor1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/returnInfiniteIntersection.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/returnStatement1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/returnTypeInferenceNotTooBroad.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/returnTypePredicateIsInstantiateInContextOfTarget.tsx Mismatch: tasks/coverage/typescript/tests/cases/compiler/returnTypeTypeArguments.ts @@ -3644,7 +3533,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/reverseMappedUnionInfer Mismatch: tasks/coverage/typescript/tests/cases/compiler/reversedRecusiveTypeInstantiation.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/satisfiesEmit.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/selfInLambdas.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/selfRef.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/selfReferencingFile.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/selfReferencingFile2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/selfReferencingFile3.ts @@ -3685,7 +3573,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/signatureInstantiationW Mismatch: tasks/coverage/typescript/tests/cases/compiler/signatureOverloadsWithComments.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/silentNeverPropagation.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/simpleArrowFunctionParameterReferencedInObjectLiteral1.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/simpleRecursionWithBaseCase2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/simplifyingConditionalWithInteriorConditionalIsRelated.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/slightlyIndirectedDeepObjectLiteralElaborations.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/sourceMap-Comment1.ts @@ -3750,7 +3637,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/sourceMapValidationFunc Mismatch: tasks/coverage/typescript/tests/cases/compiler/sourceMapValidationFunctions.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/sourceMapValidationImport.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/sourceMapValidationLabeled.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/sourceMapValidationLambdaSpanningMultipleLines.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/sourceMapValidationStatements.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/sourceMapWithCaseSensitiveFileNames.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/sourceMapWithCaseSensitiveFileNamesAndOutDir.ts @@ -3854,7 +3740,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/substitutionTypesInInde Mismatch: tasks/coverage/typescript/tests/cases/compiler/subtypeReductionUnionConstraints.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/super1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/super2.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/superAccessCastedCall.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/superCallArgsMustMatch.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts @@ -3932,7 +3817,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/targetTypeObjectLiteral Mismatch: tasks/coverage/typescript/tests/cases/compiler/targetTypeTest1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/targetTypeTest2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/targetTypeTest3.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/targetTypeVoidFunc.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/templateExpressionAsPossiblyDiscriminantValue.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/templateExpressionNoInlininingOfConstantBindingWithInitializer.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/templateLiteralConstantEvaluation.ts @@ -3955,7 +3839,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/thisInAccessors.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/thisInClassBodyStaticESNext.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/thisInConstructorParameter2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/thisInGenericStaticMembers.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/thisInInnerFunctions.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/thisInPropertyBoundDeclarations.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/thisInSuperCall.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/thisInSuperCall1.ts @@ -4041,7 +3924,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeArgumentInferenceWi Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeAssertionToGenericFunctionType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeAssignabilityErrorMessage.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeCheckObjectLiteralMethodBody.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeCheckTypeArgument.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeComparisonCaching.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeConstraintsWithConstructSignatures.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeGuardConstructorClassAndNumber.ts @@ -4056,7 +3938,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeGuardNarrowsIndexed Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty11.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty12.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty2.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty5.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty6.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty7.ts @@ -4083,7 +3964,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeParameterAssignment Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeParameterCompatibilityAccrossDeclarations.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeParameterConstrainedToOuterTypeParameter2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeParameterConstraintInstantiation.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeParameterConstraints1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeParameterExplicitlyExtendsAny.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeParameterExtendsPrimitive.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeParameterFixingWithConstraints.ts @@ -4132,7 +4012,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeVal.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeVariableConstraintIntersections.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeVariableConstraintedToAliasNotAssignableToUnion.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typeVariableTypeGuards.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/typecheckCommaExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typecheckIfCondition.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typedArrayConstructorOverloads.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/typedArrays.ts @@ -4157,9 +4036,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/umdGlobalConflict.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/umdNamedAmdMode.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/umdNamespaceMergedWithGlobalAugmentationIsNotCircular.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unaryPlus.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/uncalledFunctionChecksInConditional.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/uncalledFunctionChecksInConditional2.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/uncalledFunctionChecksInConditionalPerf.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/uncaughtCompilerError1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/undeclaredModuleError.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/undeclaredVarEmit.ts @@ -4181,7 +4057,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionExcessPropsWithPar Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionOfArraysFilterCall.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionOfClassCalls.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionOfEnumInference.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionOfFunctionAndSignatureIsCallable.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionPropertyExistence.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionPropertyOfProtectedAndIntersectionProperty.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionReductionMutualSubtypes.ts @@ -4195,8 +4070,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionTypeWithIndexAndMe Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionTypeWithIndexAndTuple.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionTypeWithIndexedLiteralType.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionTypeWithLeadingOperator.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction1.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction3.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unionWithIndexSignature.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/uniqueSymbolAllowsIndexInObjectWithIndexSignature.ts @@ -4240,7 +4113,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/unusedMethodsInInterfac Mismatch: tasks/coverage/typescript/tests/cases/compiler/unusedParameterProperty1.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unusedParameterProperty2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unusedParametersWithUnderscore.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/unusedPrivateStaticMembers.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unusedSetterInClass2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unusedTypeParameterInInterface2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/unusedTypeParameters10.ts @@ -4280,9 +4152,7 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/verbatim-declarations-p Mismatch: tasks/coverage/typescript/tests/cases/compiler/verbatimModuleSyntaxDefaultValue.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/visibilityOfCrossModuleTypeUsage.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/visibilityOfTypeParameters.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/voidArrayLit.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/voidAsNonAmbiguousReturnType.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/voidFunctionAssignmentCompat.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/voidReturnIndexUnionInference.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/voidUndefinedReduction.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/vueLikeDataAndPropsInference.ts @@ -4302,11 +4172,8 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/yieldInForInInDownlevel Expect to Parse: tasks/coverage/typescript/tests/cases/compiler/yieldStringLiteral.ts A 'yield' expression is only allowed in a generator body. Mismatch: tasks/coverage/typescript/tests/cases/conformance/Symbols/ES5SymbolProperty1.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/Symbols/ES5SymbolProperty2.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/Symbols/ES5SymbolProperty3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/Symbols/ES5SymbolProperty4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/Symbols/ES5SymbolProperty5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/Symbols/ES5SymbolProperty6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/Symbols/ES5SymbolProperty7.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/additionalChecks/noPropertyAccessFromIndexSignature1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/ambient/ambientDeclarations.ts @@ -4331,7 +4198,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/asyncAw Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/asyncAwait_es2017.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/asyncMethodWithSuperConflict_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/asyncMethodWithSuper_es2017.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/awaitBinaryExpression/awaitBinaryExpression4_es2017.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/awaitBinaryExpression/awaitBinaryExpression5_es2017.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/awaitCallExpression/awaitCallExpression1_es2017.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/awaitCallExpression/awaitCallExpression2_es2017.ts @@ -4341,7 +4207,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/awaitCa Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/awaitCallExpression/awaitCallExpression6_es2017.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/awaitCallExpression/awaitCallExpression7_es2017.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/awaitCallExpression/awaitCallExpression8_es2017.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/awaitClassExpression_es2017.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/await_incorrectThisType.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/await_unaryExpression_es2017.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es2017/await_unaryExpression_es2017_1.ts @@ -4358,7 +4223,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/asyncAwait Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/asyncAwaitNestedClasses_es5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/asyncAwait_es5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/asyncMethodWithSuper_es5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/awaitBinaryExpression/awaitBinaryExpression4_es5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/awaitBinaryExpression/awaitBinaryExpression5_es5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/awaitCallExpression/awaitCallExpression1_es5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/awaitCallExpression/awaitCallExpression2_es5.ts @@ -4368,7 +4232,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/awaitCallE Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/awaitCallExpression/awaitCallExpression6_es5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/awaitCallExpression/awaitCallExpression7_es5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/awaitCallExpression/awaitCallExpression8_es5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/awaitClassExpression_es5.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration12_es5.ts Cannot use `await` as an identifier in an async context Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts @@ -4384,7 +4247,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/asyncAwait Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/asyncAwait_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/asyncMethodWithSuper_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/asyncWithVarShadowing_es6.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/awaitBinaryExpression/awaitBinaryExpression4_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/awaitBinaryExpression/awaitBinaryExpression5_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression1_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression2_es6.ts @@ -4394,7 +4256,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/awaitCallE Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression6_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression7_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression8_es6.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/awaitClassExpression_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/await_unaryExpression_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/await_unaryExpression_es6_1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/async/es6/await_unaryExpression_es6_2.ts @@ -4415,7 +4276,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclara Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclarations/classBody/classWithEmptyBody.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclarations/classExtendingClassLikeType.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclarations/classExtendingNull.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingOptionalChain.ts Expected `{` but found `?.` Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts @@ -4427,7 +4287,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclara Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclarations/mergedInheritedClassInterface.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classDeclarations/modifierOnClassDeclarationMemberInFunction.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classExpression.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classExpressions/classExpression4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classExpressions/classWithStaticFieldInParameterBindingPattern.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classExpressions/classWithStaticFieldInParameterBindingPattern.3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/classExpressions/classWithStaticFieldInParameterBindingPattern.ts @@ -4501,12 +4360,7 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/inhe Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/superInStaticMembers1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/thisAndSuperInStaticMembers1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/thisAndSuperInStaticMembers2.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/thisAndSuperInStaticMembers3.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/thisAndSuperInStaticMembers4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers7.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers8.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers9.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInstanceMemberNarrowedWithLoopAntecedent.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameAccessorsCallExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameAndObjectRestSpread.ts @@ -4515,7 +4369,6 @@ Unexpected token Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameBadDeclaration.ts Unexpected token Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameComputedPropertyName1.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameComputedPropertyName2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameComputedPropertyName4.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameConstructorReserved.ts Classes can't have an element named '#constructor' @@ -4525,7 +4378,6 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/classes/membe Unexpected token Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameFieldCallExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameFieldDestructuredBinding.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameInLhsReceiverExpression.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameInObjectLiteral-1.ts Unexpected token Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameInObjectLiteral-2.ts @@ -4533,16 +4385,13 @@ Unexpected token Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameInObjectLiteral-3.ts Unexpected token Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameMethodAssignment.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameMethodAsync.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameMethodCallExpression.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameSetterExprReturnValue.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameStaticAccessorsAccess.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameStaticAccessorsCallExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameStaticEmitHelpers.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameStaticFieldCallExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameStaticFieldDestructuredBinding.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameStaticMethodAssignment.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameStaticMethodAsync.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameStaticMethodCallExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNameUnused.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/classes/members/privateNames/privateNamesUnique-2.ts @@ -4624,7 +4473,6 @@ Expected `,` but found `is` Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowAliasing.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowAssignmentExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowAssignmentPatternOrder.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowBinaryAndExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowBinaryOrExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowBindingElement.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowBindingPatternOrder.ts @@ -4636,7 +4484,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlF Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowElementAccessNoCrash1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowForInStatement2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowGenericTypes.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowIIFE.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowIfStatement.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowInOperator.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowInstanceofExtendsFunction.ts @@ -4648,7 +4495,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlF Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowOptionalChain3.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowParameter.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowStringIndex.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowTruthiness.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/controlFlowWithTemplateLiterals.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/dependentDestructuredVariables.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/dependentDestructuredVariablesFromNestedPatterns.ts @@ -4657,7 +4503,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/exhausti Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/neverReturningFunctions1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/switchWithConstrainedTypeVariable.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/typeGuardsAsAssertions.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/typeGuardsNestedAssignments.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/controlFlow/typeGuardsTypeParameters.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/declarationEmit/declarationEmitWorkWithInlineComments.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/declarationEmit/exportDefaultExpressionComments.ts @@ -4691,8 +4536,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/decorators/class/dec Mismatch: tasks/coverage/typescript/tests/cases/conformance/decorators/class/decoratorInstantiateModulesInFunctionBodies.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/decorators/class/decoratorOnClass2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/decorators/class/decoratorOnClass3.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod19.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/decorators/class/method/parameter/decoratorOnClassMethodParameter3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty12.ts @@ -4766,17 +4609,8 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/dynamicImport/import Mismatch: tasks/coverage/typescript/tests/cases/conformance/dynamicImport/importCallExpressionShouldNotGetParen.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/dynamicImport/importCallExpressionWithTypeArgument.ts Unexpected token -Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es2015/asyncGenerators/emitter.asyncGenerators.classMethods.es2015.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es2015/asyncGenerators/emitter.asyncGenerators.functionDeclarations.es2015.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es2015/asyncGenerators/emitter.asyncGenerators.functionExpressions.es2015.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es2015/asyncGenerators/emitter.asyncGenerators.objectLiteralMethods.es2015.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es2018/asyncGenerators/emitter.asyncGenerators.classMethods.es2018.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es2018/asyncGenerators/emitter.asyncGenerators.functionDeclarations.es2018.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es2018/asyncGenerators/emitter.asyncGenerators.functionExpressions.es2018.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es2018/asyncGenerators/emitter.asyncGenerators.objectLiteralMethods.es2018.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es5/asyncGenerators/emitter.asyncGenerators.classMethods.es5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es5/asyncGenerators/emitter.asyncGenerators.functionDeclarations.es5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es5/asyncGenerators/emitter.asyncGenerators.functionExpressions.es5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/emitter/es5/asyncGenerators/emitter.asyncGenerators.objectLiteralMethods.es5.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/enums/awaitAndYield.ts `await` is only allowed within async functions and at the top levels of modules @@ -4799,10 +4633,7 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2017/useObjectValu Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2017/useObjectValuesAndEntries4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2018/es2018IntlAPIs.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2019/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2019/globalThisAmbientModules.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2019/globalThisBlockscopedProperties.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2019/globalThisGlobalExportAsGlobal.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2019/globalThisTypeIndexAccess.ts tasks/coverage/typescript/tests/cases/conformance/es2019/globalThisVarDeclaration.ts Unexpected estree file content error: 1 != 2 @@ -4821,9 +4652,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2021/logicalAssign Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment4.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment6.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment7.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment8.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2021/logicalAssignment/logicalAssignment9.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es2022/arbitraryModuleNamespaceIdentifiers/arbitraryModuleNamespaceIdentifiers_exportEmpty.ts @@ -4873,8 +4701,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolPr Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty38.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty41.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty46.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty47.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty52.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty53.ts @@ -4888,17 +4714,11 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolPr Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty61.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty8.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolProperty9.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType1.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType11.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType12.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType16.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType17.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType18.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType19.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType20.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType3.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType6.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/Symbols/symbolType8.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts Line terminator not permitted before arrow Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/arrowFunction/emitArrowFunction.ts @@ -5009,8 +4829,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperti Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNames25_ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNames26_ES5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNames26_ES6.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNames27_ES5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNames27_ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNames28_ES5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNames28_ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNames29_ES5.ts @@ -5079,7 +4897,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperti Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit6_ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES6.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticProperty.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/decorators/class/accessor/decoratorOnClassAccessor1.es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/decorators/class/decoratorOnClass2.es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/decorators/class/decoratorOnClass3.es6.ts @@ -5107,7 +4924,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/de Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment5SiblingInitializer.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/destructuringAssignabilityCheck.ts @@ -5231,8 +5047,7 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/re Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/restElementWithInitializer2.ts Cannot assign to this expression Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/restElementWithNullInitializer.ts -Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/restPropertyWithBindingPattern.ts -Cannot assign to this expression +Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/destructuring/restPropertyWithBindingPattern.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/for-ofStatements/for-of1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/for-ofStatements/for-of10.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/for-ofStatements/for-of11.ts @@ -5370,8 +5185,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/shorthandPropert Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/spread/arrayLiteralSpread.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/spread/arrayLiteralSpreadES5iterable.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/spread/arraySpreadImportHelpers.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/spread/arraySpreadInCall.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts @@ -5602,7 +5415,6 @@ Missing initializer in const declaration Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/variableDeclarations/VariableDeclaration6_es6.ts Unexpected token Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts A 'yield' expression is only allowed in a generator body. Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts @@ -5613,25 +5425,17 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpr A 'yield' expression is only allowed in a generator body. Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts A 'yield' expression is only allowed in a generator body. -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts A 'yield' expression is only allowed in a generator body. -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorNoImplicitReturns.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck28.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck32.ts A 'yield' expression is only allowed in a generator body. -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck40.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck41.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck42.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck43.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck44.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck46.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck55.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck59.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck60.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck61.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck62.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck63.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck7.ts @@ -5677,7 +5481,6 @@ Unexpected trailing comma after rest element Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/es7/trailingCommasInFunctionParametersAndArguments.ts A rest parameter must be last in a parameter list Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classDeclaration/classSuper/esDecorators-classDeclaration-classSuper.1.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classDeclaration/classSuper/esDecorators-classDeclaration-classSuper.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classDeclaration/classSuper/esDecorators-classDeclaration-classSuper.3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classDeclaration/classSuper/esDecorators-classDeclaration-classSuper.4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classDeclaration/classSuper/esDecorators-classDeclaration-classSuper.5.ts @@ -5699,13 +5502,11 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classDe Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classDeclaration/fields/esDecorators-classDeclaration-fields-staticAccessor.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classDeclaration/fields/esDecorators-classDeclaration-fields-staticPrivateAccessor.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.1.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/esDecorators-classExpression-commentPreservation.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/esDecorators-classExpression-missingEmitHelpers-classDecorator.13.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/esDecorators-classExpression-missingEmitHelpers-classDecorator.14.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/esDecorators-classExpression-missingEmitHelpers-classDecorator.17.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/esDecorators-classExpression-missingEmitHelpers-classDecorator.3.ts @@ -5713,7 +5514,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classEx Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/esDecorators-classExpression-missingEmitHelpers-classDecorator.6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/esDecorators-classExpression-missingEmitHelpers-classDecorator.7.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/esDecorators-classExpression-missingEmitHelpers-classDecorator.8.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/namedEvaluation/esDecorators-classExpression-namedEvaluation.11.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/namedEvaluation/esDecorators-classExpression-namedEvaluation.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/namedEvaluation/esDecorators-classExpression-namedEvaluation.4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/classExpression/namedEvaluation/esDecorators-classExpression-namedEvaluation.5.ts @@ -5726,18 +5526,13 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/esDecor Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/esDecorators/esDecorators-decoratorExpression.1.ts Expected a semicolon or an implicit semicolon after a statement, but found none Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/esDecorators-decoratorExpression.2.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/esDecorators-emitDecoratorMetadata.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/esDecorators/esDecorators-preservesThis.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/esnext/logicalAssignment/logicalAssignment11.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/arrayLiterals/arrayLiteralInference.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/asOperator/asOpEmitParens.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/asOperator/asOperator1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/asOperator/asOperator3.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/asOperator/asOperator4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/asOperator/asOperatorASI.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/asOperator/asOperatorAmbiguity.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts @@ -5801,15 +5596,9 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/binaryOp Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrExpressionIsNotContextuallyTyped.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithEveryType.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithTypeParameters.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsBooleanType.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsNumberType.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts @@ -5848,7 +5637,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/function Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/functionCalls/callWithSpread5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/functionCalls/callWithSpreadES6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/functionCalls/functionCalls.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/functionCalls/grammarAmbiguities.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/functionCalls/newWithSpread.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/functionCalls/newWithSpreadES5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/functionCalls/newWithSpreadES6.ts @@ -5864,19 +5652,14 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/function Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/functions/typeOfThisInFunctionExpression.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/functions/voidParamAssignmentCompatibility.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/identifiers/scopeResolutionIdentifiers.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/newOperator/newOperatorConformance.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperator1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperator12.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperator5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperator7.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperator8.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperator9.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperatorInAsyncGenerator.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperatorInParameterBindingPattern.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperatorInParameterBindingPattern.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperatorInParameterInitializer.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperatorInParameterInitializer.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperator_es2020.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts Unexpected token Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/objectLiterals/objectLiteralGettersAndSetters.ts @@ -5896,7 +5679,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/optional Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/optionalChaining/optionalChainingInParameterBindingPattern.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/optionalChaining/optionalChainingInParameterInitializer.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/optionalChaining/optionalChainingInParameterInitializer.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/optionalChaining/optionalChainingInTypeAssertions.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/optionalChaining/optionalChainingInference.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/optionalChaining/propertyAccessChain/propertyAccessChain.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/optionalChaining/propertyAccessChain/propertyAccessChain.ts @@ -5923,20 +5705,16 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuar Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardIntersectionTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardNarrowsPrimitiveIntersection.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardNarrowsToLiteralTypeUnion.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardNesting.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOf.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOfOnInterface.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormIsTypeOnInterfaces.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormNotExpr.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormThisMember.ts Expected a semicolon or an implicit semicolon after a statement, but found none Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormThisMemberErrors.ts Expected a semicolon or an implicit semicolon after a statement, but found none Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfFunction.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfIsOrderIndependent.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfPrimitiveSubtype.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardOfFromPropNameInUnionType.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardRedundancy.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardTypeOfUndefined.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardsDefeat.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/expressions/typeGuards/typeGuardsInClassAccessors.ts @@ -6184,14 +5962,11 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/functions/parameterI Mismatch: tasks/coverage/typescript/tests/cases/conformance/functions/strictBindCallApply1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/functions/strictBindCallApply2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorAssignability.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorImplicitAny.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorReturnContextualType.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorReturnTypeFallback.1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorReturnTypeFallback.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorReturnTypeFallback.4.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorReturnTypeFallback.5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorReturnTypeInference.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorReturnTypeInferenceNonStrict.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/generatorYieldContextualType.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/generators/yieldStatementNoAsiAfterTransform.ts @@ -6470,7 +6245,6 @@ Unexpected estree file content error: 1 != 2 Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsdoc/tsNoCheckForTypescript.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsdoc/tsNoCheckForTypescriptComments1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsdoc/tsNoCheckForTypescriptComments2.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsdoc/typeParameterExtendsUnionConstraintDistributed.ts tasks/coverage/typescript/tests/cases/conformance/jsdoc/typedefCrossModule.ts Unexpected estree file content error: 1 != 5 @@ -6513,8 +6287,8 @@ Unexpected estree file content error: 1 != 2 Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/jsx/jsxParsingError1.tsx JSX expressions may not use the comma operator -Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/jsxParsingError4.tsx -Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/jsxReactTestSuite.tsx +Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/jsx/jsxReactTestSuite.tsx +JSX expressions may not use the comma operator Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/jsxSpreadOverwritesAttributeStrict.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformChildren.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformCustomImport.tsx @@ -6549,11 +6323,7 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDefaultAttrib Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName2.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName3.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName4.tsx -Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName5.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName6.tsx -Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName7.tsx -Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName8.tsx -Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxDynamicTagName9.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxElementResolution.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxElementResolution1.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/jsx/tsxElementResolution10.tsx @@ -6774,7 +6544,6 @@ Unexpected estree file content error: 1 != 6 tasks/coverage/typescript/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts Unexpected estree file content error: 1 != 6 -Mismatch: tasks/coverage/typescript/tests/cases/conformance/node/legacyNodeModulesExportsSpecifierGenerationConditions.ts tasks/coverage/typescript/tests/cases/conformance/node/nodeModules1.ts Unexpected estree file content error: 4 != 12 @@ -6888,7 +6657,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/nonjsExtensions/decl Mismatch: tasks/coverage/typescript/tests/cases/conformance/nonjsExtensions/declarationFileForHtmlImport.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/nonjsExtensions/declarationFileForJsonImport.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/override/override1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/override/override11.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/override/override19.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/override/override20.ts @@ -6932,9 +6700,6 @@ Unexpected estree file content error: 1 != 2 tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression17.ts Unexpected estree file content error: 1 != 2 -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression5.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression7.ts tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression8.ts Unexpected estree file content error: 1 != 2 @@ -6997,14 +6762,11 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/E Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment9.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Expressions/parserAssignmentExpression1.ts Cannot assign to this expression -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Expressions/parserConditionalExpression1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguity3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator4.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Generics/parserGenericsInInterfaceDeclaration1.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity11.ts Cannot assign to this expression @@ -7105,11 +6867,8 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmasc Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser643728.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645484.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/RegressionTests/parserNotHexLiteral1.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpression4.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity2.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity3.ts Unexpected flag a in regular expression literal -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity6.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakTarget3.ts @@ -7154,7 +6913,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/S Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration1.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration10.ts Unexpected token -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration2.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration5.ts Unexpected token Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts @@ -7166,11 +6924,8 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/p Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserKeywordsAsIdentifierName1.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserNotRegex1.ts A 'return' statement can only be used within a function body. -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserNotRegex2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserOptionalTypeMembers1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserParenthesizedVariableAndFunctionInTernary.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserParenthesizedVariableAndParenthesizedFunctionInTernary.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserRealSource1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserRealSource12.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts @@ -7186,7 +6941,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/p Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserS7.6_A4.2_T1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserSbp_7.9_A9_T3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserSyntaxWalker.generated.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserUnicode1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserUnicode2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserUnicode3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/parser/ecmascript5/parserUsingConstructorAsIdentifier.ts @@ -7422,7 +7176,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/continueS Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-await-ofStatements/emitter.forAwait.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-await-ofStatements/forAwaitPerIterationBindingDownlevel.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-inStatements/for-inStatements.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-inStatements/for-inStatementsArray.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-inStatements/for-inStatementsAsyncIdentifier.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-inStatements/for-inStatementsDestructuring3.ts @@ -7469,7 +7222,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/any/assignAnyT Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/any/assignEveryTypeToAny.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/any/narrowExceptionVariableInCatchClause.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.1.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/asyncGenerators/types.asyncGenerators.es2018.2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/conditional/conditionalTypes1.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/conditional/conditionalTypes2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts @@ -7481,14 +7233,8 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/conditional/in Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/conditional/variance.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionAwaitOperand.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes02.tsx -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd03.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializer.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts @@ -7586,7 +7332,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/localTypes/loc Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/localTypes/localTypes2.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/localTypes/localTypes3.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/localTypes/localTypes4.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/localTypes/localTypes5.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/mapped/isomorphicMappedTypeInference.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/mapped/mappedTypeAsClauseRelationships.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/mapped/mappedTypeAsClauses.ts @@ -7759,7 +7504,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/specifyingType Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteral.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteralForOverloads.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteralForOverloads2.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/specifyingTypes/typeLiterals/parenthesizedTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/specifyingTypes/typeQueries/circularTypeofWithVarOrFunc.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts @@ -7809,9 +7553,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/ Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTags03.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint01.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAsTypeParameterConstraint02.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes02.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInVariableDeclarations01.ts Missing initializer in const declaration Mismatch: tasks/coverage/typescript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloadAssignability01.ts diff --git a/tasks/coverage/src/tools/estree.rs b/tasks/coverage/src/tools/estree.rs index eb3804c9e046b..f99a130524e78 100644 --- a/tasks/coverage/src/tools/estree.rs +++ b/tasks/coverage/src/tools/estree.rs @@ -5,8 +5,11 @@ use std::{ }; use oxc::{ - allocator::Allocator, ast_visit::utf8_to_utf16::Utf8ToUtf16, diagnostics::OxcDiagnostic, - parser::Parser, span::SourceType, + allocator::Allocator, + ast_visit::utf8_to_utf16::Utf8ToUtf16, + diagnostics::OxcDiagnostic, + parser::{ParseOptions, Parser}, + span::SourceType, }; use crate::{ @@ -371,7 +374,10 @@ impl Case for EstreeTypescriptCase { for (unit, estree_json) in self.base.units.iter().zip(estree_units.into_iter()) { let source_text = &unit.content; let allocator = Allocator::new(); - let ret = Parser::new(&allocator, source_text, unit.source_type).parse(); + let options = ParseOptions { preserve_parens: false, ..Default::default() }; + let ret = Parser::new(&allocator, source_text, unit.source_type) + .with_options(options) + .parse(); if ret.panicked || !ret.errors.is_empty() { let error = ret