Skip to main content

hermes_ast/
node.rs

1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8//! @generated by gen_nodes.py from include/hermes/AST/ESTree.def — DO NOT EDIT.
9//! Run `python3 rust/crates/ast/gen_nodes.py` to regenerate.
10#![allow(non_camel_case_types)] // NodeKind range sentinels (_Name_First/_Last) mirror C++
11#![allow(clippy::too_many_arguments)] // node `new` arity follows ESTree.def (up to 10 args)
12#![allow(clippy::large_enum_variant)] // one enum over all nodes — boxing would defeat deep-match
13
14use std::cell::Cell;
15use crate::node_child::{NodeChild, NodeLabel, NodeList, NodeMetadata, NodeString, Strictness, INVALID_LABEL};
16use crate::visitor::{Path, TransformResult, Visitor, VisitorMut};
17use crate::NodeId;
18use crate::SemaId;
19
20/// The kind discriminant of an AST node.
21///
22/// Mirrors the C++ `NodeKind` enum: `#[repr(u32)]`, `ESTree.def` order,
23/// with `_Name_First`/`_Last` sentinels interleaved so the `Node::is_*`
24/// range predicates are two integer comparisons.
25#[repr(u32)]
26#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
27pub enum NodeKind {
28    /// The kind of [`Empty`].
29    Empty,
30    /// The kind of [`Metadata`].
31    Metadata,
32    /// Exclusive lower bound of the `FunctionLike` range.
33    _FunctionLike_First,
34    /// The kind of [`Program`].
35    Program,
36    /// The kind of [`FunctionExpression`].
37    FunctionExpression,
38    /// The kind of [`ArrowFunctionExpression`].
39    ArrowFunctionExpression,
40    /// The kind of [`FunctionDeclaration`].
41    FunctionDeclaration,
42    /// The kind of [`ComponentDeclaration`].
43    ComponentDeclaration,
44    /// The kind of [`HookDeclaration`].
45    HookDeclaration,
46    /// Exclusive upper bound of the `FunctionLike` range.
47    _FunctionLike_Last,
48    /// Exclusive lower bound of the `Statement` range.
49    _Statement_First,
50    /// The kind of [`MatchStatement`].
51    MatchStatement,
52    /// Exclusive lower bound of the `LoopStatement` range.
53    _LoopStatement_First,
54    /// The kind of [`WhileStatement`].
55    WhileStatement,
56    /// The kind of [`DoWhileStatement`].
57    DoWhileStatement,
58    /// The kind of [`ForInStatement`].
59    ForInStatement,
60    /// The kind of [`ForOfStatement`].
61    ForOfStatement,
62    /// The kind of [`ForStatement`].
63    ForStatement,
64    /// Exclusive upper bound of the `LoopStatement` range.
65    _LoopStatement_Last,
66    /// The kind of [`DebuggerStatement`].
67    DebuggerStatement,
68    /// The kind of [`EmptyStatement`].
69    EmptyStatement,
70    /// The kind of [`BlockStatement`].
71    BlockStatement,
72    /// The kind of [`StaticBlock`].
73    StaticBlock,
74    /// The kind of [`BreakStatement`].
75    BreakStatement,
76    /// The kind of [`ContinueStatement`].
77    ContinueStatement,
78    /// The kind of [`ThrowStatement`].
79    ThrowStatement,
80    /// The kind of [`ReturnStatement`].
81    ReturnStatement,
82    /// The kind of [`WithStatement`].
83    WithStatement,
84    /// The kind of [`SwitchStatement`].
85    SwitchStatement,
86    /// The kind of [`LabeledStatement`].
87    LabeledStatement,
88    /// The kind of [`ExpressionStatement`].
89    ExpressionStatement,
90    /// The kind of [`TryStatement`].
91    TryStatement,
92    /// The kind of [`IfStatement`].
93    IfStatement,
94    /// Exclusive upper bound of the `Statement` range.
95    _Statement_Last,
96    /// The kind of [`NullLiteral`].
97    NullLiteral,
98    /// The kind of [`BooleanLiteral`].
99    BooleanLiteral,
100    /// The kind of [`StringLiteral`].
101    StringLiteral,
102    /// The kind of [`NumericLiteral`].
103    NumericLiteral,
104    /// The kind of [`RegExpLiteral`].
105    RegExpLiteral,
106    /// The kind of [`BigIntLiteral`].
107    BigIntLiteral,
108    /// The kind of [`ThisExpression`].
109    ThisExpression,
110    /// The kind of [`Super`].
111    Super,
112    /// The kind of [`SequenceExpression`].
113    SequenceExpression,
114    /// The kind of [`ObjectExpression`].
115    ObjectExpression,
116    /// The kind of [`ArrayExpression`].
117    ArrayExpression,
118    /// The kind of [`SpreadElement`].
119    SpreadElement,
120    /// The kind of [`NewExpression`].
121    NewExpression,
122    /// The kind of [`YieldExpression`].
123    YieldExpression,
124    /// The kind of [`AwaitExpression`].
125    AwaitExpression,
126    /// The kind of [`ImportExpression`].
127    ImportExpression,
128    /// Exclusive lower bound of the `CallExpressionLike` range.
129    _CallExpressionLike_First,
130    /// The kind of [`CallExpression`].
131    CallExpression,
132    /// The kind of [`OptionalCallExpression`].
133    OptionalCallExpression,
134    /// Exclusive upper bound of the `CallExpressionLike` range.
135    _CallExpressionLike_Last,
136    /// The kind of [`AssignmentExpression`].
137    AssignmentExpression,
138    /// The kind of [`UnaryExpression`].
139    UnaryExpression,
140    /// The kind of [`UpdateExpression`].
141    UpdateExpression,
142    /// Exclusive lower bound of the `MemberExpressionLike` range.
143    _MemberExpressionLike_First,
144    /// The kind of [`MemberExpression`].
145    MemberExpression,
146    /// The kind of [`OptionalMemberExpression`].
147    OptionalMemberExpression,
148    /// Exclusive upper bound of the `MemberExpressionLike` range.
149    _MemberExpressionLike_Last,
150    /// The kind of [`LogicalExpression`].
151    LogicalExpression,
152    /// The kind of [`ConditionalExpression`].
153    ConditionalExpression,
154    /// The kind of [`BinaryExpression`].
155    BinaryExpression,
156    /// The kind of [`Directive`].
157    Directive,
158    /// The kind of [`DirectiveLiteral`].
159    DirectiveLiteral,
160    /// The kind of [`Identifier`].
161    Identifier,
162    /// The kind of [`PrivateName`].
163    PrivateName,
164    /// The kind of [`MetaProperty`].
165    MetaProperty,
166    /// The kind of [`SwitchCase`].
167    SwitchCase,
168    /// The kind of [`CatchClause`].
169    CatchClause,
170    /// The kind of [`VariableDeclarator`].
171    VariableDeclarator,
172    /// The kind of [`VariableDeclaration`].
173    VariableDeclaration,
174    /// The kind of [`TemplateLiteral`].
175    TemplateLiteral,
176    /// The kind of [`TaggedTemplateExpression`].
177    TaggedTemplateExpression,
178    /// The kind of [`TemplateElement`].
179    TemplateElement,
180    /// The kind of [`Property`].
181    Property,
182    /// The kind of [`Decorator`].
183    Decorator,
184    /// Exclusive lower bound of the `ClassLike` range.
185    _ClassLike_First,
186    /// The kind of [`ClassDeclaration`].
187    ClassDeclaration,
188    /// The kind of [`ClassExpression`].
189    ClassExpression,
190    /// Exclusive upper bound of the `ClassLike` range.
191    _ClassLike_Last,
192    /// The kind of [`ClassBody`].
193    ClassBody,
194    /// The kind of [`ClassProperty`].
195    ClassProperty,
196    /// The kind of [`ClassPrivateProperty`].
197    ClassPrivateProperty,
198    /// The kind of [`MethodDefinition`].
199    MethodDefinition,
200    /// The kind of [`ImportDeclaration`].
201    ImportDeclaration,
202    /// The kind of [`ImportSpecifier`].
203    ImportSpecifier,
204    /// The kind of [`ImportDefaultSpecifier`].
205    ImportDefaultSpecifier,
206    /// The kind of [`ImportNamespaceSpecifier`].
207    ImportNamespaceSpecifier,
208    /// The kind of [`ImportAttribute`].
209    ImportAttribute,
210    /// The kind of [`ExportNamedDeclaration`].
211    ExportNamedDeclaration,
212    /// The kind of [`ExportSpecifier`].
213    ExportSpecifier,
214    /// The kind of [`ExportNamespaceSpecifier`].
215    ExportNamespaceSpecifier,
216    /// The kind of [`ExportDefaultDeclaration`].
217    ExportDefaultDeclaration,
218    /// The kind of [`ExportAllDeclaration`].
219    ExportAllDeclaration,
220    /// Exclusive lower bound of the `Pattern` range.
221    _Pattern_First,
222    /// The kind of [`ObjectPattern`].
223    ObjectPattern,
224    /// The kind of [`ArrayPattern`].
225    ArrayPattern,
226    /// The kind of [`RestElement`].
227    RestElement,
228    /// The kind of [`AssignmentPattern`].
229    AssignmentPattern,
230    /// Exclusive upper bound of the `Pattern` range.
231    _Pattern_Last,
232    /// The kind of [`MatchStatementCase`].
233    MatchStatementCase,
234    /// The kind of [`MatchExpression`].
235    MatchExpression,
236    /// The kind of [`MatchExpressionCase`].
237    MatchExpressionCase,
238    /// Exclusive lower bound of the `MatchPattern` range.
239    _MatchPattern_First,
240    /// The kind of [`MatchWildcardPattern`].
241    MatchWildcardPattern,
242    /// The kind of [`MatchLiteralPattern`].
243    MatchLiteralPattern,
244    /// The kind of [`MatchUnaryPattern`].
245    MatchUnaryPattern,
246    /// The kind of [`MatchIdentifierPattern`].
247    MatchIdentifierPattern,
248    /// The kind of [`MatchBindingPattern`].
249    MatchBindingPattern,
250    /// The kind of [`MatchObjectPattern`].
251    MatchObjectPattern,
252    /// The kind of [`MatchArrayPattern`].
253    MatchArrayPattern,
254    /// The kind of [`MatchOrPattern`].
255    MatchOrPattern,
256    /// The kind of [`MatchAsPattern`].
257    MatchAsPattern,
258    /// The kind of [`MatchMemberPattern`].
259    MatchMemberPattern,
260    /// The kind of [`MatchInstancePattern`].
261    MatchInstancePattern,
262    /// Exclusive upper bound of the `MatchPattern` range.
263    _MatchPattern_Last,
264    /// The kind of [`MatchObjectPatternProperty`].
265    MatchObjectPatternProperty,
266    /// The kind of [`MatchInstanceObjectPattern`].
267    MatchInstanceObjectPattern,
268    /// The kind of [`MatchRestPattern`].
269    MatchRestPattern,
270    /// Exclusive lower bound of the `JSX` range.
271    _JSX_First,
272    /// The kind of [`JSXIdentifier`].
273    JSXIdentifier,
274    /// The kind of [`JSXMemberExpression`].
275    JSXMemberExpression,
276    /// The kind of [`JSXNamespacedName`].
277    JSXNamespacedName,
278    /// The kind of [`JSXEmptyExpression`].
279    JSXEmptyExpression,
280    /// The kind of [`JSXExpressionContainer`].
281    JSXExpressionContainer,
282    /// The kind of [`JSXSpreadChild`].
283    JSXSpreadChild,
284    /// The kind of [`JSXOpeningElement`].
285    JSXOpeningElement,
286    /// The kind of [`JSXClosingElement`].
287    JSXClosingElement,
288    /// The kind of [`JSXAttribute`].
289    JSXAttribute,
290    /// The kind of [`JSXSpreadAttribute`].
291    JSXSpreadAttribute,
292    /// The kind of [`JSXStringLiteral`].
293    JSXStringLiteral,
294    /// The kind of [`JSXText`].
295    JSXText,
296    /// The kind of [`JSXElement`].
297    JSXElement,
298    /// The kind of [`JSXFragment`].
299    JSXFragment,
300    /// The kind of [`JSXOpeningFragment`].
301    JSXOpeningFragment,
302    /// The kind of [`JSXClosingFragment`].
303    JSXClosingFragment,
304    /// Exclusive upper bound of the `JSX` range.
305    _JSX_Last,
306    /// Exclusive lower bound of the `Flow` range.
307    _Flow_First,
308    /// The kind of [`ExistsTypeAnnotation`].
309    ExistsTypeAnnotation,
310    /// The kind of [`EmptyTypeAnnotation`].
311    EmptyTypeAnnotation,
312    /// The kind of [`StringTypeAnnotation`].
313    StringTypeAnnotation,
314    /// The kind of [`NumberTypeAnnotation`].
315    NumberTypeAnnotation,
316    /// The kind of [`StringLiteralTypeAnnotation`].
317    StringLiteralTypeAnnotation,
318    /// The kind of [`NumberLiteralTypeAnnotation`].
319    NumberLiteralTypeAnnotation,
320    /// The kind of [`BigIntLiteralTypeAnnotation`].
321    BigIntLiteralTypeAnnotation,
322    /// The kind of [`BooleanTypeAnnotation`].
323    BooleanTypeAnnotation,
324    /// The kind of [`BooleanLiteralTypeAnnotation`].
325    BooleanLiteralTypeAnnotation,
326    /// The kind of [`NullLiteralTypeAnnotation`].
327    NullLiteralTypeAnnotation,
328    /// The kind of [`SymbolTypeAnnotation`].
329    SymbolTypeAnnotation,
330    /// The kind of [`AnyTypeAnnotation`].
331    AnyTypeAnnotation,
332    /// The kind of [`MixedTypeAnnotation`].
333    MixedTypeAnnotation,
334    /// The kind of [`BigIntTypeAnnotation`].
335    BigIntTypeAnnotation,
336    /// The kind of [`VoidTypeAnnotation`].
337    VoidTypeAnnotation,
338    /// The kind of [`NeverTypeAnnotation`].
339    NeverTypeAnnotation,
340    /// The kind of [`UnknownTypeAnnotation`].
341    UnknownTypeAnnotation,
342    /// The kind of [`UndefinedTypeAnnotation`].
343    UndefinedTypeAnnotation,
344    /// The kind of [`FunctionTypeAnnotation`].
345    FunctionTypeAnnotation,
346    /// The kind of [`HookTypeAnnotation`].
347    HookTypeAnnotation,
348    /// The kind of [`FunctionTypeParam`].
349    FunctionTypeParam,
350    /// The kind of [`ComponentTypeAnnotation`].
351    ComponentTypeAnnotation,
352    /// The kind of [`ComponentTypeParameter`].
353    ComponentTypeParameter,
354    /// The kind of [`NullableTypeAnnotation`].
355    NullableTypeAnnotation,
356    /// The kind of [`QualifiedTypeIdentifier`].
357    QualifiedTypeIdentifier,
358    /// The kind of [`TypeofTypeAnnotation`].
359    TypeofTypeAnnotation,
360    /// The kind of [`KeyofTypeAnnotation`].
361    KeyofTypeAnnotation,
362    /// The kind of [`TypeOperator`].
363    TypeOperator,
364    /// The kind of [`QualifiedTypeofIdentifier`].
365    QualifiedTypeofIdentifier,
366    /// The kind of [`TupleTypeAnnotation`].
367    TupleTypeAnnotation,
368    /// The kind of [`TupleTypeSpreadElement`].
369    TupleTypeSpreadElement,
370    /// The kind of [`TupleTypeLabeledElement`].
371    TupleTypeLabeledElement,
372    /// The kind of [`ArrayTypeAnnotation`].
373    ArrayTypeAnnotation,
374    /// The kind of [`InferTypeAnnotation`].
375    InferTypeAnnotation,
376    /// The kind of [`UnionTypeAnnotation`].
377    UnionTypeAnnotation,
378    /// The kind of [`IntersectionTypeAnnotation`].
379    IntersectionTypeAnnotation,
380    /// The kind of [`GenericTypeAnnotation`].
381    GenericTypeAnnotation,
382    /// The kind of [`IndexedAccessType`].
383    IndexedAccessType,
384    /// The kind of [`OptionalIndexedAccessType`].
385    OptionalIndexedAccessType,
386    /// The kind of [`ConditionalTypeAnnotation`].
387    ConditionalTypeAnnotation,
388    /// The kind of [`TypePredicate`].
389    TypePredicate,
390    /// The kind of [`InterfaceTypeAnnotation`].
391    InterfaceTypeAnnotation,
392    /// The kind of [`TypeAlias`].
393    TypeAlias,
394    /// The kind of [`OpaqueType`].
395    OpaqueType,
396    /// The kind of [`InterfaceDeclaration`].
397    InterfaceDeclaration,
398    /// The kind of [`DeclareTypeAlias`].
399    DeclareTypeAlias,
400    /// The kind of [`DeclareOpaqueType`].
401    DeclareOpaqueType,
402    /// The kind of [`DeclareInterface`].
403    DeclareInterface,
404    /// The kind of [`DeclareClass`].
405    DeclareClass,
406    /// The kind of [`DeclareFunction`].
407    DeclareFunction,
408    /// The kind of [`DeclareHook`].
409    DeclareHook,
410    /// The kind of [`DeclareComponent`].
411    DeclareComponent,
412    /// The kind of [`DeclareVariable`].
413    DeclareVariable,
414    /// The kind of [`DeclareEnum`].
415    DeclareEnum,
416    /// The kind of [`DeclareExportDeclaration`].
417    DeclareExportDeclaration,
418    /// The kind of [`DeclareExportAllDeclaration`].
419    DeclareExportAllDeclaration,
420    /// The kind of [`DeclareModule`].
421    DeclareModule,
422    /// The kind of [`DeclareNamespace`].
423    DeclareNamespace,
424    /// The kind of [`DeclareModuleExports`].
425    DeclareModuleExports,
426    /// The kind of [`InterfaceExtends`].
427    InterfaceExtends,
428    /// The kind of [`ClassImplements`].
429    ClassImplements,
430    /// The kind of [`TypeAnnotation`].
431    TypeAnnotation,
432    /// The kind of [`ObjectTypeAnnotation`].
433    ObjectTypeAnnotation,
434    /// The kind of [`ObjectTypeProperty`].
435    ObjectTypeProperty,
436    /// The kind of [`ObjectTypeSpreadProperty`].
437    ObjectTypeSpreadProperty,
438    /// The kind of [`ObjectTypeInternalSlot`].
439    ObjectTypeInternalSlot,
440    /// The kind of [`ObjectTypeCallProperty`].
441    ObjectTypeCallProperty,
442    /// The kind of [`ObjectTypeIndexer`].
443    ObjectTypeIndexer,
444    /// The kind of [`ObjectTypeMappedTypeProperty`].
445    ObjectTypeMappedTypeProperty,
446    /// The kind of [`Variance`].
447    Variance,
448    /// The kind of [`TypeParameterDeclaration`].
449    TypeParameterDeclaration,
450    /// The kind of [`TypeParameter`].
451    TypeParameter,
452    /// The kind of [`TypeParameterInstantiation`].
453    TypeParameterInstantiation,
454    /// The kind of [`TypeCastExpression`].
455    TypeCastExpression,
456    /// The kind of [`AsExpression`].
457    AsExpression,
458    /// The kind of [`AsConstExpression`].
459    AsConstExpression,
460    /// The kind of [`InferredPredicate`].
461    InferredPredicate,
462    /// The kind of [`DeclaredPredicate`].
463    DeclaredPredicate,
464    /// The kind of [`EnumDeclaration`].
465    EnumDeclaration,
466    /// The kind of [`EnumStringBody`].
467    EnumStringBody,
468    /// The kind of [`EnumNumberBody`].
469    EnumNumberBody,
470    /// The kind of [`EnumBigIntBody`].
471    EnumBigIntBody,
472    /// The kind of [`EnumBooleanBody`].
473    EnumBooleanBody,
474    /// The kind of [`EnumSymbolBody`].
475    EnumSymbolBody,
476    /// The kind of [`EnumDefaultedMember`].
477    EnumDefaultedMember,
478    /// The kind of [`EnumStringMember`].
479    EnumStringMember,
480    /// The kind of [`EnumNumberMember`].
481    EnumNumberMember,
482    /// The kind of [`EnumBigIntMember`].
483    EnumBigIntMember,
484    /// The kind of [`EnumBooleanMember`].
485    EnumBooleanMember,
486    /// The kind of [`ComponentParameter`].
487    ComponentParameter,
488    /// The kind of [`RecordDeclaration`].
489    RecordDeclaration,
490    /// The kind of [`RecordDeclarationImplements`].
491    RecordDeclarationImplements,
492    /// The kind of [`RecordDeclarationBody`].
493    RecordDeclarationBody,
494    /// The kind of [`RecordDeclarationProperty`].
495    RecordDeclarationProperty,
496    /// The kind of [`RecordDeclarationStaticProperty`].
497    RecordDeclarationStaticProperty,
498    /// The kind of [`RecordExpression`].
499    RecordExpression,
500    /// The kind of [`RecordExpressionProperties`].
501    RecordExpressionProperties,
502    /// Exclusive upper bound of the `Flow` range.
503    _Flow_Last,
504    /// Exclusive lower bound of the `TS` range.
505    _TS_First,
506    /// The kind of [`TSTypeAnnotation`].
507    TSTypeAnnotation,
508    /// The kind of [`TSAnyKeyword`].
509    TSAnyKeyword,
510    /// The kind of [`TSNumberKeyword`].
511    TSNumberKeyword,
512    /// The kind of [`TSBooleanKeyword`].
513    TSBooleanKeyword,
514    /// The kind of [`TSStringKeyword`].
515    TSStringKeyword,
516    /// The kind of [`TSSymbolKeyword`].
517    TSSymbolKeyword,
518    /// The kind of [`TSVoidKeyword`].
519    TSVoidKeyword,
520    /// The kind of [`TSUndefinedKeyword`].
521    TSUndefinedKeyword,
522    /// The kind of [`TSUnknownKeyword`].
523    TSUnknownKeyword,
524    /// The kind of [`TSNeverKeyword`].
525    TSNeverKeyword,
526    /// The kind of [`TSBigIntKeyword`].
527    TSBigIntKeyword,
528    /// The kind of [`TSThisType`].
529    TSThisType,
530    /// The kind of [`TSLiteralType`].
531    TSLiteralType,
532    /// The kind of [`TSIndexedAccessType`].
533    TSIndexedAccessType,
534    /// The kind of [`TSArrayType`].
535    TSArrayType,
536    /// The kind of [`TSTypeReference`].
537    TSTypeReference,
538    /// The kind of [`TSQualifiedName`].
539    TSQualifiedName,
540    /// The kind of [`TSFunctionType`].
541    TSFunctionType,
542    /// The kind of [`TSConstructorType`].
543    TSConstructorType,
544    /// The kind of [`TSTypePredicate`].
545    TSTypePredicate,
546    /// The kind of [`TSTupleType`].
547    TSTupleType,
548    /// The kind of [`TSTypeAssertion`].
549    TSTypeAssertion,
550    /// The kind of [`TSAsExpression`].
551    TSAsExpression,
552    /// The kind of [`TSParameterProperty`].
553    TSParameterProperty,
554    /// The kind of [`TSTypeAliasDeclaration`].
555    TSTypeAliasDeclaration,
556    /// The kind of [`TSInterfaceDeclaration`].
557    TSInterfaceDeclaration,
558    /// The kind of [`TSInterfaceHeritage`].
559    TSInterfaceHeritage,
560    /// The kind of [`TSInterfaceBody`].
561    TSInterfaceBody,
562    /// The kind of [`TSEnumDeclaration`].
563    TSEnumDeclaration,
564    /// The kind of [`TSEnumMember`].
565    TSEnumMember,
566    /// The kind of [`TSModuleDeclaration`].
567    TSModuleDeclaration,
568    /// The kind of [`TSModuleBlock`].
569    TSModuleBlock,
570    /// The kind of [`TSModuleMember`].
571    TSModuleMember,
572    /// The kind of [`TSTypeParameterDeclaration`].
573    TSTypeParameterDeclaration,
574    /// The kind of [`TSTypeParameter`].
575    TSTypeParameter,
576    /// The kind of [`TSTypeParameterInstantiation`].
577    TSTypeParameterInstantiation,
578    /// The kind of [`TSUnionType`].
579    TSUnionType,
580    /// The kind of [`TSIntersectionType`].
581    TSIntersectionType,
582    /// The kind of [`TSTypeQuery`].
583    TSTypeQuery,
584    /// The kind of [`TSConditionalType`].
585    TSConditionalType,
586    /// The kind of [`TSTypeLiteral`].
587    TSTypeLiteral,
588    /// The kind of [`TSPropertySignature`].
589    TSPropertySignature,
590    /// The kind of [`TSMethodSignature`].
591    TSMethodSignature,
592    /// The kind of [`TSIndexSignature`].
593    TSIndexSignature,
594    /// The kind of [`TSCallSignatureDeclaration`].
595    TSCallSignatureDeclaration,
596    /// The kind of [`TSModifiers`].
597    TSModifiers,
598    /// Exclusive upper bound of the `TS` range.
599    _TS_Last,
600    /// Exclusive lower bound of the `Cover` range.
601    _Cover_First,
602    /// The kind of [`CoverEmptyArgs`].
603    CoverEmptyArgs,
604    /// The kind of [`CoverTrailingComma`].
605    CoverTrailingComma,
606    /// The kind of [`CoverInitializer`].
607    CoverInitializer,
608    /// The kind of [`CoverRestElement`].
609    CoverRestElement,
610    /// The kind of [`CoverTypedIdentifier`].
611    CoverTypedIdentifier,
612    /// Exclusive upper bound of the `Cover` range.
613    _Cover_Last,
614    /// The kind of [`SHBuiltin`].
615    SHBuiltin,
616    /// The kind of [`ImplicitCheckedCast`].
617    ImplicitCheckedCast,
618}
619
620/// The name of a structural child field of an AST node (used in `Path`).
621#[derive(Debug, Copy, Clone, PartialEq, Eq)]
622#[allow(non_camel_case_types)]
623pub enum NodeField {
624    /// The `alternate` child field.
625    alternate,
626    /// The `argument` child field.
627    argument,
628    /// The `arguments` child field.
629    arguments,
630    /// The `attributes` child field.
631    attributes,
632    /// The `base` child field.
633    base,
634    /// The `block` child field.
635    block,
636    /// The `body` child field.
637    body,
638    /// The `bound` child field.
639    bound,
640    /// The `call_properties` child field.
641    call_properties,
642    /// The `callee` child field.
643    callee,
644    /// The `cases` child field.
645    cases,
646    /// The `check_type` child field.
647    check_type,
648    /// The `children` child field.
649    children,
650    /// The `closing_element` child field.
651    closing_element,
652    /// The `closing_fragment` child field.
653    closing_fragment,
654    /// The `consequent` child field.
655    consequent,
656    /// The `constraint` child field.
657    constraint,
658    /// The `declaration` child field.
659    declaration,
660    /// The `declarations` child field.
661    declarations,
662    /// The `decorators` child field.
663    decorators,
664    /// The `default` child field.
665    default,
666    /// The `default_value` child field.
667    default_value,
668    /// The `discriminant` child field.
669    discriminant,
670    /// The `element_type` child field.
671    element_type,
672    /// The `element_types` child field.
673    element_types,
674    /// The `elements` child field.
675    elements,
676    /// The `exported` child field.
677    exported,
678    /// The `expr_name` child field.
679    expr_name,
680    /// The `expression` child field.
681    expression,
682    /// The `expressions` child field.
683    expressions,
684    /// The `extends` child field.
685    extends,
686    /// The `extends_type` child field.
687    extends_type,
688    /// The `false_type` child field.
689    false_type,
690    /// The `finalizer` child field.
691    finalizer,
692    /// The `guard` child field.
693    guard,
694    /// The `handler` child field.
695    handler,
696    /// The `id` child field.
697    id,
698    /// The `implements` child field.
699    implements,
700    /// The `impltype` child field.
701    impltype,
702    /// The `imported` child field.
703    imported,
704    /// The `index_type` child field.
705    index_type,
706    /// The `indexers` child field.
707    indexers,
708    /// The `init` child field.
709    init,
710    /// The `initializer` child field.
711    initializer,
712    /// The `internal_slots` child field.
713    internal_slots,
714    /// The `key` child field.
715    key,
716    /// The `key_tparam` child field.
717    key_tparam,
718    /// The `label` child field.
719    label,
720    /// The `left` child field.
721    left,
722    /// The `literal` child field.
723    literal,
724    /// The `local` child field.
725    local,
726    /// The `lower_bound` child field.
727    lower_bound,
728    /// The `members` child field.
729    members,
730    /// The `meta` child field.
731    meta,
732    /// The `mixins` child field.
733    mixins,
734    /// The `name` child field.
735    name,
736    /// The `namespace` child field.
737    namespace,
738    /// The `object` child field.
739    object,
740    /// The `object_type` child field.
741    object_type,
742    /// The `opening_element` child field.
743    opening_element,
744    /// The `opening_fragment` child field.
745    opening_fragment,
746    /// The `options` child field.
747    options,
748    /// The `param` child field.
749    param,
750    /// The `parameter` child field.
751    parameter,
752    /// The `parameter_name` child field.
753    parameter_name,
754    /// The `parameters` child field.
755    parameters,
756    /// The `params` child field.
757    params,
758    /// The `pattern` child field.
759    pattern,
760    /// The `patterns` child field.
761    patterns,
762    /// The `predicate` child field.
763    predicate,
764    /// The `prop_type` child field.
765    prop_type,
766    /// The `properties` child field.
767    properties,
768    /// The `property` child field.
769    property,
770    /// The `qualification` child field.
771    qualification,
772    /// The `quasi` child field.
773    quasi,
774    /// The `quasis` child field.
775    quasis,
776    /// The `record_constructor` child field.
777    record_constructor,
778    /// The `renders_type` child field.
779    renders_type,
780    /// The `rest` child field.
781    rest,
782    /// The `return_type` child field.
783    return_type,
784    /// The `right` child field.
785    right,
786    /// The `source` child field.
787    source,
788    /// The `source_type` child field.
789    source_type,
790    /// The `specifiers` child field.
791    specifiers,
792    /// The `super_class` child field.
793    super_class,
794    /// The `super_type_arguments` child field.
795    super_type_arguments,
796    /// The `supertype` child field.
797    supertype,
798    /// The `tag` child field.
799    tag,
800    /// The `target` child field.
801    target,
802    /// The `target_constructor` child field.
803    target_constructor,
804    /// The `test` child field.
805    test,
806    /// The `this` child field.
807    this,
808    /// The `true_type` child field.
809    true_type,
810    /// The `ts_modifiers` child field.
811    ts_modifiers,
812    /// The `type_annotation` child field.
813    type_annotation,
814    /// The `type_arguments` child field.
815    type_arguments,
816    /// The `type_name` child field.
817    type_name,
818    /// The `type_parameter` child field.
819    type_parameter,
820    /// The `type_parameters` child field.
821    type_parameters,
822    /// The `types` child field.
823    types,
824    /// The `update` child field.
825    update,
826    /// The `upper_bound` child field.
827    upper_bound,
828    /// The `value` child field.
829    value,
830    /// The `variance` child field.
831    variance,
832}
833
834/// The `Empty` AST node.
835#[derive(Debug)]
836#[repr(C)]
837pub struct Empty<'gc> {
838    /// Source range, debug location, paren count, and node id.
839    pub metadata: NodeMetadata<'gc>,
840}
841impl<'gc> Empty<'gc> {
842    /// Build `Empty` from its metadata and `ESTree.def` fields.
843    pub fn new(
844        metadata: NodeMetadata<'gc>,
845    ) -> Self {
846        Empty {
847            metadata,
848        }
849    }
850}
851
852/// The `Metadata` AST node.
853#[derive(Debug)]
854#[repr(C)]
855pub struct Metadata<'gc> {
856    /// Source range, debug location, paren count, and node id.
857    pub metadata: NodeMetadata<'gc>,
858}
859impl<'gc> Metadata<'gc> {
860    /// Build `Metadata` from its metadata and `ESTree.def` fields.
861    pub fn new(
862        metadata: NodeMetadata<'gc>,
863    ) -> Self {
864        Metadata {
865            metadata,
866        }
867    }
868}
869
870/// The `Program` AST node.
871#[derive(Debug)]
872#[repr(C)]
873pub struct Program<'gc> {
874    /// Source range, debug location, paren count, and node id.
875    pub metadata: NodeMetadata<'gc>,
876    /// ESTree `body` property.
877    pub body: NodeList<'gc>,
878    /// Sema: the lexical scope created by this node, if any.
879    pub scope: Cell<Option<SemaId>>,
880    /// Sema: `FunctionInfo` for this function.
881    pub sem_info: Cell<Option<SemaId>>,
882    /// Sema: strict-mode state of this function.
883    pub strictness: Cell<Strictness>,
884    /// Whether this function is a method definition (getters and setters
885    /// included) rather than a `function`. Used for lazy reparsing.
886    pub is_method_definition: Cell<bool>,
887    /// Decorations attached to this function by `Hermes.decorate(...)`
888    /// calls in typed mode; each entry wraps a decoration expression.
889    pub decorations: Cell<NodeList<'gc>>,
890    /// An always-empty parameter list, for uniformity with functions.
891    pub dummy_param_list: Cell<NodeList<'gc>>,
892}
893impl<'gc> Program<'gc> {
894    /// Build `Program` from its metadata and `ESTree.def` fields.
895    /// Decoration fields start at their defaults.
896    pub fn new(
897        metadata: NodeMetadata<'gc>,
898        body: NodeList<'gc>,
899    ) -> Self {
900        Program {
901            metadata,
902            body,
903            scope: Cell::new(None),
904            sem_info: Cell::new(None),
905            strictness: Cell::new(Strictness::NotSet),
906            is_method_definition: Cell::new(false),
907            decorations: Cell::new(NodeList::empty()),
908            dummy_param_list: Cell::new(NodeList::empty()),
909        }
910    }
911}
912
913/// The `FunctionExpression` AST node.
914#[derive(Debug)]
915#[repr(C)]
916pub struct FunctionExpression<'gc> {
917    /// Source range, debug location, paren count, and node id.
918    pub metadata: NodeMetadata<'gc>,
919    /// ESTree `id` property.
920    pub id: Option<&'gc Node<'gc>>,
921    /// ESTree `params` property.
922    pub params: NodeList<'gc>,
923    /// ESTree `body` property.
924    pub body: &'gc Node<'gc>,
925    /// ESTree `typeParameters` property.
926    pub type_parameters: Option<&'gc Node<'gc>>,
927    /// ESTree `returnType` property.
928    pub return_type: Option<&'gc Node<'gc>>,
929    /// ESTree `predicate` property.
930    pub predicate: Option<&'gc Node<'gc>>,
931    /// ESTree `generator` property.
932    pub generator: Cell<bool>,
933    /// ESTree `async` property.
934    pub r#async: Cell<bool>,
935    /// Sema: the lexical scope created by this node, if any.
936    pub scope: Cell<Option<SemaId>>,
937    /// Sema: `FunctionInfo` for this function.
938    pub sem_info: Cell<Option<SemaId>>,
939    /// Sema: strict-mode state of this function.
940    pub strictness: Cell<Strictness>,
941    /// Whether this function is a method definition (getters and setters
942    /// included) rather than a `function`. Used for lazy reparsing.
943    pub is_method_definition: Cell<bool>,
944    /// Decorations attached to this function by `Hermes.decorate(...)`
945    /// calls in typed mode; each entry wraps a decoration expression.
946    pub decorations: Cell<NodeList<'gc>>,
947}
948impl<'gc> FunctionExpression<'gc> {
949    /// Build `FunctionExpression` from its metadata and `ESTree.def` fields.
950    /// Decoration fields start at their defaults.
951    pub fn new(
952        metadata: NodeMetadata<'gc>,
953        id: Option<&'gc Node<'gc>>,
954        params: NodeList<'gc>,
955        body: &'gc Node<'gc>,
956        type_parameters: Option<&'gc Node<'gc>>,
957        return_type: Option<&'gc Node<'gc>>,
958        predicate: Option<&'gc Node<'gc>>,
959        generator: bool,
960        r#async: bool,
961    ) -> Self {
962        FunctionExpression {
963            metadata,
964            id,
965            params,
966            body,
967            type_parameters,
968            return_type,
969            predicate,
970            generator: Cell::new(generator),
971            r#async: Cell::new(r#async),
972            scope: Cell::new(None),
973            sem_info: Cell::new(None),
974            strictness: Cell::new(Strictness::NotSet),
975            is_method_definition: Cell::new(false),
976            decorations: Cell::new(NodeList::empty()),
977        }
978    }
979}
980
981/// The `ArrowFunctionExpression` AST node.
982#[derive(Debug)]
983#[repr(C)]
984pub struct ArrowFunctionExpression<'gc> {
985    /// Source range, debug location, paren count, and node id.
986    pub metadata: NodeMetadata<'gc>,
987    /// ESTree `params` property.
988    pub params: NodeList<'gc>,
989    /// ESTree `body` property.
990    pub body: &'gc Node<'gc>,
991    /// ESTree `typeParameters` property.
992    pub type_parameters: Option<&'gc Node<'gc>>,
993    /// ESTree `returnType` property.
994    pub return_type: Option<&'gc Node<'gc>>,
995    /// ESTree `predicate` property.
996    pub predicate: Option<&'gc Node<'gc>>,
997    /// ESTree `expression` property.
998    pub expression: Cell<bool>,
999    /// ESTree `async` property.
1000    pub r#async: Cell<bool>,
1001    /// Sema: the lexical scope created by this node, if any.
1002    pub scope: Cell<Option<SemaId>>,
1003    /// Sema: `FunctionInfo` for this function.
1004    pub sem_info: Cell<Option<SemaId>>,
1005    /// Sema: strict-mode state of this function.
1006    pub strictness: Cell<Strictness>,
1007    /// Whether this function is a method definition (getters and setters
1008    /// included) rather than a `function`. Used for lazy reparsing.
1009    pub is_method_definition: Cell<bool>,
1010    /// Decorations attached to this function by `Hermes.decorate(...)`
1011    /// calls in typed mode; each entry wraps a decoration expression.
1012    pub decorations: Cell<NodeList<'gc>>,
1013}
1014impl<'gc> ArrowFunctionExpression<'gc> {
1015    /// Build `ArrowFunctionExpression` from its metadata and `ESTree.def`
1016    /// fields.
1017    /// Decoration fields start at their defaults.
1018    pub fn new(
1019        metadata: NodeMetadata<'gc>,
1020        params: NodeList<'gc>,
1021        body: &'gc Node<'gc>,
1022        type_parameters: Option<&'gc Node<'gc>>,
1023        return_type: Option<&'gc Node<'gc>>,
1024        predicate: Option<&'gc Node<'gc>>,
1025        expression: bool,
1026        r#async: bool,
1027    ) -> Self {
1028        ArrowFunctionExpression {
1029            metadata,
1030            params,
1031            body,
1032            type_parameters,
1033            return_type,
1034            predicate,
1035            expression: Cell::new(expression),
1036            r#async: Cell::new(r#async),
1037            scope: Cell::new(None),
1038            sem_info: Cell::new(None),
1039            strictness: Cell::new(Strictness::NotSet),
1040            is_method_definition: Cell::new(false),
1041            decorations: Cell::new(NodeList::empty()),
1042        }
1043    }
1044}
1045
1046/// The `FunctionDeclaration` AST node.
1047#[derive(Debug)]
1048#[repr(C)]
1049pub struct FunctionDeclaration<'gc> {
1050    /// Source range, debug location, paren count, and node id.
1051    pub metadata: NodeMetadata<'gc>,
1052    /// ESTree `id` property.
1053    pub id: Option<&'gc Node<'gc>>,
1054    /// ESTree `params` property.
1055    pub params: NodeList<'gc>,
1056    /// ESTree `body` property.
1057    pub body: &'gc Node<'gc>,
1058    /// ESTree `typeParameters` property.
1059    pub type_parameters: Option<&'gc Node<'gc>>,
1060    /// ESTree `returnType` property.
1061    pub return_type: Option<&'gc Node<'gc>>,
1062    /// ESTree `predicate` property.
1063    pub predicate: Option<&'gc Node<'gc>>,
1064    /// ESTree `generator` property.
1065    pub generator: Cell<bool>,
1066    /// ESTree `async` property.
1067    pub r#async: Cell<bool>,
1068    /// Sema: the lexical scope created by this node, if any.
1069    pub scope: Cell<Option<SemaId>>,
1070    /// Sema: `FunctionInfo` for this function.
1071    pub sem_info: Cell<Option<SemaId>>,
1072    /// Sema: strict-mode state of this function.
1073    pub strictness: Cell<Strictness>,
1074    /// Whether this function is a method definition (getters and setters
1075    /// included) rather than a `function`. Used for lazy reparsing.
1076    pub is_method_definition: Cell<bool>,
1077    /// Decorations attached to this function by `Hermes.decorate(...)`
1078    /// calls in typed mode; each entry wraps a decoration expression.
1079    pub decorations: Cell<NodeList<'gc>>,
1080}
1081impl<'gc> FunctionDeclaration<'gc> {
1082    /// Build `FunctionDeclaration` from its metadata and `ESTree.def` fields.
1083    /// Decoration fields start at their defaults.
1084    pub fn new(
1085        metadata: NodeMetadata<'gc>,
1086        id: Option<&'gc Node<'gc>>,
1087        params: NodeList<'gc>,
1088        body: &'gc Node<'gc>,
1089        type_parameters: Option<&'gc Node<'gc>>,
1090        return_type: Option<&'gc Node<'gc>>,
1091        predicate: Option<&'gc Node<'gc>>,
1092        generator: bool,
1093        r#async: bool,
1094    ) -> Self {
1095        FunctionDeclaration {
1096            metadata,
1097            id,
1098            params,
1099            body,
1100            type_parameters,
1101            return_type,
1102            predicate,
1103            generator: Cell::new(generator),
1104            r#async: Cell::new(r#async),
1105            scope: Cell::new(None),
1106            sem_info: Cell::new(None),
1107            strictness: Cell::new(Strictness::NotSet),
1108            is_method_definition: Cell::new(false),
1109            decorations: Cell::new(NodeList::empty()),
1110        }
1111    }
1112}
1113
1114/// The `ComponentDeclaration` AST node.
1115#[derive(Debug)]
1116#[repr(C)]
1117pub struct ComponentDeclaration<'gc> {
1118    /// Source range, debug location, paren count, and node id.
1119    pub metadata: NodeMetadata<'gc>,
1120    /// ESTree `id` property.
1121    pub id: &'gc Node<'gc>,
1122    /// ESTree `params` property.
1123    pub params: NodeList<'gc>,
1124    /// ESTree `body` property.
1125    pub body: &'gc Node<'gc>,
1126    /// ESTree `typeParameters` property.
1127    pub type_parameters: Option<&'gc Node<'gc>>,
1128    /// ESTree `rendersType` property.
1129    pub renders_type: Option<&'gc Node<'gc>>,
1130    /// ESTree `async` property.
1131    pub r#async: Cell<bool>,
1132    /// Sema: the lexical scope created by this node, if any.
1133    pub scope: Cell<Option<SemaId>>,
1134    /// Sema: `FunctionInfo` for this function.
1135    pub sem_info: Cell<Option<SemaId>>,
1136    /// Sema: strict-mode state of this function.
1137    pub strictness: Cell<Strictness>,
1138    /// Whether this function is a method definition (getters and setters
1139    /// included) rather than a `function`. Used for lazy reparsing.
1140    pub is_method_definition: Cell<bool>,
1141    /// Decorations attached to this function by `Hermes.decorate(...)`
1142    /// calls in typed mode; each entry wraps a decoration expression.
1143    pub decorations: Cell<NodeList<'gc>>,
1144}
1145impl<'gc> ComponentDeclaration<'gc> {
1146    /// Build `ComponentDeclaration` from its metadata and `ESTree.def` fields.
1147    /// Decoration fields start at their defaults.
1148    pub fn new(
1149        metadata: NodeMetadata<'gc>,
1150        id: &'gc Node<'gc>,
1151        params: NodeList<'gc>,
1152        body: &'gc Node<'gc>,
1153        type_parameters: Option<&'gc Node<'gc>>,
1154        renders_type: Option<&'gc Node<'gc>>,
1155        r#async: bool,
1156    ) -> Self {
1157        ComponentDeclaration {
1158            metadata,
1159            id,
1160            params,
1161            body,
1162            type_parameters,
1163            renders_type,
1164            r#async: Cell::new(r#async),
1165            scope: Cell::new(None),
1166            sem_info: Cell::new(None),
1167            strictness: Cell::new(Strictness::NotSet),
1168            is_method_definition: Cell::new(false),
1169            decorations: Cell::new(NodeList::empty()),
1170        }
1171    }
1172}
1173
1174/// The `HookDeclaration` AST node.
1175#[derive(Debug)]
1176#[repr(C)]
1177pub struct HookDeclaration<'gc> {
1178    /// Source range, debug location, paren count, and node id.
1179    pub metadata: NodeMetadata<'gc>,
1180    /// ESTree `id` property.
1181    pub id: &'gc Node<'gc>,
1182    /// ESTree `params` property.
1183    pub params: NodeList<'gc>,
1184    /// ESTree `body` property.
1185    pub body: &'gc Node<'gc>,
1186    /// ESTree `typeParameters` property.
1187    pub type_parameters: Option<&'gc Node<'gc>>,
1188    /// ESTree `returnType` property.
1189    pub return_type: Option<&'gc Node<'gc>>,
1190    /// ESTree `async` property.
1191    pub r#async: Cell<bool>,
1192    /// Sema: the lexical scope created by this node, if any.
1193    pub scope: Cell<Option<SemaId>>,
1194    /// Sema: `FunctionInfo` for this function.
1195    pub sem_info: Cell<Option<SemaId>>,
1196    /// Sema: strict-mode state of this function.
1197    pub strictness: Cell<Strictness>,
1198    /// Whether this function is a method definition (getters and setters
1199    /// included) rather than a `function`. Used for lazy reparsing.
1200    pub is_method_definition: Cell<bool>,
1201    /// Decorations attached to this function by `Hermes.decorate(...)`
1202    /// calls in typed mode; each entry wraps a decoration expression.
1203    pub decorations: Cell<NodeList<'gc>>,
1204}
1205impl<'gc> HookDeclaration<'gc> {
1206    /// Build `HookDeclaration` from its metadata and `ESTree.def` fields.
1207    /// Decoration fields start at their defaults.
1208    pub fn new(
1209        metadata: NodeMetadata<'gc>,
1210        id: &'gc Node<'gc>,
1211        params: NodeList<'gc>,
1212        body: &'gc Node<'gc>,
1213        type_parameters: Option<&'gc Node<'gc>>,
1214        return_type: Option<&'gc Node<'gc>>,
1215        r#async: bool,
1216    ) -> Self {
1217        HookDeclaration {
1218            metadata,
1219            id,
1220            params,
1221            body,
1222            type_parameters,
1223            return_type,
1224            r#async: Cell::new(r#async),
1225            scope: Cell::new(None),
1226            sem_info: Cell::new(None),
1227            strictness: Cell::new(Strictness::NotSet),
1228            is_method_definition: Cell::new(false),
1229            decorations: Cell::new(NodeList::empty()),
1230        }
1231    }
1232}
1233
1234/// The `MatchStatement` AST node.
1235#[derive(Debug)]
1236#[repr(C)]
1237pub struct MatchStatement<'gc> {
1238    /// Source range, debug location, paren count, and node id.
1239    pub metadata: NodeMetadata<'gc>,
1240    /// ESTree `argument` property.
1241    pub argument: &'gc Node<'gc>,
1242    /// ESTree `cases` property.
1243    pub cases: NodeList<'gc>,
1244}
1245impl<'gc> MatchStatement<'gc> {
1246    /// Build `MatchStatement` from its metadata and `ESTree.def` fields.
1247    pub fn new(
1248        metadata: NodeMetadata<'gc>,
1249        argument: &'gc Node<'gc>,
1250        cases: NodeList<'gc>,
1251    ) -> Self {
1252        MatchStatement {
1253            metadata,
1254            argument,
1255            cases,
1256        }
1257    }
1258}
1259
1260/// The `WhileStatement` AST node.
1261#[derive(Debug)]
1262#[repr(C)]
1263pub struct WhileStatement<'gc> {
1264    /// Source range, debug location, paren count, and node id.
1265    pub metadata: NodeMetadata<'gc>,
1266    /// ESTree `body` property.
1267    pub body: &'gc Node<'gc>,
1268    /// ESTree `test` property.
1269    pub test: &'gc Node<'gc>,
1270    /// Sema: label index; `INVALID_LABEL` until set.
1271    pub label_index: Cell<u32>,
1272}
1273impl<'gc> WhileStatement<'gc> {
1274    /// Build `WhileStatement` from its metadata and `ESTree.def` fields.
1275    /// Decoration fields start at their defaults.
1276    pub fn new(
1277        metadata: NodeMetadata<'gc>,
1278        body: &'gc Node<'gc>,
1279        test: &'gc Node<'gc>,
1280    ) -> Self {
1281        WhileStatement {
1282            metadata,
1283            body,
1284            test,
1285            label_index: Cell::new(INVALID_LABEL),
1286        }
1287    }
1288}
1289
1290/// The `DoWhileStatement` AST node.
1291#[derive(Debug)]
1292#[repr(C)]
1293pub struct DoWhileStatement<'gc> {
1294    /// Source range, debug location, paren count, and node id.
1295    pub metadata: NodeMetadata<'gc>,
1296    /// ESTree `body` property.
1297    pub body: &'gc Node<'gc>,
1298    /// ESTree `test` property.
1299    pub test: &'gc Node<'gc>,
1300    /// Sema: label index; `INVALID_LABEL` until set.
1301    pub label_index: Cell<u32>,
1302}
1303impl<'gc> DoWhileStatement<'gc> {
1304    /// Build `DoWhileStatement` from its metadata and `ESTree.def` fields.
1305    /// Decoration fields start at their defaults.
1306    pub fn new(
1307        metadata: NodeMetadata<'gc>,
1308        body: &'gc Node<'gc>,
1309        test: &'gc Node<'gc>,
1310    ) -> Self {
1311        DoWhileStatement {
1312            metadata,
1313            body,
1314            test,
1315            label_index: Cell::new(INVALID_LABEL),
1316        }
1317    }
1318}
1319
1320/// The `ForInStatement` AST node.
1321#[derive(Debug)]
1322#[repr(C)]
1323pub struct ForInStatement<'gc> {
1324    /// Source range, debug location, paren count, and node id.
1325    pub metadata: NodeMetadata<'gc>,
1326    /// ESTree `left` property.
1327    pub left: &'gc Node<'gc>,
1328    /// ESTree `right` property.
1329    pub right: &'gc Node<'gc>,
1330    /// ESTree `body` property.
1331    pub body: &'gc Node<'gc>,
1332    /// Sema: label index; `INVALID_LABEL` until set.
1333    pub label_index: Cell<u32>,
1334    /// Sema: the lexical scope created by this node, if any.
1335    pub scope: Cell<Option<SemaId>>,
1336}
1337impl<'gc> ForInStatement<'gc> {
1338    /// Build `ForInStatement` from its metadata and `ESTree.def` fields.
1339    /// Decoration fields start at their defaults.
1340    pub fn new(
1341        metadata: NodeMetadata<'gc>,
1342        left: &'gc Node<'gc>,
1343        right: &'gc Node<'gc>,
1344        body: &'gc Node<'gc>,
1345    ) -> Self {
1346        ForInStatement {
1347            metadata,
1348            left,
1349            right,
1350            body,
1351            label_index: Cell::new(INVALID_LABEL),
1352            scope: Cell::new(None),
1353        }
1354    }
1355}
1356
1357/// The `ForOfStatement` AST node.
1358#[derive(Debug)]
1359#[repr(C)]
1360pub struct ForOfStatement<'gc> {
1361    /// Source range, debug location, paren count, and node id.
1362    pub metadata: NodeMetadata<'gc>,
1363    /// ESTree `left` property.
1364    pub left: &'gc Node<'gc>,
1365    /// ESTree `right` property.
1366    pub right: &'gc Node<'gc>,
1367    /// ESTree `body` property.
1368    pub body: &'gc Node<'gc>,
1369    /// ESTree `await` property.
1370    pub r#await: Cell<bool>,
1371    /// Sema: label index; `INVALID_LABEL` until set.
1372    pub label_index: Cell<u32>,
1373    /// Sema: the lexical scope created by this node, if any.
1374    pub scope: Cell<Option<SemaId>>,
1375}
1376impl<'gc> ForOfStatement<'gc> {
1377    /// Build `ForOfStatement` from its metadata and `ESTree.def` fields.
1378    /// Decoration fields start at their defaults.
1379    pub fn new(
1380        metadata: NodeMetadata<'gc>,
1381        left: &'gc Node<'gc>,
1382        right: &'gc Node<'gc>,
1383        body: &'gc Node<'gc>,
1384        r#await: bool,
1385    ) -> Self {
1386        ForOfStatement {
1387            metadata,
1388            left,
1389            right,
1390            body,
1391            r#await: Cell::new(r#await),
1392            label_index: Cell::new(INVALID_LABEL),
1393            scope: Cell::new(None),
1394        }
1395    }
1396}
1397
1398/// The `ForStatement` AST node.
1399#[derive(Debug)]
1400#[repr(C)]
1401pub struct ForStatement<'gc> {
1402    /// Source range, debug location, paren count, and node id.
1403    pub metadata: NodeMetadata<'gc>,
1404    /// ESTree `init` property.
1405    pub init: Option<&'gc Node<'gc>>,
1406    /// ESTree `test` property.
1407    pub test: Option<&'gc Node<'gc>>,
1408    /// ESTree `update` property.
1409    pub update: Option<&'gc Node<'gc>>,
1410    /// ESTree `body` property.
1411    pub body: &'gc Node<'gc>,
1412    /// Sema: label index; `INVALID_LABEL` until set.
1413    pub label_index: Cell<u32>,
1414    /// Sema: the lexical scope created by this node, if any.
1415    pub scope: Cell<Option<SemaId>>,
1416}
1417impl<'gc> ForStatement<'gc> {
1418    /// Build `ForStatement` from its metadata and `ESTree.def` fields.
1419    /// Decoration fields start at their defaults.
1420    pub fn new(
1421        metadata: NodeMetadata<'gc>,
1422        init: Option<&'gc Node<'gc>>,
1423        test: Option<&'gc Node<'gc>>,
1424        update: Option<&'gc Node<'gc>>,
1425        body: &'gc Node<'gc>,
1426    ) -> Self {
1427        ForStatement {
1428            metadata,
1429            init,
1430            test,
1431            update,
1432            body,
1433            label_index: Cell::new(INVALID_LABEL),
1434            scope: Cell::new(None),
1435        }
1436    }
1437}
1438
1439/// The `DebuggerStatement` AST node.
1440#[derive(Debug)]
1441#[repr(C)]
1442pub struct DebuggerStatement<'gc> {
1443    /// Source range, debug location, paren count, and node id.
1444    pub metadata: NodeMetadata<'gc>,
1445}
1446impl<'gc> DebuggerStatement<'gc> {
1447    /// Build `DebuggerStatement` from its metadata and `ESTree.def` fields.
1448    pub fn new(
1449        metadata: NodeMetadata<'gc>,
1450    ) -> Self {
1451        DebuggerStatement {
1452            metadata,
1453        }
1454    }
1455}
1456
1457/// The `EmptyStatement` AST node.
1458#[derive(Debug)]
1459#[repr(C)]
1460pub struct EmptyStatement<'gc> {
1461    /// Source range, debug location, paren count, and node id.
1462    pub metadata: NodeMetadata<'gc>,
1463}
1464impl<'gc> EmptyStatement<'gc> {
1465    /// Build `EmptyStatement` from its metadata and `ESTree.def` fields.
1466    pub fn new(
1467        metadata: NodeMetadata<'gc>,
1468    ) -> Self {
1469        EmptyStatement {
1470            metadata,
1471        }
1472    }
1473}
1474
1475/// The `BlockStatement` AST node.
1476#[derive(Debug)]
1477#[repr(C)]
1478pub struct BlockStatement<'gc> {
1479    /// Source range, debug location, paren count, and node id.
1480    pub metadata: NodeMetadata<'gc>,
1481    /// ESTree `body` property.
1482    pub body: NodeList<'gc>,
1483    /// ESTree `implicit` property.
1484    pub implicit: Cell<bool>,
1485    /// Sema: the lexical scope created by this node, if any.
1486    pub scope: Cell<Option<SemaId>>,
1487    /// The source buffer id in which this block was found.
1488    pub buffer_id: Cell<u32>,
1489    /// True if this is a function body pruned while pre-parsing.
1490    pub is_lazy_function_body: Cell<bool>,
1491    /// For a lazy block, the `Yield` param to restore when parsed eagerly.
1492    pub param_yield: Cell<bool>,
1493    /// For a lazy block, the `Await` param to restore when parsed eagerly.
1494    pub param_await: Cell<bool>,
1495    /// Whether this function contains an arrow function. Read by lazy
1496    /// compilation to populate the `FunctionInfo`.
1497    pub contains_arrow_functions: Cell<bool>,
1498    /// Conservative estimate of whether an arrow function here may use
1499    /// `arguments`, so a non-arrow function must eagerly capture it.
1500    pub may_contain_arrow_functions_using_arguments: Cell<bool>,
1501}
1502impl<'gc> BlockStatement<'gc> {
1503    /// Build `BlockStatement` from its metadata and `ESTree.def` fields.
1504    /// Decoration fields start at their defaults.
1505    pub fn new(
1506        metadata: NodeMetadata<'gc>,
1507        body: NodeList<'gc>,
1508        implicit: bool,
1509    ) -> Self {
1510        BlockStatement {
1511            metadata,
1512            body,
1513            implicit: Cell::new(implicit),
1514            scope: Cell::new(None),
1515            buffer_id: Cell::new(0),
1516            is_lazy_function_body: Cell::new(false),
1517            param_yield: Cell::new(false),
1518            param_await: Cell::new(false),
1519            contains_arrow_functions: Cell::new(false),
1520            may_contain_arrow_functions_using_arguments: Cell::new(false),
1521        }
1522    }
1523}
1524
1525/// The `StaticBlock` AST node.
1526#[derive(Debug)]
1527#[repr(C)]
1528pub struct StaticBlock<'gc> {
1529    /// Source range, debug location, paren count, and node id.
1530    pub metadata: NodeMetadata<'gc>,
1531    /// ESTree `body` property.
1532    pub body: NodeList<'gc>,
1533    /// Sema: the lexical scope created by this node, if any.
1534    pub scope: Cell<Option<SemaId>>,
1535    /// Sema: `FunctionInfo` for this static block.
1536    pub function_info: Cell<Option<SemaId>>,
1537}
1538impl<'gc> StaticBlock<'gc> {
1539    /// Build `StaticBlock` from its metadata and `ESTree.def` fields.
1540    /// Decoration fields start at their defaults.
1541    pub fn new(
1542        metadata: NodeMetadata<'gc>,
1543        body: NodeList<'gc>,
1544    ) -> Self {
1545        StaticBlock {
1546            metadata,
1547            body,
1548            scope: Cell::new(None),
1549            function_info: Cell::new(None),
1550        }
1551    }
1552}
1553
1554/// The `BreakStatement` AST node.
1555#[derive(Debug)]
1556#[repr(C)]
1557pub struct BreakStatement<'gc> {
1558    /// Source range, debug location, paren count, and node id.
1559    pub metadata: NodeMetadata<'gc>,
1560    /// ESTree `label` property.
1561    pub label: Option<&'gc Node<'gc>>,
1562    /// Sema: label index; `INVALID_LABEL` until set.
1563    pub label_index: Cell<u32>,
1564}
1565impl<'gc> BreakStatement<'gc> {
1566    /// Build `BreakStatement` from its metadata and `ESTree.def` fields.
1567    /// Decoration fields start at their defaults.
1568    pub fn new(
1569        metadata: NodeMetadata<'gc>,
1570        label: Option<&'gc Node<'gc>>,
1571    ) -> Self {
1572        BreakStatement {
1573            metadata,
1574            label,
1575            label_index: Cell::new(INVALID_LABEL),
1576        }
1577    }
1578}
1579
1580/// The `ContinueStatement` AST node.
1581#[derive(Debug)]
1582#[repr(C)]
1583pub struct ContinueStatement<'gc> {
1584    /// Source range, debug location, paren count, and node id.
1585    pub metadata: NodeMetadata<'gc>,
1586    /// ESTree `label` property.
1587    pub label: Option<&'gc Node<'gc>>,
1588    /// Sema: label index; `INVALID_LABEL` until set.
1589    pub label_index: Cell<u32>,
1590}
1591impl<'gc> ContinueStatement<'gc> {
1592    /// Build `ContinueStatement` from its metadata and `ESTree.def` fields.
1593    /// Decoration fields start at their defaults.
1594    pub fn new(
1595        metadata: NodeMetadata<'gc>,
1596        label: Option<&'gc Node<'gc>>,
1597    ) -> Self {
1598        ContinueStatement {
1599            metadata,
1600            label,
1601            label_index: Cell::new(INVALID_LABEL),
1602        }
1603    }
1604}
1605
1606/// The `ThrowStatement` AST node.
1607#[derive(Debug)]
1608#[repr(C)]
1609pub struct ThrowStatement<'gc> {
1610    /// Source range, debug location, paren count, and node id.
1611    pub metadata: NodeMetadata<'gc>,
1612    /// ESTree `argument` property.
1613    pub argument: &'gc Node<'gc>,
1614}
1615impl<'gc> ThrowStatement<'gc> {
1616    /// Build `ThrowStatement` from its metadata and `ESTree.def` fields.
1617    pub fn new(
1618        metadata: NodeMetadata<'gc>,
1619        argument: &'gc Node<'gc>,
1620    ) -> Self {
1621        ThrowStatement {
1622            metadata,
1623            argument,
1624        }
1625    }
1626}
1627
1628/// The `ReturnStatement` AST node.
1629#[derive(Debug)]
1630#[repr(C)]
1631pub struct ReturnStatement<'gc> {
1632    /// Source range, debug location, paren count, and node id.
1633    pub metadata: NodeMetadata<'gc>,
1634    /// ESTree `argument` property.
1635    pub argument: Option<&'gc Node<'gc>>,
1636}
1637impl<'gc> ReturnStatement<'gc> {
1638    /// Build `ReturnStatement` from its metadata and `ESTree.def` fields.
1639    pub fn new(
1640        metadata: NodeMetadata<'gc>,
1641        argument: Option<&'gc Node<'gc>>,
1642    ) -> Self {
1643        ReturnStatement {
1644            metadata,
1645            argument,
1646        }
1647    }
1648}
1649
1650/// The `WithStatement` AST node.
1651#[derive(Debug)]
1652#[repr(C)]
1653pub struct WithStatement<'gc> {
1654    /// Source range, debug location, paren count, and node id.
1655    pub metadata: NodeMetadata<'gc>,
1656    /// ESTree `object` property.
1657    pub object: &'gc Node<'gc>,
1658    /// ESTree `body` property.
1659    pub body: &'gc Node<'gc>,
1660}
1661impl<'gc> WithStatement<'gc> {
1662    /// Build `WithStatement` from its metadata and `ESTree.def` fields.
1663    pub fn new(
1664        metadata: NodeMetadata<'gc>,
1665        object: &'gc Node<'gc>,
1666        body: &'gc Node<'gc>,
1667    ) -> Self {
1668        WithStatement {
1669            metadata,
1670            object,
1671            body,
1672        }
1673    }
1674}
1675
1676/// The `SwitchStatement` AST node.
1677#[derive(Debug)]
1678#[repr(C)]
1679pub struct SwitchStatement<'gc> {
1680    /// Source range, debug location, paren count, and node id.
1681    pub metadata: NodeMetadata<'gc>,
1682    /// ESTree `discriminant` property.
1683    pub discriminant: &'gc Node<'gc>,
1684    /// ESTree `cases` property.
1685    pub cases: NodeList<'gc>,
1686    /// Sema: label index; `INVALID_LABEL` until set.
1687    pub label_index: Cell<u32>,
1688    /// Sema: the lexical scope created by this node, if any.
1689    pub scope: Cell<Option<SemaId>>,
1690}
1691impl<'gc> SwitchStatement<'gc> {
1692    /// Build `SwitchStatement` from its metadata and `ESTree.def` fields.
1693    /// Decoration fields start at their defaults.
1694    pub fn new(
1695        metadata: NodeMetadata<'gc>,
1696        discriminant: &'gc Node<'gc>,
1697        cases: NodeList<'gc>,
1698    ) -> Self {
1699        SwitchStatement {
1700            metadata,
1701            discriminant,
1702            cases,
1703            label_index: Cell::new(INVALID_LABEL),
1704            scope: Cell::new(None),
1705        }
1706    }
1707}
1708
1709/// The `LabeledStatement` AST node.
1710#[derive(Debug)]
1711#[repr(C)]
1712pub struct LabeledStatement<'gc> {
1713    /// Source range, debug location, paren count, and node id.
1714    pub metadata: NodeMetadata<'gc>,
1715    /// ESTree `label` property.
1716    pub label: &'gc Node<'gc>,
1717    /// ESTree `body` property.
1718    pub body: &'gc Node<'gc>,
1719    /// Sema: label index; `INVALID_LABEL` until set.
1720    pub label_index: Cell<u32>,
1721}
1722impl<'gc> LabeledStatement<'gc> {
1723    /// Build `LabeledStatement` from its metadata and `ESTree.def` fields.
1724    /// Decoration fields start at their defaults.
1725    pub fn new(
1726        metadata: NodeMetadata<'gc>,
1727        label: &'gc Node<'gc>,
1728        body: &'gc Node<'gc>,
1729    ) -> Self {
1730        LabeledStatement {
1731            metadata,
1732            label,
1733            body,
1734            label_index: Cell::new(INVALID_LABEL),
1735        }
1736    }
1737}
1738
1739/// The `ExpressionStatement` AST node.
1740#[derive(Debug)]
1741#[repr(C)]
1742pub struct ExpressionStatement<'gc> {
1743    /// Source range, debug location, paren count, and node id.
1744    pub metadata: NodeMetadata<'gc>,
1745    /// ESTree `expression` property.
1746    pub expression: &'gc Node<'gc>,
1747    /// ESTree `directive` property.
1748    pub directive: Cell<NodeString>,
1749}
1750impl<'gc> ExpressionStatement<'gc> {
1751    /// Build `ExpressionStatement` from its metadata and `ESTree.def` fields.
1752    pub fn new(
1753        metadata: NodeMetadata<'gc>,
1754        expression: &'gc Node<'gc>,
1755        directive: NodeString,
1756    ) -> Self {
1757        ExpressionStatement {
1758            metadata,
1759            expression,
1760            directive: Cell::new(directive),
1761        }
1762    }
1763}
1764
1765/// The `TryStatement` AST node.
1766#[derive(Debug)]
1767#[repr(C)]
1768pub struct TryStatement<'gc> {
1769    /// Source range, debug location, paren count, and node id.
1770    pub metadata: NodeMetadata<'gc>,
1771    /// ESTree `block` property.
1772    pub block: &'gc Node<'gc>,
1773    /// ESTree `handler` property.
1774    pub handler: Option<&'gc Node<'gc>>,
1775    /// ESTree `finalizer` property.
1776    pub finalizer: Option<&'gc Node<'gc>>,
1777}
1778impl<'gc> TryStatement<'gc> {
1779    /// Build `TryStatement` from its metadata and `ESTree.def` fields.
1780    pub fn new(
1781        metadata: NodeMetadata<'gc>,
1782        block: &'gc Node<'gc>,
1783        handler: Option<&'gc Node<'gc>>,
1784        finalizer: Option<&'gc Node<'gc>>,
1785    ) -> Self {
1786        TryStatement {
1787            metadata,
1788            block,
1789            handler,
1790            finalizer,
1791        }
1792    }
1793}
1794
1795/// The `IfStatement` AST node.
1796#[derive(Debug)]
1797#[repr(C)]
1798pub struct IfStatement<'gc> {
1799    /// Source range, debug location, paren count, and node id.
1800    pub metadata: NodeMetadata<'gc>,
1801    /// ESTree `test` property.
1802    pub test: &'gc Node<'gc>,
1803    /// ESTree `consequent` property.
1804    pub consequent: &'gc Node<'gc>,
1805    /// ESTree `alternate` property.
1806    pub alternate: Option<&'gc Node<'gc>>,
1807}
1808impl<'gc> IfStatement<'gc> {
1809    /// Build `IfStatement` from its metadata and `ESTree.def` fields.
1810    pub fn new(
1811        metadata: NodeMetadata<'gc>,
1812        test: &'gc Node<'gc>,
1813        consequent: &'gc Node<'gc>,
1814        alternate: Option<&'gc Node<'gc>>,
1815    ) -> Self {
1816        IfStatement {
1817            metadata,
1818            test,
1819            consequent,
1820            alternate,
1821        }
1822    }
1823}
1824
1825/// The `NullLiteral` AST node.
1826#[derive(Debug)]
1827#[repr(C)]
1828pub struct NullLiteral<'gc> {
1829    /// Source range, debug location, paren count, and node id.
1830    pub metadata: NodeMetadata<'gc>,
1831}
1832impl<'gc> NullLiteral<'gc> {
1833    /// Build `NullLiteral` from its metadata and `ESTree.def` fields.
1834    pub fn new(
1835        metadata: NodeMetadata<'gc>,
1836    ) -> Self {
1837        NullLiteral {
1838            metadata,
1839        }
1840    }
1841}
1842
1843/// The `BooleanLiteral` AST node.
1844#[derive(Debug)]
1845#[repr(C)]
1846pub struct BooleanLiteral<'gc> {
1847    /// Source range, debug location, paren count, and node id.
1848    pub metadata: NodeMetadata<'gc>,
1849    /// ESTree `value` property.
1850    pub value: Cell<bool>,
1851}
1852impl<'gc> BooleanLiteral<'gc> {
1853    /// Build `BooleanLiteral` from its metadata and `ESTree.def` fields.
1854    pub fn new(
1855        metadata: NodeMetadata<'gc>,
1856        value: bool,
1857    ) -> Self {
1858        BooleanLiteral {
1859            metadata,
1860            value: Cell::new(value),
1861        }
1862    }
1863}
1864
1865/// The `StringLiteral` AST node.
1866#[derive(Debug)]
1867#[repr(C)]
1868pub struct StringLiteral<'gc> {
1869    /// Source range, debug location, paren count, and node id.
1870    pub metadata: NodeMetadata<'gc>,
1871    /// ESTree `value` property.
1872    pub value: Cell<NodeString>,
1873}
1874impl<'gc> StringLiteral<'gc> {
1875    /// Build `StringLiteral` from its metadata and `ESTree.def` fields.
1876    pub fn new(
1877        metadata: NodeMetadata<'gc>,
1878        value: NodeString,
1879    ) -> Self {
1880        StringLiteral {
1881            metadata,
1882            value: Cell::new(value),
1883        }
1884    }
1885}
1886
1887/// The `NumericLiteral` AST node.
1888#[derive(Debug)]
1889#[repr(C)]
1890pub struct NumericLiteral<'gc> {
1891    /// Source range, debug location, paren count, and node id.
1892    pub metadata: NodeMetadata<'gc>,
1893    /// ESTree `value` property.
1894    pub value: Cell<f64>,
1895}
1896impl<'gc> NumericLiteral<'gc> {
1897    /// Build `NumericLiteral` from its metadata and `ESTree.def` fields.
1898    pub fn new(
1899        metadata: NodeMetadata<'gc>,
1900        value: f64,
1901    ) -> Self {
1902        NumericLiteral {
1903            metadata,
1904            value: Cell::new(value),
1905        }
1906    }
1907}
1908
1909/// The `RegExpLiteral` AST node.
1910#[derive(Debug)]
1911#[repr(C)]
1912pub struct RegExpLiteral<'gc> {
1913    /// Source range, debug location, paren count, and node id.
1914    pub metadata: NodeMetadata<'gc>,
1915    /// ESTree `pattern` property.
1916    pub pattern: Cell<NodeLabel>,
1917    /// ESTree `flags` property.
1918    pub flags: Cell<NodeLabel>,
1919}
1920impl<'gc> RegExpLiteral<'gc> {
1921    /// Build `RegExpLiteral` from its metadata and `ESTree.def` fields.
1922    pub fn new(
1923        metadata: NodeMetadata<'gc>,
1924        pattern: NodeLabel,
1925        flags: NodeLabel,
1926    ) -> Self {
1927        RegExpLiteral {
1928            metadata,
1929            pattern: Cell::new(pattern),
1930            flags: Cell::new(flags),
1931        }
1932    }
1933}
1934
1935/// The `BigIntLiteral` AST node.
1936#[derive(Debug)]
1937#[repr(C)]
1938pub struct BigIntLiteral<'gc> {
1939    /// Source range, debug location, paren count, and node id.
1940    pub metadata: NodeMetadata<'gc>,
1941    /// ESTree `bigint` property.
1942    pub bigint: Cell<NodeLabel>,
1943}
1944impl<'gc> BigIntLiteral<'gc> {
1945    /// Build `BigIntLiteral` from its metadata and `ESTree.def` fields.
1946    pub fn new(
1947        metadata: NodeMetadata<'gc>,
1948        bigint: NodeLabel,
1949    ) -> Self {
1950        BigIntLiteral {
1951            metadata,
1952            bigint: Cell::new(bigint),
1953        }
1954    }
1955}
1956
1957/// The `ThisExpression` AST node.
1958#[derive(Debug)]
1959#[repr(C)]
1960pub struct ThisExpression<'gc> {
1961    /// Source range, debug location, paren count, and node id.
1962    pub metadata: NodeMetadata<'gc>,
1963}
1964impl<'gc> ThisExpression<'gc> {
1965    /// Build `ThisExpression` from its metadata and `ESTree.def` fields.
1966    pub fn new(
1967        metadata: NodeMetadata<'gc>,
1968    ) -> Self {
1969        ThisExpression {
1970            metadata,
1971        }
1972    }
1973}
1974
1975/// The `Super` AST node.
1976#[derive(Debug)]
1977#[repr(C)]
1978pub struct Super<'gc> {
1979    /// Source range, debug location, paren count, and node id.
1980    pub metadata: NodeMetadata<'gc>,
1981}
1982impl<'gc> Super<'gc> {
1983    /// Build `Super` from its metadata and `ESTree.def` fields.
1984    pub fn new(
1985        metadata: NodeMetadata<'gc>,
1986    ) -> Self {
1987        Super {
1988            metadata,
1989        }
1990    }
1991}
1992
1993/// The `SequenceExpression` AST node.
1994#[derive(Debug)]
1995#[repr(C)]
1996pub struct SequenceExpression<'gc> {
1997    /// Source range, debug location, paren count, and node id.
1998    pub metadata: NodeMetadata<'gc>,
1999    /// ESTree `expressions` property.
2000    pub expressions: NodeList<'gc>,
2001}
2002impl<'gc> SequenceExpression<'gc> {
2003    /// Build `SequenceExpression` from its metadata and `ESTree.def` fields.
2004    pub fn new(
2005        metadata: NodeMetadata<'gc>,
2006        expressions: NodeList<'gc>,
2007    ) -> Self {
2008        SequenceExpression {
2009            metadata,
2010            expressions,
2011        }
2012    }
2013}
2014
2015/// The `ObjectExpression` AST node.
2016#[derive(Debug)]
2017#[repr(C)]
2018pub struct ObjectExpression<'gc> {
2019    /// Source range, debug location, paren count, and node id.
2020    pub metadata: NodeMetadata<'gc>,
2021    /// ESTree `properties` property.
2022    pub properties: NodeList<'gc>,
2023}
2024impl<'gc> ObjectExpression<'gc> {
2025    /// Build `ObjectExpression` from its metadata and `ESTree.def` fields.
2026    pub fn new(
2027        metadata: NodeMetadata<'gc>,
2028        properties: NodeList<'gc>,
2029    ) -> Self {
2030        ObjectExpression {
2031            metadata,
2032            properties,
2033        }
2034    }
2035}
2036
2037/// The `ArrayExpression` AST node.
2038#[derive(Debug)]
2039#[repr(C)]
2040pub struct ArrayExpression<'gc> {
2041    /// Source range, debug location, paren count, and node id.
2042    pub metadata: NodeMetadata<'gc>,
2043    /// ESTree `elements` property.
2044    pub elements: NodeList<'gc>,
2045    /// ESTree `trailingComma` property.
2046    pub trailing_comma: Cell<bool>,
2047}
2048impl<'gc> ArrayExpression<'gc> {
2049    /// Build `ArrayExpression` from its metadata and `ESTree.def` fields.
2050    pub fn new(
2051        metadata: NodeMetadata<'gc>,
2052        elements: NodeList<'gc>,
2053        trailing_comma: bool,
2054    ) -> Self {
2055        ArrayExpression {
2056            metadata,
2057            elements,
2058            trailing_comma: Cell::new(trailing_comma),
2059        }
2060    }
2061}
2062
2063/// The `SpreadElement` AST node.
2064#[derive(Debug)]
2065#[repr(C)]
2066pub struct SpreadElement<'gc> {
2067    /// Source range, debug location, paren count, and node id.
2068    pub metadata: NodeMetadata<'gc>,
2069    /// ESTree `argument` property.
2070    pub argument: &'gc Node<'gc>,
2071}
2072impl<'gc> SpreadElement<'gc> {
2073    /// Build `SpreadElement` from its metadata and `ESTree.def` fields.
2074    pub fn new(
2075        metadata: NodeMetadata<'gc>,
2076        argument: &'gc Node<'gc>,
2077    ) -> Self {
2078        SpreadElement {
2079            metadata,
2080            argument,
2081        }
2082    }
2083}
2084
2085/// The `NewExpression` AST node.
2086#[derive(Debug)]
2087#[repr(C)]
2088pub struct NewExpression<'gc> {
2089    /// Source range, debug location, paren count, and node id.
2090    pub metadata: NodeMetadata<'gc>,
2091    /// ESTree `callee` property.
2092    pub callee: &'gc Node<'gc>,
2093    /// ESTree `typeArguments` property.
2094    pub type_arguments: Option<&'gc Node<'gc>>,
2095    /// ESTree `arguments` property.
2096    pub arguments: NodeList<'gc>,
2097}
2098impl<'gc> NewExpression<'gc> {
2099    /// Build `NewExpression` from its metadata and `ESTree.def` fields.
2100    pub fn new(
2101        metadata: NodeMetadata<'gc>,
2102        callee: &'gc Node<'gc>,
2103        type_arguments: Option<&'gc Node<'gc>>,
2104        arguments: NodeList<'gc>,
2105    ) -> Self {
2106        NewExpression {
2107            metadata,
2108            callee,
2109            type_arguments,
2110            arguments,
2111        }
2112    }
2113}
2114
2115/// The `YieldExpression` AST node.
2116#[derive(Debug)]
2117#[repr(C)]
2118pub struct YieldExpression<'gc> {
2119    /// Source range, debug location, paren count, and node id.
2120    pub metadata: NodeMetadata<'gc>,
2121    /// ESTree `argument` property.
2122    pub argument: Option<&'gc Node<'gc>>,
2123    /// ESTree `delegate` property.
2124    pub delegate: Cell<bool>,
2125}
2126impl<'gc> YieldExpression<'gc> {
2127    /// Build `YieldExpression` from its metadata and `ESTree.def` fields.
2128    pub fn new(
2129        metadata: NodeMetadata<'gc>,
2130        argument: Option<&'gc Node<'gc>>,
2131        delegate: bool,
2132    ) -> Self {
2133        YieldExpression {
2134            metadata,
2135            argument,
2136            delegate: Cell::new(delegate),
2137        }
2138    }
2139}
2140
2141/// The `AwaitExpression` AST node.
2142#[derive(Debug)]
2143#[repr(C)]
2144pub struct AwaitExpression<'gc> {
2145    /// Source range, debug location, paren count, and node id.
2146    pub metadata: NodeMetadata<'gc>,
2147    /// ESTree `argument` property.
2148    pub argument: &'gc Node<'gc>,
2149}
2150impl<'gc> AwaitExpression<'gc> {
2151    /// Build `AwaitExpression` from its metadata and `ESTree.def` fields.
2152    pub fn new(
2153        metadata: NodeMetadata<'gc>,
2154        argument: &'gc Node<'gc>,
2155    ) -> Self {
2156        AwaitExpression {
2157            metadata,
2158            argument,
2159        }
2160    }
2161}
2162
2163/// The `ImportExpression` AST node.
2164#[derive(Debug)]
2165#[repr(C)]
2166pub struct ImportExpression<'gc> {
2167    /// Source range, debug location, paren count, and node id.
2168    pub metadata: NodeMetadata<'gc>,
2169    /// ESTree `source` property.
2170    pub source: &'gc Node<'gc>,
2171    /// ESTree `options` property.
2172    pub options: Option<&'gc Node<'gc>>,
2173}
2174impl<'gc> ImportExpression<'gc> {
2175    /// Build `ImportExpression` from its metadata and `ESTree.def` fields.
2176    pub fn new(
2177        metadata: NodeMetadata<'gc>,
2178        source: &'gc Node<'gc>,
2179        options: Option<&'gc Node<'gc>>,
2180    ) -> Self {
2181        ImportExpression {
2182            metadata,
2183            source,
2184            options,
2185        }
2186    }
2187}
2188
2189/// The `CallExpression` AST node.
2190#[derive(Debug)]
2191#[repr(C)]
2192pub struct CallExpression<'gc> {
2193    /// Source range, debug location, paren count, and node id.
2194    pub metadata: NodeMetadata<'gc>,
2195    /// ESTree `callee` property.
2196    pub callee: &'gc Node<'gc>,
2197    /// ESTree `typeArguments` property.
2198    pub type_arguments: Option<&'gc Node<'gc>>,
2199    /// ESTree `arguments` property.
2200    pub arguments: NodeList<'gc>,
2201}
2202impl<'gc> CallExpression<'gc> {
2203    /// Build `CallExpression` from its metadata and `ESTree.def` fields.
2204    pub fn new(
2205        metadata: NodeMetadata<'gc>,
2206        callee: &'gc Node<'gc>,
2207        type_arguments: Option<&'gc Node<'gc>>,
2208        arguments: NodeList<'gc>,
2209    ) -> Self {
2210        CallExpression {
2211            metadata,
2212            callee,
2213            type_arguments,
2214            arguments,
2215        }
2216    }
2217}
2218
2219/// The `OptionalCallExpression` AST node.
2220#[derive(Debug)]
2221#[repr(C)]
2222pub struct OptionalCallExpression<'gc> {
2223    /// Source range, debug location, paren count, and node id.
2224    pub metadata: NodeMetadata<'gc>,
2225    /// ESTree `callee` property.
2226    pub callee: &'gc Node<'gc>,
2227    /// ESTree `typeArguments` property.
2228    pub type_arguments: Option<&'gc Node<'gc>>,
2229    /// ESTree `arguments` property.
2230    pub arguments: NodeList<'gc>,
2231    /// ESTree `optional` property.
2232    pub optional: Cell<bool>,
2233}
2234impl<'gc> OptionalCallExpression<'gc> {
2235    /// Build `OptionalCallExpression` from its metadata and `ESTree.def`
2236    /// fields.
2237    pub fn new(
2238        metadata: NodeMetadata<'gc>,
2239        callee: &'gc Node<'gc>,
2240        type_arguments: Option<&'gc Node<'gc>>,
2241        arguments: NodeList<'gc>,
2242        optional: bool,
2243    ) -> Self {
2244        OptionalCallExpression {
2245            metadata,
2246            callee,
2247            type_arguments,
2248            arguments,
2249            optional: Cell::new(optional),
2250        }
2251    }
2252}
2253
2254/// The `AssignmentExpression` AST node.
2255#[derive(Debug)]
2256#[repr(C)]
2257pub struct AssignmentExpression<'gc> {
2258    /// Source range, debug location, paren count, and node id.
2259    pub metadata: NodeMetadata<'gc>,
2260    /// ESTree `operator` property.
2261    pub operator: Cell<NodeLabel>,
2262    /// ESTree `left` property.
2263    pub left: &'gc Node<'gc>,
2264    /// ESTree `right` property.
2265    pub right: &'gc Node<'gc>,
2266}
2267impl<'gc> AssignmentExpression<'gc> {
2268    /// Build `AssignmentExpression` from its metadata and `ESTree.def` fields.
2269    pub fn new(
2270        metadata: NodeMetadata<'gc>,
2271        operator: NodeLabel,
2272        left: &'gc Node<'gc>,
2273        right: &'gc Node<'gc>,
2274    ) -> Self {
2275        AssignmentExpression {
2276            metadata,
2277            operator: Cell::new(operator),
2278            left,
2279            right,
2280        }
2281    }
2282}
2283
2284/// The `UnaryExpression` AST node.
2285#[derive(Debug)]
2286#[repr(C)]
2287pub struct UnaryExpression<'gc> {
2288    /// Source range, debug location, paren count, and node id.
2289    pub metadata: NodeMetadata<'gc>,
2290    /// ESTree `operator` property.
2291    pub operator: Cell<NodeLabel>,
2292    /// ESTree `argument` property.
2293    pub argument: &'gc Node<'gc>,
2294    /// ESTree `prefix` property.
2295    pub prefix: Cell<bool>,
2296}
2297impl<'gc> UnaryExpression<'gc> {
2298    /// Build `UnaryExpression` from its metadata and `ESTree.def` fields.
2299    pub fn new(
2300        metadata: NodeMetadata<'gc>,
2301        operator: NodeLabel,
2302        argument: &'gc Node<'gc>,
2303        prefix: bool,
2304    ) -> Self {
2305        UnaryExpression {
2306            metadata,
2307            operator: Cell::new(operator),
2308            argument,
2309            prefix: Cell::new(prefix),
2310        }
2311    }
2312}
2313
2314/// The `UpdateExpression` AST node.
2315#[derive(Debug)]
2316#[repr(C)]
2317pub struct UpdateExpression<'gc> {
2318    /// Source range, debug location, paren count, and node id.
2319    pub metadata: NodeMetadata<'gc>,
2320    /// ESTree `operator` property.
2321    pub operator: Cell<NodeLabel>,
2322    /// ESTree `argument` property.
2323    pub argument: &'gc Node<'gc>,
2324    /// ESTree `prefix` property.
2325    pub prefix: Cell<bool>,
2326}
2327impl<'gc> UpdateExpression<'gc> {
2328    /// Build `UpdateExpression` from its metadata and `ESTree.def` fields.
2329    pub fn new(
2330        metadata: NodeMetadata<'gc>,
2331        operator: NodeLabel,
2332        argument: &'gc Node<'gc>,
2333        prefix: bool,
2334    ) -> Self {
2335        UpdateExpression {
2336            metadata,
2337            operator: Cell::new(operator),
2338            argument,
2339            prefix: Cell::new(prefix),
2340        }
2341    }
2342}
2343
2344/// The `MemberExpression` AST node.
2345#[derive(Debug)]
2346#[repr(C)]
2347pub struct MemberExpression<'gc> {
2348    /// Source range, debug location, paren count, and node id.
2349    pub metadata: NodeMetadata<'gc>,
2350    /// ESTree `object` property.
2351    pub object: &'gc Node<'gc>,
2352    /// ESTree `property` property.
2353    pub property: &'gc Node<'gc>,
2354    /// ESTree `computed` property.
2355    pub computed: Cell<bool>,
2356}
2357impl<'gc> MemberExpression<'gc> {
2358    /// Build `MemberExpression` from its metadata and `ESTree.def` fields.
2359    pub fn new(
2360        metadata: NodeMetadata<'gc>,
2361        object: &'gc Node<'gc>,
2362        property: &'gc Node<'gc>,
2363        computed: bool,
2364    ) -> Self {
2365        MemberExpression {
2366            metadata,
2367            object,
2368            property,
2369            computed: Cell::new(computed),
2370        }
2371    }
2372}
2373
2374/// The `OptionalMemberExpression` AST node.
2375#[derive(Debug)]
2376#[repr(C)]
2377pub struct OptionalMemberExpression<'gc> {
2378    /// Source range, debug location, paren count, and node id.
2379    pub metadata: NodeMetadata<'gc>,
2380    /// ESTree `object` property.
2381    pub object: &'gc Node<'gc>,
2382    /// ESTree `property` property.
2383    pub property: &'gc Node<'gc>,
2384    /// ESTree `computed` property.
2385    pub computed: Cell<bool>,
2386    /// ESTree `optional` property.
2387    pub optional: Cell<bool>,
2388}
2389impl<'gc> OptionalMemberExpression<'gc> {
2390    /// Build `OptionalMemberExpression` from its metadata and `ESTree.def`
2391    /// fields.
2392    pub fn new(
2393        metadata: NodeMetadata<'gc>,
2394        object: &'gc Node<'gc>,
2395        property: &'gc Node<'gc>,
2396        computed: bool,
2397        optional: bool,
2398    ) -> Self {
2399        OptionalMemberExpression {
2400            metadata,
2401            object,
2402            property,
2403            computed: Cell::new(computed),
2404            optional: Cell::new(optional),
2405        }
2406    }
2407}
2408
2409/// The `LogicalExpression` AST node.
2410#[derive(Debug)]
2411#[repr(C)]
2412pub struct LogicalExpression<'gc> {
2413    /// Source range, debug location, paren count, and node id.
2414    pub metadata: NodeMetadata<'gc>,
2415    /// ESTree `left` property.
2416    pub left: &'gc Node<'gc>,
2417    /// ESTree `right` property.
2418    pub right: &'gc Node<'gc>,
2419    /// ESTree `operator` property.
2420    pub operator: Cell<NodeLabel>,
2421}
2422impl<'gc> LogicalExpression<'gc> {
2423    /// Build `LogicalExpression` from its metadata and `ESTree.def` fields.
2424    pub fn new(
2425        metadata: NodeMetadata<'gc>,
2426        left: &'gc Node<'gc>,
2427        right: &'gc Node<'gc>,
2428        operator: NodeLabel,
2429    ) -> Self {
2430        LogicalExpression {
2431            metadata,
2432            left,
2433            right,
2434            operator: Cell::new(operator),
2435        }
2436    }
2437}
2438
2439/// The `ConditionalExpression` AST node.
2440#[derive(Debug)]
2441#[repr(C)]
2442pub struct ConditionalExpression<'gc> {
2443    /// Source range, debug location, paren count, and node id.
2444    pub metadata: NodeMetadata<'gc>,
2445    /// ESTree `test` property.
2446    pub test: &'gc Node<'gc>,
2447    /// ESTree `alternate` property.
2448    pub alternate: &'gc Node<'gc>,
2449    /// ESTree `consequent` property.
2450    pub consequent: &'gc Node<'gc>,
2451}
2452impl<'gc> ConditionalExpression<'gc> {
2453    /// Build `ConditionalExpression` from its metadata and `ESTree.def` fields.
2454    pub fn new(
2455        metadata: NodeMetadata<'gc>,
2456        test: &'gc Node<'gc>,
2457        alternate: &'gc Node<'gc>,
2458        consequent: &'gc Node<'gc>,
2459    ) -> Self {
2460        ConditionalExpression {
2461            metadata,
2462            test,
2463            alternate,
2464            consequent,
2465        }
2466    }
2467}
2468
2469/// The `BinaryExpression` AST node.
2470#[derive(Debug)]
2471#[repr(C)]
2472pub struct BinaryExpression<'gc> {
2473    /// Source range, debug location, paren count, and node id.
2474    pub metadata: NodeMetadata<'gc>,
2475    /// ESTree `left` property.
2476    pub left: &'gc Node<'gc>,
2477    /// ESTree `right` property.
2478    pub right: &'gc Node<'gc>,
2479    /// ESTree `operator` property.
2480    pub operator: Cell<NodeLabel>,
2481}
2482impl<'gc> BinaryExpression<'gc> {
2483    /// Build `BinaryExpression` from its metadata and `ESTree.def` fields.
2484    pub fn new(
2485        metadata: NodeMetadata<'gc>,
2486        left: &'gc Node<'gc>,
2487        right: &'gc Node<'gc>,
2488        operator: NodeLabel,
2489    ) -> Self {
2490        BinaryExpression {
2491            metadata,
2492            left,
2493            right,
2494            operator: Cell::new(operator),
2495        }
2496    }
2497}
2498
2499/// The `Directive` AST node.
2500#[derive(Debug)]
2501#[repr(C)]
2502pub struct Directive<'gc> {
2503    /// Source range, debug location, paren count, and node id.
2504    pub metadata: NodeMetadata<'gc>,
2505    /// ESTree `value` property.
2506    pub value: &'gc Node<'gc>,
2507}
2508impl<'gc> Directive<'gc> {
2509    /// Build `Directive` from its metadata and `ESTree.def` fields.
2510    pub fn new(
2511        metadata: NodeMetadata<'gc>,
2512        value: &'gc Node<'gc>,
2513    ) -> Self {
2514        Directive {
2515            metadata,
2516            value,
2517        }
2518    }
2519}
2520
2521/// The `DirectiveLiteral` AST node.
2522#[derive(Debug)]
2523#[repr(C)]
2524pub struct DirectiveLiteral<'gc> {
2525    /// Source range, debug location, paren count, and node id.
2526    pub metadata: NodeMetadata<'gc>,
2527    /// ESTree `value` property.
2528    pub value: Cell<NodeString>,
2529}
2530impl<'gc> DirectiveLiteral<'gc> {
2531    /// Build `DirectiveLiteral` from its metadata and `ESTree.def` fields.
2532    pub fn new(
2533        metadata: NodeMetadata<'gc>,
2534        value: NodeString,
2535    ) -> Self {
2536        DirectiveLiteral {
2537            metadata,
2538            value: Cell::new(value),
2539        }
2540    }
2541}
2542
2543/// The `Identifier` AST node.
2544#[derive(Debug)]
2545#[repr(C)]
2546pub struct Identifier<'gc> {
2547    /// Source range, debug location, paren count, and node id.
2548    pub metadata: NodeMetadata<'gc>,
2549    /// ESTree `name` property.
2550    pub name: Cell<NodeLabel>,
2551    /// ESTree `typeAnnotation` property.
2552    pub type_annotation: Option<&'gc Node<'gc>>,
2553    /// ESTree `optional` property.
2554    pub optional: Cell<bool>,
2555    /// Sema: unresolvable because of an enclosing `eval` or `with`.
2556    pub unresolvable: Cell<bool>,
2557    /// Sema: how to read `decl` — the `BitHave*` bits of `ESTree.h`'s
2558    /// `IdentifierDecoration`.
2559    pub decl_state: Cell<u8>,
2560    /// Sema: the declaration this identifier resolves to; `None` until a
2561    /// resolution is recorded.
2562    pub decl: Cell<Option<SemaId>>,
2563}
2564impl<'gc> Identifier<'gc> {
2565    /// Build `Identifier` from its metadata and `ESTree.def` fields.
2566    /// Decoration fields start at their defaults.
2567    pub fn new(
2568        metadata: NodeMetadata<'gc>,
2569        name: NodeLabel,
2570        type_annotation: Option<&'gc Node<'gc>>,
2571        optional: bool,
2572    ) -> Self {
2573        Identifier {
2574            metadata,
2575            name: Cell::new(name),
2576            type_annotation,
2577            optional: Cell::new(optional),
2578            unresolvable: Cell::new(false),
2579            decl_state: Cell::new(0),
2580            decl: Cell::new(None),
2581        }
2582    }
2583}
2584
2585/// The `PrivateName` AST node.
2586#[derive(Debug)]
2587#[repr(C)]
2588pub struct PrivateName<'gc> {
2589    /// Source range, debug location, paren count, and node id.
2590    pub metadata: NodeMetadata<'gc>,
2591    /// ESTree `id` property.
2592    pub id: &'gc Node<'gc>,
2593}
2594impl<'gc> PrivateName<'gc> {
2595    /// Build `PrivateName` from its metadata and `ESTree.def` fields.
2596    pub fn new(
2597        metadata: NodeMetadata<'gc>,
2598        id: &'gc Node<'gc>,
2599    ) -> Self {
2600        PrivateName {
2601            metadata,
2602            id,
2603        }
2604    }
2605}
2606
2607/// The `MetaProperty` AST node.
2608#[derive(Debug)]
2609#[repr(C)]
2610pub struct MetaProperty<'gc> {
2611    /// Source range, debug location, paren count, and node id.
2612    pub metadata: NodeMetadata<'gc>,
2613    /// ESTree `meta` property.
2614    pub meta: &'gc Node<'gc>,
2615    /// ESTree `property` property.
2616    pub property: &'gc Node<'gc>,
2617}
2618impl<'gc> MetaProperty<'gc> {
2619    /// Build `MetaProperty` from its metadata and `ESTree.def` fields.
2620    pub fn new(
2621        metadata: NodeMetadata<'gc>,
2622        meta: &'gc Node<'gc>,
2623        property: &'gc Node<'gc>,
2624    ) -> Self {
2625        MetaProperty {
2626            metadata,
2627            meta,
2628            property,
2629        }
2630    }
2631}
2632
2633/// The `SwitchCase` AST node.
2634#[derive(Debug)]
2635#[repr(C)]
2636pub struct SwitchCase<'gc> {
2637    /// Source range, debug location, paren count, and node id.
2638    pub metadata: NodeMetadata<'gc>,
2639    /// ESTree `test` property.
2640    pub test: Option<&'gc Node<'gc>>,
2641    /// ESTree `consequent` property.
2642    pub consequent: NodeList<'gc>,
2643}
2644impl<'gc> SwitchCase<'gc> {
2645    /// Build `SwitchCase` from its metadata and `ESTree.def` fields.
2646    pub fn new(
2647        metadata: NodeMetadata<'gc>,
2648        test: Option<&'gc Node<'gc>>,
2649        consequent: NodeList<'gc>,
2650    ) -> Self {
2651        SwitchCase {
2652            metadata,
2653            test,
2654            consequent,
2655        }
2656    }
2657}
2658
2659/// The `CatchClause` AST node.
2660#[derive(Debug)]
2661#[repr(C)]
2662pub struct CatchClause<'gc> {
2663    /// Source range, debug location, paren count, and node id.
2664    pub metadata: NodeMetadata<'gc>,
2665    /// ESTree `param` property.
2666    pub param: Option<&'gc Node<'gc>>,
2667    /// ESTree `body` property.
2668    pub body: &'gc Node<'gc>,
2669    /// Sema: the lexical scope created by this node, if any.
2670    pub scope: Cell<Option<SemaId>>,
2671}
2672impl<'gc> CatchClause<'gc> {
2673    /// Build `CatchClause` from its metadata and `ESTree.def` fields.
2674    /// Decoration fields start at their defaults.
2675    pub fn new(
2676        metadata: NodeMetadata<'gc>,
2677        param: Option<&'gc Node<'gc>>,
2678        body: &'gc Node<'gc>,
2679    ) -> Self {
2680        CatchClause {
2681            metadata,
2682            param,
2683            body,
2684            scope: Cell::new(None),
2685        }
2686    }
2687}
2688
2689/// The `VariableDeclarator` AST node.
2690#[derive(Debug)]
2691#[repr(C)]
2692pub struct VariableDeclarator<'gc> {
2693    /// Source range, debug location, paren count, and node id.
2694    pub metadata: NodeMetadata<'gc>,
2695    /// ESTree `init` property.
2696    pub init: Option<&'gc Node<'gc>>,
2697    /// ESTree `id` property.
2698    pub id: &'gc Node<'gc>,
2699}
2700impl<'gc> VariableDeclarator<'gc> {
2701    /// Build `VariableDeclarator` from its metadata and `ESTree.def` fields.
2702    pub fn new(
2703        metadata: NodeMetadata<'gc>,
2704        init: Option<&'gc Node<'gc>>,
2705        id: &'gc Node<'gc>,
2706    ) -> Self {
2707        VariableDeclarator {
2708            metadata,
2709            init,
2710            id,
2711        }
2712    }
2713}
2714
2715/// The `VariableDeclaration` AST node.
2716#[derive(Debug)]
2717#[repr(C)]
2718pub struct VariableDeclaration<'gc> {
2719    /// Source range, debug location, paren count, and node id.
2720    pub metadata: NodeMetadata<'gc>,
2721    /// ESTree `kind` property.
2722    pub kind: Cell<NodeLabel>,
2723    /// ESTree `declarations` property.
2724    pub declarations: NodeList<'gc>,
2725}
2726impl<'gc> VariableDeclaration<'gc> {
2727    /// Build `VariableDeclaration` from its metadata and `ESTree.def` fields.
2728    pub fn new(
2729        metadata: NodeMetadata<'gc>,
2730        kind: NodeLabel,
2731        declarations: NodeList<'gc>,
2732    ) -> Self {
2733        VariableDeclaration {
2734            metadata,
2735            kind: Cell::new(kind),
2736            declarations,
2737        }
2738    }
2739}
2740
2741/// The `TemplateLiteral` AST node.
2742#[derive(Debug)]
2743#[repr(C)]
2744pub struct TemplateLiteral<'gc> {
2745    /// Source range, debug location, paren count, and node id.
2746    pub metadata: NodeMetadata<'gc>,
2747    /// ESTree `quasis` property.
2748    pub quasis: NodeList<'gc>,
2749    /// ESTree `expressions` property.
2750    pub expressions: NodeList<'gc>,
2751}
2752impl<'gc> TemplateLiteral<'gc> {
2753    /// Build `TemplateLiteral` from its metadata and `ESTree.def` fields.
2754    pub fn new(
2755        metadata: NodeMetadata<'gc>,
2756        quasis: NodeList<'gc>,
2757        expressions: NodeList<'gc>,
2758    ) -> Self {
2759        TemplateLiteral {
2760            metadata,
2761            quasis,
2762            expressions,
2763        }
2764    }
2765}
2766
2767/// The `TaggedTemplateExpression` AST node.
2768#[derive(Debug)]
2769#[repr(C)]
2770pub struct TaggedTemplateExpression<'gc> {
2771    /// Source range, debug location, paren count, and node id.
2772    pub metadata: NodeMetadata<'gc>,
2773    /// ESTree `tag` property.
2774    pub tag: &'gc Node<'gc>,
2775    /// ESTree `quasi` property.
2776    pub quasi: &'gc Node<'gc>,
2777}
2778impl<'gc> TaggedTemplateExpression<'gc> {
2779    /// Build `TaggedTemplateExpression` from its metadata and `ESTree.def`
2780    /// fields.
2781    pub fn new(
2782        metadata: NodeMetadata<'gc>,
2783        tag: &'gc Node<'gc>,
2784        quasi: &'gc Node<'gc>,
2785    ) -> Self {
2786        TaggedTemplateExpression {
2787            metadata,
2788            tag,
2789            quasi,
2790        }
2791    }
2792}
2793
2794/// The `TemplateElement` AST node.
2795#[derive(Debug)]
2796#[repr(C)]
2797pub struct TemplateElement<'gc> {
2798    /// Source range, debug location, paren count, and node id.
2799    pub metadata: NodeMetadata<'gc>,
2800    /// ESTree `tail` property.
2801    pub tail: Cell<bool>,
2802    /// ESTree `cooked` property.
2803    pub cooked: Cell<NodeString>,
2804    /// ESTree `raw` property.
2805    pub raw: Cell<NodeLabel>,
2806}
2807impl<'gc> TemplateElement<'gc> {
2808    /// Build `TemplateElement` from its metadata and `ESTree.def` fields.
2809    pub fn new(
2810        metadata: NodeMetadata<'gc>,
2811        tail: bool,
2812        cooked: NodeString,
2813        raw: NodeLabel,
2814    ) -> Self {
2815        TemplateElement {
2816            metadata,
2817            tail: Cell::new(tail),
2818            cooked: Cell::new(cooked),
2819            raw: Cell::new(raw),
2820        }
2821    }
2822}
2823
2824/// The `Property` AST node.
2825#[derive(Debug)]
2826#[repr(C)]
2827pub struct Property<'gc> {
2828    /// Source range, debug location, paren count, and node id.
2829    pub metadata: NodeMetadata<'gc>,
2830    /// ESTree `key` property.
2831    pub key: &'gc Node<'gc>,
2832    /// ESTree `value` property.
2833    pub value: &'gc Node<'gc>,
2834    /// ESTree `kind` property.
2835    pub kind: Cell<NodeLabel>,
2836    /// ESTree `computed` property.
2837    pub computed: Cell<bool>,
2838    /// ESTree `method` property.
2839    pub method: Cell<bool>,
2840    /// ESTree `shorthand` property.
2841    pub shorthand: Cell<bool>,
2842}
2843impl<'gc> Property<'gc> {
2844    /// Build `Property` from its metadata and `ESTree.def` fields.
2845    pub fn new(
2846        metadata: NodeMetadata<'gc>,
2847        key: &'gc Node<'gc>,
2848        value: &'gc Node<'gc>,
2849        kind: NodeLabel,
2850        computed: bool,
2851        method: bool,
2852        shorthand: bool,
2853    ) -> Self {
2854        Property {
2855            metadata,
2856            key,
2857            value,
2858            kind: Cell::new(kind),
2859            computed: Cell::new(computed),
2860            method: Cell::new(method),
2861            shorthand: Cell::new(shorthand),
2862        }
2863    }
2864}
2865
2866/// The `Decorator` AST node.
2867#[derive(Debug)]
2868#[repr(C)]
2869pub struct Decorator<'gc> {
2870    /// Source range, debug location, paren count, and node id.
2871    pub metadata: NodeMetadata<'gc>,
2872    /// ESTree `expression` property.
2873    pub expression: &'gc Node<'gc>,
2874}
2875impl<'gc> Decorator<'gc> {
2876    /// Build `Decorator` from its metadata and `ESTree.def` fields.
2877    pub fn new(
2878        metadata: NodeMetadata<'gc>,
2879        expression: &'gc Node<'gc>,
2880    ) -> Self {
2881        Decorator {
2882            metadata,
2883            expression,
2884        }
2885    }
2886}
2887
2888/// The `ClassDeclaration` AST node.
2889#[derive(Debug)]
2890#[repr(C)]
2891pub struct ClassDeclaration<'gc> {
2892    /// Source range, debug location, paren count, and node id.
2893    pub metadata: NodeMetadata<'gc>,
2894    /// ESTree `id` property.
2895    pub id: Option<&'gc Node<'gc>>,
2896    /// ESTree `typeParameters` property.
2897    pub type_parameters: Option<&'gc Node<'gc>>,
2898    /// ESTree `superClass` property.
2899    pub super_class: Option<&'gc Node<'gc>>,
2900    /// ESTree `superTypeArguments` property.
2901    pub super_type_arguments: Option<&'gc Node<'gc>>,
2902    /// ESTree `implements` property.
2903    pub implements: NodeList<'gc>,
2904    /// ESTree `decorators` property.
2905    pub decorators: NodeList<'gc>,
2906    /// ESTree `body` property.
2907    pub body: &'gc Node<'gc>,
2908    /// Sema: the lexical scope created by this node, if any.
2909    pub scope: Cell<Option<SemaId>>,
2910    /// Sema: `FunctionInfo` of the synthetic implicit constructor, if the
2911    /// class has one.
2912    pub implicit_ctor_function_info: Cell<Option<SemaId>>,
2913    /// Sema: `FunctionInfo` of the synthetic function that initializes the
2914    /// instance elements, if the class needs one.
2915    pub instance_elements_init_function_info: Cell<Option<SemaId>>,
2916    /// Sema: `FunctionInfo` of the synthetic function that runs the static
2917    /// field initializers, if the class has any.
2918    pub static_elements_init_function_info: Cell<Option<SemaId>>,
2919}
2920impl<'gc> ClassDeclaration<'gc> {
2921    /// Build `ClassDeclaration` from its metadata and `ESTree.def` fields.
2922    /// Decoration fields start at their defaults.
2923    pub fn new(
2924        metadata: NodeMetadata<'gc>,
2925        id: Option<&'gc Node<'gc>>,
2926        type_parameters: Option<&'gc Node<'gc>>,
2927        super_class: Option<&'gc Node<'gc>>,
2928        super_type_arguments: Option<&'gc Node<'gc>>,
2929        implements: NodeList<'gc>,
2930        decorators: NodeList<'gc>,
2931        body: &'gc Node<'gc>,
2932    ) -> Self {
2933        ClassDeclaration {
2934            metadata,
2935            id,
2936            type_parameters,
2937            super_class,
2938            super_type_arguments,
2939            implements,
2940            decorators,
2941            body,
2942            scope: Cell::new(None),
2943            implicit_ctor_function_info: Cell::new(None),
2944            instance_elements_init_function_info: Cell::new(None),
2945            static_elements_init_function_info: Cell::new(None),
2946        }
2947    }
2948}
2949
2950/// The `ClassExpression` AST node.
2951#[derive(Debug)]
2952#[repr(C)]
2953pub struct ClassExpression<'gc> {
2954    /// Source range, debug location, paren count, and node id.
2955    pub metadata: NodeMetadata<'gc>,
2956    /// ESTree `id` property.
2957    pub id: Option<&'gc Node<'gc>>,
2958    /// ESTree `typeParameters` property.
2959    pub type_parameters: Option<&'gc Node<'gc>>,
2960    /// ESTree `superClass` property.
2961    pub super_class: Option<&'gc Node<'gc>>,
2962    /// ESTree `superTypeArguments` property.
2963    pub super_type_arguments: Option<&'gc Node<'gc>>,
2964    /// ESTree `implements` property.
2965    pub implements: NodeList<'gc>,
2966    /// ESTree `decorators` property.
2967    pub decorators: NodeList<'gc>,
2968    /// ESTree `body` property.
2969    pub body: &'gc Node<'gc>,
2970    /// Sema: the lexical scope created by this node, if any.
2971    pub scope: Cell<Option<SemaId>>,
2972    /// Sema: `FunctionInfo` of the synthetic implicit constructor, if the
2973    /// class has one.
2974    pub implicit_ctor_function_info: Cell<Option<SemaId>>,
2975    /// Sema: `FunctionInfo` of the synthetic function that initializes the
2976    /// instance elements, if the class needs one.
2977    pub instance_elements_init_function_info: Cell<Option<SemaId>>,
2978    /// Sema: `FunctionInfo` of the synthetic function that runs the static
2979    /// field initializers, if the class has any.
2980    pub static_elements_init_function_info: Cell<Option<SemaId>>,
2981}
2982impl<'gc> ClassExpression<'gc> {
2983    /// Build `ClassExpression` from its metadata and `ESTree.def` fields.
2984    /// Decoration fields start at their defaults.
2985    pub fn new(
2986        metadata: NodeMetadata<'gc>,
2987        id: Option<&'gc Node<'gc>>,
2988        type_parameters: Option<&'gc Node<'gc>>,
2989        super_class: Option<&'gc Node<'gc>>,
2990        super_type_arguments: Option<&'gc Node<'gc>>,
2991        implements: NodeList<'gc>,
2992        decorators: NodeList<'gc>,
2993        body: &'gc Node<'gc>,
2994    ) -> Self {
2995        ClassExpression {
2996            metadata,
2997            id,
2998            type_parameters,
2999            super_class,
3000            super_type_arguments,
3001            implements,
3002            decorators,
3003            body,
3004            scope: Cell::new(None),
3005            implicit_ctor_function_info: Cell::new(None),
3006            instance_elements_init_function_info: Cell::new(None),
3007            static_elements_init_function_info: Cell::new(None),
3008        }
3009    }
3010}
3011
3012/// The `ClassBody` AST node.
3013#[derive(Debug)]
3014#[repr(C)]
3015pub struct ClassBody<'gc> {
3016    /// Source range, debug location, paren count, and node id.
3017    pub metadata: NodeMetadata<'gc>,
3018    /// ESTree `body` property.
3019    pub body: NodeList<'gc>,
3020}
3021impl<'gc> ClassBody<'gc> {
3022    /// Build `ClassBody` from its metadata and `ESTree.def` fields.
3023    pub fn new(
3024        metadata: NodeMetadata<'gc>,
3025        body: NodeList<'gc>,
3026    ) -> Self {
3027        ClassBody {
3028            metadata,
3029            body,
3030        }
3031    }
3032}
3033
3034/// The `ClassProperty` AST node.
3035#[derive(Debug)]
3036#[repr(C)]
3037pub struct ClassProperty<'gc> {
3038    /// Source range, debug location, paren count, and node id.
3039    pub metadata: NodeMetadata<'gc>,
3040    /// ESTree `key` property.
3041    pub key: &'gc Node<'gc>,
3042    /// ESTree `value` property.
3043    pub value: Option<&'gc Node<'gc>>,
3044    /// ESTree `computed` property.
3045    pub computed: Cell<bool>,
3046    /// ESTree `static` property.
3047    pub r#static: Cell<bool>,
3048    /// ESTree `decorators` property.
3049    pub decorators: NodeList<'gc>,
3050    /// ESTree `declare` property.
3051    pub declare: Cell<bool>,
3052    /// ESTree `optional` property.
3053    pub optional: Cell<bool>,
3054    /// ESTree `variance` property.
3055    pub variance: Option<&'gc Node<'gc>>,
3056    /// ESTree `typeAnnotation` property.
3057    pub type_annotation: Option<&'gc Node<'gc>>,
3058    /// ESTree `tsModifiers` property.
3059    pub ts_modifiers: Option<&'gc Node<'gc>>,
3060}
3061impl<'gc> ClassProperty<'gc> {
3062    /// Build `ClassProperty` from its metadata and `ESTree.def` fields.
3063    pub fn new(
3064        metadata: NodeMetadata<'gc>,
3065        key: &'gc Node<'gc>,
3066        value: Option<&'gc Node<'gc>>,
3067        computed: bool,
3068        r#static: bool,
3069        decorators: NodeList<'gc>,
3070        declare: bool,
3071        optional: bool,
3072        variance: Option<&'gc Node<'gc>>,
3073        type_annotation: Option<&'gc Node<'gc>>,
3074        ts_modifiers: Option<&'gc Node<'gc>>,
3075    ) -> Self {
3076        ClassProperty {
3077            metadata,
3078            key,
3079            value,
3080            computed: Cell::new(computed),
3081            r#static: Cell::new(r#static),
3082            decorators,
3083            declare: Cell::new(declare),
3084            optional: Cell::new(optional),
3085            variance,
3086            type_annotation,
3087            ts_modifiers,
3088        }
3089    }
3090}
3091
3092/// The `ClassPrivateProperty` AST node.
3093#[derive(Debug)]
3094#[repr(C)]
3095pub struct ClassPrivateProperty<'gc> {
3096    /// Source range, debug location, paren count, and node id.
3097    pub metadata: NodeMetadata<'gc>,
3098    /// ESTree `key` property.
3099    pub key: &'gc Node<'gc>,
3100    /// ESTree `value` property.
3101    pub value: Option<&'gc Node<'gc>>,
3102    /// ESTree `static` property.
3103    pub r#static: Cell<bool>,
3104    /// ESTree `decorators` property.
3105    pub decorators: NodeList<'gc>,
3106    /// ESTree `declare` property.
3107    pub declare: Cell<bool>,
3108    /// ESTree `optional` property.
3109    pub optional: Cell<bool>,
3110    /// ESTree `variance` property.
3111    pub variance: Option<&'gc Node<'gc>>,
3112    /// ESTree `typeAnnotation` property.
3113    pub type_annotation: Option<&'gc Node<'gc>>,
3114    /// ESTree `tsModifiers` property.
3115    pub ts_modifiers: Option<&'gc Node<'gc>>,
3116}
3117impl<'gc> ClassPrivateProperty<'gc> {
3118    /// Build `ClassPrivateProperty` from its metadata and `ESTree.def` fields.
3119    pub fn new(
3120        metadata: NodeMetadata<'gc>,
3121        key: &'gc Node<'gc>,
3122        value: Option<&'gc Node<'gc>>,
3123        r#static: bool,
3124        decorators: NodeList<'gc>,
3125        declare: bool,
3126        optional: bool,
3127        variance: Option<&'gc Node<'gc>>,
3128        type_annotation: Option<&'gc Node<'gc>>,
3129        ts_modifiers: Option<&'gc Node<'gc>>,
3130    ) -> Self {
3131        ClassPrivateProperty {
3132            metadata,
3133            key,
3134            value,
3135            r#static: Cell::new(r#static),
3136            decorators,
3137            declare: Cell::new(declare),
3138            optional: Cell::new(optional),
3139            variance,
3140            type_annotation,
3141            ts_modifiers,
3142        }
3143    }
3144}
3145
3146/// The `MethodDefinition` AST node.
3147#[derive(Debug)]
3148#[repr(C)]
3149pub struct MethodDefinition<'gc> {
3150    /// Source range, debug location, paren count, and node id.
3151    pub metadata: NodeMetadata<'gc>,
3152    /// ESTree `key` property.
3153    pub key: &'gc Node<'gc>,
3154    /// ESTree `value` property.
3155    pub value: &'gc Node<'gc>,
3156    /// ESTree `kind` property.
3157    pub kind: Cell<NodeLabel>,
3158    /// ESTree `computed` property.
3159    pub computed: Cell<bool>,
3160    /// ESTree `static` property.
3161    pub r#static: Cell<bool>,
3162    /// ESTree `decorators` property.
3163    pub decorators: NodeList<'gc>,
3164}
3165impl<'gc> MethodDefinition<'gc> {
3166    /// Build `MethodDefinition` from its metadata and `ESTree.def` fields.
3167    pub fn new(
3168        metadata: NodeMetadata<'gc>,
3169        key: &'gc Node<'gc>,
3170        value: &'gc Node<'gc>,
3171        kind: NodeLabel,
3172        computed: bool,
3173        r#static: bool,
3174        decorators: NodeList<'gc>,
3175    ) -> Self {
3176        MethodDefinition {
3177            metadata,
3178            key,
3179            value,
3180            kind: Cell::new(kind),
3181            computed: Cell::new(computed),
3182            r#static: Cell::new(r#static),
3183            decorators,
3184        }
3185    }
3186}
3187
3188/// The `ImportDeclaration` AST node.
3189#[derive(Debug)]
3190#[repr(C)]
3191pub struct ImportDeclaration<'gc> {
3192    /// Source range, debug location, paren count, and node id.
3193    pub metadata: NodeMetadata<'gc>,
3194    /// ESTree `specifiers` property.
3195    pub specifiers: NodeList<'gc>,
3196    /// ESTree `source` property.
3197    pub source: &'gc Node<'gc>,
3198    /// ESTree `attributes` property.
3199    pub attributes: NodeList<'gc>,
3200    /// ESTree `importKind` property.
3201    pub import_kind: Cell<NodeLabel>,
3202}
3203impl<'gc> ImportDeclaration<'gc> {
3204    /// Build `ImportDeclaration` from its metadata and `ESTree.def` fields.
3205    pub fn new(
3206        metadata: NodeMetadata<'gc>,
3207        specifiers: NodeList<'gc>,
3208        source: &'gc Node<'gc>,
3209        attributes: NodeList<'gc>,
3210        import_kind: NodeLabel,
3211    ) -> Self {
3212        ImportDeclaration {
3213            metadata,
3214            specifiers,
3215            source,
3216            attributes,
3217            import_kind: Cell::new(import_kind),
3218        }
3219    }
3220}
3221
3222/// The `ImportSpecifier` AST node.
3223#[derive(Debug)]
3224#[repr(C)]
3225pub struct ImportSpecifier<'gc> {
3226    /// Source range, debug location, paren count, and node id.
3227    pub metadata: NodeMetadata<'gc>,
3228    /// ESTree `imported` property.
3229    pub imported: &'gc Node<'gc>,
3230    /// ESTree `local` property.
3231    pub local: &'gc Node<'gc>,
3232    /// ESTree `importKind` property.
3233    pub import_kind: Cell<NodeLabel>,
3234}
3235impl<'gc> ImportSpecifier<'gc> {
3236    /// Build `ImportSpecifier` from its metadata and `ESTree.def` fields.
3237    pub fn new(
3238        metadata: NodeMetadata<'gc>,
3239        imported: &'gc Node<'gc>,
3240        local: &'gc Node<'gc>,
3241        import_kind: NodeLabel,
3242    ) -> Self {
3243        ImportSpecifier {
3244            metadata,
3245            imported,
3246            local,
3247            import_kind: Cell::new(import_kind),
3248        }
3249    }
3250}
3251
3252/// The `ImportDefaultSpecifier` AST node.
3253#[derive(Debug)]
3254#[repr(C)]
3255pub struct ImportDefaultSpecifier<'gc> {
3256    /// Source range, debug location, paren count, and node id.
3257    pub metadata: NodeMetadata<'gc>,
3258    /// ESTree `local` property.
3259    pub local: &'gc Node<'gc>,
3260}
3261impl<'gc> ImportDefaultSpecifier<'gc> {
3262    /// Build `ImportDefaultSpecifier` from its metadata and `ESTree.def`
3263    /// fields.
3264    pub fn new(
3265        metadata: NodeMetadata<'gc>,
3266        local: &'gc Node<'gc>,
3267    ) -> Self {
3268        ImportDefaultSpecifier {
3269            metadata,
3270            local,
3271        }
3272    }
3273}
3274
3275/// The `ImportNamespaceSpecifier` AST node.
3276#[derive(Debug)]
3277#[repr(C)]
3278pub struct ImportNamespaceSpecifier<'gc> {
3279    /// Source range, debug location, paren count, and node id.
3280    pub metadata: NodeMetadata<'gc>,
3281    /// ESTree `local` property.
3282    pub local: &'gc Node<'gc>,
3283}
3284impl<'gc> ImportNamespaceSpecifier<'gc> {
3285    /// Build `ImportNamespaceSpecifier` from its metadata and `ESTree.def`
3286    /// fields.
3287    pub fn new(
3288        metadata: NodeMetadata<'gc>,
3289        local: &'gc Node<'gc>,
3290    ) -> Self {
3291        ImportNamespaceSpecifier {
3292            metadata,
3293            local,
3294        }
3295    }
3296}
3297
3298/// The `ImportAttribute` AST node.
3299#[derive(Debug)]
3300#[repr(C)]
3301pub struct ImportAttribute<'gc> {
3302    /// Source range, debug location, paren count, and node id.
3303    pub metadata: NodeMetadata<'gc>,
3304    /// ESTree `key` property.
3305    pub key: &'gc Node<'gc>,
3306    /// ESTree `value` property.
3307    pub value: &'gc Node<'gc>,
3308}
3309impl<'gc> ImportAttribute<'gc> {
3310    /// Build `ImportAttribute` from its metadata and `ESTree.def` fields.
3311    pub fn new(
3312        metadata: NodeMetadata<'gc>,
3313        key: &'gc Node<'gc>,
3314        value: &'gc Node<'gc>,
3315    ) -> Self {
3316        ImportAttribute {
3317            metadata,
3318            key,
3319            value,
3320        }
3321    }
3322}
3323
3324/// The `ExportNamedDeclaration` AST node.
3325#[derive(Debug)]
3326#[repr(C)]
3327pub struct ExportNamedDeclaration<'gc> {
3328    /// Source range, debug location, paren count, and node id.
3329    pub metadata: NodeMetadata<'gc>,
3330    /// ESTree `declaration` property.
3331    pub declaration: Option<&'gc Node<'gc>>,
3332    /// ESTree `specifiers` property.
3333    pub specifiers: NodeList<'gc>,
3334    /// ESTree `source` property.
3335    pub source: Option<&'gc Node<'gc>>,
3336    /// ESTree `exportKind` property.
3337    pub export_kind: Cell<NodeLabel>,
3338}
3339impl<'gc> ExportNamedDeclaration<'gc> {
3340    /// Build `ExportNamedDeclaration` from its metadata and `ESTree.def`
3341    /// fields.
3342    pub fn new(
3343        metadata: NodeMetadata<'gc>,
3344        declaration: Option<&'gc Node<'gc>>,
3345        specifiers: NodeList<'gc>,
3346        source: Option<&'gc Node<'gc>>,
3347        export_kind: NodeLabel,
3348    ) -> Self {
3349        ExportNamedDeclaration {
3350            metadata,
3351            declaration,
3352            specifiers,
3353            source,
3354            export_kind: Cell::new(export_kind),
3355        }
3356    }
3357}
3358
3359/// The `ExportSpecifier` AST node.
3360#[derive(Debug)]
3361#[repr(C)]
3362pub struct ExportSpecifier<'gc> {
3363    /// Source range, debug location, paren count, and node id.
3364    pub metadata: NodeMetadata<'gc>,
3365    /// ESTree `exported` property.
3366    pub exported: &'gc Node<'gc>,
3367    /// ESTree `local` property.
3368    pub local: &'gc Node<'gc>,
3369}
3370impl<'gc> ExportSpecifier<'gc> {
3371    /// Build `ExportSpecifier` from its metadata and `ESTree.def` fields.
3372    pub fn new(
3373        metadata: NodeMetadata<'gc>,
3374        exported: &'gc Node<'gc>,
3375        local: &'gc Node<'gc>,
3376    ) -> Self {
3377        ExportSpecifier {
3378            metadata,
3379            exported,
3380            local,
3381        }
3382    }
3383}
3384
3385/// The `ExportNamespaceSpecifier` AST node.
3386#[derive(Debug)]
3387#[repr(C)]
3388pub struct ExportNamespaceSpecifier<'gc> {
3389    /// Source range, debug location, paren count, and node id.
3390    pub metadata: NodeMetadata<'gc>,
3391    /// ESTree `exported` property.
3392    pub exported: &'gc Node<'gc>,
3393}
3394impl<'gc> ExportNamespaceSpecifier<'gc> {
3395    /// Build `ExportNamespaceSpecifier` from its metadata and `ESTree.def`
3396    /// fields.
3397    pub fn new(
3398        metadata: NodeMetadata<'gc>,
3399        exported: &'gc Node<'gc>,
3400    ) -> Self {
3401        ExportNamespaceSpecifier {
3402            metadata,
3403            exported,
3404        }
3405    }
3406}
3407
3408/// The `ExportDefaultDeclaration` AST node.
3409#[derive(Debug)]
3410#[repr(C)]
3411pub struct ExportDefaultDeclaration<'gc> {
3412    /// Source range, debug location, paren count, and node id.
3413    pub metadata: NodeMetadata<'gc>,
3414    /// ESTree `declaration` property.
3415    pub declaration: &'gc Node<'gc>,
3416}
3417impl<'gc> ExportDefaultDeclaration<'gc> {
3418    /// Build `ExportDefaultDeclaration` from its metadata and `ESTree.def`
3419    /// fields.
3420    pub fn new(
3421        metadata: NodeMetadata<'gc>,
3422        declaration: &'gc Node<'gc>,
3423    ) -> Self {
3424        ExportDefaultDeclaration {
3425            metadata,
3426            declaration,
3427        }
3428    }
3429}
3430
3431/// The `ExportAllDeclaration` AST node.
3432#[derive(Debug)]
3433#[repr(C)]
3434pub struct ExportAllDeclaration<'gc> {
3435    /// Source range, debug location, paren count, and node id.
3436    pub metadata: NodeMetadata<'gc>,
3437    /// ESTree `source` property.
3438    pub source: &'gc Node<'gc>,
3439    /// ESTree `exportKind` property.
3440    pub export_kind: Cell<NodeLabel>,
3441}
3442impl<'gc> ExportAllDeclaration<'gc> {
3443    /// Build `ExportAllDeclaration` from its metadata and `ESTree.def` fields.
3444    pub fn new(
3445        metadata: NodeMetadata<'gc>,
3446        source: &'gc Node<'gc>,
3447        export_kind: NodeLabel,
3448    ) -> Self {
3449        ExportAllDeclaration {
3450            metadata,
3451            source,
3452            export_kind: Cell::new(export_kind),
3453        }
3454    }
3455}
3456
3457/// The `ObjectPattern` AST node.
3458#[derive(Debug)]
3459#[repr(C)]
3460pub struct ObjectPattern<'gc> {
3461    /// Source range, debug location, paren count, and node id.
3462    pub metadata: NodeMetadata<'gc>,
3463    /// ESTree `properties` property.
3464    pub properties: NodeList<'gc>,
3465    /// ESTree `typeAnnotation` property.
3466    pub type_annotation: Option<&'gc Node<'gc>>,
3467}
3468impl<'gc> ObjectPattern<'gc> {
3469    /// Build `ObjectPattern` from its metadata and `ESTree.def` fields.
3470    pub fn new(
3471        metadata: NodeMetadata<'gc>,
3472        properties: NodeList<'gc>,
3473        type_annotation: Option<&'gc Node<'gc>>,
3474    ) -> Self {
3475        ObjectPattern {
3476            metadata,
3477            properties,
3478            type_annotation,
3479        }
3480    }
3481}
3482
3483/// The `ArrayPattern` AST node.
3484#[derive(Debug)]
3485#[repr(C)]
3486pub struct ArrayPattern<'gc> {
3487    /// Source range, debug location, paren count, and node id.
3488    pub metadata: NodeMetadata<'gc>,
3489    /// ESTree `elements` property.
3490    pub elements: NodeList<'gc>,
3491    /// ESTree `typeAnnotation` property.
3492    pub type_annotation: Option<&'gc Node<'gc>>,
3493}
3494impl<'gc> ArrayPattern<'gc> {
3495    /// Build `ArrayPattern` from its metadata and `ESTree.def` fields.
3496    pub fn new(
3497        metadata: NodeMetadata<'gc>,
3498        elements: NodeList<'gc>,
3499        type_annotation: Option<&'gc Node<'gc>>,
3500    ) -> Self {
3501        ArrayPattern {
3502            metadata,
3503            elements,
3504            type_annotation,
3505        }
3506    }
3507}
3508
3509/// The `RestElement` AST node.
3510#[derive(Debug)]
3511#[repr(C)]
3512pub struct RestElement<'gc> {
3513    /// Source range, debug location, paren count, and node id.
3514    pub metadata: NodeMetadata<'gc>,
3515    /// ESTree `argument` property.
3516    pub argument: &'gc Node<'gc>,
3517}
3518impl<'gc> RestElement<'gc> {
3519    /// Build `RestElement` from its metadata and `ESTree.def` fields.
3520    pub fn new(
3521        metadata: NodeMetadata<'gc>,
3522        argument: &'gc Node<'gc>,
3523    ) -> Self {
3524        RestElement {
3525            metadata,
3526            argument,
3527        }
3528    }
3529}
3530
3531/// The `AssignmentPattern` AST node.
3532#[derive(Debug)]
3533#[repr(C)]
3534pub struct AssignmentPattern<'gc> {
3535    /// Source range, debug location, paren count, and node id.
3536    pub metadata: NodeMetadata<'gc>,
3537    /// ESTree `left` property.
3538    pub left: &'gc Node<'gc>,
3539    /// ESTree `right` property.
3540    pub right: &'gc Node<'gc>,
3541}
3542impl<'gc> AssignmentPattern<'gc> {
3543    /// Build `AssignmentPattern` from its metadata and `ESTree.def` fields.
3544    pub fn new(
3545        metadata: NodeMetadata<'gc>,
3546        left: &'gc Node<'gc>,
3547        right: &'gc Node<'gc>,
3548    ) -> Self {
3549        AssignmentPattern {
3550            metadata,
3551            left,
3552            right,
3553        }
3554    }
3555}
3556
3557/// The `MatchStatementCase` AST node.
3558#[derive(Debug)]
3559#[repr(C)]
3560pub struct MatchStatementCase<'gc> {
3561    /// Source range, debug location, paren count, and node id.
3562    pub metadata: NodeMetadata<'gc>,
3563    /// ESTree `pattern` property.
3564    pub pattern: &'gc Node<'gc>,
3565    /// ESTree `body` property.
3566    pub body: &'gc Node<'gc>,
3567    /// ESTree `guard` property.
3568    pub guard: Option<&'gc Node<'gc>>,
3569}
3570impl<'gc> MatchStatementCase<'gc> {
3571    /// Build `MatchStatementCase` from its metadata and `ESTree.def` fields.
3572    pub fn new(
3573        metadata: NodeMetadata<'gc>,
3574        pattern: &'gc Node<'gc>,
3575        body: &'gc Node<'gc>,
3576        guard: Option<&'gc Node<'gc>>,
3577    ) -> Self {
3578        MatchStatementCase {
3579            metadata,
3580            pattern,
3581            body,
3582            guard,
3583        }
3584    }
3585}
3586
3587/// The `MatchExpression` AST node.
3588#[derive(Debug)]
3589#[repr(C)]
3590pub struct MatchExpression<'gc> {
3591    /// Source range, debug location, paren count, and node id.
3592    pub metadata: NodeMetadata<'gc>,
3593    /// ESTree `argument` property.
3594    pub argument: &'gc Node<'gc>,
3595    /// ESTree `cases` property.
3596    pub cases: NodeList<'gc>,
3597}
3598impl<'gc> MatchExpression<'gc> {
3599    /// Build `MatchExpression` from its metadata and `ESTree.def` fields.
3600    pub fn new(
3601        metadata: NodeMetadata<'gc>,
3602        argument: &'gc Node<'gc>,
3603        cases: NodeList<'gc>,
3604    ) -> Self {
3605        MatchExpression {
3606            metadata,
3607            argument,
3608            cases,
3609        }
3610    }
3611}
3612
3613/// The `MatchExpressionCase` AST node.
3614#[derive(Debug)]
3615#[repr(C)]
3616pub struct MatchExpressionCase<'gc> {
3617    /// Source range, debug location, paren count, and node id.
3618    pub metadata: NodeMetadata<'gc>,
3619    /// ESTree `pattern` property.
3620    pub pattern: &'gc Node<'gc>,
3621    /// ESTree `body` property.
3622    pub body: &'gc Node<'gc>,
3623    /// ESTree `guard` property.
3624    pub guard: Option<&'gc Node<'gc>>,
3625}
3626impl<'gc> MatchExpressionCase<'gc> {
3627    /// Build `MatchExpressionCase` from its metadata and `ESTree.def` fields.
3628    pub fn new(
3629        metadata: NodeMetadata<'gc>,
3630        pattern: &'gc Node<'gc>,
3631        body: &'gc Node<'gc>,
3632        guard: Option<&'gc Node<'gc>>,
3633    ) -> Self {
3634        MatchExpressionCase {
3635            metadata,
3636            pattern,
3637            body,
3638            guard,
3639        }
3640    }
3641}
3642
3643/// The `MatchWildcardPattern` AST node.
3644#[derive(Debug)]
3645#[repr(C)]
3646pub struct MatchWildcardPattern<'gc> {
3647    /// Source range, debug location, paren count, and node id.
3648    pub metadata: NodeMetadata<'gc>,
3649}
3650impl<'gc> MatchWildcardPattern<'gc> {
3651    /// Build `MatchWildcardPattern` from its metadata and `ESTree.def` fields.
3652    pub fn new(
3653        metadata: NodeMetadata<'gc>,
3654    ) -> Self {
3655        MatchWildcardPattern {
3656            metadata,
3657        }
3658    }
3659}
3660
3661/// The `MatchLiteralPattern` AST node.
3662#[derive(Debug)]
3663#[repr(C)]
3664pub struct MatchLiteralPattern<'gc> {
3665    /// Source range, debug location, paren count, and node id.
3666    pub metadata: NodeMetadata<'gc>,
3667    /// ESTree `literal` property.
3668    pub literal: &'gc Node<'gc>,
3669}
3670impl<'gc> MatchLiteralPattern<'gc> {
3671    /// Build `MatchLiteralPattern` from its metadata and `ESTree.def` fields.
3672    pub fn new(
3673        metadata: NodeMetadata<'gc>,
3674        literal: &'gc Node<'gc>,
3675    ) -> Self {
3676        MatchLiteralPattern {
3677            metadata,
3678            literal,
3679        }
3680    }
3681}
3682
3683/// The `MatchUnaryPattern` AST node.
3684#[derive(Debug)]
3685#[repr(C)]
3686pub struct MatchUnaryPattern<'gc> {
3687    /// Source range, debug location, paren count, and node id.
3688    pub metadata: NodeMetadata<'gc>,
3689    /// ESTree `argument` property.
3690    pub argument: &'gc Node<'gc>,
3691    /// ESTree `operator` property.
3692    pub operator: Cell<NodeLabel>,
3693}
3694impl<'gc> MatchUnaryPattern<'gc> {
3695    /// Build `MatchUnaryPattern` from its metadata and `ESTree.def` fields.
3696    pub fn new(
3697        metadata: NodeMetadata<'gc>,
3698        argument: &'gc Node<'gc>,
3699        operator: NodeLabel,
3700    ) -> Self {
3701        MatchUnaryPattern {
3702            metadata,
3703            argument,
3704            operator: Cell::new(operator),
3705        }
3706    }
3707}
3708
3709/// The `MatchIdentifierPattern` AST node.
3710#[derive(Debug)]
3711#[repr(C)]
3712pub struct MatchIdentifierPattern<'gc> {
3713    /// Source range, debug location, paren count, and node id.
3714    pub metadata: NodeMetadata<'gc>,
3715    /// ESTree `id` property.
3716    pub id: &'gc Node<'gc>,
3717}
3718impl<'gc> MatchIdentifierPattern<'gc> {
3719    /// Build `MatchIdentifierPattern` from its metadata and `ESTree.def`
3720    /// fields.
3721    pub fn new(
3722        metadata: NodeMetadata<'gc>,
3723        id: &'gc Node<'gc>,
3724    ) -> Self {
3725        MatchIdentifierPattern {
3726            metadata,
3727            id,
3728        }
3729    }
3730}
3731
3732/// The `MatchBindingPattern` AST node.
3733#[derive(Debug)]
3734#[repr(C)]
3735pub struct MatchBindingPattern<'gc> {
3736    /// Source range, debug location, paren count, and node id.
3737    pub metadata: NodeMetadata<'gc>,
3738    /// ESTree `id` property.
3739    pub id: &'gc Node<'gc>,
3740    /// ESTree `kind` property.
3741    pub kind: Cell<NodeLabel>,
3742}
3743impl<'gc> MatchBindingPattern<'gc> {
3744    /// Build `MatchBindingPattern` from its metadata and `ESTree.def` fields.
3745    pub fn new(
3746        metadata: NodeMetadata<'gc>,
3747        id: &'gc Node<'gc>,
3748        kind: NodeLabel,
3749    ) -> Self {
3750        MatchBindingPattern {
3751            metadata,
3752            id,
3753            kind: Cell::new(kind),
3754        }
3755    }
3756}
3757
3758/// The `MatchObjectPattern` AST node.
3759#[derive(Debug)]
3760#[repr(C)]
3761pub struct MatchObjectPattern<'gc> {
3762    /// Source range, debug location, paren count, and node id.
3763    pub metadata: NodeMetadata<'gc>,
3764    /// ESTree `properties` property.
3765    pub properties: NodeList<'gc>,
3766    /// ESTree `rest` property.
3767    pub rest: Option<&'gc Node<'gc>>,
3768}
3769impl<'gc> MatchObjectPattern<'gc> {
3770    /// Build `MatchObjectPattern` from its metadata and `ESTree.def` fields.
3771    pub fn new(
3772        metadata: NodeMetadata<'gc>,
3773        properties: NodeList<'gc>,
3774        rest: Option<&'gc Node<'gc>>,
3775    ) -> Self {
3776        MatchObjectPattern {
3777            metadata,
3778            properties,
3779            rest,
3780        }
3781    }
3782}
3783
3784/// The `MatchArrayPattern` AST node.
3785#[derive(Debug)]
3786#[repr(C)]
3787pub struct MatchArrayPattern<'gc> {
3788    /// Source range, debug location, paren count, and node id.
3789    pub metadata: NodeMetadata<'gc>,
3790    /// ESTree `elements` property.
3791    pub elements: NodeList<'gc>,
3792    /// ESTree `rest` property.
3793    pub rest: Option<&'gc Node<'gc>>,
3794}
3795impl<'gc> MatchArrayPattern<'gc> {
3796    /// Build `MatchArrayPattern` from its metadata and `ESTree.def` fields.
3797    pub fn new(
3798        metadata: NodeMetadata<'gc>,
3799        elements: NodeList<'gc>,
3800        rest: Option<&'gc Node<'gc>>,
3801    ) -> Self {
3802        MatchArrayPattern {
3803            metadata,
3804            elements,
3805            rest,
3806        }
3807    }
3808}
3809
3810/// The `MatchOrPattern` AST node.
3811#[derive(Debug)]
3812#[repr(C)]
3813pub struct MatchOrPattern<'gc> {
3814    /// Source range, debug location, paren count, and node id.
3815    pub metadata: NodeMetadata<'gc>,
3816    /// ESTree `patterns` property.
3817    pub patterns: NodeList<'gc>,
3818}
3819impl<'gc> MatchOrPattern<'gc> {
3820    /// Build `MatchOrPattern` from its metadata and `ESTree.def` fields.
3821    pub fn new(
3822        metadata: NodeMetadata<'gc>,
3823        patterns: NodeList<'gc>,
3824    ) -> Self {
3825        MatchOrPattern {
3826            metadata,
3827            patterns,
3828        }
3829    }
3830}
3831
3832/// The `MatchAsPattern` AST node.
3833#[derive(Debug)]
3834#[repr(C)]
3835pub struct MatchAsPattern<'gc> {
3836    /// Source range, debug location, paren count, and node id.
3837    pub metadata: NodeMetadata<'gc>,
3838    /// ESTree `pattern` property.
3839    pub pattern: &'gc Node<'gc>,
3840    /// ESTree `target` property.
3841    pub target: &'gc Node<'gc>,
3842}
3843impl<'gc> MatchAsPattern<'gc> {
3844    /// Build `MatchAsPattern` from its metadata and `ESTree.def` fields.
3845    pub fn new(
3846        metadata: NodeMetadata<'gc>,
3847        pattern: &'gc Node<'gc>,
3848        target: &'gc Node<'gc>,
3849    ) -> Self {
3850        MatchAsPattern {
3851            metadata,
3852            pattern,
3853            target,
3854        }
3855    }
3856}
3857
3858/// The `MatchMemberPattern` AST node.
3859#[derive(Debug)]
3860#[repr(C)]
3861pub struct MatchMemberPattern<'gc> {
3862    /// Source range, debug location, paren count, and node id.
3863    pub metadata: NodeMetadata<'gc>,
3864    /// ESTree `base` property.
3865    pub base: &'gc Node<'gc>,
3866    /// ESTree `property` property.
3867    pub property: &'gc Node<'gc>,
3868}
3869impl<'gc> MatchMemberPattern<'gc> {
3870    /// Build `MatchMemberPattern` from its metadata and `ESTree.def` fields.
3871    pub fn new(
3872        metadata: NodeMetadata<'gc>,
3873        base: &'gc Node<'gc>,
3874        property: &'gc Node<'gc>,
3875    ) -> Self {
3876        MatchMemberPattern {
3877            metadata,
3878            base,
3879            property,
3880        }
3881    }
3882}
3883
3884/// The `MatchInstancePattern` AST node.
3885#[derive(Debug)]
3886#[repr(C)]
3887pub struct MatchInstancePattern<'gc> {
3888    /// Source range, debug location, paren count, and node id.
3889    pub metadata: NodeMetadata<'gc>,
3890    /// ESTree `targetConstructor` property.
3891    pub target_constructor: &'gc Node<'gc>,
3892    /// ESTree `properties` property.
3893    pub properties: &'gc Node<'gc>,
3894}
3895impl<'gc> MatchInstancePattern<'gc> {
3896    /// Build `MatchInstancePattern` from its metadata and `ESTree.def` fields.
3897    pub fn new(
3898        metadata: NodeMetadata<'gc>,
3899        target_constructor: &'gc Node<'gc>,
3900        properties: &'gc Node<'gc>,
3901    ) -> Self {
3902        MatchInstancePattern {
3903            metadata,
3904            target_constructor,
3905            properties,
3906        }
3907    }
3908}
3909
3910/// The `MatchObjectPatternProperty` AST node.
3911#[derive(Debug)]
3912#[repr(C)]
3913pub struct MatchObjectPatternProperty<'gc> {
3914    /// Source range, debug location, paren count, and node id.
3915    pub metadata: NodeMetadata<'gc>,
3916    /// ESTree `key` property.
3917    pub key: &'gc Node<'gc>,
3918    /// ESTree `pattern` property.
3919    pub pattern: &'gc Node<'gc>,
3920    /// ESTree `shorthand` property.
3921    pub shorthand: Cell<bool>,
3922}
3923impl<'gc> MatchObjectPatternProperty<'gc> {
3924    /// Build `MatchObjectPatternProperty` from its metadata and `ESTree.def`
3925    /// fields.
3926    pub fn new(
3927        metadata: NodeMetadata<'gc>,
3928        key: &'gc Node<'gc>,
3929        pattern: &'gc Node<'gc>,
3930        shorthand: bool,
3931    ) -> Self {
3932        MatchObjectPatternProperty {
3933            metadata,
3934            key,
3935            pattern,
3936            shorthand: Cell::new(shorthand),
3937        }
3938    }
3939}
3940
3941/// The `MatchInstanceObjectPattern` AST node.
3942#[derive(Debug)]
3943#[repr(C)]
3944pub struct MatchInstanceObjectPattern<'gc> {
3945    /// Source range, debug location, paren count, and node id.
3946    pub metadata: NodeMetadata<'gc>,
3947    /// ESTree `properties` property.
3948    pub properties: NodeList<'gc>,
3949    /// ESTree `rest` property.
3950    pub rest: Option<&'gc Node<'gc>>,
3951}
3952impl<'gc> MatchInstanceObjectPattern<'gc> {
3953    /// Build `MatchInstanceObjectPattern` from its metadata and `ESTree.def`
3954    /// fields.
3955    pub fn new(
3956        metadata: NodeMetadata<'gc>,
3957        properties: NodeList<'gc>,
3958        rest: Option<&'gc Node<'gc>>,
3959    ) -> Self {
3960        MatchInstanceObjectPattern {
3961            metadata,
3962            properties,
3963            rest,
3964        }
3965    }
3966}
3967
3968/// The `MatchRestPattern` AST node.
3969#[derive(Debug)]
3970#[repr(C)]
3971pub struct MatchRestPattern<'gc> {
3972    /// Source range, debug location, paren count, and node id.
3973    pub metadata: NodeMetadata<'gc>,
3974    /// ESTree `argument` property.
3975    pub argument: Option<&'gc Node<'gc>>,
3976}
3977impl<'gc> MatchRestPattern<'gc> {
3978    /// Build `MatchRestPattern` from its metadata and `ESTree.def` fields.
3979    pub fn new(
3980        metadata: NodeMetadata<'gc>,
3981        argument: Option<&'gc Node<'gc>>,
3982    ) -> Self {
3983        MatchRestPattern {
3984            metadata,
3985            argument,
3986        }
3987    }
3988}
3989
3990/// The `JSXIdentifier` AST node.
3991#[derive(Debug)]
3992#[repr(C)]
3993pub struct JSXIdentifier<'gc> {
3994    /// Source range, debug location, paren count, and node id.
3995    pub metadata: NodeMetadata<'gc>,
3996    /// ESTree `name` property.
3997    pub name: Cell<NodeLabel>,
3998}
3999impl<'gc> JSXIdentifier<'gc> {
4000    /// Build `JSXIdentifier` from its metadata and `ESTree.def` fields.
4001    pub fn new(
4002        metadata: NodeMetadata<'gc>,
4003        name: NodeLabel,
4004    ) -> Self {
4005        JSXIdentifier {
4006            metadata,
4007            name: Cell::new(name),
4008        }
4009    }
4010}
4011
4012/// The `JSXMemberExpression` AST node.
4013#[derive(Debug)]
4014#[repr(C)]
4015pub struct JSXMemberExpression<'gc> {
4016    /// Source range, debug location, paren count, and node id.
4017    pub metadata: NodeMetadata<'gc>,
4018    /// ESTree `object` property.
4019    pub object: &'gc Node<'gc>,
4020    /// ESTree `property` property.
4021    pub property: &'gc Node<'gc>,
4022}
4023impl<'gc> JSXMemberExpression<'gc> {
4024    /// Build `JSXMemberExpression` from its metadata and `ESTree.def` fields.
4025    pub fn new(
4026        metadata: NodeMetadata<'gc>,
4027        object: &'gc Node<'gc>,
4028        property: &'gc Node<'gc>,
4029    ) -> Self {
4030        JSXMemberExpression {
4031            metadata,
4032            object,
4033            property,
4034        }
4035    }
4036}
4037
4038/// The `JSXNamespacedName` AST node.
4039#[derive(Debug)]
4040#[repr(C)]
4041pub struct JSXNamespacedName<'gc> {
4042    /// Source range, debug location, paren count, and node id.
4043    pub metadata: NodeMetadata<'gc>,
4044    /// ESTree `namespace` property.
4045    pub namespace: &'gc Node<'gc>,
4046    /// ESTree `name` property.
4047    pub name: &'gc Node<'gc>,
4048}
4049impl<'gc> JSXNamespacedName<'gc> {
4050    /// Build `JSXNamespacedName` from its metadata and `ESTree.def` fields.
4051    pub fn new(
4052        metadata: NodeMetadata<'gc>,
4053        namespace: &'gc Node<'gc>,
4054        name: &'gc Node<'gc>,
4055    ) -> Self {
4056        JSXNamespacedName {
4057            metadata,
4058            namespace,
4059            name,
4060        }
4061    }
4062}
4063
4064/// The `JSXEmptyExpression` AST node.
4065#[derive(Debug)]
4066#[repr(C)]
4067pub struct JSXEmptyExpression<'gc> {
4068    /// Source range, debug location, paren count, and node id.
4069    pub metadata: NodeMetadata<'gc>,
4070}
4071impl<'gc> JSXEmptyExpression<'gc> {
4072    /// Build `JSXEmptyExpression` from its metadata and `ESTree.def` fields.
4073    pub fn new(
4074        metadata: NodeMetadata<'gc>,
4075    ) -> Self {
4076        JSXEmptyExpression {
4077            metadata,
4078        }
4079    }
4080}
4081
4082/// The `JSXExpressionContainer` AST node.
4083#[derive(Debug)]
4084#[repr(C)]
4085pub struct JSXExpressionContainer<'gc> {
4086    /// Source range, debug location, paren count, and node id.
4087    pub metadata: NodeMetadata<'gc>,
4088    /// ESTree `expression` property.
4089    pub expression: &'gc Node<'gc>,
4090}
4091impl<'gc> JSXExpressionContainer<'gc> {
4092    /// Build `JSXExpressionContainer` from its metadata and `ESTree.def`
4093    /// fields.
4094    pub fn new(
4095        metadata: NodeMetadata<'gc>,
4096        expression: &'gc Node<'gc>,
4097    ) -> Self {
4098        JSXExpressionContainer {
4099            metadata,
4100            expression,
4101        }
4102    }
4103}
4104
4105/// The `JSXSpreadChild` AST node.
4106#[derive(Debug)]
4107#[repr(C)]
4108pub struct JSXSpreadChild<'gc> {
4109    /// Source range, debug location, paren count, and node id.
4110    pub metadata: NodeMetadata<'gc>,
4111    /// ESTree `expression` property.
4112    pub expression: &'gc Node<'gc>,
4113}
4114impl<'gc> JSXSpreadChild<'gc> {
4115    /// Build `JSXSpreadChild` from its metadata and `ESTree.def` fields.
4116    pub fn new(
4117        metadata: NodeMetadata<'gc>,
4118        expression: &'gc Node<'gc>,
4119    ) -> Self {
4120        JSXSpreadChild {
4121            metadata,
4122            expression,
4123        }
4124    }
4125}
4126
4127/// The `JSXOpeningElement` AST node.
4128#[derive(Debug)]
4129#[repr(C)]
4130pub struct JSXOpeningElement<'gc> {
4131    /// Source range, debug location, paren count, and node id.
4132    pub metadata: NodeMetadata<'gc>,
4133    /// ESTree `name` property.
4134    pub name: &'gc Node<'gc>,
4135    /// ESTree `attributes` property.
4136    pub attributes: NodeList<'gc>,
4137    /// ESTree `selfClosing` property.
4138    pub self_closing: Cell<bool>,
4139    /// ESTree `typeArguments` property.
4140    pub type_arguments: Option<&'gc Node<'gc>>,
4141}
4142impl<'gc> JSXOpeningElement<'gc> {
4143    /// Build `JSXOpeningElement` from its metadata and `ESTree.def` fields.
4144    pub fn new(
4145        metadata: NodeMetadata<'gc>,
4146        name: &'gc Node<'gc>,
4147        attributes: NodeList<'gc>,
4148        self_closing: bool,
4149        type_arguments: Option<&'gc Node<'gc>>,
4150    ) -> Self {
4151        JSXOpeningElement {
4152            metadata,
4153            name,
4154            attributes,
4155            self_closing: Cell::new(self_closing),
4156            type_arguments,
4157        }
4158    }
4159}
4160
4161/// The `JSXClosingElement` AST node.
4162#[derive(Debug)]
4163#[repr(C)]
4164pub struct JSXClosingElement<'gc> {
4165    /// Source range, debug location, paren count, and node id.
4166    pub metadata: NodeMetadata<'gc>,
4167    /// ESTree `name` property.
4168    pub name: &'gc Node<'gc>,
4169}
4170impl<'gc> JSXClosingElement<'gc> {
4171    /// Build `JSXClosingElement` from its metadata and `ESTree.def` fields.
4172    pub fn new(
4173        metadata: NodeMetadata<'gc>,
4174        name: &'gc Node<'gc>,
4175    ) -> Self {
4176        JSXClosingElement {
4177            metadata,
4178            name,
4179        }
4180    }
4181}
4182
4183/// The `JSXAttribute` AST node.
4184#[derive(Debug)]
4185#[repr(C)]
4186pub struct JSXAttribute<'gc> {
4187    /// Source range, debug location, paren count, and node id.
4188    pub metadata: NodeMetadata<'gc>,
4189    /// ESTree `name` property.
4190    pub name: &'gc Node<'gc>,
4191    /// ESTree `value` property.
4192    pub value: Option<&'gc Node<'gc>>,
4193}
4194impl<'gc> JSXAttribute<'gc> {
4195    /// Build `JSXAttribute` from its metadata and `ESTree.def` fields.
4196    pub fn new(
4197        metadata: NodeMetadata<'gc>,
4198        name: &'gc Node<'gc>,
4199        value: Option<&'gc Node<'gc>>,
4200    ) -> Self {
4201        JSXAttribute {
4202            metadata,
4203            name,
4204            value,
4205        }
4206    }
4207}
4208
4209/// The `JSXSpreadAttribute` AST node.
4210#[derive(Debug)]
4211#[repr(C)]
4212pub struct JSXSpreadAttribute<'gc> {
4213    /// Source range, debug location, paren count, and node id.
4214    pub metadata: NodeMetadata<'gc>,
4215    /// ESTree `argument` property.
4216    pub argument: &'gc Node<'gc>,
4217}
4218impl<'gc> JSXSpreadAttribute<'gc> {
4219    /// Build `JSXSpreadAttribute` from its metadata and `ESTree.def` fields.
4220    pub fn new(
4221        metadata: NodeMetadata<'gc>,
4222        argument: &'gc Node<'gc>,
4223    ) -> Self {
4224        JSXSpreadAttribute {
4225            metadata,
4226            argument,
4227        }
4228    }
4229}
4230
4231/// The `JSXStringLiteral` AST node.
4232#[derive(Debug)]
4233#[repr(C)]
4234pub struct JSXStringLiteral<'gc> {
4235    /// Source range, debug location, paren count, and node id.
4236    pub metadata: NodeMetadata<'gc>,
4237    /// ESTree `value` property.
4238    pub value: Cell<NodeString>,
4239    /// ESTree `raw` property.
4240    pub raw: Cell<NodeLabel>,
4241}
4242impl<'gc> JSXStringLiteral<'gc> {
4243    /// Build `JSXStringLiteral` from its metadata and `ESTree.def` fields.
4244    pub fn new(
4245        metadata: NodeMetadata<'gc>,
4246        value: NodeString,
4247        raw: NodeLabel,
4248    ) -> Self {
4249        JSXStringLiteral {
4250            metadata,
4251            value: Cell::new(value),
4252            raw: Cell::new(raw),
4253        }
4254    }
4255}
4256
4257/// The `JSXText` AST node.
4258#[derive(Debug)]
4259#[repr(C)]
4260pub struct JSXText<'gc> {
4261    /// Source range, debug location, paren count, and node id.
4262    pub metadata: NodeMetadata<'gc>,
4263    /// ESTree `value` property.
4264    pub value: Cell<NodeString>,
4265    /// ESTree `raw` property.
4266    pub raw: Cell<NodeLabel>,
4267}
4268impl<'gc> JSXText<'gc> {
4269    /// Build `JSXText` from its metadata and `ESTree.def` fields.
4270    pub fn new(
4271        metadata: NodeMetadata<'gc>,
4272        value: NodeString,
4273        raw: NodeLabel,
4274    ) -> Self {
4275        JSXText {
4276            metadata,
4277            value: Cell::new(value),
4278            raw: Cell::new(raw),
4279        }
4280    }
4281}
4282
4283/// The `JSXElement` AST node.
4284#[derive(Debug)]
4285#[repr(C)]
4286pub struct JSXElement<'gc> {
4287    /// Source range, debug location, paren count, and node id.
4288    pub metadata: NodeMetadata<'gc>,
4289    /// ESTree `openingElement` property.
4290    pub opening_element: &'gc Node<'gc>,
4291    /// ESTree `children` property.
4292    pub children: NodeList<'gc>,
4293    /// ESTree `closingElement` property.
4294    pub closing_element: Option<&'gc Node<'gc>>,
4295}
4296impl<'gc> JSXElement<'gc> {
4297    /// Build `JSXElement` from its metadata and `ESTree.def` fields.
4298    pub fn new(
4299        metadata: NodeMetadata<'gc>,
4300        opening_element: &'gc Node<'gc>,
4301        children: NodeList<'gc>,
4302        closing_element: Option<&'gc Node<'gc>>,
4303    ) -> Self {
4304        JSXElement {
4305            metadata,
4306            opening_element,
4307            children,
4308            closing_element,
4309        }
4310    }
4311}
4312
4313/// The `JSXFragment` AST node.
4314#[derive(Debug)]
4315#[repr(C)]
4316pub struct JSXFragment<'gc> {
4317    /// Source range, debug location, paren count, and node id.
4318    pub metadata: NodeMetadata<'gc>,
4319    /// ESTree `openingFragment` property.
4320    pub opening_fragment: &'gc Node<'gc>,
4321    /// ESTree `children` property.
4322    pub children: NodeList<'gc>,
4323    /// ESTree `closingFragment` property.
4324    pub closing_fragment: &'gc Node<'gc>,
4325}
4326impl<'gc> JSXFragment<'gc> {
4327    /// Build `JSXFragment` from its metadata and `ESTree.def` fields.
4328    pub fn new(
4329        metadata: NodeMetadata<'gc>,
4330        opening_fragment: &'gc Node<'gc>,
4331        children: NodeList<'gc>,
4332        closing_fragment: &'gc Node<'gc>,
4333    ) -> Self {
4334        JSXFragment {
4335            metadata,
4336            opening_fragment,
4337            children,
4338            closing_fragment,
4339        }
4340    }
4341}
4342
4343/// The `JSXOpeningFragment` AST node.
4344#[derive(Debug)]
4345#[repr(C)]
4346pub struct JSXOpeningFragment<'gc> {
4347    /// Source range, debug location, paren count, and node id.
4348    pub metadata: NodeMetadata<'gc>,
4349}
4350impl<'gc> JSXOpeningFragment<'gc> {
4351    /// Build `JSXOpeningFragment` from its metadata and `ESTree.def` fields.
4352    pub fn new(
4353        metadata: NodeMetadata<'gc>,
4354    ) -> Self {
4355        JSXOpeningFragment {
4356            metadata,
4357        }
4358    }
4359}
4360
4361/// The `JSXClosingFragment` AST node.
4362#[derive(Debug)]
4363#[repr(C)]
4364pub struct JSXClosingFragment<'gc> {
4365    /// Source range, debug location, paren count, and node id.
4366    pub metadata: NodeMetadata<'gc>,
4367}
4368impl<'gc> JSXClosingFragment<'gc> {
4369    /// Build `JSXClosingFragment` from its metadata and `ESTree.def` fields.
4370    pub fn new(
4371        metadata: NodeMetadata<'gc>,
4372    ) -> Self {
4373        JSXClosingFragment {
4374            metadata,
4375        }
4376    }
4377}
4378
4379/// The `ExistsTypeAnnotation` AST node.
4380#[derive(Debug)]
4381#[repr(C)]
4382pub struct ExistsTypeAnnotation<'gc> {
4383    /// Source range, debug location, paren count, and node id.
4384    pub metadata: NodeMetadata<'gc>,
4385}
4386impl<'gc> ExistsTypeAnnotation<'gc> {
4387    /// Build `ExistsTypeAnnotation` from its metadata and `ESTree.def` fields.
4388    pub fn new(
4389        metadata: NodeMetadata<'gc>,
4390    ) -> Self {
4391        ExistsTypeAnnotation {
4392            metadata,
4393        }
4394    }
4395}
4396
4397/// The `EmptyTypeAnnotation` AST node.
4398#[derive(Debug)]
4399#[repr(C)]
4400pub struct EmptyTypeAnnotation<'gc> {
4401    /// Source range, debug location, paren count, and node id.
4402    pub metadata: NodeMetadata<'gc>,
4403}
4404impl<'gc> EmptyTypeAnnotation<'gc> {
4405    /// Build `EmptyTypeAnnotation` from its metadata and `ESTree.def` fields.
4406    pub fn new(
4407        metadata: NodeMetadata<'gc>,
4408    ) -> Self {
4409        EmptyTypeAnnotation {
4410            metadata,
4411        }
4412    }
4413}
4414
4415/// The `StringTypeAnnotation` AST node.
4416#[derive(Debug)]
4417#[repr(C)]
4418pub struct StringTypeAnnotation<'gc> {
4419    /// Source range, debug location, paren count, and node id.
4420    pub metadata: NodeMetadata<'gc>,
4421}
4422impl<'gc> StringTypeAnnotation<'gc> {
4423    /// Build `StringTypeAnnotation` from its metadata and `ESTree.def` fields.
4424    pub fn new(
4425        metadata: NodeMetadata<'gc>,
4426    ) -> Self {
4427        StringTypeAnnotation {
4428            metadata,
4429        }
4430    }
4431}
4432
4433/// The `NumberTypeAnnotation` AST node.
4434#[derive(Debug)]
4435#[repr(C)]
4436pub struct NumberTypeAnnotation<'gc> {
4437    /// Source range, debug location, paren count, and node id.
4438    pub metadata: NodeMetadata<'gc>,
4439}
4440impl<'gc> NumberTypeAnnotation<'gc> {
4441    /// Build `NumberTypeAnnotation` from its metadata and `ESTree.def` fields.
4442    pub fn new(
4443        metadata: NodeMetadata<'gc>,
4444    ) -> Self {
4445        NumberTypeAnnotation {
4446            metadata,
4447        }
4448    }
4449}
4450
4451/// The `StringLiteralTypeAnnotation` AST node.
4452#[derive(Debug)]
4453#[repr(C)]
4454pub struct StringLiteralTypeAnnotation<'gc> {
4455    /// Source range, debug location, paren count, and node id.
4456    pub metadata: NodeMetadata<'gc>,
4457    /// ESTree `value` property.
4458    pub value: Cell<NodeString>,
4459    /// ESTree `raw` property.
4460    pub raw: Cell<NodeString>,
4461}
4462impl<'gc> StringLiteralTypeAnnotation<'gc> {
4463    /// Build `StringLiteralTypeAnnotation` from its metadata and `ESTree.def`
4464    /// fields.
4465    pub fn new(
4466        metadata: NodeMetadata<'gc>,
4467        value: NodeString,
4468        raw: NodeString,
4469    ) -> Self {
4470        StringLiteralTypeAnnotation {
4471            metadata,
4472            value: Cell::new(value),
4473            raw: Cell::new(raw),
4474        }
4475    }
4476}
4477
4478/// The `NumberLiteralTypeAnnotation` AST node.
4479#[derive(Debug)]
4480#[repr(C)]
4481pub struct NumberLiteralTypeAnnotation<'gc> {
4482    /// Source range, debug location, paren count, and node id.
4483    pub metadata: NodeMetadata<'gc>,
4484    /// ESTree `value` property.
4485    pub value: Cell<f64>,
4486    /// ESTree `raw` property.
4487    pub raw: Cell<NodeLabel>,
4488}
4489impl<'gc> NumberLiteralTypeAnnotation<'gc> {
4490    /// Build `NumberLiteralTypeAnnotation` from its metadata and `ESTree.def`
4491    /// fields.
4492    pub fn new(
4493        metadata: NodeMetadata<'gc>,
4494        value: f64,
4495        raw: NodeLabel,
4496    ) -> Self {
4497        NumberLiteralTypeAnnotation {
4498            metadata,
4499            value: Cell::new(value),
4500            raw: Cell::new(raw),
4501        }
4502    }
4503}
4504
4505/// The `BigIntLiteralTypeAnnotation` AST node.
4506#[derive(Debug)]
4507#[repr(C)]
4508pub struct BigIntLiteralTypeAnnotation<'gc> {
4509    /// Source range, debug location, paren count, and node id.
4510    pub metadata: NodeMetadata<'gc>,
4511    /// ESTree `raw` property.
4512    pub raw: Cell<NodeLabel>,
4513}
4514impl<'gc> BigIntLiteralTypeAnnotation<'gc> {
4515    /// Build `BigIntLiteralTypeAnnotation` from its metadata and `ESTree.def`
4516    /// fields.
4517    pub fn new(
4518        metadata: NodeMetadata<'gc>,
4519        raw: NodeLabel,
4520    ) -> Self {
4521        BigIntLiteralTypeAnnotation {
4522            metadata,
4523            raw: Cell::new(raw),
4524        }
4525    }
4526}
4527
4528/// The `BooleanTypeAnnotation` AST node.
4529#[derive(Debug)]
4530#[repr(C)]
4531pub struct BooleanTypeAnnotation<'gc> {
4532    /// Source range, debug location, paren count, and node id.
4533    pub metadata: NodeMetadata<'gc>,
4534}
4535impl<'gc> BooleanTypeAnnotation<'gc> {
4536    /// Build `BooleanTypeAnnotation` from its metadata and `ESTree.def` fields.
4537    pub fn new(
4538        metadata: NodeMetadata<'gc>,
4539    ) -> Self {
4540        BooleanTypeAnnotation {
4541            metadata,
4542        }
4543    }
4544}
4545
4546/// The `BooleanLiteralTypeAnnotation` AST node.
4547#[derive(Debug)]
4548#[repr(C)]
4549pub struct BooleanLiteralTypeAnnotation<'gc> {
4550    /// Source range, debug location, paren count, and node id.
4551    pub metadata: NodeMetadata<'gc>,
4552    /// ESTree `value` property.
4553    pub value: Cell<bool>,
4554    /// ESTree `raw` property.
4555    pub raw: Cell<NodeLabel>,
4556}
4557impl<'gc> BooleanLiteralTypeAnnotation<'gc> {
4558    /// Build `BooleanLiteralTypeAnnotation` from its metadata and `ESTree.def`
4559    /// fields.
4560    pub fn new(
4561        metadata: NodeMetadata<'gc>,
4562        value: bool,
4563        raw: NodeLabel,
4564    ) -> Self {
4565        BooleanLiteralTypeAnnotation {
4566            metadata,
4567            value: Cell::new(value),
4568            raw: Cell::new(raw),
4569        }
4570    }
4571}
4572
4573/// The `NullLiteralTypeAnnotation` AST node.
4574#[derive(Debug)]
4575#[repr(C)]
4576pub struct NullLiteralTypeAnnotation<'gc> {
4577    /// Source range, debug location, paren count, and node id.
4578    pub metadata: NodeMetadata<'gc>,
4579}
4580impl<'gc> NullLiteralTypeAnnotation<'gc> {
4581    /// Build `NullLiteralTypeAnnotation` from its metadata and `ESTree.def`
4582    /// fields.
4583    pub fn new(
4584        metadata: NodeMetadata<'gc>,
4585    ) -> Self {
4586        NullLiteralTypeAnnotation {
4587            metadata,
4588        }
4589    }
4590}
4591
4592/// The `SymbolTypeAnnotation` AST node.
4593#[derive(Debug)]
4594#[repr(C)]
4595pub struct SymbolTypeAnnotation<'gc> {
4596    /// Source range, debug location, paren count, and node id.
4597    pub metadata: NodeMetadata<'gc>,
4598}
4599impl<'gc> SymbolTypeAnnotation<'gc> {
4600    /// Build `SymbolTypeAnnotation` from its metadata and `ESTree.def` fields.
4601    pub fn new(
4602        metadata: NodeMetadata<'gc>,
4603    ) -> Self {
4604        SymbolTypeAnnotation {
4605            metadata,
4606        }
4607    }
4608}
4609
4610/// The `AnyTypeAnnotation` AST node.
4611#[derive(Debug)]
4612#[repr(C)]
4613pub struct AnyTypeAnnotation<'gc> {
4614    /// Source range, debug location, paren count, and node id.
4615    pub metadata: NodeMetadata<'gc>,
4616}
4617impl<'gc> AnyTypeAnnotation<'gc> {
4618    /// Build `AnyTypeAnnotation` from its metadata and `ESTree.def` fields.
4619    pub fn new(
4620        metadata: NodeMetadata<'gc>,
4621    ) -> Self {
4622        AnyTypeAnnotation {
4623            metadata,
4624        }
4625    }
4626}
4627
4628/// The `MixedTypeAnnotation` AST node.
4629#[derive(Debug)]
4630#[repr(C)]
4631pub struct MixedTypeAnnotation<'gc> {
4632    /// Source range, debug location, paren count, and node id.
4633    pub metadata: NodeMetadata<'gc>,
4634}
4635impl<'gc> MixedTypeAnnotation<'gc> {
4636    /// Build `MixedTypeAnnotation` from its metadata and `ESTree.def` fields.
4637    pub fn new(
4638        metadata: NodeMetadata<'gc>,
4639    ) -> Self {
4640        MixedTypeAnnotation {
4641            metadata,
4642        }
4643    }
4644}
4645
4646/// The `BigIntTypeAnnotation` AST node.
4647#[derive(Debug)]
4648#[repr(C)]
4649pub struct BigIntTypeAnnotation<'gc> {
4650    /// Source range, debug location, paren count, and node id.
4651    pub metadata: NodeMetadata<'gc>,
4652}
4653impl<'gc> BigIntTypeAnnotation<'gc> {
4654    /// Build `BigIntTypeAnnotation` from its metadata and `ESTree.def` fields.
4655    pub fn new(
4656        metadata: NodeMetadata<'gc>,
4657    ) -> Self {
4658        BigIntTypeAnnotation {
4659            metadata,
4660        }
4661    }
4662}
4663
4664/// The `VoidTypeAnnotation` AST node.
4665#[derive(Debug)]
4666#[repr(C)]
4667pub struct VoidTypeAnnotation<'gc> {
4668    /// Source range, debug location, paren count, and node id.
4669    pub metadata: NodeMetadata<'gc>,
4670}
4671impl<'gc> VoidTypeAnnotation<'gc> {
4672    /// Build `VoidTypeAnnotation` from its metadata and `ESTree.def` fields.
4673    pub fn new(
4674        metadata: NodeMetadata<'gc>,
4675    ) -> Self {
4676        VoidTypeAnnotation {
4677            metadata,
4678        }
4679    }
4680}
4681
4682/// The `NeverTypeAnnotation` AST node.
4683#[derive(Debug)]
4684#[repr(C)]
4685pub struct NeverTypeAnnotation<'gc> {
4686    /// Source range, debug location, paren count, and node id.
4687    pub metadata: NodeMetadata<'gc>,
4688}
4689impl<'gc> NeverTypeAnnotation<'gc> {
4690    /// Build `NeverTypeAnnotation` from its metadata and `ESTree.def` fields.
4691    pub fn new(
4692        metadata: NodeMetadata<'gc>,
4693    ) -> Self {
4694        NeverTypeAnnotation {
4695            metadata,
4696        }
4697    }
4698}
4699
4700/// The `UnknownTypeAnnotation` AST node.
4701#[derive(Debug)]
4702#[repr(C)]
4703pub struct UnknownTypeAnnotation<'gc> {
4704    /// Source range, debug location, paren count, and node id.
4705    pub metadata: NodeMetadata<'gc>,
4706}
4707impl<'gc> UnknownTypeAnnotation<'gc> {
4708    /// Build `UnknownTypeAnnotation` from its metadata and `ESTree.def` fields.
4709    pub fn new(
4710        metadata: NodeMetadata<'gc>,
4711    ) -> Self {
4712        UnknownTypeAnnotation {
4713            metadata,
4714        }
4715    }
4716}
4717
4718/// The `UndefinedTypeAnnotation` AST node.
4719#[derive(Debug)]
4720#[repr(C)]
4721pub struct UndefinedTypeAnnotation<'gc> {
4722    /// Source range, debug location, paren count, and node id.
4723    pub metadata: NodeMetadata<'gc>,
4724}
4725impl<'gc> UndefinedTypeAnnotation<'gc> {
4726    /// Build `UndefinedTypeAnnotation` from its metadata and `ESTree.def`
4727    /// fields.
4728    pub fn new(
4729        metadata: NodeMetadata<'gc>,
4730    ) -> Self {
4731        UndefinedTypeAnnotation {
4732            metadata,
4733        }
4734    }
4735}
4736
4737/// The `FunctionTypeAnnotation` AST node.
4738#[derive(Debug)]
4739#[repr(C)]
4740pub struct FunctionTypeAnnotation<'gc> {
4741    /// Source range, debug location, paren count, and node id.
4742    pub metadata: NodeMetadata<'gc>,
4743    /// ESTree `params` property.
4744    pub params: NodeList<'gc>,
4745    /// ESTree `this` property.
4746    pub this: Option<&'gc Node<'gc>>,
4747    /// ESTree `returnType` property.
4748    pub return_type: &'gc Node<'gc>,
4749    /// ESTree `rest` property.
4750    pub rest: Option<&'gc Node<'gc>>,
4751    /// ESTree `typeParameters` property.
4752    pub type_parameters: Option<&'gc Node<'gc>>,
4753}
4754impl<'gc> FunctionTypeAnnotation<'gc> {
4755    /// Build `FunctionTypeAnnotation` from its metadata and `ESTree.def`
4756    /// fields.
4757    pub fn new(
4758        metadata: NodeMetadata<'gc>,
4759        params: NodeList<'gc>,
4760        this: Option<&'gc Node<'gc>>,
4761        return_type: &'gc Node<'gc>,
4762        rest: Option<&'gc Node<'gc>>,
4763        type_parameters: Option<&'gc Node<'gc>>,
4764    ) -> Self {
4765        FunctionTypeAnnotation {
4766            metadata,
4767            params,
4768            this,
4769            return_type,
4770            rest,
4771            type_parameters,
4772        }
4773    }
4774}
4775
4776/// The `HookTypeAnnotation` AST node.
4777#[derive(Debug)]
4778#[repr(C)]
4779pub struct HookTypeAnnotation<'gc> {
4780    /// Source range, debug location, paren count, and node id.
4781    pub metadata: NodeMetadata<'gc>,
4782    /// ESTree `params` property.
4783    pub params: NodeList<'gc>,
4784    /// ESTree `returnType` property.
4785    pub return_type: &'gc Node<'gc>,
4786    /// ESTree `rest` property.
4787    pub rest: Option<&'gc Node<'gc>>,
4788    /// ESTree `typeParameters` property.
4789    pub type_parameters: Option<&'gc Node<'gc>>,
4790}
4791impl<'gc> HookTypeAnnotation<'gc> {
4792    /// Build `HookTypeAnnotation` from its metadata and `ESTree.def` fields.
4793    pub fn new(
4794        metadata: NodeMetadata<'gc>,
4795        params: NodeList<'gc>,
4796        return_type: &'gc Node<'gc>,
4797        rest: Option<&'gc Node<'gc>>,
4798        type_parameters: Option<&'gc Node<'gc>>,
4799    ) -> Self {
4800        HookTypeAnnotation {
4801            metadata,
4802            params,
4803            return_type,
4804            rest,
4805            type_parameters,
4806        }
4807    }
4808}
4809
4810/// The `FunctionTypeParam` AST node.
4811#[derive(Debug)]
4812#[repr(C)]
4813pub struct FunctionTypeParam<'gc> {
4814    /// Source range, debug location, paren count, and node id.
4815    pub metadata: NodeMetadata<'gc>,
4816    /// ESTree `name` property.
4817    pub name: Option<&'gc Node<'gc>>,
4818    /// ESTree `typeAnnotation` property.
4819    pub type_annotation: &'gc Node<'gc>,
4820    /// ESTree `optional` property.
4821    pub optional: Cell<bool>,
4822}
4823impl<'gc> FunctionTypeParam<'gc> {
4824    /// Build `FunctionTypeParam` from its metadata and `ESTree.def` fields.
4825    pub fn new(
4826        metadata: NodeMetadata<'gc>,
4827        name: Option<&'gc Node<'gc>>,
4828        type_annotation: &'gc Node<'gc>,
4829        optional: bool,
4830    ) -> Self {
4831        FunctionTypeParam {
4832            metadata,
4833            name,
4834            type_annotation,
4835            optional: Cell::new(optional),
4836        }
4837    }
4838}
4839
4840/// The `ComponentTypeAnnotation` AST node.
4841#[derive(Debug)]
4842#[repr(C)]
4843pub struct ComponentTypeAnnotation<'gc> {
4844    /// Source range, debug location, paren count, and node id.
4845    pub metadata: NodeMetadata<'gc>,
4846    /// ESTree `params` property.
4847    pub params: NodeList<'gc>,
4848    /// ESTree `rest` property.
4849    pub rest: Option<&'gc Node<'gc>>,
4850    /// ESTree `typeParameters` property.
4851    pub type_parameters: Option<&'gc Node<'gc>>,
4852    /// ESTree `rendersType` property.
4853    pub renders_type: Option<&'gc Node<'gc>>,
4854}
4855impl<'gc> ComponentTypeAnnotation<'gc> {
4856    /// Build `ComponentTypeAnnotation` from its metadata and `ESTree.def`
4857    /// fields.
4858    pub fn new(
4859        metadata: NodeMetadata<'gc>,
4860        params: NodeList<'gc>,
4861        rest: Option<&'gc Node<'gc>>,
4862        type_parameters: Option<&'gc Node<'gc>>,
4863        renders_type: Option<&'gc Node<'gc>>,
4864    ) -> Self {
4865        ComponentTypeAnnotation {
4866            metadata,
4867            params,
4868            rest,
4869            type_parameters,
4870            renders_type,
4871        }
4872    }
4873}
4874
4875/// The `ComponentTypeParameter` AST node.
4876#[derive(Debug)]
4877#[repr(C)]
4878pub struct ComponentTypeParameter<'gc> {
4879    /// Source range, debug location, paren count, and node id.
4880    pub metadata: NodeMetadata<'gc>,
4881    /// ESTree `name` property.
4882    pub name: Option<&'gc Node<'gc>>,
4883    /// ESTree `typeAnnotation` property.
4884    pub type_annotation: &'gc Node<'gc>,
4885    /// ESTree `optional` property.
4886    pub optional: Cell<bool>,
4887}
4888impl<'gc> ComponentTypeParameter<'gc> {
4889    /// Build `ComponentTypeParameter` from its metadata and `ESTree.def`
4890    /// fields.
4891    pub fn new(
4892        metadata: NodeMetadata<'gc>,
4893        name: Option<&'gc Node<'gc>>,
4894        type_annotation: &'gc Node<'gc>,
4895        optional: bool,
4896    ) -> Self {
4897        ComponentTypeParameter {
4898            metadata,
4899            name,
4900            type_annotation,
4901            optional: Cell::new(optional),
4902        }
4903    }
4904}
4905
4906/// The `NullableTypeAnnotation` AST node.
4907#[derive(Debug)]
4908#[repr(C)]
4909pub struct NullableTypeAnnotation<'gc> {
4910    /// Source range, debug location, paren count, and node id.
4911    pub metadata: NodeMetadata<'gc>,
4912    /// ESTree `typeAnnotation` property.
4913    pub type_annotation: &'gc Node<'gc>,
4914}
4915impl<'gc> NullableTypeAnnotation<'gc> {
4916    /// Build `NullableTypeAnnotation` from its metadata and `ESTree.def`
4917    /// fields.
4918    pub fn new(
4919        metadata: NodeMetadata<'gc>,
4920        type_annotation: &'gc Node<'gc>,
4921    ) -> Self {
4922        NullableTypeAnnotation {
4923            metadata,
4924            type_annotation,
4925        }
4926    }
4927}
4928
4929/// The `QualifiedTypeIdentifier` AST node.
4930#[derive(Debug)]
4931#[repr(C)]
4932pub struct QualifiedTypeIdentifier<'gc> {
4933    /// Source range, debug location, paren count, and node id.
4934    pub metadata: NodeMetadata<'gc>,
4935    /// ESTree `qualification` property.
4936    pub qualification: &'gc Node<'gc>,
4937    /// ESTree `id` property.
4938    pub id: &'gc Node<'gc>,
4939}
4940impl<'gc> QualifiedTypeIdentifier<'gc> {
4941    /// Build `QualifiedTypeIdentifier` from its metadata and `ESTree.def`
4942    /// fields.
4943    pub fn new(
4944        metadata: NodeMetadata<'gc>,
4945        qualification: &'gc Node<'gc>,
4946        id: &'gc Node<'gc>,
4947    ) -> Self {
4948        QualifiedTypeIdentifier {
4949            metadata,
4950            qualification,
4951            id,
4952        }
4953    }
4954}
4955
4956/// The `TypeofTypeAnnotation` AST node.
4957#[derive(Debug)]
4958#[repr(C)]
4959pub struct TypeofTypeAnnotation<'gc> {
4960    /// Source range, debug location, paren count, and node id.
4961    pub metadata: NodeMetadata<'gc>,
4962    /// ESTree `argument` property.
4963    pub argument: &'gc Node<'gc>,
4964    /// ESTree `typeArguments` property.
4965    pub type_arguments: Option<&'gc Node<'gc>>,
4966}
4967impl<'gc> TypeofTypeAnnotation<'gc> {
4968    /// Build `TypeofTypeAnnotation` from its metadata and `ESTree.def` fields.
4969    pub fn new(
4970        metadata: NodeMetadata<'gc>,
4971        argument: &'gc Node<'gc>,
4972        type_arguments: Option<&'gc Node<'gc>>,
4973    ) -> Self {
4974        TypeofTypeAnnotation {
4975            metadata,
4976            argument,
4977            type_arguments,
4978        }
4979    }
4980}
4981
4982/// The `KeyofTypeAnnotation` AST node.
4983#[derive(Debug)]
4984#[repr(C)]
4985pub struct KeyofTypeAnnotation<'gc> {
4986    /// Source range, debug location, paren count, and node id.
4987    pub metadata: NodeMetadata<'gc>,
4988    /// ESTree `argument` property.
4989    pub argument: &'gc Node<'gc>,
4990}
4991impl<'gc> KeyofTypeAnnotation<'gc> {
4992    /// Build `KeyofTypeAnnotation` from its metadata and `ESTree.def` fields.
4993    pub fn new(
4994        metadata: NodeMetadata<'gc>,
4995        argument: &'gc Node<'gc>,
4996    ) -> Self {
4997        KeyofTypeAnnotation {
4998            metadata,
4999            argument,
5000        }
5001    }
5002}
5003
5004/// The `TypeOperator` AST node.
5005#[derive(Debug)]
5006#[repr(C)]
5007pub struct TypeOperator<'gc> {
5008    /// Source range, debug location, paren count, and node id.
5009    pub metadata: NodeMetadata<'gc>,
5010    /// ESTree `operator` property.
5011    pub operator: Cell<NodeLabel>,
5012    /// ESTree `typeAnnotation` property.
5013    pub type_annotation: &'gc Node<'gc>,
5014}
5015impl<'gc> TypeOperator<'gc> {
5016    /// Build `TypeOperator` from its metadata and `ESTree.def` fields.
5017    pub fn new(
5018        metadata: NodeMetadata<'gc>,
5019        operator: NodeLabel,
5020        type_annotation: &'gc Node<'gc>,
5021    ) -> Self {
5022        TypeOperator {
5023            metadata,
5024            operator: Cell::new(operator),
5025            type_annotation,
5026        }
5027    }
5028}
5029
5030/// The `QualifiedTypeofIdentifier` AST node.
5031#[derive(Debug)]
5032#[repr(C)]
5033pub struct QualifiedTypeofIdentifier<'gc> {
5034    /// Source range, debug location, paren count, and node id.
5035    pub metadata: NodeMetadata<'gc>,
5036    /// ESTree `qualification` property.
5037    pub qualification: &'gc Node<'gc>,
5038    /// ESTree `id` property.
5039    pub id: &'gc Node<'gc>,
5040}
5041impl<'gc> QualifiedTypeofIdentifier<'gc> {
5042    /// Build `QualifiedTypeofIdentifier` from its metadata and `ESTree.def`
5043    /// fields.
5044    pub fn new(
5045        metadata: NodeMetadata<'gc>,
5046        qualification: &'gc Node<'gc>,
5047        id: &'gc Node<'gc>,
5048    ) -> Self {
5049        QualifiedTypeofIdentifier {
5050            metadata,
5051            qualification,
5052            id,
5053        }
5054    }
5055}
5056
5057/// The `TupleTypeAnnotation` AST node.
5058#[derive(Debug)]
5059#[repr(C)]
5060pub struct TupleTypeAnnotation<'gc> {
5061    /// Source range, debug location, paren count, and node id.
5062    pub metadata: NodeMetadata<'gc>,
5063    /// ESTree `elementTypes` property.
5064    pub element_types: NodeList<'gc>,
5065    /// ESTree `inexact` property.
5066    pub inexact: Cell<bool>,
5067}
5068impl<'gc> TupleTypeAnnotation<'gc> {
5069    /// Build `TupleTypeAnnotation` from its metadata and `ESTree.def` fields.
5070    pub fn new(
5071        metadata: NodeMetadata<'gc>,
5072        element_types: NodeList<'gc>,
5073        inexact: bool,
5074    ) -> Self {
5075        TupleTypeAnnotation {
5076            metadata,
5077            element_types,
5078            inexact: Cell::new(inexact),
5079        }
5080    }
5081}
5082
5083/// The `TupleTypeSpreadElement` AST node.
5084#[derive(Debug)]
5085#[repr(C)]
5086pub struct TupleTypeSpreadElement<'gc> {
5087    /// Source range, debug location, paren count, and node id.
5088    pub metadata: NodeMetadata<'gc>,
5089    /// ESTree `label` property.
5090    pub label: Option<&'gc Node<'gc>>,
5091    /// ESTree `typeAnnotation` property.
5092    pub type_annotation: &'gc Node<'gc>,
5093}
5094impl<'gc> TupleTypeSpreadElement<'gc> {
5095    /// Build `TupleTypeSpreadElement` from its metadata and `ESTree.def`
5096    /// fields.
5097    pub fn new(
5098        metadata: NodeMetadata<'gc>,
5099        label: Option<&'gc Node<'gc>>,
5100        type_annotation: &'gc Node<'gc>,
5101    ) -> Self {
5102        TupleTypeSpreadElement {
5103            metadata,
5104            label,
5105            type_annotation,
5106        }
5107    }
5108}
5109
5110/// The `TupleTypeLabeledElement` AST node.
5111#[derive(Debug)]
5112#[repr(C)]
5113pub struct TupleTypeLabeledElement<'gc> {
5114    /// Source range, debug location, paren count, and node id.
5115    pub metadata: NodeMetadata<'gc>,
5116    /// ESTree `label` property.
5117    pub label: &'gc Node<'gc>,
5118    /// ESTree `elementType` property.
5119    pub element_type: &'gc Node<'gc>,
5120    /// ESTree `optional` property.
5121    pub optional: Cell<bool>,
5122    /// ESTree `variance` property.
5123    pub variance: Option<&'gc Node<'gc>>,
5124}
5125impl<'gc> TupleTypeLabeledElement<'gc> {
5126    /// Build `TupleTypeLabeledElement` from its metadata and `ESTree.def`
5127    /// fields.
5128    pub fn new(
5129        metadata: NodeMetadata<'gc>,
5130        label: &'gc Node<'gc>,
5131        element_type: &'gc Node<'gc>,
5132        optional: bool,
5133        variance: Option<&'gc Node<'gc>>,
5134    ) -> Self {
5135        TupleTypeLabeledElement {
5136            metadata,
5137            label,
5138            element_type,
5139            optional: Cell::new(optional),
5140            variance,
5141        }
5142    }
5143}
5144
5145/// The `ArrayTypeAnnotation` AST node.
5146#[derive(Debug)]
5147#[repr(C)]
5148pub struct ArrayTypeAnnotation<'gc> {
5149    /// Source range, debug location, paren count, and node id.
5150    pub metadata: NodeMetadata<'gc>,
5151    /// ESTree `elementType` property.
5152    pub element_type: &'gc Node<'gc>,
5153}
5154impl<'gc> ArrayTypeAnnotation<'gc> {
5155    /// Build `ArrayTypeAnnotation` from its metadata and `ESTree.def` fields.
5156    pub fn new(
5157        metadata: NodeMetadata<'gc>,
5158        element_type: &'gc Node<'gc>,
5159    ) -> Self {
5160        ArrayTypeAnnotation {
5161            metadata,
5162            element_type,
5163        }
5164    }
5165}
5166
5167/// The `InferTypeAnnotation` AST node.
5168#[derive(Debug)]
5169#[repr(C)]
5170pub struct InferTypeAnnotation<'gc> {
5171    /// Source range, debug location, paren count, and node id.
5172    pub metadata: NodeMetadata<'gc>,
5173    /// ESTree `typeParameter` property.
5174    pub type_parameter: &'gc Node<'gc>,
5175}
5176impl<'gc> InferTypeAnnotation<'gc> {
5177    /// Build `InferTypeAnnotation` from its metadata and `ESTree.def` fields.
5178    pub fn new(
5179        metadata: NodeMetadata<'gc>,
5180        type_parameter: &'gc Node<'gc>,
5181    ) -> Self {
5182        InferTypeAnnotation {
5183            metadata,
5184            type_parameter,
5185        }
5186    }
5187}
5188
5189/// The `UnionTypeAnnotation` AST node.
5190#[derive(Debug)]
5191#[repr(C)]
5192pub struct UnionTypeAnnotation<'gc> {
5193    /// Source range, debug location, paren count, and node id.
5194    pub metadata: NodeMetadata<'gc>,
5195    /// ESTree `types` property.
5196    pub types: NodeList<'gc>,
5197}
5198impl<'gc> UnionTypeAnnotation<'gc> {
5199    /// Build `UnionTypeAnnotation` from its metadata and `ESTree.def` fields.
5200    pub fn new(
5201        metadata: NodeMetadata<'gc>,
5202        types: NodeList<'gc>,
5203    ) -> Self {
5204        UnionTypeAnnotation {
5205            metadata,
5206            types,
5207        }
5208    }
5209}
5210
5211/// The `IntersectionTypeAnnotation` AST node.
5212#[derive(Debug)]
5213#[repr(C)]
5214pub struct IntersectionTypeAnnotation<'gc> {
5215    /// Source range, debug location, paren count, and node id.
5216    pub metadata: NodeMetadata<'gc>,
5217    /// ESTree `types` property.
5218    pub types: NodeList<'gc>,
5219}
5220impl<'gc> IntersectionTypeAnnotation<'gc> {
5221    /// Build `IntersectionTypeAnnotation` from its metadata and `ESTree.def`
5222    /// fields.
5223    pub fn new(
5224        metadata: NodeMetadata<'gc>,
5225        types: NodeList<'gc>,
5226    ) -> Self {
5227        IntersectionTypeAnnotation {
5228            metadata,
5229            types,
5230        }
5231    }
5232}
5233
5234/// The `GenericTypeAnnotation` AST node.
5235#[derive(Debug)]
5236#[repr(C)]
5237pub struct GenericTypeAnnotation<'gc> {
5238    /// Source range, debug location, paren count, and node id.
5239    pub metadata: NodeMetadata<'gc>,
5240    /// ESTree `id` property.
5241    pub id: &'gc Node<'gc>,
5242    /// ESTree `typeParameters` property.
5243    pub type_parameters: Option<&'gc Node<'gc>>,
5244}
5245impl<'gc> GenericTypeAnnotation<'gc> {
5246    /// Build `GenericTypeAnnotation` from its metadata and `ESTree.def` fields.
5247    pub fn new(
5248        metadata: NodeMetadata<'gc>,
5249        id: &'gc Node<'gc>,
5250        type_parameters: Option<&'gc Node<'gc>>,
5251    ) -> Self {
5252        GenericTypeAnnotation {
5253            metadata,
5254            id,
5255            type_parameters,
5256        }
5257    }
5258}
5259
5260/// The `IndexedAccessType` AST node.
5261#[derive(Debug)]
5262#[repr(C)]
5263pub struct IndexedAccessType<'gc> {
5264    /// Source range, debug location, paren count, and node id.
5265    pub metadata: NodeMetadata<'gc>,
5266    /// ESTree `objectType` property.
5267    pub object_type: &'gc Node<'gc>,
5268    /// ESTree `indexType` property.
5269    pub index_type: &'gc Node<'gc>,
5270}
5271impl<'gc> IndexedAccessType<'gc> {
5272    /// Build `IndexedAccessType` from its metadata and `ESTree.def` fields.
5273    pub fn new(
5274        metadata: NodeMetadata<'gc>,
5275        object_type: &'gc Node<'gc>,
5276        index_type: &'gc Node<'gc>,
5277    ) -> Self {
5278        IndexedAccessType {
5279            metadata,
5280            object_type,
5281            index_type,
5282        }
5283    }
5284}
5285
5286/// The `OptionalIndexedAccessType` AST node.
5287#[derive(Debug)]
5288#[repr(C)]
5289pub struct OptionalIndexedAccessType<'gc> {
5290    /// Source range, debug location, paren count, and node id.
5291    pub metadata: NodeMetadata<'gc>,
5292    /// ESTree `objectType` property.
5293    pub object_type: &'gc Node<'gc>,
5294    /// ESTree `indexType` property.
5295    pub index_type: &'gc Node<'gc>,
5296    /// ESTree `optional` property.
5297    pub optional: Cell<bool>,
5298}
5299impl<'gc> OptionalIndexedAccessType<'gc> {
5300    /// Build `OptionalIndexedAccessType` from its metadata and `ESTree.def`
5301    /// fields.
5302    pub fn new(
5303        metadata: NodeMetadata<'gc>,
5304        object_type: &'gc Node<'gc>,
5305        index_type: &'gc Node<'gc>,
5306        optional: bool,
5307    ) -> Self {
5308        OptionalIndexedAccessType {
5309            metadata,
5310            object_type,
5311            index_type,
5312            optional: Cell::new(optional),
5313        }
5314    }
5315}
5316
5317/// The `ConditionalTypeAnnotation` AST node.
5318#[derive(Debug)]
5319#[repr(C)]
5320pub struct ConditionalTypeAnnotation<'gc> {
5321    /// Source range, debug location, paren count, and node id.
5322    pub metadata: NodeMetadata<'gc>,
5323    /// ESTree `checkType` property.
5324    pub check_type: &'gc Node<'gc>,
5325    /// ESTree `extendsType` property.
5326    pub extends_type: &'gc Node<'gc>,
5327    /// ESTree `trueType` property.
5328    pub true_type: &'gc Node<'gc>,
5329    /// ESTree `falseType` property.
5330    pub false_type: &'gc Node<'gc>,
5331}
5332impl<'gc> ConditionalTypeAnnotation<'gc> {
5333    /// Build `ConditionalTypeAnnotation` from its metadata and `ESTree.def`
5334    /// fields.
5335    pub fn new(
5336        metadata: NodeMetadata<'gc>,
5337        check_type: &'gc Node<'gc>,
5338        extends_type: &'gc Node<'gc>,
5339        true_type: &'gc Node<'gc>,
5340        false_type: &'gc Node<'gc>,
5341    ) -> Self {
5342        ConditionalTypeAnnotation {
5343            metadata,
5344            check_type,
5345            extends_type,
5346            true_type,
5347            false_type,
5348        }
5349    }
5350}
5351
5352/// The `TypePredicate` AST node.
5353#[derive(Debug)]
5354#[repr(C)]
5355pub struct TypePredicate<'gc> {
5356    /// Source range, debug location, paren count, and node id.
5357    pub metadata: NodeMetadata<'gc>,
5358    /// ESTree `parameterName` property.
5359    pub parameter_name: &'gc Node<'gc>,
5360    /// ESTree `typeAnnotation` property.
5361    pub type_annotation: Option<&'gc Node<'gc>>,
5362    /// ESTree `kind` property.
5363    pub kind: Cell<NodeString>,
5364}
5365impl<'gc> TypePredicate<'gc> {
5366    /// Build `TypePredicate` from its metadata and `ESTree.def` fields.
5367    pub fn new(
5368        metadata: NodeMetadata<'gc>,
5369        parameter_name: &'gc Node<'gc>,
5370        type_annotation: Option<&'gc Node<'gc>>,
5371        kind: NodeString,
5372    ) -> Self {
5373        TypePredicate {
5374            metadata,
5375            parameter_name,
5376            type_annotation,
5377            kind: Cell::new(kind),
5378        }
5379    }
5380}
5381
5382/// The `InterfaceTypeAnnotation` AST node.
5383#[derive(Debug)]
5384#[repr(C)]
5385pub struct InterfaceTypeAnnotation<'gc> {
5386    /// Source range, debug location, paren count, and node id.
5387    pub metadata: NodeMetadata<'gc>,
5388    /// ESTree `extends` property.
5389    pub extends: NodeList<'gc>,
5390    /// ESTree `body` property.
5391    pub body: Option<&'gc Node<'gc>>,
5392}
5393impl<'gc> InterfaceTypeAnnotation<'gc> {
5394    /// Build `InterfaceTypeAnnotation` from its metadata and `ESTree.def`
5395    /// fields.
5396    pub fn new(
5397        metadata: NodeMetadata<'gc>,
5398        extends: NodeList<'gc>,
5399        body: Option<&'gc Node<'gc>>,
5400    ) -> Self {
5401        InterfaceTypeAnnotation {
5402            metadata,
5403            extends,
5404            body,
5405        }
5406    }
5407}
5408
5409/// The `TypeAlias` AST node.
5410#[derive(Debug)]
5411#[repr(C)]
5412pub struct TypeAlias<'gc> {
5413    /// Source range, debug location, paren count, and node id.
5414    pub metadata: NodeMetadata<'gc>,
5415    /// ESTree `id` property.
5416    pub id: &'gc Node<'gc>,
5417    /// ESTree `typeParameters` property.
5418    pub type_parameters: Option<&'gc Node<'gc>>,
5419    /// ESTree `right` property.
5420    pub right: &'gc Node<'gc>,
5421}
5422impl<'gc> TypeAlias<'gc> {
5423    /// Build `TypeAlias` from its metadata and `ESTree.def` fields.
5424    pub fn new(
5425        metadata: NodeMetadata<'gc>,
5426        id: &'gc Node<'gc>,
5427        type_parameters: Option<&'gc Node<'gc>>,
5428        right: &'gc Node<'gc>,
5429    ) -> Self {
5430        TypeAlias {
5431            metadata,
5432            id,
5433            type_parameters,
5434            right,
5435        }
5436    }
5437}
5438
5439/// The `OpaqueType` AST node.
5440#[derive(Debug)]
5441#[repr(C)]
5442pub struct OpaqueType<'gc> {
5443    /// Source range, debug location, paren count, and node id.
5444    pub metadata: NodeMetadata<'gc>,
5445    /// ESTree `id` property.
5446    pub id: &'gc Node<'gc>,
5447    /// ESTree `typeParameters` property.
5448    pub type_parameters: Option<&'gc Node<'gc>>,
5449    /// ESTree `impltype` property.
5450    pub impltype: &'gc Node<'gc>,
5451    /// ESTree `lowerBound` property.
5452    pub lower_bound: Option<&'gc Node<'gc>>,
5453    /// ESTree `upperBound` property.
5454    pub upper_bound: Option<&'gc Node<'gc>>,
5455    /// ESTree `supertype` property.
5456    pub supertype: Option<&'gc Node<'gc>>,
5457}
5458impl<'gc> OpaqueType<'gc> {
5459    /// Build `OpaqueType` from its metadata and `ESTree.def` fields.
5460    pub fn new(
5461        metadata: NodeMetadata<'gc>,
5462        id: &'gc Node<'gc>,
5463        type_parameters: Option<&'gc Node<'gc>>,
5464        impltype: &'gc Node<'gc>,
5465        lower_bound: Option<&'gc Node<'gc>>,
5466        upper_bound: Option<&'gc Node<'gc>>,
5467        supertype: Option<&'gc Node<'gc>>,
5468    ) -> Self {
5469        OpaqueType {
5470            metadata,
5471            id,
5472            type_parameters,
5473            impltype,
5474            lower_bound,
5475            upper_bound,
5476            supertype,
5477        }
5478    }
5479}
5480
5481/// The `InterfaceDeclaration` AST node.
5482#[derive(Debug)]
5483#[repr(C)]
5484pub struct InterfaceDeclaration<'gc> {
5485    /// Source range, debug location, paren count, and node id.
5486    pub metadata: NodeMetadata<'gc>,
5487    /// ESTree `id` property.
5488    pub id: &'gc Node<'gc>,
5489    /// ESTree `typeParameters` property.
5490    pub type_parameters: Option<&'gc Node<'gc>>,
5491    /// ESTree `extends` property.
5492    pub extends: NodeList<'gc>,
5493    /// ESTree `body` property.
5494    pub body: &'gc Node<'gc>,
5495}
5496impl<'gc> InterfaceDeclaration<'gc> {
5497    /// Build `InterfaceDeclaration` from its metadata and `ESTree.def` fields.
5498    pub fn new(
5499        metadata: NodeMetadata<'gc>,
5500        id: &'gc Node<'gc>,
5501        type_parameters: Option<&'gc Node<'gc>>,
5502        extends: NodeList<'gc>,
5503        body: &'gc Node<'gc>,
5504    ) -> Self {
5505        InterfaceDeclaration {
5506            metadata,
5507            id,
5508            type_parameters,
5509            extends,
5510            body,
5511        }
5512    }
5513}
5514
5515/// The `DeclareTypeAlias` AST node.
5516#[derive(Debug)]
5517#[repr(C)]
5518pub struct DeclareTypeAlias<'gc> {
5519    /// Source range, debug location, paren count, and node id.
5520    pub metadata: NodeMetadata<'gc>,
5521    /// ESTree `id` property.
5522    pub id: &'gc Node<'gc>,
5523    /// ESTree `typeParameters` property.
5524    pub type_parameters: Option<&'gc Node<'gc>>,
5525    /// ESTree `right` property.
5526    pub right: &'gc Node<'gc>,
5527}
5528impl<'gc> DeclareTypeAlias<'gc> {
5529    /// Build `DeclareTypeAlias` from its metadata and `ESTree.def` fields.
5530    pub fn new(
5531        metadata: NodeMetadata<'gc>,
5532        id: &'gc Node<'gc>,
5533        type_parameters: Option<&'gc Node<'gc>>,
5534        right: &'gc Node<'gc>,
5535    ) -> Self {
5536        DeclareTypeAlias {
5537            metadata,
5538            id,
5539            type_parameters,
5540            right,
5541        }
5542    }
5543}
5544
5545/// The `DeclareOpaqueType` AST node.
5546#[derive(Debug)]
5547#[repr(C)]
5548pub struct DeclareOpaqueType<'gc> {
5549    /// Source range, debug location, paren count, and node id.
5550    pub metadata: NodeMetadata<'gc>,
5551    /// ESTree `id` property.
5552    pub id: &'gc Node<'gc>,
5553    /// ESTree `typeParameters` property.
5554    pub type_parameters: Option<&'gc Node<'gc>>,
5555    /// ESTree `impltype` property.
5556    pub impltype: Option<&'gc Node<'gc>>,
5557    /// ESTree `lowerBound` property.
5558    pub lower_bound: Option<&'gc Node<'gc>>,
5559    /// ESTree `upperBound` property.
5560    pub upper_bound: Option<&'gc Node<'gc>>,
5561    /// ESTree `supertype` property.
5562    pub supertype: Option<&'gc Node<'gc>>,
5563}
5564impl<'gc> DeclareOpaqueType<'gc> {
5565    /// Build `DeclareOpaqueType` from its metadata and `ESTree.def` fields.
5566    pub fn new(
5567        metadata: NodeMetadata<'gc>,
5568        id: &'gc Node<'gc>,
5569        type_parameters: Option<&'gc Node<'gc>>,
5570        impltype: Option<&'gc Node<'gc>>,
5571        lower_bound: Option<&'gc Node<'gc>>,
5572        upper_bound: Option<&'gc Node<'gc>>,
5573        supertype: Option<&'gc Node<'gc>>,
5574    ) -> Self {
5575        DeclareOpaqueType {
5576            metadata,
5577            id,
5578            type_parameters,
5579            impltype,
5580            lower_bound,
5581            upper_bound,
5582            supertype,
5583        }
5584    }
5585}
5586
5587/// The `DeclareInterface` AST node.
5588#[derive(Debug)]
5589#[repr(C)]
5590pub struct DeclareInterface<'gc> {
5591    /// Source range, debug location, paren count, and node id.
5592    pub metadata: NodeMetadata<'gc>,
5593    /// ESTree `id` property.
5594    pub id: &'gc Node<'gc>,
5595    /// ESTree `typeParameters` property.
5596    pub type_parameters: Option<&'gc Node<'gc>>,
5597    /// ESTree `extends` property.
5598    pub extends: NodeList<'gc>,
5599    /// ESTree `body` property.
5600    pub body: &'gc Node<'gc>,
5601}
5602impl<'gc> DeclareInterface<'gc> {
5603    /// Build `DeclareInterface` from its metadata and `ESTree.def` fields.
5604    pub fn new(
5605        metadata: NodeMetadata<'gc>,
5606        id: &'gc Node<'gc>,
5607        type_parameters: Option<&'gc Node<'gc>>,
5608        extends: NodeList<'gc>,
5609        body: &'gc Node<'gc>,
5610    ) -> Self {
5611        DeclareInterface {
5612            metadata,
5613            id,
5614            type_parameters,
5615            extends,
5616            body,
5617        }
5618    }
5619}
5620
5621/// The `DeclareClass` AST node.
5622#[derive(Debug)]
5623#[repr(C)]
5624pub struct DeclareClass<'gc> {
5625    /// Source range, debug location, paren count, and node id.
5626    pub metadata: NodeMetadata<'gc>,
5627    /// ESTree `id` property.
5628    pub id: &'gc Node<'gc>,
5629    /// ESTree `typeParameters` property.
5630    pub type_parameters: Option<&'gc Node<'gc>>,
5631    /// ESTree `extends` property.
5632    pub extends: NodeList<'gc>,
5633    /// ESTree `implements` property.
5634    pub implements: NodeList<'gc>,
5635    /// ESTree `mixins` property.
5636    pub mixins: NodeList<'gc>,
5637    /// ESTree `body` property.
5638    pub body: &'gc Node<'gc>,
5639}
5640impl<'gc> DeclareClass<'gc> {
5641    /// Build `DeclareClass` from its metadata and `ESTree.def` fields.
5642    pub fn new(
5643        metadata: NodeMetadata<'gc>,
5644        id: &'gc Node<'gc>,
5645        type_parameters: Option<&'gc Node<'gc>>,
5646        extends: NodeList<'gc>,
5647        implements: NodeList<'gc>,
5648        mixins: NodeList<'gc>,
5649        body: &'gc Node<'gc>,
5650    ) -> Self {
5651        DeclareClass {
5652            metadata,
5653            id,
5654            type_parameters,
5655            extends,
5656            implements,
5657            mixins,
5658            body,
5659        }
5660    }
5661}
5662
5663/// The `DeclareFunction` AST node.
5664#[derive(Debug)]
5665#[repr(C)]
5666pub struct DeclareFunction<'gc> {
5667    /// Source range, debug location, paren count, and node id.
5668    pub metadata: NodeMetadata<'gc>,
5669    /// ESTree `id` property.
5670    pub id: &'gc Node<'gc>,
5671    /// ESTree `predicate` property.
5672    pub predicate: Option<&'gc Node<'gc>>,
5673}
5674impl<'gc> DeclareFunction<'gc> {
5675    /// Build `DeclareFunction` from its metadata and `ESTree.def` fields.
5676    pub fn new(
5677        metadata: NodeMetadata<'gc>,
5678        id: &'gc Node<'gc>,
5679        predicate: Option<&'gc Node<'gc>>,
5680    ) -> Self {
5681        DeclareFunction {
5682            metadata,
5683            id,
5684            predicate,
5685        }
5686    }
5687}
5688
5689/// The `DeclareHook` AST node.
5690#[derive(Debug)]
5691#[repr(C)]
5692pub struct DeclareHook<'gc> {
5693    /// Source range, debug location, paren count, and node id.
5694    pub metadata: NodeMetadata<'gc>,
5695    /// ESTree `id` property.
5696    pub id: &'gc Node<'gc>,
5697}
5698impl<'gc> DeclareHook<'gc> {
5699    /// Build `DeclareHook` from its metadata and `ESTree.def` fields.
5700    pub fn new(
5701        metadata: NodeMetadata<'gc>,
5702        id: &'gc Node<'gc>,
5703    ) -> Self {
5704        DeclareHook {
5705            metadata,
5706            id,
5707        }
5708    }
5709}
5710
5711/// The `DeclareComponent` AST node.
5712#[derive(Debug)]
5713#[repr(C)]
5714pub struct DeclareComponent<'gc> {
5715    /// Source range, debug location, paren count, and node id.
5716    pub metadata: NodeMetadata<'gc>,
5717    /// ESTree `id` property.
5718    pub id: &'gc Node<'gc>,
5719    /// ESTree `params` property.
5720    pub params: NodeList<'gc>,
5721    /// ESTree `rest` property.
5722    pub rest: Option<&'gc Node<'gc>>,
5723    /// ESTree `typeParameters` property.
5724    pub type_parameters: Option<&'gc Node<'gc>>,
5725    /// ESTree `rendersType` property.
5726    pub renders_type: Option<&'gc Node<'gc>>,
5727}
5728impl<'gc> DeclareComponent<'gc> {
5729    /// Build `DeclareComponent` from its metadata and `ESTree.def` fields.
5730    pub fn new(
5731        metadata: NodeMetadata<'gc>,
5732        id: &'gc Node<'gc>,
5733        params: NodeList<'gc>,
5734        rest: Option<&'gc Node<'gc>>,
5735        type_parameters: Option<&'gc Node<'gc>>,
5736        renders_type: Option<&'gc Node<'gc>>,
5737    ) -> Self {
5738        DeclareComponent {
5739            metadata,
5740            id,
5741            params,
5742            rest,
5743            type_parameters,
5744            renders_type,
5745        }
5746    }
5747}
5748
5749/// The `DeclareVariable` AST node.
5750#[derive(Debug)]
5751#[repr(C)]
5752pub struct DeclareVariable<'gc> {
5753    /// Source range, debug location, paren count, and node id.
5754    pub metadata: NodeMetadata<'gc>,
5755    /// ESTree `id` property.
5756    pub id: &'gc Node<'gc>,
5757    /// ESTree `kind` property.
5758    pub kind: Cell<NodeLabel>,
5759}
5760impl<'gc> DeclareVariable<'gc> {
5761    /// Build `DeclareVariable` from its metadata and `ESTree.def` fields.
5762    pub fn new(
5763        metadata: NodeMetadata<'gc>,
5764        id: &'gc Node<'gc>,
5765        kind: NodeLabel,
5766    ) -> Self {
5767        DeclareVariable {
5768            metadata,
5769            id,
5770            kind: Cell::new(kind),
5771        }
5772    }
5773}
5774
5775/// The `DeclareEnum` AST node.
5776#[derive(Debug)]
5777#[repr(C)]
5778pub struct DeclareEnum<'gc> {
5779    /// Source range, debug location, paren count, and node id.
5780    pub metadata: NodeMetadata<'gc>,
5781    /// ESTree `id` property.
5782    pub id: &'gc Node<'gc>,
5783    /// ESTree `body` property.
5784    pub body: &'gc Node<'gc>,
5785}
5786impl<'gc> DeclareEnum<'gc> {
5787    /// Build `DeclareEnum` from its metadata and `ESTree.def` fields.
5788    pub fn new(
5789        metadata: NodeMetadata<'gc>,
5790        id: &'gc Node<'gc>,
5791        body: &'gc Node<'gc>,
5792    ) -> Self {
5793        DeclareEnum {
5794            metadata,
5795            id,
5796            body,
5797        }
5798    }
5799}
5800
5801/// The `DeclareExportDeclaration` AST node.
5802#[derive(Debug)]
5803#[repr(C)]
5804pub struct DeclareExportDeclaration<'gc> {
5805    /// Source range, debug location, paren count, and node id.
5806    pub metadata: NodeMetadata<'gc>,
5807    /// ESTree `declaration` property.
5808    pub declaration: Option<&'gc Node<'gc>>,
5809    /// ESTree `specifiers` property.
5810    pub specifiers: NodeList<'gc>,
5811    /// ESTree `source` property.
5812    pub source: Option<&'gc Node<'gc>>,
5813    /// ESTree `default` property.
5814    pub default: Cell<bool>,
5815}
5816impl<'gc> DeclareExportDeclaration<'gc> {
5817    /// Build `DeclareExportDeclaration` from its metadata and `ESTree.def`
5818    /// fields.
5819    pub fn new(
5820        metadata: NodeMetadata<'gc>,
5821        declaration: Option<&'gc Node<'gc>>,
5822        specifiers: NodeList<'gc>,
5823        source: Option<&'gc Node<'gc>>,
5824        default: bool,
5825    ) -> Self {
5826        DeclareExportDeclaration {
5827            metadata,
5828            declaration,
5829            specifiers,
5830            source,
5831            default: Cell::new(default),
5832        }
5833    }
5834}
5835
5836/// The `DeclareExportAllDeclaration` AST node.
5837#[derive(Debug)]
5838#[repr(C)]
5839pub struct DeclareExportAllDeclaration<'gc> {
5840    /// Source range, debug location, paren count, and node id.
5841    pub metadata: NodeMetadata<'gc>,
5842    /// ESTree `source` property.
5843    pub source: &'gc Node<'gc>,
5844}
5845impl<'gc> DeclareExportAllDeclaration<'gc> {
5846    /// Build `DeclareExportAllDeclaration` from its metadata and `ESTree.def`
5847    /// fields.
5848    pub fn new(
5849        metadata: NodeMetadata<'gc>,
5850        source: &'gc Node<'gc>,
5851    ) -> Self {
5852        DeclareExportAllDeclaration {
5853            metadata,
5854            source,
5855        }
5856    }
5857}
5858
5859/// The `DeclareModule` AST node.
5860#[derive(Debug)]
5861#[repr(C)]
5862pub struct DeclareModule<'gc> {
5863    /// Source range, debug location, paren count, and node id.
5864    pub metadata: NodeMetadata<'gc>,
5865    /// ESTree `id` property.
5866    pub id: &'gc Node<'gc>,
5867    /// ESTree `body` property.
5868    pub body: &'gc Node<'gc>,
5869}
5870impl<'gc> DeclareModule<'gc> {
5871    /// Build `DeclareModule` from its metadata and `ESTree.def` fields.
5872    pub fn new(
5873        metadata: NodeMetadata<'gc>,
5874        id: &'gc Node<'gc>,
5875        body: &'gc Node<'gc>,
5876    ) -> Self {
5877        DeclareModule {
5878            metadata,
5879            id,
5880            body,
5881        }
5882    }
5883}
5884
5885/// The `DeclareNamespace` AST node.
5886#[derive(Debug)]
5887#[repr(C)]
5888pub struct DeclareNamespace<'gc> {
5889    /// Source range, debug location, paren count, and node id.
5890    pub metadata: NodeMetadata<'gc>,
5891    /// ESTree `id` property.
5892    pub id: &'gc Node<'gc>,
5893    /// ESTree `body` property.
5894    pub body: &'gc Node<'gc>,
5895}
5896impl<'gc> DeclareNamespace<'gc> {
5897    /// Build `DeclareNamespace` from its metadata and `ESTree.def` fields.
5898    pub fn new(
5899        metadata: NodeMetadata<'gc>,
5900        id: &'gc Node<'gc>,
5901        body: &'gc Node<'gc>,
5902    ) -> Self {
5903        DeclareNamespace {
5904            metadata,
5905            id,
5906            body,
5907        }
5908    }
5909}
5910
5911/// The `DeclareModuleExports` AST node.
5912#[derive(Debug)]
5913#[repr(C)]
5914pub struct DeclareModuleExports<'gc> {
5915    /// Source range, debug location, paren count, and node id.
5916    pub metadata: NodeMetadata<'gc>,
5917    /// ESTree `typeAnnotation` property.
5918    pub type_annotation: &'gc Node<'gc>,
5919}
5920impl<'gc> DeclareModuleExports<'gc> {
5921    /// Build `DeclareModuleExports` from its metadata and `ESTree.def` fields.
5922    pub fn new(
5923        metadata: NodeMetadata<'gc>,
5924        type_annotation: &'gc Node<'gc>,
5925    ) -> Self {
5926        DeclareModuleExports {
5927            metadata,
5928            type_annotation,
5929        }
5930    }
5931}
5932
5933/// The `InterfaceExtends` AST node.
5934#[derive(Debug)]
5935#[repr(C)]
5936pub struct InterfaceExtends<'gc> {
5937    /// Source range, debug location, paren count, and node id.
5938    pub metadata: NodeMetadata<'gc>,
5939    /// ESTree `id` property.
5940    pub id: &'gc Node<'gc>,
5941    /// ESTree `typeParameters` property.
5942    pub type_parameters: Option<&'gc Node<'gc>>,
5943}
5944impl<'gc> InterfaceExtends<'gc> {
5945    /// Build `InterfaceExtends` from its metadata and `ESTree.def` fields.
5946    pub fn new(
5947        metadata: NodeMetadata<'gc>,
5948        id: &'gc Node<'gc>,
5949        type_parameters: Option<&'gc Node<'gc>>,
5950    ) -> Self {
5951        InterfaceExtends {
5952            metadata,
5953            id,
5954            type_parameters,
5955        }
5956    }
5957}
5958
5959/// The `ClassImplements` AST node.
5960#[derive(Debug)]
5961#[repr(C)]
5962pub struct ClassImplements<'gc> {
5963    /// Source range, debug location, paren count, and node id.
5964    pub metadata: NodeMetadata<'gc>,
5965    /// ESTree `id` property.
5966    pub id: &'gc Node<'gc>,
5967    /// ESTree `typeParameters` property.
5968    pub type_parameters: Option<&'gc Node<'gc>>,
5969}
5970impl<'gc> ClassImplements<'gc> {
5971    /// Build `ClassImplements` from its metadata and `ESTree.def` fields.
5972    pub fn new(
5973        metadata: NodeMetadata<'gc>,
5974        id: &'gc Node<'gc>,
5975        type_parameters: Option<&'gc Node<'gc>>,
5976    ) -> Self {
5977        ClassImplements {
5978            metadata,
5979            id,
5980            type_parameters,
5981        }
5982    }
5983}
5984
5985/// The `TypeAnnotation` AST node.
5986#[derive(Debug)]
5987#[repr(C)]
5988pub struct TypeAnnotation<'gc> {
5989    /// Source range, debug location, paren count, and node id.
5990    pub metadata: NodeMetadata<'gc>,
5991    /// ESTree `typeAnnotation` property.
5992    pub type_annotation: &'gc Node<'gc>,
5993}
5994impl<'gc> TypeAnnotation<'gc> {
5995    /// Build `TypeAnnotation` from its metadata and `ESTree.def` fields.
5996    pub fn new(
5997        metadata: NodeMetadata<'gc>,
5998        type_annotation: &'gc Node<'gc>,
5999    ) -> Self {
6000        TypeAnnotation {
6001            metadata,
6002            type_annotation,
6003        }
6004    }
6005}
6006
6007/// The `ObjectTypeAnnotation` AST node.
6008#[derive(Debug)]
6009#[repr(C)]
6010pub struct ObjectTypeAnnotation<'gc> {
6011    /// Source range, debug location, paren count, and node id.
6012    pub metadata: NodeMetadata<'gc>,
6013    /// ESTree `properties` property.
6014    pub properties: NodeList<'gc>,
6015    /// ESTree `indexers` property.
6016    pub indexers: NodeList<'gc>,
6017    /// ESTree `callProperties` property.
6018    pub call_properties: NodeList<'gc>,
6019    /// ESTree `internalSlots` property.
6020    pub internal_slots: NodeList<'gc>,
6021    /// ESTree `inexact` property.
6022    pub inexact: Cell<bool>,
6023    /// ESTree `exact` property.
6024    pub exact: Cell<bool>,
6025}
6026impl<'gc> ObjectTypeAnnotation<'gc> {
6027    /// Build `ObjectTypeAnnotation` from its metadata and `ESTree.def` fields.
6028    pub fn new(
6029        metadata: NodeMetadata<'gc>,
6030        properties: NodeList<'gc>,
6031        indexers: NodeList<'gc>,
6032        call_properties: NodeList<'gc>,
6033        internal_slots: NodeList<'gc>,
6034        inexact: bool,
6035        exact: bool,
6036    ) -> Self {
6037        ObjectTypeAnnotation {
6038            metadata,
6039            properties,
6040            indexers,
6041            call_properties,
6042            internal_slots,
6043            inexact: Cell::new(inexact),
6044            exact: Cell::new(exact),
6045        }
6046    }
6047}
6048
6049/// The `ObjectTypeProperty` AST node.
6050#[derive(Debug)]
6051#[repr(C)]
6052pub struct ObjectTypeProperty<'gc> {
6053    /// Source range, debug location, paren count, and node id.
6054    pub metadata: NodeMetadata<'gc>,
6055    /// ESTree `key` property.
6056    pub key: &'gc Node<'gc>,
6057    /// ESTree `value` property.
6058    pub value: &'gc Node<'gc>,
6059    /// ESTree `method` property.
6060    pub method: Cell<bool>,
6061    /// ESTree `optional` property.
6062    pub optional: Cell<bool>,
6063    /// ESTree `static` property.
6064    pub r#static: Cell<bool>,
6065    /// ESTree `proto` property.
6066    pub proto: Cell<bool>,
6067    /// ESTree `variance` property.
6068    pub variance: Option<&'gc Node<'gc>>,
6069    /// ESTree `kind` property.
6070    pub kind: Cell<NodeLabel>,
6071}
6072impl<'gc> ObjectTypeProperty<'gc> {
6073    /// Build `ObjectTypeProperty` from its metadata and `ESTree.def` fields.
6074    pub fn new(
6075        metadata: NodeMetadata<'gc>,
6076        key: &'gc Node<'gc>,
6077        value: &'gc Node<'gc>,
6078        method: bool,
6079        optional: bool,
6080        r#static: bool,
6081        proto: bool,
6082        variance: Option<&'gc Node<'gc>>,
6083        kind: NodeLabel,
6084    ) -> Self {
6085        ObjectTypeProperty {
6086            metadata,
6087            key,
6088            value,
6089            method: Cell::new(method),
6090            optional: Cell::new(optional),
6091            r#static: Cell::new(r#static),
6092            proto: Cell::new(proto),
6093            variance,
6094            kind: Cell::new(kind),
6095        }
6096    }
6097}
6098
6099/// The `ObjectTypeSpreadProperty` AST node.
6100#[derive(Debug)]
6101#[repr(C)]
6102pub struct ObjectTypeSpreadProperty<'gc> {
6103    /// Source range, debug location, paren count, and node id.
6104    pub metadata: NodeMetadata<'gc>,
6105    /// ESTree `argument` property.
6106    pub argument: &'gc Node<'gc>,
6107}
6108impl<'gc> ObjectTypeSpreadProperty<'gc> {
6109    /// Build `ObjectTypeSpreadProperty` from its metadata and `ESTree.def`
6110    /// fields.
6111    pub fn new(
6112        metadata: NodeMetadata<'gc>,
6113        argument: &'gc Node<'gc>,
6114    ) -> Self {
6115        ObjectTypeSpreadProperty {
6116            metadata,
6117            argument,
6118        }
6119    }
6120}
6121
6122/// The `ObjectTypeInternalSlot` AST node.
6123#[derive(Debug)]
6124#[repr(C)]
6125pub struct ObjectTypeInternalSlot<'gc> {
6126    /// Source range, debug location, paren count, and node id.
6127    pub metadata: NodeMetadata<'gc>,
6128    /// ESTree `id` property.
6129    pub id: &'gc Node<'gc>,
6130    /// ESTree `value` property.
6131    pub value: &'gc Node<'gc>,
6132    /// ESTree `optional` property.
6133    pub optional: Cell<bool>,
6134    /// ESTree `static` property.
6135    pub r#static: Cell<bool>,
6136    /// ESTree `method` property.
6137    pub method: Cell<bool>,
6138}
6139impl<'gc> ObjectTypeInternalSlot<'gc> {
6140    /// Build `ObjectTypeInternalSlot` from its metadata and `ESTree.def`
6141    /// fields.
6142    pub fn new(
6143        metadata: NodeMetadata<'gc>,
6144        id: &'gc Node<'gc>,
6145        value: &'gc Node<'gc>,
6146        optional: bool,
6147        r#static: bool,
6148        method: bool,
6149    ) -> Self {
6150        ObjectTypeInternalSlot {
6151            metadata,
6152            id,
6153            value,
6154            optional: Cell::new(optional),
6155            r#static: Cell::new(r#static),
6156            method: Cell::new(method),
6157        }
6158    }
6159}
6160
6161/// The `ObjectTypeCallProperty` AST node.
6162#[derive(Debug)]
6163#[repr(C)]
6164pub struct ObjectTypeCallProperty<'gc> {
6165    /// Source range, debug location, paren count, and node id.
6166    pub metadata: NodeMetadata<'gc>,
6167    /// ESTree `value` property.
6168    pub value: &'gc Node<'gc>,
6169    /// ESTree `static` property.
6170    pub r#static: Cell<bool>,
6171}
6172impl<'gc> ObjectTypeCallProperty<'gc> {
6173    /// Build `ObjectTypeCallProperty` from its metadata and `ESTree.def`
6174    /// fields.
6175    pub fn new(
6176        metadata: NodeMetadata<'gc>,
6177        value: &'gc Node<'gc>,
6178        r#static: bool,
6179    ) -> Self {
6180        ObjectTypeCallProperty {
6181            metadata,
6182            value,
6183            r#static: Cell::new(r#static),
6184        }
6185    }
6186}
6187
6188/// The `ObjectTypeIndexer` AST node.
6189#[derive(Debug)]
6190#[repr(C)]
6191pub struct ObjectTypeIndexer<'gc> {
6192    /// Source range, debug location, paren count, and node id.
6193    pub metadata: NodeMetadata<'gc>,
6194    /// ESTree `id` property.
6195    pub id: Option<&'gc Node<'gc>>,
6196    /// ESTree `key` property.
6197    pub key: &'gc Node<'gc>,
6198    /// ESTree `value` property.
6199    pub value: &'gc Node<'gc>,
6200    /// ESTree `static` property.
6201    pub r#static: Cell<bool>,
6202    /// ESTree `variance` property.
6203    pub variance: Option<&'gc Node<'gc>>,
6204}
6205impl<'gc> ObjectTypeIndexer<'gc> {
6206    /// Build `ObjectTypeIndexer` from its metadata and `ESTree.def` fields.
6207    pub fn new(
6208        metadata: NodeMetadata<'gc>,
6209        id: Option<&'gc Node<'gc>>,
6210        key: &'gc Node<'gc>,
6211        value: &'gc Node<'gc>,
6212        r#static: bool,
6213        variance: Option<&'gc Node<'gc>>,
6214    ) -> Self {
6215        ObjectTypeIndexer {
6216            metadata,
6217            id,
6218            key,
6219            value,
6220            r#static: Cell::new(r#static),
6221            variance,
6222        }
6223    }
6224}
6225
6226/// The `ObjectTypeMappedTypeProperty` AST node.
6227#[derive(Debug)]
6228#[repr(C)]
6229pub struct ObjectTypeMappedTypeProperty<'gc> {
6230    /// Source range, debug location, paren count, and node id.
6231    pub metadata: NodeMetadata<'gc>,
6232    /// ESTree `keyTparam` property.
6233    pub key_tparam: &'gc Node<'gc>,
6234    /// ESTree `propType` property.
6235    pub prop_type: &'gc Node<'gc>,
6236    /// ESTree `sourceType` property.
6237    pub source_type: &'gc Node<'gc>,
6238    /// ESTree `variance` property.
6239    pub variance: Option<&'gc Node<'gc>>,
6240    /// ESTree `optional` property.
6241    pub optional: Cell<NodeString>,
6242}
6243impl<'gc> ObjectTypeMappedTypeProperty<'gc> {
6244    /// Build `ObjectTypeMappedTypeProperty` from its metadata and `ESTree.def`
6245    /// fields.
6246    pub fn new(
6247        metadata: NodeMetadata<'gc>,
6248        key_tparam: &'gc Node<'gc>,
6249        prop_type: &'gc Node<'gc>,
6250        source_type: &'gc Node<'gc>,
6251        variance: Option<&'gc Node<'gc>>,
6252        optional: NodeString,
6253    ) -> Self {
6254        ObjectTypeMappedTypeProperty {
6255            metadata,
6256            key_tparam,
6257            prop_type,
6258            source_type,
6259            variance,
6260            optional: Cell::new(optional),
6261        }
6262    }
6263}
6264
6265/// The `Variance` AST node.
6266#[derive(Debug)]
6267#[repr(C)]
6268pub struct Variance<'gc> {
6269    /// Source range, debug location, paren count, and node id.
6270    pub metadata: NodeMetadata<'gc>,
6271    /// ESTree `kind` property.
6272    pub kind: Cell<NodeLabel>,
6273}
6274impl<'gc> Variance<'gc> {
6275    /// Build `Variance` from its metadata and `ESTree.def` fields.
6276    pub fn new(
6277        metadata: NodeMetadata<'gc>,
6278        kind: NodeLabel,
6279    ) -> Self {
6280        Variance {
6281            metadata,
6282            kind: Cell::new(kind),
6283        }
6284    }
6285}
6286
6287/// The `TypeParameterDeclaration` AST node.
6288#[derive(Debug)]
6289#[repr(C)]
6290pub struct TypeParameterDeclaration<'gc> {
6291    /// Source range, debug location, paren count, and node id.
6292    pub metadata: NodeMetadata<'gc>,
6293    /// ESTree `params` property.
6294    pub params: NodeList<'gc>,
6295}
6296impl<'gc> TypeParameterDeclaration<'gc> {
6297    /// Build `TypeParameterDeclaration` from its metadata and `ESTree.def`
6298    /// fields.
6299    pub fn new(
6300        metadata: NodeMetadata<'gc>,
6301        params: NodeList<'gc>,
6302    ) -> Self {
6303        TypeParameterDeclaration {
6304            metadata,
6305            params,
6306        }
6307    }
6308}
6309
6310/// The `TypeParameter` AST node.
6311#[derive(Debug)]
6312#[repr(C)]
6313pub struct TypeParameter<'gc> {
6314    /// Source range, debug location, paren count, and node id.
6315    pub metadata: NodeMetadata<'gc>,
6316    /// ESTree `name` property.
6317    pub name: Cell<NodeLabel>,
6318    /// ESTree `const` property.
6319    pub r#const: Cell<bool>,
6320    /// ESTree `bound` property.
6321    pub bound: Option<&'gc Node<'gc>>,
6322    /// ESTree `variance` property.
6323    pub variance: Option<&'gc Node<'gc>>,
6324    /// ESTree `default` property.
6325    pub default: Option<&'gc Node<'gc>>,
6326    /// ESTree `usesExtendsBound` property.
6327    pub uses_extends_bound: Cell<bool>,
6328}
6329impl<'gc> TypeParameter<'gc> {
6330    /// Build `TypeParameter` from its metadata and `ESTree.def` fields.
6331    pub fn new(
6332        metadata: NodeMetadata<'gc>,
6333        name: NodeLabel,
6334        r#const: bool,
6335        bound: Option<&'gc Node<'gc>>,
6336        variance: Option<&'gc Node<'gc>>,
6337        default: Option<&'gc Node<'gc>>,
6338        uses_extends_bound: bool,
6339    ) -> Self {
6340        TypeParameter {
6341            metadata,
6342            name: Cell::new(name),
6343            r#const: Cell::new(r#const),
6344            bound,
6345            variance,
6346            default,
6347            uses_extends_bound: Cell::new(uses_extends_bound),
6348        }
6349    }
6350}
6351
6352/// The `TypeParameterInstantiation` AST node.
6353#[derive(Debug)]
6354#[repr(C)]
6355pub struct TypeParameterInstantiation<'gc> {
6356    /// Source range, debug location, paren count, and node id.
6357    pub metadata: NodeMetadata<'gc>,
6358    /// ESTree `params` property.
6359    pub params: NodeList<'gc>,
6360}
6361impl<'gc> TypeParameterInstantiation<'gc> {
6362    /// Build `TypeParameterInstantiation` from its metadata and `ESTree.def`
6363    /// fields.
6364    pub fn new(
6365        metadata: NodeMetadata<'gc>,
6366        params: NodeList<'gc>,
6367    ) -> Self {
6368        TypeParameterInstantiation {
6369            metadata,
6370            params,
6371        }
6372    }
6373}
6374
6375/// The `TypeCastExpression` AST node.
6376#[derive(Debug)]
6377#[repr(C)]
6378pub struct TypeCastExpression<'gc> {
6379    /// Source range, debug location, paren count, and node id.
6380    pub metadata: NodeMetadata<'gc>,
6381    /// ESTree `expression` property.
6382    pub expression: &'gc Node<'gc>,
6383    /// ESTree `typeAnnotation` property.
6384    pub type_annotation: &'gc Node<'gc>,
6385}
6386impl<'gc> TypeCastExpression<'gc> {
6387    /// Build `TypeCastExpression` from its metadata and `ESTree.def` fields.
6388    pub fn new(
6389        metadata: NodeMetadata<'gc>,
6390        expression: &'gc Node<'gc>,
6391        type_annotation: &'gc Node<'gc>,
6392    ) -> Self {
6393        TypeCastExpression {
6394            metadata,
6395            expression,
6396            type_annotation,
6397        }
6398    }
6399}
6400
6401/// The `AsExpression` AST node.
6402#[derive(Debug)]
6403#[repr(C)]
6404pub struct AsExpression<'gc> {
6405    /// Source range, debug location, paren count, and node id.
6406    pub metadata: NodeMetadata<'gc>,
6407    /// ESTree `expression` property.
6408    pub expression: &'gc Node<'gc>,
6409    /// ESTree `typeAnnotation` property.
6410    pub type_annotation: &'gc Node<'gc>,
6411}
6412impl<'gc> AsExpression<'gc> {
6413    /// Build `AsExpression` from its metadata and `ESTree.def` fields.
6414    pub fn new(
6415        metadata: NodeMetadata<'gc>,
6416        expression: &'gc Node<'gc>,
6417        type_annotation: &'gc Node<'gc>,
6418    ) -> Self {
6419        AsExpression {
6420            metadata,
6421            expression,
6422            type_annotation,
6423        }
6424    }
6425}
6426
6427/// The `AsConstExpression` AST node.
6428#[derive(Debug)]
6429#[repr(C)]
6430pub struct AsConstExpression<'gc> {
6431    /// Source range, debug location, paren count, and node id.
6432    pub metadata: NodeMetadata<'gc>,
6433    /// ESTree `expression` property.
6434    pub expression: &'gc Node<'gc>,
6435}
6436impl<'gc> AsConstExpression<'gc> {
6437    /// Build `AsConstExpression` from its metadata and `ESTree.def` fields.
6438    pub fn new(
6439        metadata: NodeMetadata<'gc>,
6440        expression: &'gc Node<'gc>,
6441    ) -> Self {
6442        AsConstExpression {
6443            metadata,
6444            expression,
6445        }
6446    }
6447}
6448
6449/// The `InferredPredicate` AST node.
6450#[derive(Debug)]
6451#[repr(C)]
6452pub struct InferredPredicate<'gc> {
6453    /// Source range, debug location, paren count, and node id.
6454    pub metadata: NodeMetadata<'gc>,
6455}
6456impl<'gc> InferredPredicate<'gc> {
6457    /// Build `InferredPredicate` from its metadata and `ESTree.def` fields.
6458    pub fn new(
6459        metadata: NodeMetadata<'gc>,
6460    ) -> Self {
6461        InferredPredicate {
6462            metadata,
6463        }
6464    }
6465}
6466
6467/// The `DeclaredPredicate` AST node.
6468#[derive(Debug)]
6469#[repr(C)]
6470pub struct DeclaredPredicate<'gc> {
6471    /// Source range, debug location, paren count, and node id.
6472    pub metadata: NodeMetadata<'gc>,
6473    /// ESTree `value` property.
6474    pub value: &'gc Node<'gc>,
6475}
6476impl<'gc> DeclaredPredicate<'gc> {
6477    /// Build `DeclaredPredicate` from its metadata and `ESTree.def` fields.
6478    pub fn new(
6479        metadata: NodeMetadata<'gc>,
6480        value: &'gc Node<'gc>,
6481    ) -> Self {
6482        DeclaredPredicate {
6483            metadata,
6484            value,
6485        }
6486    }
6487}
6488
6489/// The `EnumDeclaration` AST node.
6490#[derive(Debug)]
6491#[repr(C)]
6492pub struct EnumDeclaration<'gc> {
6493    /// Source range, debug location, paren count, and node id.
6494    pub metadata: NodeMetadata<'gc>,
6495    /// ESTree `id` property.
6496    pub id: &'gc Node<'gc>,
6497    /// ESTree `body` property.
6498    pub body: &'gc Node<'gc>,
6499}
6500impl<'gc> EnumDeclaration<'gc> {
6501    /// Build `EnumDeclaration` from its metadata and `ESTree.def` fields.
6502    pub fn new(
6503        metadata: NodeMetadata<'gc>,
6504        id: &'gc Node<'gc>,
6505        body: &'gc Node<'gc>,
6506    ) -> Self {
6507        EnumDeclaration {
6508            metadata,
6509            id,
6510            body,
6511        }
6512    }
6513}
6514
6515/// The `EnumStringBody` AST node.
6516#[derive(Debug)]
6517#[repr(C)]
6518pub struct EnumStringBody<'gc> {
6519    /// Source range, debug location, paren count, and node id.
6520    pub metadata: NodeMetadata<'gc>,
6521    /// ESTree `members` property.
6522    pub members: NodeList<'gc>,
6523    /// ESTree `explicitType` property.
6524    pub explicit_type: Cell<bool>,
6525    /// ESTree `hasUnknownMembers` property.
6526    pub has_unknown_members: Cell<bool>,
6527}
6528impl<'gc> EnumStringBody<'gc> {
6529    /// Build `EnumStringBody` from its metadata and `ESTree.def` fields.
6530    pub fn new(
6531        metadata: NodeMetadata<'gc>,
6532        members: NodeList<'gc>,
6533        explicit_type: bool,
6534        has_unknown_members: bool,
6535    ) -> Self {
6536        EnumStringBody {
6537            metadata,
6538            members,
6539            explicit_type: Cell::new(explicit_type),
6540            has_unknown_members: Cell::new(has_unknown_members),
6541        }
6542    }
6543}
6544
6545/// The `EnumNumberBody` AST node.
6546#[derive(Debug)]
6547#[repr(C)]
6548pub struct EnumNumberBody<'gc> {
6549    /// Source range, debug location, paren count, and node id.
6550    pub metadata: NodeMetadata<'gc>,
6551    /// ESTree `members` property.
6552    pub members: NodeList<'gc>,
6553    /// ESTree `explicitType` property.
6554    pub explicit_type: Cell<bool>,
6555    /// ESTree `hasUnknownMembers` property.
6556    pub has_unknown_members: Cell<bool>,
6557}
6558impl<'gc> EnumNumberBody<'gc> {
6559    /// Build `EnumNumberBody` from its metadata and `ESTree.def` fields.
6560    pub fn new(
6561        metadata: NodeMetadata<'gc>,
6562        members: NodeList<'gc>,
6563        explicit_type: bool,
6564        has_unknown_members: bool,
6565    ) -> Self {
6566        EnumNumberBody {
6567            metadata,
6568            members,
6569            explicit_type: Cell::new(explicit_type),
6570            has_unknown_members: Cell::new(has_unknown_members),
6571        }
6572    }
6573}
6574
6575/// The `EnumBigIntBody` AST node.
6576#[derive(Debug)]
6577#[repr(C)]
6578pub struct EnumBigIntBody<'gc> {
6579    /// Source range, debug location, paren count, and node id.
6580    pub metadata: NodeMetadata<'gc>,
6581    /// ESTree `members` property.
6582    pub members: NodeList<'gc>,
6583    /// ESTree `explicitType` property.
6584    pub explicit_type: Cell<bool>,
6585    /// ESTree `hasUnknownMembers` property.
6586    pub has_unknown_members: Cell<bool>,
6587}
6588impl<'gc> EnumBigIntBody<'gc> {
6589    /// Build `EnumBigIntBody` from its metadata and `ESTree.def` fields.
6590    pub fn new(
6591        metadata: NodeMetadata<'gc>,
6592        members: NodeList<'gc>,
6593        explicit_type: bool,
6594        has_unknown_members: bool,
6595    ) -> Self {
6596        EnumBigIntBody {
6597            metadata,
6598            members,
6599            explicit_type: Cell::new(explicit_type),
6600            has_unknown_members: Cell::new(has_unknown_members),
6601        }
6602    }
6603}
6604
6605/// The `EnumBooleanBody` AST node.
6606#[derive(Debug)]
6607#[repr(C)]
6608pub struct EnumBooleanBody<'gc> {
6609    /// Source range, debug location, paren count, and node id.
6610    pub metadata: NodeMetadata<'gc>,
6611    /// ESTree `members` property.
6612    pub members: NodeList<'gc>,
6613    /// ESTree `explicitType` property.
6614    pub explicit_type: Cell<bool>,
6615    /// ESTree `hasUnknownMembers` property.
6616    pub has_unknown_members: Cell<bool>,
6617}
6618impl<'gc> EnumBooleanBody<'gc> {
6619    /// Build `EnumBooleanBody` from its metadata and `ESTree.def` fields.
6620    pub fn new(
6621        metadata: NodeMetadata<'gc>,
6622        members: NodeList<'gc>,
6623        explicit_type: bool,
6624        has_unknown_members: bool,
6625    ) -> Self {
6626        EnumBooleanBody {
6627            metadata,
6628            members,
6629            explicit_type: Cell::new(explicit_type),
6630            has_unknown_members: Cell::new(has_unknown_members),
6631        }
6632    }
6633}
6634
6635/// The `EnumSymbolBody` AST node.
6636#[derive(Debug)]
6637#[repr(C)]
6638pub struct EnumSymbolBody<'gc> {
6639    /// Source range, debug location, paren count, and node id.
6640    pub metadata: NodeMetadata<'gc>,
6641    /// ESTree `members` property.
6642    pub members: NodeList<'gc>,
6643    /// ESTree `hasUnknownMembers` property.
6644    pub has_unknown_members: Cell<bool>,
6645}
6646impl<'gc> EnumSymbolBody<'gc> {
6647    /// Build `EnumSymbolBody` from its metadata and `ESTree.def` fields.
6648    pub fn new(
6649        metadata: NodeMetadata<'gc>,
6650        members: NodeList<'gc>,
6651        has_unknown_members: bool,
6652    ) -> Self {
6653        EnumSymbolBody {
6654            metadata,
6655            members,
6656            has_unknown_members: Cell::new(has_unknown_members),
6657        }
6658    }
6659}
6660
6661/// The `EnumDefaultedMember` AST node.
6662#[derive(Debug)]
6663#[repr(C)]
6664pub struct EnumDefaultedMember<'gc> {
6665    /// Source range, debug location, paren count, and node id.
6666    pub metadata: NodeMetadata<'gc>,
6667    /// ESTree `id` property.
6668    pub id: &'gc Node<'gc>,
6669}
6670impl<'gc> EnumDefaultedMember<'gc> {
6671    /// Build `EnumDefaultedMember` from its metadata and `ESTree.def` fields.
6672    pub fn new(
6673        metadata: NodeMetadata<'gc>,
6674        id: &'gc Node<'gc>,
6675    ) -> Self {
6676        EnumDefaultedMember {
6677            metadata,
6678            id,
6679        }
6680    }
6681}
6682
6683/// The `EnumStringMember` AST node.
6684#[derive(Debug)]
6685#[repr(C)]
6686pub struct EnumStringMember<'gc> {
6687    /// Source range, debug location, paren count, and node id.
6688    pub metadata: NodeMetadata<'gc>,
6689    /// ESTree `id` property.
6690    pub id: &'gc Node<'gc>,
6691    /// ESTree `init` property.
6692    pub init: &'gc Node<'gc>,
6693}
6694impl<'gc> EnumStringMember<'gc> {
6695    /// Build `EnumStringMember` from its metadata and `ESTree.def` fields.
6696    pub fn new(
6697        metadata: NodeMetadata<'gc>,
6698        id: &'gc Node<'gc>,
6699        init: &'gc Node<'gc>,
6700    ) -> Self {
6701        EnumStringMember {
6702            metadata,
6703            id,
6704            init,
6705        }
6706    }
6707}
6708
6709/// The `EnumNumberMember` AST node.
6710#[derive(Debug)]
6711#[repr(C)]
6712pub struct EnumNumberMember<'gc> {
6713    /// Source range, debug location, paren count, and node id.
6714    pub metadata: NodeMetadata<'gc>,
6715    /// ESTree `id` property.
6716    pub id: &'gc Node<'gc>,
6717    /// ESTree `init` property.
6718    pub init: &'gc Node<'gc>,
6719}
6720impl<'gc> EnumNumberMember<'gc> {
6721    /// Build `EnumNumberMember` from its metadata and `ESTree.def` fields.
6722    pub fn new(
6723        metadata: NodeMetadata<'gc>,
6724        id: &'gc Node<'gc>,
6725        init: &'gc Node<'gc>,
6726    ) -> Self {
6727        EnumNumberMember {
6728            metadata,
6729            id,
6730            init,
6731        }
6732    }
6733}
6734
6735/// The `EnumBigIntMember` AST node.
6736#[derive(Debug)]
6737#[repr(C)]
6738pub struct EnumBigIntMember<'gc> {
6739    /// Source range, debug location, paren count, and node id.
6740    pub metadata: NodeMetadata<'gc>,
6741    /// ESTree `id` property.
6742    pub id: &'gc Node<'gc>,
6743    /// ESTree `init` property.
6744    pub init: &'gc Node<'gc>,
6745}
6746impl<'gc> EnumBigIntMember<'gc> {
6747    /// Build `EnumBigIntMember` from its metadata and `ESTree.def` fields.
6748    pub fn new(
6749        metadata: NodeMetadata<'gc>,
6750        id: &'gc Node<'gc>,
6751        init: &'gc Node<'gc>,
6752    ) -> Self {
6753        EnumBigIntMember {
6754            metadata,
6755            id,
6756            init,
6757        }
6758    }
6759}
6760
6761/// The `EnumBooleanMember` AST node.
6762#[derive(Debug)]
6763#[repr(C)]
6764pub struct EnumBooleanMember<'gc> {
6765    /// Source range, debug location, paren count, and node id.
6766    pub metadata: NodeMetadata<'gc>,
6767    /// ESTree `id` property.
6768    pub id: &'gc Node<'gc>,
6769    /// ESTree `init` property.
6770    pub init: &'gc Node<'gc>,
6771}
6772impl<'gc> EnumBooleanMember<'gc> {
6773    /// Build `EnumBooleanMember` from its metadata and `ESTree.def` fields.
6774    pub fn new(
6775        metadata: NodeMetadata<'gc>,
6776        id: &'gc Node<'gc>,
6777        init: &'gc Node<'gc>,
6778    ) -> Self {
6779        EnumBooleanMember {
6780            metadata,
6781            id,
6782            init,
6783        }
6784    }
6785}
6786
6787/// The `ComponentParameter` AST node.
6788#[derive(Debug)]
6789#[repr(C)]
6790pub struct ComponentParameter<'gc> {
6791    /// Source range, debug location, paren count, and node id.
6792    pub metadata: NodeMetadata<'gc>,
6793    /// ESTree `name` property.
6794    pub name: &'gc Node<'gc>,
6795    /// ESTree `local` property.
6796    pub local: &'gc Node<'gc>,
6797    /// ESTree `shorthand` property.
6798    pub shorthand: Cell<bool>,
6799}
6800impl<'gc> ComponentParameter<'gc> {
6801    /// Build `ComponentParameter` from its metadata and `ESTree.def` fields.
6802    pub fn new(
6803        metadata: NodeMetadata<'gc>,
6804        name: &'gc Node<'gc>,
6805        local: &'gc Node<'gc>,
6806        shorthand: bool,
6807    ) -> Self {
6808        ComponentParameter {
6809            metadata,
6810            name,
6811            local,
6812            shorthand: Cell::new(shorthand),
6813        }
6814    }
6815}
6816
6817/// The `RecordDeclaration` AST node.
6818#[derive(Debug)]
6819#[repr(C)]
6820pub struct RecordDeclaration<'gc> {
6821    /// Source range, debug location, paren count, and node id.
6822    pub metadata: NodeMetadata<'gc>,
6823    /// ESTree `id` property.
6824    pub id: &'gc Node<'gc>,
6825    /// ESTree `typeParameters` property.
6826    pub type_parameters: Option<&'gc Node<'gc>>,
6827    /// ESTree `implements` property.
6828    pub implements: NodeList<'gc>,
6829    /// ESTree `body` property.
6830    pub body: &'gc Node<'gc>,
6831}
6832impl<'gc> RecordDeclaration<'gc> {
6833    /// Build `RecordDeclaration` from its metadata and `ESTree.def` fields.
6834    pub fn new(
6835        metadata: NodeMetadata<'gc>,
6836        id: &'gc Node<'gc>,
6837        type_parameters: Option<&'gc Node<'gc>>,
6838        implements: NodeList<'gc>,
6839        body: &'gc Node<'gc>,
6840    ) -> Self {
6841        RecordDeclaration {
6842            metadata,
6843            id,
6844            type_parameters,
6845            implements,
6846            body,
6847        }
6848    }
6849}
6850
6851/// The `RecordDeclarationImplements` AST node.
6852#[derive(Debug)]
6853#[repr(C)]
6854pub struct RecordDeclarationImplements<'gc> {
6855    /// Source range, debug location, paren count, and node id.
6856    pub metadata: NodeMetadata<'gc>,
6857    /// ESTree `id` property.
6858    pub id: &'gc Node<'gc>,
6859    /// ESTree `typeArguments` property.
6860    pub type_arguments: Option<&'gc Node<'gc>>,
6861}
6862impl<'gc> RecordDeclarationImplements<'gc> {
6863    /// Build `RecordDeclarationImplements` from its metadata and `ESTree.def`
6864    /// fields.
6865    pub fn new(
6866        metadata: NodeMetadata<'gc>,
6867        id: &'gc Node<'gc>,
6868        type_arguments: Option<&'gc Node<'gc>>,
6869    ) -> Self {
6870        RecordDeclarationImplements {
6871            metadata,
6872            id,
6873            type_arguments,
6874        }
6875    }
6876}
6877
6878/// The `RecordDeclarationBody` AST node.
6879#[derive(Debug)]
6880#[repr(C)]
6881pub struct RecordDeclarationBody<'gc> {
6882    /// Source range, debug location, paren count, and node id.
6883    pub metadata: NodeMetadata<'gc>,
6884    /// ESTree `elements` property.
6885    pub elements: NodeList<'gc>,
6886}
6887impl<'gc> RecordDeclarationBody<'gc> {
6888    /// Build `RecordDeclarationBody` from its metadata and `ESTree.def` fields.
6889    pub fn new(
6890        metadata: NodeMetadata<'gc>,
6891        elements: NodeList<'gc>,
6892    ) -> Self {
6893        RecordDeclarationBody {
6894            metadata,
6895            elements,
6896        }
6897    }
6898}
6899
6900/// The `RecordDeclarationProperty` AST node.
6901#[derive(Debug)]
6902#[repr(C)]
6903pub struct RecordDeclarationProperty<'gc> {
6904    /// Source range, debug location, paren count, and node id.
6905    pub metadata: NodeMetadata<'gc>,
6906    /// ESTree `key` property.
6907    pub key: &'gc Node<'gc>,
6908    /// ESTree `typeAnnotation` property.
6909    pub type_annotation: &'gc Node<'gc>,
6910    /// ESTree `defaultValue` property.
6911    pub default_value: Option<&'gc Node<'gc>>,
6912}
6913impl<'gc> RecordDeclarationProperty<'gc> {
6914    /// Build `RecordDeclarationProperty` from its metadata and `ESTree.def`
6915    /// fields.
6916    pub fn new(
6917        metadata: NodeMetadata<'gc>,
6918        key: &'gc Node<'gc>,
6919        type_annotation: &'gc Node<'gc>,
6920        default_value: Option<&'gc Node<'gc>>,
6921    ) -> Self {
6922        RecordDeclarationProperty {
6923            metadata,
6924            key,
6925            type_annotation,
6926            default_value,
6927        }
6928    }
6929}
6930
6931/// The `RecordDeclarationStaticProperty` AST node.
6932#[derive(Debug)]
6933#[repr(C)]
6934pub struct RecordDeclarationStaticProperty<'gc> {
6935    /// Source range, debug location, paren count, and node id.
6936    pub metadata: NodeMetadata<'gc>,
6937    /// ESTree `key` property.
6938    pub key: &'gc Node<'gc>,
6939    /// ESTree `typeAnnotation` property.
6940    pub type_annotation: &'gc Node<'gc>,
6941    /// ESTree `value` property.
6942    pub value: &'gc Node<'gc>,
6943}
6944impl<'gc> RecordDeclarationStaticProperty<'gc> {
6945    /// Build `RecordDeclarationStaticProperty` from its metadata and
6946    /// `ESTree.def` fields.
6947    pub fn new(
6948        metadata: NodeMetadata<'gc>,
6949        key: &'gc Node<'gc>,
6950        type_annotation: &'gc Node<'gc>,
6951        value: &'gc Node<'gc>,
6952    ) -> Self {
6953        RecordDeclarationStaticProperty {
6954            metadata,
6955            key,
6956            type_annotation,
6957            value,
6958        }
6959    }
6960}
6961
6962/// The `RecordExpression` AST node.
6963#[derive(Debug)]
6964#[repr(C)]
6965pub struct RecordExpression<'gc> {
6966    /// Source range, debug location, paren count, and node id.
6967    pub metadata: NodeMetadata<'gc>,
6968    /// ESTree `recordConstructor` property.
6969    pub record_constructor: &'gc Node<'gc>,
6970    /// ESTree `typeArguments` property.
6971    pub type_arguments: Option<&'gc Node<'gc>>,
6972    /// ESTree `properties` property.
6973    pub properties: &'gc Node<'gc>,
6974}
6975impl<'gc> RecordExpression<'gc> {
6976    /// Build `RecordExpression` from its metadata and `ESTree.def` fields.
6977    pub fn new(
6978        metadata: NodeMetadata<'gc>,
6979        record_constructor: &'gc Node<'gc>,
6980        type_arguments: Option<&'gc Node<'gc>>,
6981        properties: &'gc Node<'gc>,
6982    ) -> Self {
6983        RecordExpression {
6984            metadata,
6985            record_constructor,
6986            type_arguments,
6987            properties,
6988        }
6989    }
6990}
6991
6992/// The `RecordExpressionProperties` AST node.
6993#[derive(Debug)]
6994#[repr(C)]
6995pub struct RecordExpressionProperties<'gc> {
6996    /// Source range, debug location, paren count, and node id.
6997    pub metadata: NodeMetadata<'gc>,
6998    /// ESTree `properties` property.
6999    pub properties: NodeList<'gc>,
7000}
7001impl<'gc> RecordExpressionProperties<'gc> {
7002    /// Build `RecordExpressionProperties` from its metadata and `ESTree.def`
7003    /// fields.
7004    pub fn new(
7005        metadata: NodeMetadata<'gc>,
7006        properties: NodeList<'gc>,
7007    ) -> Self {
7008        RecordExpressionProperties {
7009            metadata,
7010            properties,
7011        }
7012    }
7013}
7014
7015/// The `TSTypeAnnotation` AST node.
7016#[derive(Debug)]
7017#[repr(C)]
7018pub struct TSTypeAnnotation<'gc> {
7019    /// Source range, debug location, paren count, and node id.
7020    pub metadata: NodeMetadata<'gc>,
7021    /// ESTree `typeAnnotation` property.
7022    pub type_annotation: &'gc Node<'gc>,
7023}
7024impl<'gc> TSTypeAnnotation<'gc> {
7025    /// Build `TSTypeAnnotation` from its metadata and `ESTree.def` fields.
7026    pub fn new(
7027        metadata: NodeMetadata<'gc>,
7028        type_annotation: &'gc Node<'gc>,
7029    ) -> Self {
7030        TSTypeAnnotation {
7031            metadata,
7032            type_annotation,
7033        }
7034    }
7035}
7036
7037/// The `TSAnyKeyword` AST node.
7038#[derive(Debug)]
7039#[repr(C)]
7040pub struct TSAnyKeyword<'gc> {
7041    /// Source range, debug location, paren count, and node id.
7042    pub metadata: NodeMetadata<'gc>,
7043}
7044impl<'gc> TSAnyKeyword<'gc> {
7045    /// Build `TSAnyKeyword` from its metadata and `ESTree.def` fields.
7046    pub fn new(
7047        metadata: NodeMetadata<'gc>,
7048    ) -> Self {
7049        TSAnyKeyword {
7050            metadata,
7051        }
7052    }
7053}
7054
7055/// The `TSNumberKeyword` AST node.
7056#[derive(Debug)]
7057#[repr(C)]
7058pub struct TSNumberKeyword<'gc> {
7059    /// Source range, debug location, paren count, and node id.
7060    pub metadata: NodeMetadata<'gc>,
7061}
7062impl<'gc> TSNumberKeyword<'gc> {
7063    /// Build `TSNumberKeyword` from its metadata and `ESTree.def` fields.
7064    pub fn new(
7065        metadata: NodeMetadata<'gc>,
7066    ) -> Self {
7067        TSNumberKeyword {
7068            metadata,
7069        }
7070    }
7071}
7072
7073/// The `TSBooleanKeyword` AST node.
7074#[derive(Debug)]
7075#[repr(C)]
7076pub struct TSBooleanKeyword<'gc> {
7077    /// Source range, debug location, paren count, and node id.
7078    pub metadata: NodeMetadata<'gc>,
7079}
7080impl<'gc> TSBooleanKeyword<'gc> {
7081    /// Build `TSBooleanKeyword` from its metadata and `ESTree.def` fields.
7082    pub fn new(
7083        metadata: NodeMetadata<'gc>,
7084    ) -> Self {
7085        TSBooleanKeyword {
7086            metadata,
7087        }
7088    }
7089}
7090
7091/// The `TSStringKeyword` AST node.
7092#[derive(Debug)]
7093#[repr(C)]
7094pub struct TSStringKeyword<'gc> {
7095    /// Source range, debug location, paren count, and node id.
7096    pub metadata: NodeMetadata<'gc>,
7097}
7098impl<'gc> TSStringKeyword<'gc> {
7099    /// Build `TSStringKeyword` from its metadata and `ESTree.def` fields.
7100    pub fn new(
7101        metadata: NodeMetadata<'gc>,
7102    ) -> Self {
7103        TSStringKeyword {
7104            metadata,
7105        }
7106    }
7107}
7108
7109/// The `TSSymbolKeyword` AST node.
7110#[derive(Debug)]
7111#[repr(C)]
7112pub struct TSSymbolKeyword<'gc> {
7113    /// Source range, debug location, paren count, and node id.
7114    pub metadata: NodeMetadata<'gc>,
7115}
7116impl<'gc> TSSymbolKeyword<'gc> {
7117    /// Build `TSSymbolKeyword` from its metadata and `ESTree.def` fields.
7118    pub fn new(
7119        metadata: NodeMetadata<'gc>,
7120    ) -> Self {
7121        TSSymbolKeyword {
7122            metadata,
7123        }
7124    }
7125}
7126
7127/// The `TSVoidKeyword` AST node.
7128#[derive(Debug)]
7129#[repr(C)]
7130pub struct TSVoidKeyword<'gc> {
7131    /// Source range, debug location, paren count, and node id.
7132    pub metadata: NodeMetadata<'gc>,
7133}
7134impl<'gc> TSVoidKeyword<'gc> {
7135    /// Build `TSVoidKeyword` from its metadata and `ESTree.def` fields.
7136    pub fn new(
7137        metadata: NodeMetadata<'gc>,
7138    ) -> Self {
7139        TSVoidKeyword {
7140            metadata,
7141        }
7142    }
7143}
7144
7145/// The `TSUndefinedKeyword` AST node.
7146#[derive(Debug)]
7147#[repr(C)]
7148pub struct TSUndefinedKeyword<'gc> {
7149    /// Source range, debug location, paren count, and node id.
7150    pub metadata: NodeMetadata<'gc>,
7151}
7152impl<'gc> TSUndefinedKeyword<'gc> {
7153    /// Build `TSUndefinedKeyword` from its metadata and `ESTree.def` fields.
7154    pub fn new(
7155        metadata: NodeMetadata<'gc>,
7156    ) -> Self {
7157        TSUndefinedKeyword {
7158            metadata,
7159        }
7160    }
7161}
7162
7163/// The `TSUnknownKeyword` AST node.
7164#[derive(Debug)]
7165#[repr(C)]
7166pub struct TSUnknownKeyword<'gc> {
7167    /// Source range, debug location, paren count, and node id.
7168    pub metadata: NodeMetadata<'gc>,
7169}
7170impl<'gc> TSUnknownKeyword<'gc> {
7171    /// Build `TSUnknownKeyword` from its metadata and `ESTree.def` fields.
7172    pub fn new(
7173        metadata: NodeMetadata<'gc>,
7174    ) -> Self {
7175        TSUnknownKeyword {
7176            metadata,
7177        }
7178    }
7179}
7180
7181/// The `TSNeverKeyword` AST node.
7182#[derive(Debug)]
7183#[repr(C)]
7184pub struct TSNeverKeyword<'gc> {
7185    /// Source range, debug location, paren count, and node id.
7186    pub metadata: NodeMetadata<'gc>,
7187}
7188impl<'gc> TSNeverKeyword<'gc> {
7189    /// Build `TSNeverKeyword` from its metadata and `ESTree.def` fields.
7190    pub fn new(
7191        metadata: NodeMetadata<'gc>,
7192    ) -> Self {
7193        TSNeverKeyword {
7194            metadata,
7195        }
7196    }
7197}
7198
7199/// The `TSBigIntKeyword` AST node.
7200#[derive(Debug)]
7201#[repr(C)]
7202pub struct TSBigIntKeyword<'gc> {
7203    /// Source range, debug location, paren count, and node id.
7204    pub metadata: NodeMetadata<'gc>,
7205}
7206impl<'gc> TSBigIntKeyword<'gc> {
7207    /// Build `TSBigIntKeyword` from its metadata and `ESTree.def` fields.
7208    pub fn new(
7209        metadata: NodeMetadata<'gc>,
7210    ) -> Self {
7211        TSBigIntKeyword {
7212            metadata,
7213        }
7214    }
7215}
7216
7217/// The `TSThisType` AST node.
7218#[derive(Debug)]
7219#[repr(C)]
7220pub struct TSThisType<'gc> {
7221    /// Source range, debug location, paren count, and node id.
7222    pub metadata: NodeMetadata<'gc>,
7223}
7224impl<'gc> TSThisType<'gc> {
7225    /// Build `TSThisType` from its metadata and `ESTree.def` fields.
7226    pub fn new(
7227        metadata: NodeMetadata<'gc>,
7228    ) -> Self {
7229        TSThisType {
7230            metadata,
7231        }
7232    }
7233}
7234
7235/// The `TSLiteralType` AST node.
7236#[derive(Debug)]
7237#[repr(C)]
7238pub struct TSLiteralType<'gc> {
7239    /// Source range, debug location, paren count, and node id.
7240    pub metadata: NodeMetadata<'gc>,
7241    /// ESTree `literal` property.
7242    pub literal: &'gc Node<'gc>,
7243}
7244impl<'gc> TSLiteralType<'gc> {
7245    /// Build `TSLiteralType` from its metadata and `ESTree.def` fields.
7246    pub fn new(
7247        metadata: NodeMetadata<'gc>,
7248        literal: &'gc Node<'gc>,
7249    ) -> Self {
7250        TSLiteralType {
7251            metadata,
7252            literal,
7253        }
7254    }
7255}
7256
7257/// The `TSIndexedAccessType` AST node.
7258#[derive(Debug)]
7259#[repr(C)]
7260pub struct TSIndexedAccessType<'gc> {
7261    /// Source range, debug location, paren count, and node id.
7262    pub metadata: NodeMetadata<'gc>,
7263    /// ESTree `objectType` property.
7264    pub object_type: &'gc Node<'gc>,
7265    /// ESTree `indexType` property.
7266    pub index_type: &'gc Node<'gc>,
7267}
7268impl<'gc> TSIndexedAccessType<'gc> {
7269    /// Build `TSIndexedAccessType` from its metadata and `ESTree.def` fields.
7270    pub fn new(
7271        metadata: NodeMetadata<'gc>,
7272        object_type: &'gc Node<'gc>,
7273        index_type: &'gc Node<'gc>,
7274    ) -> Self {
7275        TSIndexedAccessType {
7276            metadata,
7277            object_type,
7278            index_type,
7279        }
7280    }
7281}
7282
7283/// The `TSArrayType` AST node.
7284#[derive(Debug)]
7285#[repr(C)]
7286pub struct TSArrayType<'gc> {
7287    /// Source range, debug location, paren count, and node id.
7288    pub metadata: NodeMetadata<'gc>,
7289    /// ESTree `elementType` property.
7290    pub element_type: &'gc Node<'gc>,
7291}
7292impl<'gc> TSArrayType<'gc> {
7293    /// Build `TSArrayType` from its metadata and `ESTree.def` fields.
7294    pub fn new(
7295        metadata: NodeMetadata<'gc>,
7296        element_type: &'gc Node<'gc>,
7297    ) -> Self {
7298        TSArrayType {
7299            metadata,
7300            element_type,
7301        }
7302    }
7303}
7304
7305/// The `TSTypeReference` AST node.
7306#[derive(Debug)]
7307#[repr(C)]
7308pub struct TSTypeReference<'gc> {
7309    /// Source range, debug location, paren count, and node id.
7310    pub metadata: NodeMetadata<'gc>,
7311    /// ESTree `typeName` property.
7312    pub type_name: &'gc Node<'gc>,
7313    /// ESTree `typeParameters` property.
7314    pub type_parameters: Option<&'gc Node<'gc>>,
7315}
7316impl<'gc> TSTypeReference<'gc> {
7317    /// Build `TSTypeReference` from its metadata and `ESTree.def` fields.
7318    pub fn new(
7319        metadata: NodeMetadata<'gc>,
7320        type_name: &'gc Node<'gc>,
7321        type_parameters: Option<&'gc Node<'gc>>,
7322    ) -> Self {
7323        TSTypeReference {
7324            metadata,
7325            type_name,
7326            type_parameters,
7327        }
7328    }
7329}
7330
7331/// The `TSQualifiedName` AST node.
7332#[derive(Debug)]
7333#[repr(C)]
7334pub struct TSQualifiedName<'gc> {
7335    /// Source range, debug location, paren count, and node id.
7336    pub metadata: NodeMetadata<'gc>,
7337    /// ESTree `left` property.
7338    pub left: &'gc Node<'gc>,
7339    /// ESTree `right` property.
7340    pub right: Option<&'gc Node<'gc>>,
7341}
7342impl<'gc> TSQualifiedName<'gc> {
7343    /// Build `TSQualifiedName` from its metadata and `ESTree.def` fields.
7344    pub fn new(
7345        metadata: NodeMetadata<'gc>,
7346        left: &'gc Node<'gc>,
7347        right: Option<&'gc Node<'gc>>,
7348    ) -> Self {
7349        TSQualifiedName {
7350            metadata,
7351            left,
7352            right,
7353        }
7354    }
7355}
7356
7357/// The `TSFunctionType` AST node.
7358#[derive(Debug)]
7359#[repr(C)]
7360pub struct TSFunctionType<'gc> {
7361    /// Source range, debug location, paren count, and node id.
7362    pub metadata: NodeMetadata<'gc>,
7363    /// ESTree `params` property.
7364    pub params: NodeList<'gc>,
7365    /// ESTree `returnType` property.
7366    pub return_type: &'gc Node<'gc>,
7367    /// ESTree `typeParameters` property.
7368    pub type_parameters: Option<&'gc Node<'gc>>,
7369}
7370impl<'gc> TSFunctionType<'gc> {
7371    /// Build `TSFunctionType` from its metadata and `ESTree.def` fields.
7372    pub fn new(
7373        metadata: NodeMetadata<'gc>,
7374        params: NodeList<'gc>,
7375        return_type: &'gc Node<'gc>,
7376        type_parameters: Option<&'gc Node<'gc>>,
7377    ) -> Self {
7378        TSFunctionType {
7379            metadata,
7380            params,
7381            return_type,
7382            type_parameters,
7383        }
7384    }
7385}
7386
7387/// The `TSConstructorType` AST node.
7388#[derive(Debug)]
7389#[repr(C)]
7390pub struct TSConstructorType<'gc> {
7391    /// Source range, debug location, paren count, and node id.
7392    pub metadata: NodeMetadata<'gc>,
7393    /// ESTree `params` property.
7394    pub params: NodeList<'gc>,
7395    /// ESTree `returnType` property.
7396    pub return_type: &'gc Node<'gc>,
7397    /// ESTree `typeParameters` property.
7398    pub type_parameters: Option<&'gc Node<'gc>>,
7399}
7400impl<'gc> TSConstructorType<'gc> {
7401    /// Build `TSConstructorType` from its metadata and `ESTree.def` fields.
7402    pub fn new(
7403        metadata: NodeMetadata<'gc>,
7404        params: NodeList<'gc>,
7405        return_type: &'gc Node<'gc>,
7406        type_parameters: Option<&'gc Node<'gc>>,
7407    ) -> Self {
7408        TSConstructorType {
7409            metadata,
7410            params,
7411            return_type,
7412            type_parameters,
7413        }
7414    }
7415}
7416
7417/// The `TSTypePredicate` AST node.
7418#[derive(Debug)]
7419#[repr(C)]
7420pub struct TSTypePredicate<'gc> {
7421    /// Source range, debug location, paren count, and node id.
7422    pub metadata: NodeMetadata<'gc>,
7423    /// ESTree `parameterName` property.
7424    pub parameter_name: &'gc Node<'gc>,
7425    /// ESTree `typeAnnotation` property.
7426    pub type_annotation: &'gc Node<'gc>,
7427}
7428impl<'gc> TSTypePredicate<'gc> {
7429    /// Build `TSTypePredicate` from its metadata and `ESTree.def` fields.
7430    pub fn new(
7431        metadata: NodeMetadata<'gc>,
7432        parameter_name: &'gc Node<'gc>,
7433        type_annotation: &'gc Node<'gc>,
7434    ) -> Self {
7435        TSTypePredicate {
7436            metadata,
7437            parameter_name,
7438            type_annotation,
7439        }
7440    }
7441}
7442
7443/// The `TSTupleType` AST node.
7444#[derive(Debug)]
7445#[repr(C)]
7446pub struct TSTupleType<'gc> {
7447    /// Source range, debug location, paren count, and node id.
7448    pub metadata: NodeMetadata<'gc>,
7449    /// ESTree `elementTypes` property.
7450    pub element_types: NodeList<'gc>,
7451}
7452impl<'gc> TSTupleType<'gc> {
7453    /// Build `TSTupleType` from its metadata and `ESTree.def` fields.
7454    pub fn new(
7455        metadata: NodeMetadata<'gc>,
7456        element_types: NodeList<'gc>,
7457    ) -> Self {
7458        TSTupleType {
7459            metadata,
7460            element_types,
7461        }
7462    }
7463}
7464
7465/// The `TSTypeAssertion` AST node.
7466#[derive(Debug)]
7467#[repr(C)]
7468pub struct TSTypeAssertion<'gc> {
7469    /// Source range, debug location, paren count, and node id.
7470    pub metadata: NodeMetadata<'gc>,
7471    /// ESTree `typeAnnotation` property.
7472    pub type_annotation: &'gc Node<'gc>,
7473    /// ESTree `expression` property.
7474    pub expression: &'gc Node<'gc>,
7475}
7476impl<'gc> TSTypeAssertion<'gc> {
7477    /// Build `TSTypeAssertion` from its metadata and `ESTree.def` fields.
7478    pub fn new(
7479        metadata: NodeMetadata<'gc>,
7480        type_annotation: &'gc Node<'gc>,
7481        expression: &'gc Node<'gc>,
7482    ) -> Self {
7483        TSTypeAssertion {
7484            metadata,
7485            type_annotation,
7486            expression,
7487        }
7488    }
7489}
7490
7491/// The `TSAsExpression` AST node.
7492#[derive(Debug)]
7493#[repr(C)]
7494pub struct TSAsExpression<'gc> {
7495    /// Source range, debug location, paren count, and node id.
7496    pub metadata: NodeMetadata<'gc>,
7497    /// ESTree `expression` property.
7498    pub expression: &'gc Node<'gc>,
7499    /// ESTree `typeAnnotation` property.
7500    pub type_annotation: &'gc Node<'gc>,
7501}
7502impl<'gc> TSAsExpression<'gc> {
7503    /// Build `TSAsExpression` from its metadata and `ESTree.def` fields.
7504    pub fn new(
7505        metadata: NodeMetadata<'gc>,
7506        expression: &'gc Node<'gc>,
7507        type_annotation: &'gc Node<'gc>,
7508    ) -> Self {
7509        TSAsExpression {
7510            metadata,
7511            expression,
7512            type_annotation,
7513        }
7514    }
7515}
7516
7517/// The `TSParameterProperty` AST node.
7518#[derive(Debug)]
7519#[repr(C)]
7520pub struct TSParameterProperty<'gc> {
7521    /// Source range, debug location, paren count, and node id.
7522    pub metadata: NodeMetadata<'gc>,
7523    /// ESTree `parameter` property.
7524    pub parameter: &'gc Node<'gc>,
7525    /// ESTree `accessibility` property.
7526    pub accessibility: Cell<NodeLabel>,
7527    /// ESTree `readonly` property.
7528    pub readonly: Cell<bool>,
7529    /// ESTree `static` property.
7530    pub r#static: Cell<bool>,
7531    /// ESTree `export` property.
7532    pub export: Cell<bool>,
7533}
7534impl<'gc> TSParameterProperty<'gc> {
7535    /// Build `TSParameterProperty` from its metadata and `ESTree.def` fields.
7536    pub fn new(
7537        metadata: NodeMetadata<'gc>,
7538        parameter: &'gc Node<'gc>,
7539        accessibility: NodeLabel,
7540        readonly: bool,
7541        r#static: bool,
7542        export: bool,
7543    ) -> Self {
7544        TSParameterProperty {
7545            metadata,
7546            parameter,
7547            accessibility: Cell::new(accessibility),
7548            readonly: Cell::new(readonly),
7549            r#static: Cell::new(r#static),
7550            export: Cell::new(export),
7551        }
7552    }
7553}
7554
7555/// The `TSTypeAliasDeclaration` AST node.
7556#[derive(Debug)]
7557#[repr(C)]
7558pub struct TSTypeAliasDeclaration<'gc> {
7559    /// Source range, debug location, paren count, and node id.
7560    pub metadata: NodeMetadata<'gc>,
7561    /// ESTree `id` property.
7562    pub id: &'gc Node<'gc>,
7563    /// ESTree `typeParameters` property.
7564    pub type_parameters: Option<&'gc Node<'gc>>,
7565    /// ESTree `typeAnnotation` property.
7566    pub type_annotation: &'gc Node<'gc>,
7567}
7568impl<'gc> TSTypeAliasDeclaration<'gc> {
7569    /// Build `TSTypeAliasDeclaration` from its metadata and `ESTree.def`
7570    /// fields.
7571    pub fn new(
7572        metadata: NodeMetadata<'gc>,
7573        id: &'gc Node<'gc>,
7574        type_parameters: Option<&'gc Node<'gc>>,
7575        type_annotation: &'gc Node<'gc>,
7576    ) -> Self {
7577        TSTypeAliasDeclaration {
7578            metadata,
7579            id,
7580            type_parameters,
7581            type_annotation,
7582        }
7583    }
7584}
7585
7586/// The `TSInterfaceDeclaration` AST node.
7587#[derive(Debug)]
7588#[repr(C)]
7589pub struct TSInterfaceDeclaration<'gc> {
7590    /// Source range, debug location, paren count, and node id.
7591    pub metadata: NodeMetadata<'gc>,
7592    /// ESTree `id` property.
7593    pub id: &'gc Node<'gc>,
7594    /// ESTree `body` property.
7595    pub body: &'gc Node<'gc>,
7596    /// ESTree `extends` property.
7597    pub extends: NodeList<'gc>,
7598    /// ESTree `typeParameters` property.
7599    pub type_parameters: Option<&'gc Node<'gc>>,
7600}
7601impl<'gc> TSInterfaceDeclaration<'gc> {
7602    /// Build `TSInterfaceDeclaration` from its metadata and `ESTree.def`
7603    /// fields.
7604    pub fn new(
7605        metadata: NodeMetadata<'gc>,
7606        id: &'gc Node<'gc>,
7607        body: &'gc Node<'gc>,
7608        extends: NodeList<'gc>,
7609        type_parameters: Option<&'gc Node<'gc>>,
7610    ) -> Self {
7611        TSInterfaceDeclaration {
7612            metadata,
7613            id,
7614            body,
7615            extends,
7616            type_parameters,
7617        }
7618    }
7619}
7620
7621/// The `TSInterfaceHeritage` AST node.
7622#[derive(Debug)]
7623#[repr(C)]
7624pub struct TSInterfaceHeritage<'gc> {
7625    /// Source range, debug location, paren count, and node id.
7626    pub metadata: NodeMetadata<'gc>,
7627    /// ESTree `expression` property.
7628    pub expression: &'gc Node<'gc>,
7629    /// ESTree `typeParameters` property.
7630    pub type_parameters: Option<&'gc Node<'gc>>,
7631}
7632impl<'gc> TSInterfaceHeritage<'gc> {
7633    /// Build `TSInterfaceHeritage` from its metadata and `ESTree.def` fields.
7634    pub fn new(
7635        metadata: NodeMetadata<'gc>,
7636        expression: &'gc Node<'gc>,
7637        type_parameters: Option<&'gc Node<'gc>>,
7638    ) -> Self {
7639        TSInterfaceHeritage {
7640            metadata,
7641            expression,
7642            type_parameters,
7643        }
7644    }
7645}
7646
7647/// The `TSInterfaceBody` AST node.
7648#[derive(Debug)]
7649#[repr(C)]
7650pub struct TSInterfaceBody<'gc> {
7651    /// Source range, debug location, paren count, and node id.
7652    pub metadata: NodeMetadata<'gc>,
7653    /// ESTree `body` property.
7654    pub body: NodeList<'gc>,
7655}
7656impl<'gc> TSInterfaceBody<'gc> {
7657    /// Build `TSInterfaceBody` from its metadata and `ESTree.def` fields.
7658    pub fn new(
7659        metadata: NodeMetadata<'gc>,
7660        body: NodeList<'gc>,
7661    ) -> Self {
7662        TSInterfaceBody {
7663            metadata,
7664            body,
7665        }
7666    }
7667}
7668
7669/// The `TSEnumDeclaration` AST node.
7670#[derive(Debug)]
7671#[repr(C)]
7672pub struct TSEnumDeclaration<'gc> {
7673    /// Source range, debug location, paren count, and node id.
7674    pub metadata: NodeMetadata<'gc>,
7675    /// ESTree `id` property.
7676    pub id: &'gc Node<'gc>,
7677    /// ESTree `members` property.
7678    pub members: NodeList<'gc>,
7679}
7680impl<'gc> TSEnumDeclaration<'gc> {
7681    /// Build `TSEnumDeclaration` from its metadata and `ESTree.def` fields.
7682    pub fn new(
7683        metadata: NodeMetadata<'gc>,
7684        id: &'gc Node<'gc>,
7685        members: NodeList<'gc>,
7686    ) -> Self {
7687        TSEnumDeclaration {
7688            metadata,
7689            id,
7690            members,
7691        }
7692    }
7693}
7694
7695/// The `TSEnumMember` AST node.
7696#[derive(Debug)]
7697#[repr(C)]
7698pub struct TSEnumMember<'gc> {
7699    /// Source range, debug location, paren count, and node id.
7700    pub metadata: NodeMetadata<'gc>,
7701    /// ESTree `id` property.
7702    pub id: &'gc Node<'gc>,
7703    /// ESTree `initializer` property.
7704    pub initializer: Option<&'gc Node<'gc>>,
7705}
7706impl<'gc> TSEnumMember<'gc> {
7707    /// Build `TSEnumMember` from its metadata and `ESTree.def` fields.
7708    pub fn new(
7709        metadata: NodeMetadata<'gc>,
7710        id: &'gc Node<'gc>,
7711        initializer: Option<&'gc Node<'gc>>,
7712    ) -> Self {
7713        TSEnumMember {
7714            metadata,
7715            id,
7716            initializer,
7717        }
7718    }
7719}
7720
7721/// The `TSModuleDeclaration` AST node.
7722#[derive(Debug)]
7723#[repr(C)]
7724pub struct TSModuleDeclaration<'gc> {
7725    /// Source range, debug location, paren count, and node id.
7726    pub metadata: NodeMetadata<'gc>,
7727    /// ESTree `id` property.
7728    pub id: &'gc Node<'gc>,
7729    /// ESTree `body` property.
7730    pub body: &'gc Node<'gc>,
7731}
7732impl<'gc> TSModuleDeclaration<'gc> {
7733    /// Build `TSModuleDeclaration` from its metadata and `ESTree.def` fields.
7734    pub fn new(
7735        metadata: NodeMetadata<'gc>,
7736        id: &'gc Node<'gc>,
7737        body: &'gc Node<'gc>,
7738    ) -> Self {
7739        TSModuleDeclaration {
7740            metadata,
7741            id,
7742            body,
7743        }
7744    }
7745}
7746
7747/// The `TSModuleBlock` AST node.
7748#[derive(Debug)]
7749#[repr(C)]
7750pub struct TSModuleBlock<'gc> {
7751    /// Source range, debug location, paren count, and node id.
7752    pub metadata: NodeMetadata<'gc>,
7753    /// ESTree `body` property.
7754    pub body: NodeList<'gc>,
7755}
7756impl<'gc> TSModuleBlock<'gc> {
7757    /// Build `TSModuleBlock` from its metadata and `ESTree.def` fields.
7758    pub fn new(
7759        metadata: NodeMetadata<'gc>,
7760        body: NodeList<'gc>,
7761    ) -> Self {
7762        TSModuleBlock {
7763            metadata,
7764            body,
7765        }
7766    }
7767}
7768
7769/// The `TSModuleMember` AST node.
7770#[derive(Debug)]
7771#[repr(C)]
7772pub struct TSModuleMember<'gc> {
7773    /// Source range, debug location, paren count, and node id.
7774    pub metadata: NodeMetadata<'gc>,
7775    /// ESTree `id` property.
7776    pub id: &'gc Node<'gc>,
7777    /// ESTree `initializer` property.
7778    pub initializer: Option<&'gc Node<'gc>>,
7779}
7780impl<'gc> TSModuleMember<'gc> {
7781    /// Build `TSModuleMember` from its metadata and `ESTree.def` fields.
7782    pub fn new(
7783        metadata: NodeMetadata<'gc>,
7784        id: &'gc Node<'gc>,
7785        initializer: Option<&'gc Node<'gc>>,
7786    ) -> Self {
7787        TSModuleMember {
7788            metadata,
7789            id,
7790            initializer,
7791        }
7792    }
7793}
7794
7795/// The `TSTypeParameterDeclaration` AST node.
7796#[derive(Debug)]
7797#[repr(C)]
7798pub struct TSTypeParameterDeclaration<'gc> {
7799    /// Source range, debug location, paren count, and node id.
7800    pub metadata: NodeMetadata<'gc>,
7801    /// ESTree `params` property.
7802    pub params: NodeList<'gc>,
7803}
7804impl<'gc> TSTypeParameterDeclaration<'gc> {
7805    /// Build `TSTypeParameterDeclaration` from its metadata and `ESTree.def`
7806    /// fields.
7807    pub fn new(
7808        metadata: NodeMetadata<'gc>,
7809        params: NodeList<'gc>,
7810    ) -> Self {
7811        TSTypeParameterDeclaration {
7812            metadata,
7813            params,
7814        }
7815    }
7816}
7817
7818/// The `TSTypeParameter` AST node.
7819#[derive(Debug)]
7820#[repr(C)]
7821pub struct TSTypeParameter<'gc> {
7822    /// Source range, debug location, paren count, and node id.
7823    pub metadata: NodeMetadata<'gc>,
7824    /// ESTree `name` property.
7825    pub name: &'gc Node<'gc>,
7826    /// ESTree `constraint` property.
7827    pub constraint: Option<&'gc Node<'gc>>,
7828    /// ESTree `default` property.
7829    pub default: Option<&'gc Node<'gc>>,
7830}
7831impl<'gc> TSTypeParameter<'gc> {
7832    /// Build `TSTypeParameter` from its metadata and `ESTree.def` fields.
7833    pub fn new(
7834        metadata: NodeMetadata<'gc>,
7835        name: &'gc Node<'gc>,
7836        constraint: Option<&'gc Node<'gc>>,
7837        default: Option<&'gc Node<'gc>>,
7838    ) -> Self {
7839        TSTypeParameter {
7840            metadata,
7841            name,
7842            constraint,
7843            default,
7844        }
7845    }
7846}
7847
7848/// The `TSTypeParameterInstantiation` AST node.
7849#[derive(Debug)]
7850#[repr(C)]
7851pub struct TSTypeParameterInstantiation<'gc> {
7852    /// Source range, debug location, paren count, and node id.
7853    pub metadata: NodeMetadata<'gc>,
7854    /// ESTree `params` property.
7855    pub params: NodeList<'gc>,
7856}
7857impl<'gc> TSTypeParameterInstantiation<'gc> {
7858    /// Build `TSTypeParameterInstantiation` from its metadata and `ESTree.def`
7859    /// fields.
7860    pub fn new(
7861        metadata: NodeMetadata<'gc>,
7862        params: NodeList<'gc>,
7863    ) -> Self {
7864        TSTypeParameterInstantiation {
7865            metadata,
7866            params,
7867        }
7868    }
7869}
7870
7871/// The `TSUnionType` AST node.
7872#[derive(Debug)]
7873#[repr(C)]
7874pub struct TSUnionType<'gc> {
7875    /// Source range, debug location, paren count, and node id.
7876    pub metadata: NodeMetadata<'gc>,
7877    /// ESTree `types` property.
7878    pub types: NodeList<'gc>,
7879}
7880impl<'gc> TSUnionType<'gc> {
7881    /// Build `TSUnionType` from its metadata and `ESTree.def` fields.
7882    pub fn new(
7883        metadata: NodeMetadata<'gc>,
7884        types: NodeList<'gc>,
7885    ) -> Self {
7886        TSUnionType {
7887            metadata,
7888            types,
7889        }
7890    }
7891}
7892
7893/// The `TSIntersectionType` AST node.
7894#[derive(Debug)]
7895#[repr(C)]
7896pub struct TSIntersectionType<'gc> {
7897    /// Source range, debug location, paren count, and node id.
7898    pub metadata: NodeMetadata<'gc>,
7899    /// ESTree `types` property.
7900    pub types: NodeList<'gc>,
7901}
7902impl<'gc> TSIntersectionType<'gc> {
7903    /// Build `TSIntersectionType` from its metadata and `ESTree.def` fields.
7904    pub fn new(
7905        metadata: NodeMetadata<'gc>,
7906        types: NodeList<'gc>,
7907    ) -> Self {
7908        TSIntersectionType {
7909            metadata,
7910            types,
7911        }
7912    }
7913}
7914
7915/// The `TSTypeQuery` AST node.
7916#[derive(Debug)]
7917#[repr(C)]
7918pub struct TSTypeQuery<'gc> {
7919    /// Source range, debug location, paren count, and node id.
7920    pub metadata: NodeMetadata<'gc>,
7921    /// ESTree `exprName` property.
7922    pub expr_name: &'gc Node<'gc>,
7923}
7924impl<'gc> TSTypeQuery<'gc> {
7925    /// Build `TSTypeQuery` from its metadata and `ESTree.def` fields.
7926    pub fn new(
7927        metadata: NodeMetadata<'gc>,
7928        expr_name: &'gc Node<'gc>,
7929    ) -> Self {
7930        TSTypeQuery {
7931            metadata,
7932            expr_name,
7933        }
7934    }
7935}
7936
7937/// The `TSConditionalType` AST node.
7938#[derive(Debug)]
7939#[repr(C)]
7940pub struct TSConditionalType<'gc> {
7941    /// Source range, debug location, paren count, and node id.
7942    pub metadata: NodeMetadata<'gc>,
7943    /// ESTree `checkType` property.
7944    pub check_type: &'gc Node<'gc>,
7945    /// ESTree `extendsType` property.
7946    pub extends_type: &'gc Node<'gc>,
7947    /// ESTree `trueType` property.
7948    pub true_type: &'gc Node<'gc>,
7949    /// ESTree `falseType` property.
7950    pub false_type: &'gc Node<'gc>,
7951}
7952impl<'gc> TSConditionalType<'gc> {
7953    /// Build `TSConditionalType` from its metadata and `ESTree.def` fields.
7954    pub fn new(
7955        metadata: NodeMetadata<'gc>,
7956        check_type: &'gc Node<'gc>,
7957        extends_type: &'gc Node<'gc>,
7958        true_type: &'gc Node<'gc>,
7959        false_type: &'gc Node<'gc>,
7960    ) -> Self {
7961        TSConditionalType {
7962            metadata,
7963            check_type,
7964            extends_type,
7965            true_type,
7966            false_type,
7967        }
7968    }
7969}
7970
7971/// The `TSTypeLiteral` AST node.
7972#[derive(Debug)]
7973#[repr(C)]
7974pub struct TSTypeLiteral<'gc> {
7975    /// Source range, debug location, paren count, and node id.
7976    pub metadata: NodeMetadata<'gc>,
7977    /// ESTree `members` property.
7978    pub members: NodeList<'gc>,
7979}
7980impl<'gc> TSTypeLiteral<'gc> {
7981    /// Build `TSTypeLiteral` from its metadata and `ESTree.def` fields.
7982    pub fn new(
7983        metadata: NodeMetadata<'gc>,
7984        members: NodeList<'gc>,
7985    ) -> Self {
7986        TSTypeLiteral {
7987            metadata,
7988            members,
7989        }
7990    }
7991}
7992
7993/// The `TSPropertySignature` AST node.
7994#[derive(Debug)]
7995#[repr(C)]
7996pub struct TSPropertySignature<'gc> {
7997    /// Source range, debug location, paren count, and node id.
7998    pub metadata: NodeMetadata<'gc>,
7999    /// ESTree `key` property.
8000    pub key: &'gc Node<'gc>,
8001    /// ESTree `typeAnnotation` property.
8002    pub type_annotation: Option<&'gc Node<'gc>>,
8003    /// ESTree `initializer` property.
8004    pub initializer: Option<&'gc Node<'gc>>,
8005    /// ESTree `optional` property.
8006    pub optional: Cell<bool>,
8007    /// ESTree `computed` property.
8008    pub computed: Cell<bool>,
8009    /// ESTree `readonly` property.
8010    pub readonly: Cell<bool>,
8011    /// ESTree `static` property.
8012    pub r#static: Cell<bool>,
8013    /// ESTree `export` property.
8014    pub export: Cell<bool>,
8015}
8016impl<'gc> TSPropertySignature<'gc> {
8017    /// Build `TSPropertySignature` from its metadata and `ESTree.def` fields.
8018    pub fn new(
8019        metadata: NodeMetadata<'gc>,
8020        key: &'gc Node<'gc>,
8021        type_annotation: Option<&'gc Node<'gc>>,
8022        initializer: Option<&'gc Node<'gc>>,
8023        optional: bool,
8024        computed: bool,
8025        readonly: bool,
8026        r#static: bool,
8027        export: bool,
8028    ) -> Self {
8029        TSPropertySignature {
8030            metadata,
8031            key,
8032            type_annotation,
8033            initializer,
8034            optional: Cell::new(optional),
8035            computed: Cell::new(computed),
8036            readonly: Cell::new(readonly),
8037            r#static: Cell::new(r#static),
8038            export: Cell::new(export),
8039        }
8040    }
8041}
8042
8043/// The `TSMethodSignature` AST node.
8044#[derive(Debug)]
8045#[repr(C)]
8046pub struct TSMethodSignature<'gc> {
8047    /// Source range, debug location, paren count, and node id.
8048    pub metadata: NodeMetadata<'gc>,
8049    /// ESTree `key` property.
8050    pub key: &'gc Node<'gc>,
8051    /// ESTree `params` property.
8052    pub params: NodeList<'gc>,
8053    /// ESTree `returnType` property.
8054    pub return_type: Option<&'gc Node<'gc>>,
8055    /// ESTree `computed` property.
8056    pub computed: Cell<bool>,
8057}
8058impl<'gc> TSMethodSignature<'gc> {
8059    /// Build `TSMethodSignature` from its metadata and `ESTree.def` fields.
8060    pub fn new(
8061        metadata: NodeMetadata<'gc>,
8062        key: &'gc Node<'gc>,
8063        params: NodeList<'gc>,
8064        return_type: Option<&'gc Node<'gc>>,
8065        computed: bool,
8066    ) -> Self {
8067        TSMethodSignature {
8068            metadata,
8069            key,
8070            params,
8071            return_type,
8072            computed: Cell::new(computed),
8073        }
8074    }
8075}
8076
8077/// The `TSIndexSignature` AST node.
8078#[derive(Debug)]
8079#[repr(C)]
8080pub struct TSIndexSignature<'gc> {
8081    /// Source range, debug location, paren count, and node id.
8082    pub metadata: NodeMetadata<'gc>,
8083    /// ESTree `parameters` property.
8084    pub parameters: NodeList<'gc>,
8085    /// ESTree `typeAnnotation` property.
8086    pub type_annotation: Option<&'gc Node<'gc>>,
8087}
8088impl<'gc> TSIndexSignature<'gc> {
8089    /// Build `TSIndexSignature` from its metadata and `ESTree.def` fields.
8090    pub fn new(
8091        metadata: NodeMetadata<'gc>,
8092        parameters: NodeList<'gc>,
8093        type_annotation: Option<&'gc Node<'gc>>,
8094    ) -> Self {
8095        TSIndexSignature {
8096            metadata,
8097            parameters,
8098            type_annotation,
8099        }
8100    }
8101}
8102
8103/// The `TSCallSignatureDeclaration` AST node.
8104#[derive(Debug)]
8105#[repr(C)]
8106pub struct TSCallSignatureDeclaration<'gc> {
8107    /// Source range, debug location, paren count, and node id.
8108    pub metadata: NodeMetadata<'gc>,
8109    /// ESTree `params` property.
8110    pub params: NodeList<'gc>,
8111    /// ESTree `returnType` property.
8112    pub return_type: Option<&'gc Node<'gc>>,
8113}
8114impl<'gc> TSCallSignatureDeclaration<'gc> {
8115    /// Build `TSCallSignatureDeclaration` from its metadata and `ESTree.def`
8116    /// fields.
8117    pub fn new(
8118        metadata: NodeMetadata<'gc>,
8119        params: NodeList<'gc>,
8120        return_type: Option<&'gc Node<'gc>>,
8121    ) -> Self {
8122        TSCallSignatureDeclaration {
8123            metadata,
8124            params,
8125            return_type,
8126        }
8127    }
8128}
8129
8130/// The `TSModifiers` AST node.
8131#[derive(Debug)]
8132#[repr(C)]
8133pub struct TSModifiers<'gc> {
8134    /// Source range, debug location, paren count, and node id.
8135    pub metadata: NodeMetadata<'gc>,
8136    /// ESTree `accessibility` property.
8137    pub accessibility: Cell<NodeLabel>,
8138    /// ESTree `readonly` property.
8139    pub readonly: Cell<bool>,
8140}
8141impl<'gc> TSModifiers<'gc> {
8142    /// Build `TSModifiers` from its metadata and `ESTree.def` fields.
8143    pub fn new(
8144        metadata: NodeMetadata<'gc>,
8145        accessibility: NodeLabel,
8146        readonly: bool,
8147    ) -> Self {
8148        TSModifiers {
8149            metadata,
8150            accessibility: Cell::new(accessibility),
8151            readonly: Cell::new(readonly),
8152        }
8153    }
8154}
8155
8156/// The `CoverEmptyArgs` AST node.
8157#[derive(Debug)]
8158#[repr(C)]
8159pub struct CoverEmptyArgs<'gc> {
8160    /// Source range, debug location, paren count, and node id.
8161    pub metadata: NodeMetadata<'gc>,
8162}
8163impl<'gc> CoverEmptyArgs<'gc> {
8164    /// Build `CoverEmptyArgs` from its metadata and `ESTree.def` fields.
8165    pub fn new(
8166        metadata: NodeMetadata<'gc>,
8167    ) -> Self {
8168        CoverEmptyArgs {
8169            metadata,
8170        }
8171    }
8172}
8173
8174/// The `CoverTrailingComma` AST node.
8175#[derive(Debug)]
8176#[repr(C)]
8177pub struct CoverTrailingComma<'gc> {
8178    /// Source range, debug location, paren count, and node id.
8179    pub metadata: NodeMetadata<'gc>,
8180}
8181impl<'gc> CoverTrailingComma<'gc> {
8182    /// Build `CoverTrailingComma` from its metadata and `ESTree.def` fields.
8183    pub fn new(
8184        metadata: NodeMetadata<'gc>,
8185    ) -> Self {
8186        CoverTrailingComma {
8187            metadata,
8188        }
8189    }
8190}
8191
8192/// The `CoverInitializer` AST node.
8193#[derive(Debug)]
8194#[repr(C)]
8195pub struct CoverInitializer<'gc> {
8196    /// Source range, debug location, paren count, and node id.
8197    pub metadata: NodeMetadata<'gc>,
8198    /// ESTree `init` property.
8199    pub init: &'gc Node<'gc>,
8200}
8201impl<'gc> CoverInitializer<'gc> {
8202    /// Build `CoverInitializer` from its metadata and `ESTree.def` fields.
8203    pub fn new(
8204        metadata: NodeMetadata<'gc>,
8205        init: &'gc Node<'gc>,
8206    ) -> Self {
8207        CoverInitializer {
8208            metadata,
8209            init,
8210        }
8211    }
8212}
8213
8214/// The `CoverRestElement` AST node.
8215#[derive(Debug)]
8216#[repr(C)]
8217pub struct CoverRestElement<'gc> {
8218    /// Source range, debug location, paren count, and node id.
8219    pub metadata: NodeMetadata<'gc>,
8220    /// ESTree `rest` property.
8221    pub rest: &'gc Node<'gc>,
8222}
8223impl<'gc> CoverRestElement<'gc> {
8224    /// Build `CoverRestElement` from its metadata and `ESTree.def` fields.
8225    pub fn new(
8226        metadata: NodeMetadata<'gc>,
8227        rest: &'gc Node<'gc>,
8228    ) -> Self {
8229        CoverRestElement {
8230            metadata,
8231            rest,
8232        }
8233    }
8234}
8235
8236/// The `CoverTypedIdentifier` AST node.
8237#[derive(Debug)]
8238#[repr(C)]
8239pub struct CoverTypedIdentifier<'gc> {
8240    /// Source range, debug location, paren count, and node id.
8241    pub metadata: NodeMetadata<'gc>,
8242    /// ESTree `left` property.
8243    pub left: &'gc Node<'gc>,
8244    /// ESTree `right` property.
8245    pub right: Option<&'gc Node<'gc>>,
8246    /// ESTree `optional` property.
8247    pub optional: Cell<bool>,
8248}
8249impl<'gc> CoverTypedIdentifier<'gc> {
8250    /// Build `CoverTypedIdentifier` from its metadata and `ESTree.def` fields.
8251    pub fn new(
8252        metadata: NodeMetadata<'gc>,
8253        left: &'gc Node<'gc>,
8254        right: Option<&'gc Node<'gc>>,
8255        optional: bool,
8256    ) -> Self {
8257        CoverTypedIdentifier {
8258            metadata,
8259            left,
8260            right,
8261            optional: Cell::new(optional),
8262        }
8263    }
8264}
8265
8266/// The `SHBuiltin` AST node.
8267#[derive(Debug)]
8268#[repr(C)]
8269pub struct SHBuiltin<'gc> {
8270    /// Source range, debug location, paren count, and node id.
8271    pub metadata: NodeMetadata<'gc>,
8272}
8273impl<'gc> SHBuiltin<'gc> {
8274    /// Build `SHBuiltin` from its metadata and `ESTree.def` fields.
8275    pub fn new(
8276        metadata: NodeMetadata<'gc>,
8277    ) -> Self {
8278        SHBuiltin {
8279            metadata,
8280        }
8281    }
8282}
8283
8284/// The `ImplicitCheckedCast` AST node.
8285#[derive(Debug)]
8286#[repr(C)]
8287pub struct ImplicitCheckedCast<'gc> {
8288    /// Source range, debug location, paren count, and node id.
8289    pub metadata: NodeMetadata<'gc>,
8290    /// ESTree `argument` property.
8291    pub argument: &'gc Node<'gc>,
8292}
8293impl<'gc> ImplicitCheckedCast<'gc> {
8294    /// Build `ImplicitCheckedCast` from its metadata and `ESTree.def` fields.
8295    pub fn new(
8296        metadata: NodeMetadata<'gc>,
8297        argument: &'gc Node<'gc>,
8298    ) -> Self {
8299        ImplicitCheckedCast {
8300            metadata,
8301            argument,
8302        }
8303    }
8304}
8305
8306/// An AST node: one arm per `ESTree.def` node kind.
8307///
8308/// `#[repr(C)]`, and each arm's payload struct is named after the arm,
8309/// so a deep `match` compiles to a single dispatch. Nodes live in the
8310/// [`crate::context::Context`] arena and are handed out as `&'gc Node`
8311/// for as long as a [`crate::context::GCLock`] is held.
8312#[derive(Debug)]
8313#[repr(C)]
8314pub enum Node<'gc> {
8315    /// A [`Empty`] node.
8316    Empty(Empty<'gc>),
8317    /// A [`Metadata`] node.
8318    Metadata(Metadata<'gc>),
8319    /// A [`Program`] node.
8320    Program(Program<'gc>),
8321    /// A [`FunctionExpression`] node.
8322    FunctionExpression(FunctionExpression<'gc>),
8323    /// A [`ArrowFunctionExpression`] node.
8324    ArrowFunctionExpression(ArrowFunctionExpression<'gc>),
8325    /// A [`FunctionDeclaration`] node.
8326    FunctionDeclaration(FunctionDeclaration<'gc>),
8327    /// A [`ComponentDeclaration`] node.
8328    ComponentDeclaration(ComponentDeclaration<'gc>),
8329    /// A [`HookDeclaration`] node.
8330    HookDeclaration(HookDeclaration<'gc>),
8331    /// A [`MatchStatement`] node.
8332    MatchStatement(MatchStatement<'gc>),
8333    /// A [`WhileStatement`] node.
8334    WhileStatement(WhileStatement<'gc>),
8335    /// A [`DoWhileStatement`] node.
8336    DoWhileStatement(DoWhileStatement<'gc>),
8337    /// A [`ForInStatement`] node.
8338    ForInStatement(ForInStatement<'gc>),
8339    /// A [`ForOfStatement`] node.
8340    ForOfStatement(ForOfStatement<'gc>),
8341    /// A [`ForStatement`] node.
8342    ForStatement(ForStatement<'gc>),
8343    /// A [`DebuggerStatement`] node.
8344    DebuggerStatement(DebuggerStatement<'gc>),
8345    /// A [`EmptyStatement`] node.
8346    EmptyStatement(EmptyStatement<'gc>),
8347    /// A [`BlockStatement`] node.
8348    BlockStatement(BlockStatement<'gc>),
8349    /// A [`StaticBlock`] node.
8350    StaticBlock(StaticBlock<'gc>),
8351    /// A [`BreakStatement`] node.
8352    BreakStatement(BreakStatement<'gc>),
8353    /// A [`ContinueStatement`] node.
8354    ContinueStatement(ContinueStatement<'gc>),
8355    /// A [`ThrowStatement`] node.
8356    ThrowStatement(ThrowStatement<'gc>),
8357    /// A [`ReturnStatement`] node.
8358    ReturnStatement(ReturnStatement<'gc>),
8359    /// A [`WithStatement`] node.
8360    WithStatement(WithStatement<'gc>),
8361    /// A [`SwitchStatement`] node.
8362    SwitchStatement(SwitchStatement<'gc>),
8363    /// A [`LabeledStatement`] node.
8364    LabeledStatement(LabeledStatement<'gc>),
8365    /// A [`ExpressionStatement`] node.
8366    ExpressionStatement(ExpressionStatement<'gc>),
8367    /// A [`TryStatement`] node.
8368    TryStatement(TryStatement<'gc>),
8369    /// A [`IfStatement`] node.
8370    IfStatement(IfStatement<'gc>),
8371    /// A [`NullLiteral`] node.
8372    NullLiteral(NullLiteral<'gc>),
8373    /// A [`BooleanLiteral`] node.
8374    BooleanLiteral(BooleanLiteral<'gc>),
8375    /// A [`StringLiteral`] node.
8376    StringLiteral(StringLiteral<'gc>),
8377    /// A [`NumericLiteral`] node.
8378    NumericLiteral(NumericLiteral<'gc>),
8379    /// A [`RegExpLiteral`] node.
8380    RegExpLiteral(RegExpLiteral<'gc>),
8381    /// A [`BigIntLiteral`] node.
8382    BigIntLiteral(BigIntLiteral<'gc>),
8383    /// A [`ThisExpression`] node.
8384    ThisExpression(ThisExpression<'gc>),
8385    /// A [`Super`] node.
8386    Super(Super<'gc>),
8387    /// A [`SequenceExpression`] node.
8388    SequenceExpression(SequenceExpression<'gc>),
8389    /// A [`ObjectExpression`] node.
8390    ObjectExpression(ObjectExpression<'gc>),
8391    /// A [`ArrayExpression`] node.
8392    ArrayExpression(ArrayExpression<'gc>),
8393    /// A [`SpreadElement`] node.
8394    SpreadElement(SpreadElement<'gc>),
8395    /// A [`NewExpression`] node.
8396    NewExpression(NewExpression<'gc>),
8397    /// A [`YieldExpression`] node.
8398    YieldExpression(YieldExpression<'gc>),
8399    /// A [`AwaitExpression`] node.
8400    AwaitExpression(AwaitExpression<'gc>),
8401    /// A [`ImportExpression`] node.
8402    ImportExpression(ImportExpression<'gc>),
8403    /// A [`CallExpression`] node.
8404    CallExpression(CallExpression<'gc>),
8405    /// A [`OptionalCallExpression`] node.
8406    OptionalCallExpression(OptionalCallExpression<'gc>),
8407    /// A [`AssignmentExpression`] node.
8408    AssignmentExpression(AssignmentExpression<'gc>),
8409    /// A [`UnaryExpression`] node.
8410    UnaryExpression(UnaryExpression<'gc>),
8411    /// A [`UpdateExpression`] node.
8412    UpdateExpression(UpdateExpression<'gc>),
8413    /// A [`MemberExpression`] node.
8414    MemberExpression(MemberExpression<'gc>),
8415    /// A [`OptionalMemberExpression`] node.
8416    OptionalMemberExpression(OptionalMemberExpression<'gc>),
8417    /// A [`LogicalExpression`] node.
8418    LogicalExpression(LogicalExpression<'gc>),
8419    /// A [`ConditionalExpression`] node.
8420    ConditionalExpression(ConditionalExpression<'gc>),
8421    /// A [`BinaryExpression`] node.
8422    BinaryExpression(BinaryExpression<'gc>),
8423    /// A [`Directive`] node.
8424    Directive(Directive<'gc>),
8425    /// A [`DirectiveLiteral`] node.
8426    DirectiveLiteral(DirectiveLiteral<'gc>),
8427    /// A [`Identifier`] node.
8428    Identifier(Identifier<'gc>),
8429    /// A [`PrivateName`] node.
8430    PrivateName(PrivateName<'gc>),
8431    /// A [`MetaProperty`] node.
8432    MetaProperty(MetaProperty<'gc>),
8433    /// A [`SwitchCase`] node.
8434    SwitchCase(SwitchCase<'gc>),
8435    /// A [`CatchClause`] node.
8436    CatchClause(CatchClause<'gc>),
8437    /// A [`VariableDeclarator`] node.
8438    VariableDeclarator(VariableDeclarator<'gc>),
8439    /// A [`VariableDeclaration`] node.
8440    VariableDeclaration(VariableDeclaration<'gc>),
8441    /// A [`TemplateLiteral`] node.
8442    TemplateLiteral(TemplateLiteral<'gc>),
8443    /// A [`TaggedTemplateExpression`] node.
8444    TaggedTemplateExpression(TaggedTemplateExpression<'gc>),
8445    /// A [`TemplateElement`] node.
8446    TemplateElement(TemplateElement<'gc>),
8447    /// A [`Property`] node.
8448    Property(Property<'gc>),
8449    /// A [`Decorator`] node.
8450    Decorator(Decorator<'gc>),
8451    /// A [`ClassDeclaration`] node.
8452    ClassDeclaration(ClassDeclaration<'gc>),
8453    /// A [`ClassExpression`] node.
8454    ClassExpression(ClassExpression<'gc>),
8455    /// A [`ClassBody`] node.
8456    ClassBody(ClassBody<'gc>),
8457    /// A [`ClassProperty`] node.
8458    ClassProperty(ClassProperty<'gc>),
8459    /// A [`ClassPrivateProperty`] node.
8460    ClassPrivateProperty(ClassPrivateProperty<'gc>),
8461    /// A [`MethodDefinition`] node.
8462    MethodDefinition(MethodDefinition<'gc>),
8463    /// A [`ImportDeclaration`] node.
8464    ImportDeclaration(ImportDeclaration<'gc>),
8465    /// A [`ImportSpecifier`] node.
8466    ImportSpecifier(ImportSpecifier<'gc>),
8467    /// A [`ImportDefaultSpecifier`] node.
8468    ImportDefaultSpecifier(ImportDefaultSpecifier<'gc>),
8469    /// A [`ImportNamespaceSpecifier`] node.
8470    ImportNamespaceSpecifier(ImportNamespaceSpecifier<'gc>),
8471    /// A [`ImportAttribute`] node.
8472    ImportAttribute(ImportAttribute<'gc>),
8473    /// A [`ExportNamedDeclaration`] node.
8474    ExportNamedDeclaration(ExportNamedDeclaration<'gc>),
8475    /// A [`ExportSpecifier`] node.
8476    ExportSpecifier(ExportSpecifier<'gc>),
8477    /// A [`ExportNamespaceSpecifier`] node.
8478    ExportNamespaceSpecifier(ExportNamespaceSpecifier<'gc>),
8479    /// A [`ExportDefaultDeclaration`] node.
8480    ExportDefaultDeclaration(ExportDefaultDeclaration<'gc>),
8481    /// A [`ExportAllDeclaration`] node.
8482    ExportAllDeclaration(ExportAllDeclaration<'gc>),
8483    /// A [`ObjectPattern`] node.
8484    ObjectPattern(ObjectPattern<'gc>),
8485    /// A [`ArrayPattern`] node.
8486    ArrayPattern(ArrayPattern<'gc>),
8487    /// A [`RestElement`] node.
8488    RestElement(RestElement<'gc>),
8489    /// A [`AssignmentPattern`] node.
8490    AssignmentPattern(AssignmentPattern<'gc>),
8491    /// A [`MatchStatementCase`] node.
8492    MatchStatementCase(MatchStatementCase<'gc>),
8493    /// A [`MatchExpression`] node.
8494    MatchExpression(MatchExpression<'gc>),
8495    /// A [`MatchExpressionCase`] node.
8496    MatchExpressionCase(MatchExpressionCase<'gc>),
8497    /// A [`MatchWildcardPattern`] node.
8498    MatchWildcardPattern(MatchWildcardPattern<'gc>),
8499    /// A [`MatchLiteralPattern`] node.
8500    MatchLiteralPattern(MatchLiteralPattern<'gc>),
8501    /// A [`MatchUnaryPattern`] node.
8502    MatchUnaryPattern(MatchUnaryPattern<'gc>),
8503    /// A [`MatchIdentifierPattern`] node.
8504    MatchIdentifierPattern(MatchIdentifierPattern<'gc>),
8505    /// A [`MatchBindingPattern`] node.
8506    MatchBindingPattern(MatchBindingPattern<'gc>),
8507    /// A [`MatchObjectPattern`] node.
8508    MatchObjectPattern(MatchObjectPattern<'gc>),
8509    /// A [`MatchArrayPattern`] node.
8510    MatchArrayPattern(MatchArrayPattern<'gc>),
8511    /// A [`MatchOrPattern`] node.
8512    MatchOrPattern(MatchOrPattern<'gc>),
8513    /// A [`MatchAsPattern`] node.
8514    MatchAsPattern(MatchAsPattern<'gc>),
8515    /// A [`MatchMemberPattern`] node.
8516    MatchMemberPattern(MatchMemberPattern<'gc>),
8517    /// A [`MatchInstancePattern`] node.
8518    MatchInstancePattern(MatchInstancePattern<'gc>),
8519    /// A [`MatchObjectPatternProperty`] node.
8520    MatchObjectPatternProperty(MatchObjectPatternProperty<'gc>),
8521    /// A [`MatchInstanceObjectPattern`] node.
8522    MatchInstanceObjectPattern(MatchInstanceObjectPattern<'gc>),
8523    /// A [`MatchRestPattern`] node.
8524    MatchRestPattern(MatchRestPattern<'gc>),
8525    /// A [`JSXIdentifier`] node.
8526    JSXIdentifier(JSXIdentifier<'gc>),
8527    /// A [`JSXMemberExpression`] node.
8528    JSXMemberExpression(JSXMemberExpression<'gc>),
8529    /// A [`JSXNamespacedName`] node.
8530    JSXNamespacedName(JSXNamespacedName<'gc>),
8531    /// A [`JSXEmptyExpression`] node.
8532    JSXEmptyExpression(JSXEmptyExpression<'gc>),
8533    /// A [`JSXExpressionContainer`] node.
8534    JSXExpressionContainer(JSXExpressionContainer<'gc>),
8535    /// A [`JSXSpreadChild`] node.
8536    JSXSpreadChild(JSXSpreadChild<'gc>),
8537    /// A [`JSXOpeningElement`] node.
8538    JSXOpeningElement(JSXOpeningElement<'gc>),
8539    /// A [`JSXClosingElement`] node.
8540    JSXClosingElement(JSXClosingElement<'gc>),
8541    /// A [`JSXAttribute`] node.
8542    JSXAttribute(JSXAttribute<'gc>),
8543    /// A [`JSXSpreadAttribute`] node.
8544    JSXSpreadAttribute(JSXSpreadAttribute<'gc>),
8545    /// A [`JSXStringLiteral`] node.
8546    JSXStringLiteral(JSXStringLiteral<'gc>),
8547    /// A [`JSXText`] node.
8548    JSXText(JSXText<'gc>),
8549    /// A [`JSXElement`] node.
8550    JSXElement(JSXElement<'gc>),
8551    /// A [`JSXFragment`] node.
8552    JSXFragment(JSXFragment<'gc>),
8553    /// A [`JSXOpeningFragment`] node.
8554    JSXOpeningFragment(JSXOpeningFragment<'gc>),
8555    /// A [`JSXClosingFragment`] node.
8556    JSXClosingFragment(JSXClosingFragment<'gc>),
8557    /// A [`ExistsTypeAnnotation`] node.
8558    ExistsTypeAnnotation(ExistsTypeAnnotation<'gc>),
8559    /// A [`EmptyTypeAnnotation`] node.
8560    EmptyTypeAnnotation(EmptyTypeAnnotation<'gc>),
8561    /// A [`StringTypeAnnotation`] node.
8562    StringTypeAnnotation(StringTypeAnnotation<'gc>),
8563    /// A [`NumberTypeAnnotation`] node.
8564    NumberTypeAnnotation(NumberTypeAnnotation<'gc>),
8565    /// A [`StringLiteralTypeAnnotation`] node.
8566    StringLiteralTypeAnnotation(StringLiteralTypeAnnotation<'gc>),
8567    /// A [`NumberLiteralTypeAnnotation`] node.
8568    NumberLiteralTypeAnnotation(NumberLiteralTypeAnnotation<'gc>),
8569    /// A [`BigIntLiteralTypeAnnotation`] node.
8570    BigIntLiteralTypeAnnotation(BigIntLiteralTypeAnnotation<'gc>),
8571    /// A [`BooleanTypeAnnotation`] node.
8572    BooleanTypeAnnotation(BooleanTypeAnnotation<'gc>),
8573    /// A [`BooleanLiteralTypeAnnotation`] node.
8574    BooleanLiteralTypeAnnotation(BooleanLiteralTypeAnnotation<'gc>),
8575    /// A [`NullLiteralTypeAnnotation`] node.
8576    NullLiteralTypeAnnotation(NullLiteralTypeAnnotation<'gc>),
8577    /// A [`SymbolTypeAnnotation`] node.
8578    SymbolTypeAnnotation(SymbolTypeAnnotation<'gc>),
8579    /// A [`AnyTypeAnnotation`] node.
8580    AnyTypeAnnotation(AnyTypeAnnotation<'gc>),
8581    /// A [`MixedTypeAnnotation`] node.
8582    MixedTypeAnnotation(MixedTypeAnnotation<'gc>),
8583    /// A [`BigIntTypeAnnotation`] node.
8584    BigIntTypeAnnotation(BigIntTypeAnnotation<'gc>),
8585    /// A [`VoidTypeAnnotation`] node.
8586    VoidTypeAnnotation(VoidTypeAnnotation<'gc>),
8587    /// A [`NeverTypeAnnotation`] node.
8588    NeverTypeAnnotation(NeverTypeAnnotation<'gc>),
8589    /// A [`UnknownTypeAnnotation`] node.
8590    UnknownTypeAnnotation(UnknownTypeAnnotation<'gc>),
8591    /// A [`UndefinedTypeAnnotation`] node.
8592    UndefinedTypeAnnotation(UndefinedTypeAnnotation<'gc>),
8593    /// A [`FunctionTypeAnnotation`] node.
8594    FunctionTypeAnnotation(FunctionTypeAnnotation<'gc>),
8595    /// A [`HookTypeAnnotation`] node.
8596    HookTypeAnnotation(HookTypeAnnotation<'gc>),
8597    /// A [`FunctionTypeParam`] node.
8598    FunctionTypeParam(FunctionTypeParam<'gc>),
8599    /// A [`ComponentTypeAnnotation`] node.
8600    ComponentTypeAnnotation(ComponentTypeAnnotation<'gc>),
8601    /// A [`ComponentTypeParameter`] node.
8602    ComponentTypeParameter(ComponentTypeParameter<'gc>),
8603    /// A [`NullableTypeAnnotation`] node.
8604    NullableTypeAnnotation(NullableTypeAnnotation<'gc>),
8605    /// A [`QualifiedTypeIdentifier`] node.
8606    QualifiedTypeIdentifier(QualifiedTypeIdentifier<'gc>),
8607    /// A [`TypeofTypeAnnotation`] node.
8608    TypeofTypeAnnotation(TypeofTypeAnnotation<'gc>),
8609    /// A [`KeyofTypeAnnotation`] node.
8610    KeyofTypeAnnotation(KeyofTypeAnnotation<'gc>),
8611    /// A [`TypeOperator`] node.
8612    TypeOperator(TypeOperator<'gc>),
8613    /// A [`QualifiedTypeofIdentifier`] node.
8614    QualifiedTypeofIdentifier(QualifiedTypeofIdentifier<'gc>),
8615    /// A [`TupleTypeAnnotation`] node.
8616    TupleTypeAnnotation(TupleTypeAnnotation<'gc>),
8617    /// A [`TupleTypeSpreadElement`] node.
8618    TupleTypeSpreadElement(TupleTypeSpreadElement<'gc>),
8619    /// A [`TupleTypeLabeledElement`] node.
8620    TupleTypeLabeledElement(TupleTypeLabeledElement<'gc>),
8621    /// A [`ArrayTypeAnnotation`] node.
8622    ArrayTypeAnnotation(ArrayTypeAnnotation<'gc>),
8623    /// A [`InferTypeAnnotation`] node.
8624    InferTypeAnnotation(InferTypeAnnotation<'gc>),
8625    /// A [`UnionTypeAnnotation`] node.
8626    UnionTypeAnnotation(UnionTypeAnnotation<'gc>),
8627    /// A [`IntersectionTypeAnnotation`] node.
8628    IntersectionTypeAnnotation(IntersectionTypeAnnotation<'gc>),
8629    /// A [`GenericTypeAnnotation`] node.
8630    GenericTypeAnnotation(GenericTypeAnnotation<'gc>),
8631    /// A [`IndexedAccessType`] node.
8632    IndexedAccessType(IndexedAccessType<'gc>),
8633    /// A [`OptionalIndexedAccessType`] node.
8634    OptionalIndexedAccessType(OptionalIndexedAccessType<'gc>),
8635    /// A [`ConditionalTypeAnnotation`] node.
8636    ConditionalTypeAnnotation(ConditionalTypeAnnotation<'gc>),
8637    /// A [`TypePredicate`] node.
8638    TypePredicate(TypePredicate<'gc>),
8639    /// A [`InterfaceTypeAnnotation`] node.
8640    InterfaceTypeAnnotation(InterfaceTypeAnnotation<'gc>),
8641    /// A [`TypeAlias`] node.
8642    TypeAlias(TypeAlias<'gc>),
8643    /// A [`OpaqueType`] node.
8644    OpaqueType(OpaqueType<'gc>),
8645    /// A [`InterfaceDeclaration`] node.
8646    InterfaceDeclaration(InterfaceDeclaration<'gc>),
8647    /// A [`DeclareTypeAlias`] node.
8648    DeclareTypeAlias(DeclareTypeAlias<'gc>),
8649    /// A [`DeclareOpaqueType`] node.
8650    DeclareOpaqueType(DeclareOpaqueType<'gc>),
8651    /// A [`DeclareInterface`] node.
8652    DeclareInterface(DeclareInterface<'gc>),
8653    /// A [`DeclareClass`] node.
8654    DeclareClass(DeclareClass<'gc>),
8655    /// A [`DeclareFunction`] node.
8656    DeclareFunction(DeclareFunction<'gc>),
8657    /// A [`DeclareHook`] node.
8658    DeclareHook(DeclareHook<'gc>),
8659    /// A [`DeclareComponent`] node.
8660    DeclareComponent(DeclareComponent<'gc>),
8661    /// A [`DeclareVariable`] node.
8662    DeclareVariable(DeclareVariable<'gc>),
8663    /// A [`DeclareEnum`] node.
8664    DeclareEnum(DeclareEnum<'gc>),
8665    /// A [`DeclareExportDeclaration`] node.
8666    DeclareExportDeclaration(DeclareExportDeclaration<'gc>),
8667    /// A [`DeclareExportAllDeclaration`] node.
8668    DeclareExportAllDeclaration(DeclareExportAllDeclaration<'gc>),
8669    /// A [`DeclareModule`] node.
8670    DeclareModule(DeclareModule<'gc>),
8671    /// A [`DeclareNamespace`] node.
8672    DeclareNamespace(DeclareNamespace<'gc>),
8673    /// A [`DeclareModuleExports`] node.
8674    DeclareModuleExports(DeclareModuleExports<'gc>),
8675    /// A [`InterfaceExtends`] node.
8676    InterfaceExtends(InterfaceExtends<'gc>),
8677    /// A [`ClassImplements`] node.
8678    ClassImplements(ClassImplements<'gc>),
8679    /// A [`TypeAnnotation`] node.
8680    TypeAnnotation(TypeAnnotation<'gc>),
8681    /// A [`ObjectTypeAnnotation`] node.
8682    ObjectTypeAnnotation(ObjectTypeAnnotation<'gc>),
8683    /// A [`ObjectTypeProperty`] node.
8684    ObjectTypeProperty(ObjectTypeProperty<'gc>),
8685    /// A [`ObjectTypeSpreadProperty`] node.
8686    ObjectTypeSpreadProperty(ObjectTypeSpreadProperty<'gc>),
8687    /// A [`ObjectTypeInternalSlot`] node.
8688    ObjectTypeInternalSlot(ObjectTypeInternalSlot<'gc>),
8689    /// A [`ObjectTypeCallProperty`] node.
8690    ObjectTypeCallProperty(ObjectTypeCallProperty<'gc>),
8691    /// A [`ObjectTypeIndexer`] node.
8692    ObjectTypeIndexer(ObjectTypeIndexer<'gc>),
8693    /// A [`ObjectTypeMappedTypeProperty`] node.
8694    ObjectTypeMappedTypeProperty(ObjectTypeMappedTypeProperty<'gc>),
8695    /// A [`Variance`] node.
8696    Variance(Variance<'gc>),
8697    /// A [`TypeParameterDeclaration`] node.
8698    TypeParameterDeclaration(TypeParameterDeclaration<'gc>),
8699    /// A [`TypeParameter`] node.
8700    TypeParameter(TypeParameter<'gc>),
8701    /// A [`TypeParameterInstantiation`] node.
8702    TypeParameterInstantiation(TypeParameterInstantiation<'gc>),
8703    /// A [`TypeCastExpression`] node.
8704    TypeCastExpression(TypeCastExpression<'gc>),
8705    /// A [`AsExpression`] node.
8706    AsExpression(AsExpression<'gc>),
8707    /// A [`AsConstExpression`] node.
8708    AsConstExpression(AsConstExpression<'gc>),
8709    /// A [`InferredPredicate`] node.
8710    InferredPredicate(InferredPredicate<'gc>),
8711    /// A [`DeclaredPredicate`] node.
8712    DeclaredPredicate(DeclaredPredicate<'gc>),
8713    /// A [`EnumDeclaration`] node.
8714    EnumDeclaration(EnumDeclaration<'gc>),
8715    /// A [`EnumStringBody`] node.
8716    EnumStringBody(EnumStringBody<'gc>),
8717    /// A [`EnumNumberBody`] node.
8718    EnumNumberBody(EnumNumberBody<'gc>),
8719    /// A [`EnumBigIntBody`] node.
8720    EnumBigIntBody(EnumBigIntBody<'gc>),
8721    /// A [`EnumBooleanBody`] node.
8722    EnumBooleanBody(EnumBooleanBody<'gc>),
8723    /// A [`EnumSymbolBody`] node.
8724    EnumSymbolBody(EnumSymbolBody<'gc>),
8725    /// A [`EnumDefaultedMember`] node.
8726    EnumDefaultedMember(EnumDefaultedMember<'gc>),
8727    /// A [`EnumStringMember`] node.
8728    EnumStringMember(EnumStringMember<'gc>),
8729    /// A [`EnumNumberMember`] node.
8730    EnumNumberMember(EnumNumberMember<'gc>),
8731    /// A [`EnumBigIntMember`] node.
8732    EnumBigIntMember(EnumBigIntMember<'gc>),
8733    /// A [`EnumBooleanMember`] node.
8734    EnumBooleanMember(EnumBooleanMember<'gc>),
8735    /// A [`ComponentParameter`] node.
8736    ComponentParameter(ComponentParameter<'gc>),
8737    /// A [`RecordDeclaration`] node.
8738    RecordDeclaration(RecordDeclaration<'gc>),
8739    /// A [`RecordDeclarationImplements`] node.
8740    RecordDeclarationImplements(RecordDeclarationImplements<'gc>),
8741    /// A [`RecordDeclarationBody`] node.
8742    RecordDeclarationBody(RecordDeclarationBody<'gc>),
8743    /// A [`RecordDeclarationProperty`] node.
8744    RecordDeclarationProperty(RecordDeclarationProperty<'gc>),
8745    /// A [`RecordDeclarationStaticProperty`] node.
8746    RecordDeclarationStaticProperty(RecordDeclarationStaticProperty<'gc>),
8747    /// A [`RecordExpression`] node.
8748    RecordExpression(RecordExpression<'gc>),
8749    /// A [`RecordExpressionProperties`] node.
8750    RecordExpressionProperties(RecordExpressionProperties<'gc>),
8751    /// A [`TSTypeAnnotation`] node.
8752    TSTypeAnnotation(TSTypeAnnotation<'gc>),
8753    /// A [`TSAnyKeyword`] node.
8754    TSAnyKeyword(TSAnyKeyword<'gc>),
8755    /// A [`TSNumberKeyword`] node.
8756    TSNumberKeyword(TSNumberKeyword<'gc>),
8757    /// A [`TSBooleanKeyword`] node.
8758    TSBooleanKeyword(TSBooleanKeyword<'gc>),
8759    /// A [`TSStringKeyword`] node.
8760    TSStringKeyword(TSStringKeyword<'gc>),
8761    /// A [`TSSymbolKeyword`] node.
8762    TSSymbolKeyword(TSSymbolKeyword<'gc>),
8763    /// A [`TSVoidKeyword`] node.
8764    TSVoidKeyword(TSVoidKeyword<'gc>),
8765    /// A [`TSUndefinedKeyword`] node.
8766    TSUndefinedKeyword(TSUndefinedKeyword<'gc>),
8767    /// A [`TSUnknownKeyword`] node.
8768    TSUnknownKeyword(TSUnknownKeyword<'gc>),
8769    /// A [`TSNeverKeyword`] node.
8770    TSNeverKeyword(TSNeverKeyword<'gc>),
8771    /// A [`TSBigIntKeyword`] node.
8772    TSBigIntKeyword(TSBigIntKeyword<'gc>),
8773    /// A [`TSThisType`] node.
8774    TSThisType(TSThisType<'gc>),
8775    /// A [`TSLiteralType`] node.
8776    TSLiteralType(TSLiteralType<'gc>),
8777    /// A [`TSIndexedAccessType`] node.
8778    TSIndexedAccessType(TSIndexedAccessType<'gc>),
8779    /// A [`TSArrayType`] node.
8780    TSArrayType(TSArrayType<'gc>),
8781    /// A [`TSTypeReference`] node.
8782    TSTypeReference(TSTypeReference<'gc>),
8783    /// A [`TSQualifiedName`] node.
8784    TSQualifiedName(TSQualifiedName<'gc>),
8785    /// A [`TSFunctionType`] node.
8786    TSFunctionType(TSFunctionType<'gc>),
8787    /// A [`TSConstructorType`] node.
8788    TSConstructorType(TSConstructorType<'gc>),
8789    /// A [`TSTypePredicate`] node.
8790    TSTypePredicate(TSTypePredicate<'gc>),
8791    /// A [`TSTupleType`] node.
8792    TSTupleType(TSTupleType<'gc>),
8793    /// A [`TSTypeAssertion`] node.
8794    TSTypeAssertion(TSTypeAssertion<'gc>),
8795    /// A [`TSAsExpression`] node.
8796    TSAsExpression(TSAsExpression<'gc>),
8797    /// A [`TSParameterProperty`] node.
8798    TSParameterProperty(TSParameterProperty<'gc>),
8799    /// A [`TSTypeAliasDeclaration`] node.
8800    TSTypeAliasDeclaration(TSTypeAliasDeclaration<'gc>),
8801    /// A [`TSInterfaceDeclaration`] node.
8802    TSInterfaceDeclaration(TSInterfaceDeclaration<'gc>),
8803    /// A [`TSInterfaceHeritage`] node.
8804    TSInterfaceHeritage(TSInterfaceHeritage<'gc>),
8805    /// A [`TSInterfaceBody`] node.
8806    TSInterfaceBody(TSInterfaceBody<'gc>),
8807    /// A [`TSEnumDeclaration`] node.
8808    TSEnumDeclaration(TSEnumDeclaration<'gc>),
8809    /// A [`TSEnumMember`] node.
8810    TSEnumMember(TSEnumMember<'gc>),
8811    /// A [`TSModuleDeclaration`] node.
8812    TSModuleDeclaration(TSModuleDeclaration<'gc>),
8813    /// A [`TSModuleBlock`] node.
8814    TSModuleBlock(TSModuleBlock<'gc>),
8815    /// A [`TSModuleMember`] node.
8816    TSModuleMember(TSModuleMember<'gc>),
8817    /// A [`TSTypeParameterDeclaration`] node.
8818    TSTypeParameterDeclaration(TSTypeParameterDeclaration<'gc>),
8819    /// A [`TSTypeParameter`] node.
8820    TSTypeParameter(TSTypeParameter<'gc>),
8821    /// A [`TSTypeParameterInstantiation`] node.
8822    TSTypeParameterInstantiation(TSTypeParameterInstantiation<'gc>),
8823    /// A [`TSUnionType`] node.
8824    TSUnionType(TSUnionType<'gc>),
8825    /// A [`TSIntersectionType`] node.
8826    TSIntersectionType(TSIntersectionType<'gc>),
8827    /// A [`TSTypeQuery`] node.
8828    TSTypeQuery(TSTypeQuery<'gc>),
8829    /// A [`TSConditionalType`] node.
8830    TSConditionalType(TSConditionalType<'gc>),
8831    /// A [`TSTypeLiteral`] node.
8832    TSTypeLiteral(TSTypeLiteral<'gc>),
8833    /// A [`TSPropertySignature`] node.
8834    TSPropertySignature(TSPropertySignature<'gc>),
8835    /// A [`TSMethodSignature`] node.
8836    TSMethodSignature(TSMethodSignature<'gc>),
8837    /// A [`TSIndexSignature`] node.
8838    TSIndexSignature(TSIndexSignature<'gc>),
8839    /// A [`TSCallSignatureDeclaration`] node.
8840    TSCallSignatureDeclaration(TSCallSignatureDeclaration<'gc>),
8841    /// A [`TSModifiers`] node.
8842    TSModifiers(TSModifiers<'gc>),
8843    /// A [`CoverEmptyArgs`] node.
8844    CoverEmptyArgs(CoverEmptyArgs<'gc>),
8845    /// A [`CoverTrailingComma`] node.
8846    CoverTrailingComma(CoverTrailingComma<'gc>),
8847    /// A [`CoverInitializer`] node.
8848    CoverInitializer(CoverInitializer<'gc>),
8849    /// A [`CoverRestElement`] node.
8850    CoverRestElement(CoverRestElement<'gc>),
8851    /// A [`CoverTypedIdentifier`] node.
8852    CoverTypedIdentifier(CoverTypedIdentifier<'gc>),
8853    /// A [`SHBuiltin`] node.
8854    SHBuiltin(SHBuiltin<'gc>),
8855    /// A [`ImplicitCheckedCast`] node.
8856    ImplicitCheckedCast(ImplicitCheckedCast<'gc>),
8857}
8858
8859impl<'gc> Node<'gc> {
8860    /// This node's [`NodeKind`].
8861    pub fn kind(&self) -> NodeKind {
8862        match self {
8863            Node::Empty(_) => NodeKind::Empty,
8864            Node::Metadata(_) => NodeKind::Metadata,
8865            Node::Program(_) => NodeKind::Program,
8866            Node::FunctionExpression(_) => NodeKind::FunctionExpression,
8867            Node::ArrowFunctionExpression(_) => NodeKind::ArrowFunctionExpression,
8868            Node::FunctionDeclaration(_) => NodeKind::FunctionDeclaration,
8869            Node::ComponentDeclaration(_) => NodeKind::ComponentDeclaration,
8870            Node::HookDeclaration(_) => NodeKind::HookDeclaration,
8871            Node::MatchStatement(_) => NodeKind::MatchStatement,
8872            Node::WhileStatement(_) => NodeKind::WhileStatement,
8873            Node::DoWhileStatement(_) => NodeKind::DoWhileStatement,
8874            Node::ForInStatement(_) => NodeKind::ForInStatement,
8875            Node::ForOfStatement(_) => NodeKind::ForOfStatement,
8876            Node::ForStatement(_) => NodeKind::ForStatement,
8877            Node::DebuggerStatement(_) => NodeKind::DebuggerStatement,
8878            Node::EmptyStatement(_) => NodeKind::EmptyStatement,
8879            Node::BlockStatement(_) => NodeKind::BlockStatement,
8880            Node::StaticBlock(_) => NodeKind::StaticBlock,
8881            Node::BreakStatement(_) => NodeKind::BreakStatement,
8882            Node::ContinueStatement(_) => NodeKind::ContinueStatement,
8883            Node::ThrowStatement(_) => NodeKind::ThrowStatement,
8884            Node::ReturnStatement(_) => NodeKind::ReturnStatement,
8885            Node::WithStatement(_) => NodeKind::WithStatement,
8886            Node::SwitchStatement(_) => NodeKind::SwitchStatement,
8887            Node::LabeledStatement(_) => NodeKind::LabeledStatement,
8888            Node::ExpressionStatement(_) => NodeKind::ExpressionStatement,
8889            Node::TryStatement(_) => NodeKind::TryStatement,
8890            Node::IfStatement(_) => NodeKind::IfStatement,
8891            Node::NullLiteral(_) => NodeKind::NullLiteral,
8892            Node::BooleanLiteral(_) => NodeKind::BooleanLiteral,
8893            Node::StringLiteral(_) => NodeKind::StringLiteral,
8894            Node::NumericLiteral(_) => NodeKind::NumericLiteral,
8895            Node::RegExpLiteral(_) => NodeKind::RegExpLiteral,
8896            Node::BigIntLiteral(_) => NodeKind::BigIntLiteral,
8897            Node::ThisExpression(_) => NodeKind::ThisExpression,
8898            Node::Super(_) => NodeKind::Super,
8899            Node::SequenceExpression(_) => NodeKind::SequenceExpression,
8900            Node::ObjectExpression(_) => NodeKind::ObjectExpression,
8901            Node::ArrayExpression(_) => NodeKind::ArrayExpression,
8902            Node::SpreadElement(_) => NodeKind::SpreadElement,
8903            Node::NewExpression(_) => NodeKind::NewExpression,
8904            Node::YieldExpression(_) => NodeKind::YieldExpression,
8905            Node::AwaitExpression(_) => NodeKind::AwaitExpression,
8906            Node::ImportExpression(_) => NodeKind::ImportExpression,
8907            Node::CallExpression(_) => NodeKind::CallExpression,
8908            Node::OptionalCallExpression(_) => NodeKind::OptionalCallExpression,
8909            Node::AssignmentExpression(_) => NodeKind::AssignmentExpression,
8910            Node::UnaryExpression(_) => NodeKind::UnaryExpression,
8911            Node::UpdateExpression(_) => NodeKind::UpdateExpression,
8912            Node::MemberExpression(_) => NodeKind::MemberExpression,
8913            Node::OptionalMemberExpression(_) => NodeKind::OptionalMemberExpression,
8914            Node::LogicalExpression(_) => NodeKind::LogicalExpression,
8915            Node::ConditionalExpression(_) => NodeKind::ConditionalExpression,
8916            Node::BinaryExpression(_) => NodeKind::BinaryExpression,
8917            Node::Directive(_) => NodeKind::Directive,
8918            Node::DirectiveLiteral(_) => NodeKind::DirectiveLiteral,
8919            Node::Identifier(_) => NodeKind::Identifier,
8920            Node::PrivateName(_) => NodeKind::PrivateName,
8921            Node::MetaProperty(_) => NodeKind::MetaProperty,
8922            Node::SwitchCase(_) => NodeKind::SwitchCase,
8923            Node::CatchClause(_) => NodeKind::CatchClause,
8924            Node::VariableDeclarator(_) => NodeKind::VariableDeclarator,
8925            Node::VariableDeclaration(_) => NodeKind::VariableDeclaration,
8926            Node::TemplateLiteral(_) => NodeKind::TemplateLiteral,
8927            Node::TaggedTemplateExpression(_) => NodeKind::TaggedTemplateExpression,
8928            Node::TemplateElement(_) => NodeKind::TemplateElement,
8929            Node::Property(_) => NodeKind::Property,
8930            Node::Decorator(_) => NodeKind::Decorator,
8931            Node::ClassDeclaration(_) => NodeKind::ClassDeclaration,
8932            Node::ClassExpression(_) => NodeKind::ClassExpression,
8933            Node::ClassBody(_) => NodeKind::ClassBody,
8934            Node::ClassProperty(_) => NodeKind::ClassProperty,
8935            Node::ClassPrivateProperty(_) => NodeKind::ClassPrivateProperty,
8936            Node::MethodDefinition(_) => NodeKind::MethodDefinition,
8937            Node::ImportDeclaration(_) => NodeKind::ImportDeclaration,
8938            Node::ImportSpecifier(_) => NodeKind::ImportSpecifier,
8939            Node::ImportDefaultSpecifier(_) => NodeKind::ImportDefaultSpecifier,
8940            Node::ImportNamespaceSpecifier(_) => NodeKind::ImportNamespaceSpecifier,
8941            Node::ImportAttribute(_) => NodeKind::ImportAttribute,
8942            Node::ExportNamedDeclaration(_) => NodeKind::ExportNamedDeclaration,
8943            Node::ExportSpecifier(_) => NodeKind::ExportSpecifier,
8944            Node::ExportNamespaceSpecifier(_) => NodeKind::ExportNamespaceSpecifier,
8945            Node::ExportDefaultDeclaration(_) => NodeKind::ExportDefaultDeclaration,
8946            Node::ExportAllDeclaration(_) => NodeKind::ExportAllDeclaration,
8947            Node::ObjectPattern(_) => NodeKind::ObjectPattern,
8948            Node::ArrayPattern(_) => NodeKind::ArrayPattern,
8949            Node::RestElement(_) => NodeKind::RestElement,
8950            Node::AssignmentPattern(_) => NodeKind::AssignmentPattern,
8951            Node::MatchStatementCase(_) => NodeKind::MatchStatementCase,
8952            Node::MatchExpression(_) => NodeKind::MatchExpression,
8953            Node::MatchExpressionCase(_) => NodeKind::MatchExpressionCase,
8954            Node::MatchWildcardPattern(_) => NodeKind::MatchWildcardPattern,
8955            Node::MatchLiteralPattern(_) => NodeKind::MatchLiteralPattern,
8956            Node::MatchUnaryPattern(_) => NodeKind::MatchUnaryPattern,
8957            Node::MatchIdentifierPattern(_) => NodeKind::MatchIdentifierPattern,
8958            Node::MatchBindingPattern(_) => NodeKind::MatchBindingPattern,
8959            Node::MatchObjectPattern(_) => NodeKind::MatchObjectPattern,
8960            Node::MatchArrayPattern(_) => NodeKind::MatchArrayPattern,
8961            Node::MatchOrPattern(_) => NodeKind::MatchOrPattern,
8962            Node::MatchAsPattern(_) => NodeKind::MatchAsPattern,
8963            Node::MatchMemberPattern(_) => NodeKind::MatchMemberPattern,
8964            Node::MatchInstancePattern(_) => NodeKind::MatchInstancePattern,
8965            Node::MatchObjectPatternProperty(_) => NodeKind::MatchObjectPatternProperty,
8966            Node::MatchInstanceObjectPattern(_) => NodeKind::MatchInstanceObjectPattern,
8967            Node::MatchRestPattern(_) => NodeKind::MatchRestPattern,
8968            Node::JSXIdentifier(_) => NodeKind::JSXIdentifier,
8969            Node::JSXMemberExpression(_) => NodeKind::JSXMemberExpression,
8970            Node::JSXNamespacedName(_) => NodeKind::JSXNamespacedName,
8971            Node::JSXEmptyExpression(_) => NodeKind::JSXEmptyExpression,
8972            Node::JSXExpressionContainer(_) => NodeKind::JSXExpressionContainer,
8973            Node::JSXSpreadChild(_) => NodeKind::JSXSpreadChild,
8974            Node::JSXOpeningElement(_) => NodeKind::JSXOpeningElement,
8975            Node::JSXClosingElement(_) => NodeKind::JSXClosingElement,
8976            Node::JSXAttribute(_) => NodeKind::JSXAttribute,
8977            Node::JSXSpreadAttribute(_) => NodeKind::JSXSpreadAttribute,
8978            Node::JSXStringLiteral(_) => NodeKind::JSXStringLiteral,
8979            Node::JSXText(_) => NodeKind::JSXText,
8980            Node::JSXElement(_) => NodeKind::JSXElement,
8981            Node::JSXFragment(_) => NodeKind::JSXFragment,
8982            Node::JSXOpeningFragment(_) => NodeKind::JSXOpeningFragment,
8983            Node::JSXClosingFragment(_) => NodeKind::JSXClosingFragment,
8984            Node::ExistsTypeAnnotation(_) => NodeKind::ExistsTypeAnnotation,
8985            Node::EmptyTypeAnnotation(_) => NodeKind::EmptyTypeAnnotation,
8986            Node::StringTypeAnnotation(_) => NodeKind::StringTypeAnnotation,
8987            Node::NumberTypeAnnotation(_) => NodeKind::NumberTypeAnnotation,
8988            Node::StringLiteralTypeAnnotation(_) => NodeKind::StringLiteralTypeAnnotation,
8989            Node::NumberLiteralTypeAnnotation(_) => NodeKind::NumberLiteralTypeAnnotation,
8990            Node::BigIntLiteralTypeAnnotation(_) => NodeKind::BigIntLiteralTypeAnnotation,
8991            Node::BooleanTypeAnnotation(_) => NodeKind::BooleanTypeAnnotation,
8992            Node::BooleanLiteralTypeAnnotation(_) => NodeKind::BooleanLiteralTypeAnnotation,
8993            Node::NullLiteralTypeAnnotation(_) => NodeKind::NullLiteralTypeAnnotation,
8994            Node::SymbolTypeAnnotation(_) => NodeKind::SymbolTypeAnnotation,
8995            Node::AnyTypeAnnotation(_) => NodeKind::AnyTypeAnnotation,
8996            Node::MixedTypeAnnotation(_) => NodeKind::MixedTypeAnnotation,
8997            Node::BigIntTypeAnnotation(_) => NodeKind::BigIntTypeAnnotation,
8998            Node::VoidTypeAnnotation(_) => NodeKind::VoidTypeAnnotation,
8999            Node::NeverTypeAnnotation(_) => NodeKind::NeverTypeAnnotation,
9000            Node::UnknownTypeAnnotation(_) => NodeKind::UnknownTypeAnnotation,
9001            Node::UndefinedTypeAnnotation(_) => NodeKind::UndefinedTypeAnnotation,
9002            Node::FunctionTypeAnnotation(_) => NodeKind::FunctionTypeAnnotation,
9003            Node::HookTypeAnnotation(_) => NodeKind::HookTypeAnnotation,
9004            Node::FunctionTypeParam(_) => NodeKind::FunctionTypeParam,
9005            Node::ComponentTypeAnnotation(_) => NodeKind::ComponentTypeAnnotation,
9006            Node::ComponentTypeParameter(_) => NodeKind::ComponentTypeParameter,
9007            Node::NullableTypeAnnotation(_) => NodeKind::NullableTypeAnnotation,
9008            Node::QualifiedTypeIdentifier(_) => NodeKind::QualifiedTypeIdentifier,
9009            Node::TypeofTypeAnnotation(_) => NodeKind::TypeofTypeAnnotation,
9010            Node::KeyofTypeAnnotation(_) => NodeKind::KeyofTypeAnnotation,
9011            Node::TypeOperator(_) => NodeKind::TypeOperator,
9012            Node::QualifiedTypeofIdentifier(_) => NodeKind::QualifiedTypeofIdentifier,
9013            Node::TupleTypeAnnotation(_) => NodeKind::TupleTypeAnnotation,
9014            Node::TupleTypeSpreadElement(_) => NodeKind::TupleTypeSpreadElement,
9015            Node::TupleTypeLabeledElement(_) => NodeKind::TupleTypeLabeledElement,
9016            Node::ArrayTypeAnnotation(_) => NodeKind::ArrayTypeAnnotation,
9017            Node::InferTypeAnnotation(_) => NodeKind::InferTypeAnnotation,
9018            Node::UnionTypeAnnotation(_) => NodeKind::UnionTypeAnnotation,
9019            Node::IntersectionTypeAnnotation(_) => NodeKind::IntersectionTypeAnnotation,
9020            Node::GenericTypeAnnotation(_) => NodeKind::GenericTypeAnnotation,
9021            Node::IndexedAccessType(_) => NodeKind::IndexedAccessType,
9022            Node::OptionalIndexedAccessType(_) => NodeKind::OptionalIndexedAccessType,
9023            Node::ConditionalTypeAnnotation(_) => NodeKind::ConditionalTypeAnnotation,
9024            Node::TypePredicate(_) => NodeKind::TypePredicate,
9025            Node::InterfaceTypeAnnotation(_) => NodeKind::InterfaceTypeAnnotation,
9026            Node::TypeAlias(_) => NodeKind::TypeAlias,
9027            Node::OpaqueType(_) => NodeKind::OpaqueType,
9028            Node::InterfaceDeclaration(_) => NodeKind::InterfaceDeclaration,
9029            Node::DeclareTypeAlias(_) => NodeKind::DeclareTypeAlias,
9030            Node::DeclareOpaqueType(_) => NodeKind::DeclareOpaqueType,
9031            Node::DeclareInterface(_) => NodeKind::DeclareInterface,
9032            Node::DeclareClass(_) => NodeKind::DeclareClass,
9033            Node::DeclareFunction(_) => NodeKind::DeclareFunction,
9034            Node::DeclareHook(_) => NodeKind::DeclareHook,
9035            Node::DeclareComponent(_) => NodeKind::DeclareComponent,
9036            Node::DeclareVariable(_) => NodeKind::DeclareVariable,
9037            Node::DeclareEnum(_) => NodeKind::DeclareEnum,
9038            Node::DeclareExportDeclaration(_) => NodeKind::DeclareExportDeclaration,
9039            Node::DeclareExportAllDeclaration(_) => NodeKind::DeclareExportAllDeclaration,
9040            Node::DeclareModule(_) => NodeKind::DeclareModule,
9041            Node::DeclareNamespace(_) => NodeKind::DeclareNamespace,
9042            Node::DeclareModuleExports(_) => NodeKind::DeclareModuleExports,
9043            Node::InterfaceExtends(_) => NodeKind::InterfaceExtends,
9044            Node::ClassImplements(_) => NodeKind::ClassImplements,
9045            Node::TypeAnnotation(_) => NodeKind::TypeAnnotation,
9046            Node::ObjectTypeAnnotation(_) => NodeKind::ObjectTypeAnnotation,
9047            Node::ObjectTypeProperty(_) => NodeKind::ObjectTypeProperty,
9048            Node::ObjectTypeSpreadProperty(_) => NodeKind::ObjectTypeSpreadProperty,
9049            Node::ObjectTypeInternalSlot(_) => NodeKind::ObjectTypeInternalSlot,
9050            Node::ObjectTypeCallProperty(_) => NodeKind::ObjectTypeCallProperty,
9051            Node::ObjectTypeIndexer(_) => NodeKind::ObjectTypeIndexer,
9052            Node::ObjectTypeMappedTypeProperty(_) => NodeKind::ObjectTypeMappedTypeProperty,
9053            Node::Variance(_) => NodeKind::Variance,
9054            Node::TypeParameterDeclaration(_) => NodeKind::TypeParameterDeclaration,
9055            Node::TypeParameter(_) => NodeKind::TypeParameter,
9056            Node::TypeParameterInstantiation(_) => NodeKind::TypeParameterInstantiation,
9057            Node::TypeCastExpression(_) => NodeKind::TypeCastExpression,
9058            Node::AsExpression(_) => NodeKind::AsExpression,
9059            Node::AsConstExpression(_) => NodeKind::AsConstExpression,
9060            Node::InferredPredicate(_) => NodeKind::InferredPredicate,
9061            Node::DeclaredPredicate(_) => NodeKind::DeclaredPredicate,
9062            Node::EnumDeclaration(_) => NodeKind::EnumDeclaration,
9063            Node::EnumStringBody(_) => NodeKind::EnumStringBody,
9064            Node::EnumNumberBody(_) => NodeKind::EnumNumberBody,
9065            Node::EnumBigIntBody(_) => NodeKind::EnumBigIntBody,
9066            Node::EnumBooleanBody(_) => NodeKind::EnumBooleanBody,
9067            Node::EnumSymbolBody(_) => NodeKind::EnumSymbolBody,
9068            Node::EnumDefaultedMember(_) => NodeKind::EnumDefaultedMember,
9069            Node::EnumStringMember(_) => NodeKind::EnumStringMember,
9070            Node::EnumNumberMember(_) => NodeKind::EnumNumberMember,
9071            Node::EnumBigIntMember(_) => NodeKind::EnumBigIntMember,
9072            Node::EnumBooleanMember(_) => NodeKind::EnumBooleanMember,
9073            Node::ComponentParameter(_) => NodeKind::ComponentParameter,
9074            Node::RecordDeclaration(_) => NodeKind::RecordDeclaration,
9075            Node::RecordDeclarationImplements(_) => NodeKind::RecordDeclarationImplements,
9076            Node::RecordDeclarationBody(_) => NodeKind::RecordDeclarationBody,
9077            Node::RecordDeclarationProperty(_) => NodeKind::RecordDeclarationProperty,
9078            Node::RecordDeclarationStaticProperty(_) => NodeKind::RecordDeclarationStaticProperty,
9079            Node::RecordExpression(_) => NodeKind::RecordExpression,
9080            Node::RecordExpressionProperties(_) => NodeKind::RecordExpressionProperties,
9081            Node::TSTypeAnnotation(_) => NodeKind::TSTypeAnnotation,
9082            Node::TSAnyKeyword(_) => NodeKind::TSAnyKeyword,
9083            Node::TSNumberKeyword(_) => NodeKind::TSNumberKeyword,
9084            Node::TSBooleanKeyword(_) => NodeKind::TSBooleanKeyword,
9085            Node::TSStringKeyword(_) => NodeKind::TSStringKeyword,
9086            Node::TSSymbolKeyword(_) => NodeKind::TSSymbolKeyword,
9087            Node::TSVoidKeyword(_) => NodeKind::TSVoidKeyword,
9088            Node::TSUndefinedKeyword(_) => NodeKind::TSUndefinedKeyword,
9089            Node::TSUnknownKeyword(_) => NodeKind::TSUnknownKeyword,
9090            Node::TSNeverKeyword(_) => NodeKind::TSNeverKeyword,
9091            Node::TSBigIntKeyword(_) => NodeKind::TSBigIntKeyword,
9092            Node::TSThisType(_) => NodeKind::TSThisType,
9093            Node::TSLiteralType(_) => NodeKind::TSLiteralType,
9094            Node::TSIndexedAccessType(_) => NodeKind::TSIndexedAccessType,
9095            Node::TSArrayType(_) => NodeKind::TSArrayType,
9096            Node::TSTypeReference(_) => NodeKind::TSTypeReference,
9097            Node::TSQualifiedName(_) => NodeKind::TSQualifiedName,
9098            Node::TSFunctionType(_) => NodeKind::TSFunctionType,
9099            Node::TSConstructorType(_) => NodeKind::TSConstructorType,
9100            Node::TSTypePredicate(_) => NodeKind::TSTypePredicate,
9101            Node::TSTupleType(_) => NodeKind::TSTupleType,
9102            Node::TSTypeAssertion(_) => NodeKind::TSTypeAssertion,
9103            Node::TSAsExpression(_) => NodeKind::TSAsExpression,
9104            Node::TSParameterProperty(_) => NodeKind::TSParameterProperty,
9105            Node::TSTypeAliasDeclaration(_) => NodeKind::TSTypeAliasDeclaration,
9106            Node::TSInterfaceDeclaration(_) => NodeKind::TSInterfaceDeclaration,
9107            Node::TSInterfaceHeritage(_) => NodeKind::TSInterfaceHeritage,
9108            Node::TSInterfaceBody(_) => NodeKind::TSInterfaceBody,
9109            Node::TSEnumDeclaration(_) => NodeKind::TSEnumDeclaration,
9110            Node::TSEnumMember(_) => NodeKind::TSEnumMember,
9111            Node::TSModuleDeclaration(_) => NodeKind::TSModuleDeclaration,
9112            Node::TSModuleBlock(_) => NodeKind::TSModuleBlock,
9113            Node::TSModuleMember(_) => NodeKind::TSModuleMember,
9114            Node::TSTypeParameterDeclaration(_) => NodeKind::TSTypeParameterDeclaration,
9115            Node::TSTypeParameter(_) => NodeKind::TSTypeParameter,
9116            Node::TSTypeParameterInstantiation(_) => NodeKind::TSTypeParameterInstantiation,
9117            Node::TSUnionType(_) => NodeKind::TSUnionType,
9118            Node::TSIntersectionType(_) => NodeKind::TSIntersectionType,
9119            Node::TSTypeQuery(_) => NodeKind::TSTypeQuery,
9120            Node::TSConditionalType(_) => NodeKind::TSConditionalType,
9121            Node::TSTypeLiteral(_) => NodeKind::TSTypeLiteral,
9122            Node::TSPropertySignature(_) => NodeKind::TSPropertySignature,
9123            Node::TSMethodSignature(_) => NodeKind::TSMethodSignature,
9124            Node::TSIndexSignature(_) => NodeKind::TSIndexSignature,
9125            Node::TSCallSignatureDeclaration(_) => NodeKind::TSCallSignatureDeclaration,
9126            Node::TSModifiers(_) => NodeKind::TSModifiers,
9127            Node::CoverEmptyArgs(_) => NodeKind::CoverEmptyArgs,
9128            Node::CoverTrailingComma(_) => NodeKind::CoverTrailingComma,
9129            Node::CoverInitializer(_) => NodeKind::CoverInitializer,
9130            Node::CoverRestElement(_) => NodeKind::CoverRestElement,
9131            Node::CoverTypedIdentifier(_) => NodeKind::CoverTypedIdentifier,
9132            Node::SHBuiltin(_) => NodeKind::SHBuiltin,
9133            Node::ImplicitCheckedCast(_) => NodeKind::ImplicitCheckedCast,
9134        }
9135    }
9136
9137    /// This node's metadata, common to every kind.
9138    pub fn metadata(&self) -> &NodeMetadata<'gc> {
9139        match self {
9140            Node::Empty(n) => &n.metadata,
9141            Node::Metadata(n) => &n.metadata,
9142            Node::Program(n) => &n.metadata,
9143            Node::FunctionExpression(n) => &n.metadata,
9144            Node::ArrowFunctionExpression(n) => &n.metadata,
9145            Node::FunctionDeclaration(n) => &n.metadata,
9146            Node::ComponentDeclaration(n) => &n.metadata,
9147            Node::HookDeclaration(n) => &n.metadata,
9148            Node::MatchStatement(n) => &n.metadata,
9149            Node::WhileStatement(n) => &n.metadata,
9150            Node::DoWhileStatement(n) => &n.metadata,
9151            Node::ForInStatement(n) => &n.metadata,
9152            Node::ForOfStatement(n) => &n.metadata,
9153            Node::ForStatement(n) => &n.metadata,
9154            Node::DebuggerStatement(n) => &n.metadata,
9155            Node::EmptyStatement(n) => &n.metadata,
9156            Node::BlockStatement(n) => &n.metadata,
9157            Node::StaticBlock(n) => &n.metadata,
9158            Node::BreakStatement(n) => &n.metadata,
9159            Node::ContinueStatement(n) => &n.metadata,
9160            Node::ThrowStatement(n) => &n.metadata,
9161            Node::ReturnStatement(n) => &n.metadata,
9162            Node::WithStatement(n) => &n.metadata,
9163            Node::SwitchStatement(n) => &n.metadata,
9164            Node::LabeledStatement(n) => &n.metadata,
9165            Node::ExpressionStatement(n) => &n.metadata,
9166            Node::TryStatement(n) => &n.metadata,
9167            Node::IfStatement(n) => &n.metadata,
9168            Node::NullLiteral(n) => &n.metadata,
9169            Node::BooleanLiteral(n) => &n.metadata,
9170            Node::StringLiteral(n) => &n.metadata,
9171            Node::NumericLiteral(n) => &n.metadata,
9172            Node::RegExpLiteral(n) => &n.metadata,
9173            Node::BigIntLiteral(n) => &n.metadata,
9174            Node::ThisExpression(n) => &n.metadata,
9175            Node::Super(n) => &n.metadata,
9176            Node::SequenceExpression(n) => &n.metadata,
9177            Node::ObjectExpression(n) => &n.metadata,
9178            Node::ArrayExpression(n) => &n.metadata,
9179            Node::SpreadElement(n) => &n.metadata,
9180            Node::NewExpression(n) => &n.metadata,
9181            Node::YieldExpression(n) => &n.metadata,
9182            Node::AwaitExpression(n) => &n.metadata,
9183            Node::ImportExpression(n) => &n.metadata,
9184            Node::CallExpression(n) => &n.metadata,
9185            Node::OptionalCallExpression(n) => &n.metadata,
9186            Node::AssignmentExpression(n) => &n.metadata,
9187            Node::UnaryExpression(n) => &n.metadata,
9188            Node::UpdateExpression(n) => &n.metadata,
9189            Node::MemberExpression(n) => &n.metadata,
9190            Node::OptionalMemberExpression(n) => &n.metadata,
9191            Node::LogicalExpression(n) => &n.metadata,
9192            Node::ConditionalExpression(n) => &n.metadata,
9193            Node::BinaryExpression(n) => &n.metadata,
9194            Node::Directive(n) => &n.metadata,
9195            Node::DirectiveLiteral(n) => &n.metadata,
9196            Node::Identifier(n) => &n.metadata,
9197            Node::PrivateName(n) => &n.metadata,
9198            Node::MetaProperty(n) => &n.metadata,
9199            Node::SwitchCase(n) => &n.metadata,
9200            Node::CatchClause(n) => &n.metadata,
9201            Node::VariableDeclarator(n) => &n.metadata,
9202            Node::VariableDeclaration(n) => &n.metadata,
9203            Node::TemplateLiteral(n) => &n.metadata,
9204            Node::TaggedTemplateExpression(n) => &n.metadata,
9205            Node::TemplateElement(n) => &n.metadata,
9206            Node::Property(n) => &n.metadata,
9207            Node::Decorator(n) => &n.metadata,
9208            Node::ClassDeclaration(n) => &n.metadata,
9209            Node::ClassExpression(n) => &n.metadata,
9210            Node::ClassBody(n) => &n.metadata,
9211            Node::ClassProperty(n) => &n.metadata,
9212            Node::ClassPrivateProperty(n) => &n.metadata,
9213            Node::MethodDefinition(n) => &n.metadata,
9214            Node::ImportDeclaration(n) => &n.metadata,
9215            Node::ImportSpecifier(n) => &n.metadata,
9216            Node::ImportDefaultSpecifier(n) => &n.metadata,
9217            Node::ImportNamespaceSpecifier(n) => &n.metadata,
9218            Node::ImportAttribute(n) => &n.metadata,
9219            Node::ExportNamedDeclaration(n) => &n.metadata,
9220            Node::ExportSpecifier(n) => &n.metadata,
9221            Node::ExportNamespaceSpecifier(n) => &n.metadata,
9222            Node::ExportDefaultDeclaration(n) => &n.metadata,
9223            Node::ExportAllDeclaration(n) => &n.metadata,
9224            Node::ObjectPattern(n) => &n.metadata,
9225            Node::ArrayPattern(n) => &n.metadata,
9226            Node::RestElement(n) => &n.metadata,
9227            Node::AssignmentPattern(n) => &n.metadata,
9228            Node::MatchStatementCase(n) => &n.metadata,
9229            Node::MatchExpression(n) => &n.metadata,
9230            Node::MatchExpressionCase(n) => &n.metadata,
9231            Node::MatchWildcardPattern(n) => &n.metadata,
9232            Node::MatchLiteralPattern(n) => &n.metadata,
9233            Node::MatchUnaryPattern(n) => &n.metadata,
9234            Node::MatchIdentifierPattern(n) => &n.metadata,
9235            Node::MatchBindingPattern(n) => &n.metadata,
9236            Node::MatchObjectPattern(n) => &n.metadata,
9237            Node::MatchArrayPattern(n) => &n.metadata,
9238            Node::MatchOrPattern(n) => &n.metadata,
9239            Node::MatchAsPattern(n) => &n.metadata,
9240            Node::MatchMemberPattern(n) => &n.metadata,
9241            Node::MatchInstancePattern(n) => &n.metadata,
9242            Node::MatchObjectPatternProperty(n) => &n.metadata,
9243            Node::MatchInstanceObjectPattern(n) => &n.metadata,
9244            Node::MatchRestPattern(n) => &n.metadata,
9245            Node::JSXIdentifier(n) => &n.metadata,
9246            Node::JSXMemberExpression(n) => &n.metadata,
9247            Node::JSXNamespacedName(n) => &n.metadata,
9248            Node::JSXEmptyExpression(n) => &n.metadata,
9249            Node::JSXExpressionContainer(n) => &n.metadata,
9250            Node::JSXSpreadChild(n) => &n.metadata,
9251            Node::JSXOpeningElement(n) => &n.metadata,
9252            Node::JSXClosingElement(n) => &n.metadata,
9253            Node::JSXAttribute(n) => &n.metadata,
9254            Node::JSXSpreadAttribute(n) => &n.metadata,
9255            Node::JSXStringLiteral(n) => &n.metadata,
9256            Node::JSXText(n) => &n.metadata,
9257            Node::JSXElement(n) => &n.metadata,
9258            Node::JSXFragment(n) => &n.metadata,
9259            Node::JSXOpeningFragment(n) => &n.metadata,
9260            Node::JSXClosingFragment(n) => &n.metadata,
9261            Node::ExistsTypeAnnotation(n) => &n.metadata,
9262            Node::EmptyTypeAnnotation(n) => &n.metadata,
9263            Node::StringTypeAnnotation(n) => &n.metadata,
9264            Node::NumberTypeAnnotation(n) => &n.metadata,
9265            Node::StringLiteralTypeAnnotation(n) => &n.metadata,
9266            Node::NumberLiteralTypeAnnotation(n) => &n.metadata,
9267            Node::BigIntLiteralTypeAnnotation(n) => &n.metadata,
9268            Node::BooleanTypeAnnotation(n) => &n.metadata,
9269            Node::BooleanLiteralTypeAnnotation(n) => &n.metadata,
9270            Node::NullLiteralTypeAnnotation(n) => &n.metadata,
9271            Node::SymbolTypeAnnotation(n) => &n.metadata,
9272            Node::AnyTypeAnnotation(n) => &n.metadata,
9273            Node::MixedTypeAnnotation(n) => &n.metadata,
9274            Node::BigIntTypeAnnotation(n) => &n.metadata,
9275            Node::VoidTypeAnnotation(n) => &n.metadata,
9276            Node::NeverTypeAnnotation(n) => &n.metadata,
9277            Node::UnknownTypeAnnotation(n) => &n.metadata,
9278            Node::UndefinedTypeAnnotation(n) => &n.metadata,
9279            Node::FunctionTypeAnnotation(n) => &n.metadata,
9280            Node::HookTypeAnnotation(n) => &n.metadata,
9281            Node::FunctionTypeParam(n) => &n.metadata,
9282            Node::ComponentTypeAnnotation(n) => &n.metadata,
9283            Node::ComponentTypeParameter(n) => &n.metadata,
9284            Node::NullableTypeAnnotation(n) => &n.metadata,
9285            Node::QualifiedTypeIdentifier(n) => &n.metadata,
9286            Node::TypeofTypeAnnotation(n) => &n.metadata,
9287            Node::KeyofTypeAnnotation(n) => &n.metadata,
9288            Node::TypeOperator(n) => &n.metadata,
9289            Node::QualifiedTypeofIdentifier(n) => &n.metadata,
9290            Node::TupleTypeAnnotation(n) => &n.metadata,
9291            Node::TupleTypeSpreadElement(n) => &n.metadata,
9292            Node::TupleTypeLabeledElement(n) => &n.metadata,
9293            Node::ArrayTypeAnnotation(n) => &n.metadata,
9294            Node::InferTypeAnnotation(n) => &n.metadata,
9295            Node::UnionTypeAnnotation(n) => &n.metadata,
9296            Node::IntersectionTypeAnnotation(n) => &n.metadata,
9297            Node::GenericTypeAnnotation(n) => &n.metadata,
9298            Node::IndexedAccessType(n) => &n.metadata,
9299            Node::OptionalIndexedAccessType(n) => &n.metadata,
9300            Node::ConditionalTypeAnnotation(n) => &n.metadata,
9301            Node::TypePredicate(n) => &n.metadata,
9302            Node::InterfaceTypeAnnotation(n) => &n.metadata,
9303            Node::TypeAlias(n) => &n.metadata,
9304            Node::OpaqueType(n) => &n.metadata,
9305            Node::InterfaceDeclaration(n) => &n.metadata,
9306            Node::DeclareTypeAlias(n) => &n.metadata,
9307            Node::DeclareOpaqueType(n) => &n.metadata,
9308            Node::DeclareInterface(n) => &n.metadata,
9309            Node::DeclareClass(n) => &n.metadata,
9310            Node::DeclareFunction(n) => &n.metadata,
9311            Node::DeclareHook(n) => &n.metadata,
9312            Node::DeclareComponent(n) => &n.metadata,
9313            Node::DeclareVariable(n) => &n.metadata,
9314            Node::DeclareEnum(n) => &n.metadata,
9315            Node::DeclareExportDeclaration(n) => &n.metadata,
9316            Node::DeclareExportAllDeclaration(n) => &n.metadata,
9317            Node::DeclareModule(n) => &n.metadata,
9318            Node::DeclareNamespace(n) => &n.metadata,
9319            Node::DeclareModuleExports(n) => &n.metadata,
9320            Node::InterfaceExtends(n) => &n.metadata,
9321            Node::ClassImplements(n) => &n.metadata,
9322            Node::TypeAnnotation(n) => &n.metadata,
9323            Node::ObjectTypeAnnotation(n) => &n.metadata,
9324            Node::ObjectTypeProperty(n) => &n.metadata,
9325            Node::ObjectTypeSpreadProperty(n) => &n.metadata,
9326            Node::ObjectTypeInternalSlot(n) => &n.metadata,
9327            Node::ObjectTypeCallProperty(n) => &n.metadata,
9328            Node::ObjectTypeIndexer(n) => &n.metadata,
9329            Node::ObjectTypeMappedTypeProperty(n) => &n.metadata,
9330            Node::Variance(n) => &n.metadata,
9331            Node::TypeParameterDeclaration(n) => &n.metadata,
9332            Node::TypeParameter(n) => &n.metadata,
9333            Node::TypeParameterInstantiation(n) => &n.metadata,
9334            Node::TypeCastExpression(n) => &n.metadata,
9335            Node::AsExpression(n) => &n.metadata,
9336            Node::AsConstExpression(n) => &n.metadata,
9337            Node::InferredPredicate(n) => &n.metadata,
9338            Node::DeclaredPredicate(n) => &n.metadata,
9339            Node::EnumDeclaration(n) => &n.metadata,
9340            Node::EnumStringBody(n) => &n.metadata,
9341            Node::EnumNumberBody(n) => &n.metadata,
9342            Node::EnumBigIntBody(n) => &n.metadata,
9343            Node::EnumBooleanBody(n) => &n.metadata,
9344            Node::EnumSymbolBody(n) => &n.metadata,
9345            Node::EnumDefaultedMember(n) => &n.metadata,
9346            Node::EnumStringMember(n) => &n.metadata,
9347            Node::EnumNumberMember(n) => &n.metadata,
9348            Node::EnumBigIntMember(n) => &n.metadata,
9349            Node::EnumBooleanMember(n) => &n.metadata,
9350            Node::ComponentParameter(n) => &n.metadata,
9351            Node::RecordDeclaration(n) => &n.metadata,
9352            Node::RecordDeclarationImplements(n) => &n.metadata,
9353            Node::RecordDeclarationBody(n) => &n.metadata,
9354            Node::RecordDeclarationProperty(n) => &n.metadata,
9355            Node::RecordDeclarationStaticProperty(n) => &n.metadata,
9356            Node::RecordExpression(n) => &n.metadata,
9357            Node::RecordExpressionProperties(n) => &n.metadata,
9358            Node::TSTypeAnnotation(n) => &n.metadata,
9359            Node::TSAnyKeyword(n) => &n.metadata,
9360            Node::TSNumberKeyword(n) => &n.metadata,
9361            Node::TSBooleanKeyword(n) => &n.metadata,
9362            Node::TSStringKeyword(n) => &n.metadata,
9363            Node::TSSymbolKeyword(n) => &n.metadata,
9364            Node::TSVoidKeyword(n) => &n.metadata,
9365            Node::TSUndefinedKeyword(n) => &n.metadata,
9366            Node::TSUnknownKeyword(n) => &n.metadata,
9367            Node::TSNeverKeyword(n) => &n.metadata,
9368            Node::TSBigIntKeyword(n) => &n.metadata,
9369            Node::TSThisType(n) => &n.metadata,
9370            Node::TSLiteralType(n) => &n.metadata,
9371            Node::TSIndexedAccessType(n) => &n.metadata,
9372            Node::TSArrayType(n) => &n.metadata,
9373            Node::TSTypeReference(n) => &n.metadata,
9374            Node::TSQualifiedName(n) => &n.metadata,
9375            Node::TSFunctionType(n) => &n.metadata,
9376            Node::TSConstructorType(n) => &n.metadata,
9377            Node::TSTypePredicate(n) => &n.metadata,
9378            Node::TSTupleType(n) => &n.metadata,
9379            Node::TSTypeAssertion(n) => &n.metadata,
9380            Node::TSAsExpression(n) => &n.metadata,
9381            Node::TSParameterProperty(n) => &n.metadata,
9382            Node::TSTypeAliasDeclaration(n) => &n.metadata,
9383            Node::TSInterfaceDeclaration(n) => &n.metadata,
9384            Node::TSInterfaceHeritage(n) => &n.metadata,
9385            Node::TSInterfaceBody(n) => &n.metadata,
9386            Node::TSEnumDeclaration(n) => &n.metadata,
9387            Node::TSEnumMember(n) => &n.metadata,
9388            Node::TSModuleDeclaration(n) => &n.metadata,
9389            Node::TSModuleBlock(n) => &n.metadata,
9390            Node::TSModuleMember(n) => &n.metadata,
9391            Node::TSTypeParameterDeclaration(n) => &n.metadata,
9392            Node::TSTypeParameter(n) => &n.metadata,
9393            Node::TSTypeParameterInstantiation(n) => &n.metadata,
9394            Node::TSUnionType(n) => &n.metadata,
9395            Node::TSIntersectionType(n) => &n.metadata,
9396            Node::TSTypeQuery(n) => &n.metadata,
9397            Node::TSConditionalType(n) => &n.metadata,
9398            Node::TSTypeLiteral(n) => &n.metadata,
9399            Node::TSPropertySignature(n) => &n.metadata,
9400            Node::TSMethodSignature(n) => &n.metadata,
9401            Node::TSIndexSignature(n) => &n.metadata,
9402            Node::TSCallSignatureDeclaration(n) => &n.metadata,
9403            Node::TSModifiers(n) => &n.metadata,
9404            Node::CoverEmptyArgs(n) => &n.metadata,
9405            Node::CoverTrailingComma(n) => &n.metadata,
9406            Node::CoverInitializer(n) => &n.metadata,
9407            Node::CoverRestElement(n) => &n.metadata,
9408            Node::CoverTypedIdentifier(n) => &n.metadata,
9409            Node::SHBuiltin(n) => &n.metadata,
9410            Node::ImplicitCheckedCast(n) => &n.metadata,
9411        }
9412    }
9413
9414    /// This node's arena identity (see [`NodeId`]).
9415    pub fn node_id(&self) -> NodeId {
9416        self.metadata().id.get()
9417    }
9418
9419    /// This node's source range.
9420    pub fn range(&self) -> hermes_support::location::SMRange {
9421        self.metadata().range.get()
9422    }
9423
9424    /// Whether this node's kind is in the `FunctionLike` range.
9425    pub fn is_function_like(&self) -> bool {
9426        let k = self.kind() as u32;
9427        (NodeKind::_FunctionLike_First as u32) < k && k < (NodeKind::_FunctionLike_Last as u32)
9428    }
9429
9430    /// Whether this node's kind is in the `Statement` range.
9431    pub fn is_statement(&self) -> bool {
9432        let k = self.kind() as u32;
9433        (NodeKind::_Statement_First as u32) < k && k < (NodeKind::_Statement_Last as u32)
9434    }
9435
9436    /// Whether this node's kind is in the `LoopStatement` range.
9437    pub fn is_loop_statement(&self) -> bool {
9438        let k = self.kind() as u32;
9439        (NodeKind::_LoopStatement_First as u32) < k && k < (NodeKind::_LoopStatement_Last as u32)
9440    }
9441
9442    /// Whether this node's kind is in the `CallExpressionLike` range.
9443    pub fn is_call_expression_like(&self) -> bool {
9444        let k = self.kind() as u32;
9445        (NodeKind::_CallExpressionLike_First as u32) < k && k < (NodeKind::_CallExpressionLike_Last as u32)
9446    }
9447
9448    /// Whether this node's kind is in the `MemberExpressionLike` range.
9449    pub fn is_member_expression_like(&self) -> bool {
9450        let k = self.kind() as u32;
9451        (NodeKind::_MemberExpressionLike_First as u32) < k && k < (NodeKind::_MemberExpressionLike_Last as u32)
9452    }
9453
9454    /// Whether this node's kind is in the `ClassLike` range.
9455    pub fn is_class_like(&self) -> bool {
9456        let k = self.kind() as u32;
9457        (NodeKind::_ClassLike_First as u32) < k && k < (NodeKind::_ClassLike_Last as u32)
9458    }
9459
9460    /// Whether this node's kind is in the `Pattern` range.
9461    pub fn is_pattern(&self) -> bool {
9462        let k = self.kind() as u32;
9463        (NodeKind::_Pattern_First as u32) < k && k < (NodeKind::_Pattern_Last as u32)
9464    }
9465
9466    /// Whether this node's kind is in the `MatchPattern` range.
9467    pub fn is_match_pattern(&self) -> bool {
9468        let k = self.kind() as u32;
9469        (NodeKind::_MatchPattern_First as u32) < k && k < (NodeKind::_MatchPattern_Last as u32)
9470    }
9471
9472    /// Whether this node's kind is in the `JSX` range.
9473    pub fn is_jsx(&self) -> bool {
9474        let k = self.kind() as u32;
9475        (NodeKind::_JSX_First as u32) < k && k < (NodeKind::_JSX_Last as u32)
9476    }
9477
9478    /// Whether this node's kind is in the `Flow` range.
9479    pub fn is_flow(&self) -> bool {
9480        let k = self.kind() as u32;
9481        (NodeKind::_Flow_First as u32) < k && k < (NodeKind::_Flow_Last as u32)
9482    }
9483
9484    /// Whether this node's kind is in the `TS` range.
9485    pub fn is_ts(&self) -> bool {
9486        let k = self.kind() as u32;
9487        (NodeKind::_TS_First as u32) < k && k < (NodeKind::_TS_Last as u32)
9488    }
9489
9490    /// Whether this node's kind is in the `Cover` range.
9491    pub fn is_cover(&self) -> bool {
9492        let k = self.kind() as u32;
9493        (NodeKind::_Cover_First as u32) < k && k < (NodeKind::_Cover_Last as u32)
9494    }
9495
9496    /// The payload if this is a [`Empty`], `None` otherwise.
9497    pub fn as_empty(&self) -> Option<&Empty<'gc>> {
9498        if let Node::Empty(n) = self { Some(n) } else { None }
9499    }
9500
9501    /// The payload if this is a [`Metadata`], `None` otherwise.
9502    pub fn as_metadata(&self) -> Option<&Metadata<'gc>> {
9503        if let Node::Metadata(n) = self { Some(n) } else { None }
9504    }
9505
9506    /// The payload if this is a [`Program`], `None` otherwise.
9507    pub fn as_program(&self) -> Option<&Program<'gc>> {
9508        if let Node::Program(n) = self { Some(n) } else { None }
9509    }
9510
9511    /// The payload if this is a [`FunctionExpression`], `None` otherwise.
9512    pub fn as_function_expression(&self) -> Option<&FunctionExpression<'gc>> {
9513        if let Node::FunctionExpression(n) = self { Some(n) } else { None }
9514    }
9515
9516    /// The payload if this is a [`ArrowFunctionExpression`], `None` otherwise.
9517    pub fn as_arrow_function_expression(&self) -> Option<&ArrowFunctionExpression<'gc>> {
9518        if let Node::ArrowFunctionExpression(n) = self { Some(n) } else { None }
9519    }
9520
9521    /// The payload if this is a [`FunctionDeclaration`], `None` otherwise.
9522    pub fn as_function_declaration(&self) -> Option<&FunctionDeclaration<'gc>> {
9523        if let Node::FunctionDeclaration(n) = self { Some(n) } else { None }
9524    }
9525
9526    /// The payload if this is a [`ComponentDeclaration`], `None` otherwise.
9527    pub fn as_component_declaration(&self) -> Option<&ComponentDeclaration<'gc>> {
9528        if let Node::ComponentDeclaration(n) = self { Some(n) } else { None }
9529    }
9530
9531    /// The payload if this is a [`HookDeclaration`], `None` otherwise.
9532    pub fn as_hook_declaration(&self) -> Option<&HookDeclaration<'gc>> {
9533        if let Node::HookDeclaration(n) = self { Some(n) } else { None }
9534    }
9535
9536    /// The payload if this is a [`MatchStatement`], `None` otherwise.
9537    pub fn as_match_statement(&self) -> Option<&MatchStatement<'gc>> {
9538        if let Node::MatchStatement(n) = self { Some(n) } else { None }
9539    }
9540
9541    /// The payload if this is a [`WhileStatement`], `None` otherwise.
9542    pub fn as_while_statement(&self) -> Option<&WhileStatement<'gc>> {
9543        if let Node::WhileStatement(n) = self { Some(n) } else { None }
9544    }
9545
9546    /// The payload if this is a [`DoWhileStatement`], `None` otherwise.
9547    pub fn as_do_while_statement(&self) -> Option<&DoWhileStatement<'gc>> {
9548        if let Node::DoWhileStatement(n) = self { Some(n) } else { None }
9549    }
9550
9551    /// The payload if this is a [`ForInStatement`], `None` otherwise.
9552    pub fn as_for_in_statement(&self) -> Option<&ForInStatement<'gc>> {
9553        if let Node::ForInStatement(n) = self { Some(n) } else { None }
9554    }
9555
9556    /// The payload if this is a [`ForOfStatement`], `None` otherwise.
9557    pub fn as_for_of_statement(&self) -> Option<&ForOfStatement<'gc>> {
9558        if let Node::ForOfStatement(n) = self { Some(n) } else { None }
9559    }
9560
9561    /// The payload if this is a [`ForStatement`], `None` otherwise.
9562    pub fn as_for_statement(&self) -> Option<&ForStatement<'gc>> {
9563        if let Node::ForStatement(n) = self { Some(n) } else { None }
9564    }
9565
9566    /// The payload if this is a [`DebuggerStatement`], `None` otherwise.
9567    pub fn as_debugger_statement(&self) -> Option<&DebuggerStatement<'gc>> {
9568        if let Node::DebuggerStatement(n) = self { Some(n) } else { None }
9569    }
9570
9571    /// The payload if this is a [`EmptyStatement`], `None` otherwise.
9572    pub fn as_empty_statement(&self) -> Option<&EmptyStatement<'gc>> {
9573        if let Node::EmptyStatement(n) = self { Some(n) } else { None }
9574    }
9575
9576    /// The payload if this is a [`BlockStatement`], `None` otherwise.
9577    pub fn as_block_statement(&self) -> Option<&BlockStatement<'gc>> {
9578        if let Node::BlockStatement(n) = self { Some(n) } else { None }
9579    }
9580
9581    /// The payload if this is a [`StaticBlock`], `None` otherwise.
9582    pub fn as_static_block(&self) -> Option<&StaticBlock<'gc>> {
9583        if let Node::StaticBlock(n) = self { Some(n) } else { None }
9584    }
9585
9586    /// The payload if this is a [`BreakStatement`], `None` otherwise.
9587    pub fn as_break_statement(&self) -> Option<&BreakStatement<'gc>> {
9588        if let Node::BreakStatement(n) = self { Some(n) } else { None }
9589    }
9590
9591    /// The payload if this is a [`ContinueStatement`], `None` otherwise.
9592    pub fn as_continue_statement(&self) -> Option<&ContinueStatement<'gc>> {
9593        if let Node::ContinueStatement(n) = self { Some(n) } else { None }
9594    }
9595
9596    /// The payload if this is a [`ThrowStatement`], `None` otherwise.
9597    pub fn as_throw_statement(&self) -> Option<&ThrowStatement<'gc>> {
9598        if let Node::ThrowStatement(n) = self { Some(n) } else { None }
9599    }
9600
9601    /// The payload if this is a [`ReturnStatement`], `None` otherwise.
9602    pub fn as_return_statement(&self) -> Option<&ReturnStatement<'gc>> {
9603        if let Node::ReturnStatement(n) = self { Some(n) } else { None }
9604    }
9605
9606    /// The payload if this is a [`WithStatement`], `None` otherwise.
9607    pub fn as_with_statement(&self) -> Option<&WithStatement<'gc>> {
9608        if let Node::WithStatement(n) = self { Some(n) } else { None }
9609    }
9610
9611    /// The payload if this is a [`SwitchStatement`], `None` otherwise.
9612    pub fn as_switch_statement(&self) -> Option<&SwitchStatement<'gc>> {
9613        if let Node::SwitchStatement(n) = self { Some(n) } else { None }
9614    }
9615
9616    /// The payload if this is a [`LabeledStatement`], `None` otherwise.
9617    pub fn as_labeled_statement(&self) -> Option<&LabeledStatement<'gc>> {
9618        if let Node::LabeledStatement(n) = self { Some(n) } else { None }
9619    }
9620
9621    /// The payload if this is a [`ExpressionStatement`], `None` otherwise.
9622    pub fn as_expression_statement(&self) -> Option<&ExpressionStatement<'gc>> {
9623        if let Node::ExpressionStatement(n) = self { Some(n) } else { None }
9624    }
9625
9626    /// The payload if this is a [`TryStatement`], `None` otherwise.
9627    pub fn as_try_statement(&self) -> Option<&TryStatement<'gc>> {
9628        if let Node::TryStatement(n) = self { Some(n) } else { None }
9629    }
9630
9631    /// The payload if this is a [`IfStatement`], `None` otherwise.
9632    pub fn as_if_statement(&self) -> Option<&IfStatement<'gc>> {
9633        if let Node::IfStatement(n) = self { Some(n) } else { None }
9634    }
9635
9636    /// The payload if this is a [`NullLiteral`], `None` otherwise.
9637    pub fn as_null_literal(&self) -> Option<&NullLiteral<'gc>> {
9638        if let Node::NullLiteral(n) = self { Some(n) } else { None }
9639    }
9640
9641    /// The payload if this is a [`BooleanLiteral`], `None` otherwise.
9642    pub fn as_boolean_literal(&self) -> Option<&BooleanLiteral<'gc>> {
9643        if let Node::BooleanLiteral(n) = self { Some(n) } else { None }
9644    }
9645
9646    /// The payload if this is a [`StringLiteral`], `None` otherwise.
9647    pub fn as_string_literal(&self) -> Option<&StringLiteral<'gc>> {
9648        if let Node::StringLiteral(n) = self { Some(n) } else { None }
9649    }
9650
9651    /// The payload if this is a [`NumericLiteral`], `None` otherwise.
9652    pub fn as_numeric_literal(&self) -> Option<&NumericLiteral<'gc>> {
9653        if let Node::NumericLiteral(n) = self { Some(n) } else { None }
9654    }
9655
9656    /// The payload if this is a [`RegExpLiteral`], `None` otherwise.
9657    pub fn as_reg_exp_literal(&self) -> Option<&RegExpLiteral<'gc>> {
9658        if let Node::RegExpLiteral(n) = self { Some(n) } else { None }
9659    }
9660
9661    /// The payload if this is a [`BigIntLiteral`], `None` otherwise.
9662    pub fn as_big_int_literal(&self) -> Option<&BigIntLiteral<'gc>> {
9663        if let Node::BigIntLiteral(n) = self { Some(n) } else { None }
9664    }
9665
9666    /// The payload if this is a [`ThisExpression`], `None` otherwise.
9667    pub fn as_this_expression(&self) -> Option<&ThisExpression<'gc>> {
9668        if let Node::ThisExpression(n) = self { Some(n) } else { None }
9669    }
9670
9671    /// The payload if this is a [`Super`], `None` otherwise.
9672    pub fn as_super(&self) -> Option<&Super<'gc>> {
9673        if let Node::Super(n) = self { Some(n) } else { None }
9674    }
9675
9676    /// The payload if this is a [`SequenceExpression`], `None` otherwise.
9677    pub fn as_sequence_expression(&self) -> Option<&SequenceExpression<'gc>> {
9678        if let Node::SequenceExpression(n) = self { Some(n) } else { None }
9679    }
9680
9681    /// The payload if this is a [`ObjectExpression`], `None` otherwise.
9682    pub fn as_object_expression(&self) -> Option<&ObjectExpression<'gc>> {
9683        if let Node::ObjectExpression(n) = self { Some(n) } else { None }
9684    }
9685
9686    /// The payload if this is a [`ArrayExpression`], `None` otherwise.
9687    pub fn as_array_expression(&self) -> Option<&ArrayExpression<'gc>> {
9688        if let Node::ArrayExpression(n) = self { Some(n) } else { None }
9689    }
9690
9691    /// The payload if this is a [`SpreadElement`], `None` otherwise.
9692    pub fn as_spread_element(&self) -> Option<&SpreadElement<'gc>> {
9693        if let Node::SpreadElement(n) = self { Some(n) } else { None }
9694    }
9695
9696    /// The payload if this is a [`NewExpression`], `None` otherwise.
9697    pub fn as_new_expression(&self) -> Option<&NewExpression<'gc>> {
9698        if let Node::NewExpression(n) = self { Some(n) } else { None }
9699    }
9700
9701    /// The payload if this is a [`YieldExpression`], `None` otherwise.
9702    pub fn as_yield_expression(&self) -> Option<&YieldExpression<'gc>> {
9703        if let Node::YieldExpression(n) = self { Some(n) } else { None }
9704    }
9705
9706    /// The payload if this is a [`AwaitExpression`], `None` otherwise.
9707    pub fn as_await_expression(&self) -> Option<&AwaitExpression<'gc>> {
9708        if let Node::AwaitExpression(n) = self { Some(n) } else { None }
9709    }
9710
9711    /// The payload if this is a [`ImportExpression`], `None` otherwise.
9712    pub fn as_import_expression(&self) -> Option<&ImportExpression<'gc>> {
9713        if let Node::ImportExpression(n) = self { Some(n) } else { None }
9714    }
9715
9716    /// The payload if this is a [`CallExpression`], `None` otherwise.
9717    pub fn as_call_expression(&self) -> Option<&CallExpression<'gc>> {
9718        if let Node::CallExpression(n) = self { Some(n) } else { None }
9719    }
9720
9721    /// The payload if this is a [`OptionalCallExpression`], `None` otherwise.
9722    pub fn as_optional_call_expression(&self) -> Option<&OptionalCallExpression<'gc>> {
9723        if let Node::OptionalCallExpression(n) = self { Some(n) } else { None }
9724    }
9725
9726    /// The payload if this is a [`AssignmentExpression`], `None` otherwise.
9727    pub fn as_assignment_expression(&self) -> Option<&AssignmentExpression<'gc>> {
9728        if let Node::AssignmentExpression(n) = self { Some(n) } else { None }
9729    }
9730
9731    /// The payload if this is a [`UnaryExpression`], `None` otherwise.
9732    pub fn as_unary_expression(&self) -> Option<&UnaryExpression<'gc>> {
9733        if let Node::UnaryExpression(n) = self { Some(n) } else { None }
9734    }
9735
9736    /// The payload if this is a [`UpdateExpression`], `None` otherwise.
9737    pub fn as_update_expression(&self) -> Option<&UpdateExpression<'gc>> {
9738        if let Node::UpdateExpression(n) = self { Some(n) } else { None }
9739    }
9740
9741    /// The payload if this is a [`MemberExpression`], `None` otherwise.
9742    pub fn as_member_expression(&self) -> Option<&MemberExpression<'gc>> {
9743        if let Node::MemberExpression(n) = self { Some(n) } else { None }
9744    }
9745
9746    /// The payload if this is a [`OptionalMemberExpression`], `None` otherwise.
9747    pub fn as_optional_member_expression(&self) -> Option<&OptionalMemberExpression<'gc>> {
9748        if let Node::OptionalMemberExpression(n) = self { Some(n) } else { None }
9749    }
9750
9751    /// The payload if this is a [`LogicalExpression`], `None` otherwise.
9752    pub fn as_logical_expression(&self) -> Option<&LogicalExpression<'gc>> {
9753        if let Node::LogicalExpression(n) = self { Some(n) } else { None }
9754    }
9755
9756    /// The payload if this is a [`ConditionalExpression`], `None` otherwise.
9757    pub fn as_conditional_expression(&self) -> Option<&ConditionalExpression<'gc>> {
9758        if let Node::ConditionalExpression(n) = self { Some(n) } else { None }
9759    }
9760
9761    /// The payload if this is a [`BinaryExpression`], `None` otherwise.
9762    pub fn as_binary_expression(&self) -> Option<&BinaryExpression<'gc>> {
9763        if let Node::BinaryExpression(n) = self { Some(n) } else { None }
9764    }
9765
9766    /// The payload if this is a [`Directive`], `None` otherwise.
9767    pub fn as_directive(&self) -> Option<&Directive<'gc>> {
9768        if let Node::Directive(n) = self { Some(n) } else { None }
9769    }
9770
9771    /// The payload if this is a [`DirectiveLiteral`], `None` otherwise.
9772    pub fn as_directive_literal(&self) -> Option<&DirectiveLiteral<'gc>> {
9773        if let Node::DirectiveLiteral(n) = self { Some(n) } else { None }
9774    }
9775
9776    /// The payload if this is a [`Identifier`], `None` otherwise.
9777    pub fn as_identifier(&self) -> Option<&Identifier<'gc>> {
9778        if let Node::Identifier(n) = self { Some(n) } else { None }
9779    }
9780
9781    /// The payload if this is a [`PrivateName`], `None` otherwise.
9782    pub fn as_private_name(&self) -> Option<&PrivateName<'gc>> {
9783        if let Node::PrivateName(n) = self { Some(n) } else { None }
9784    }
9785
9786    /// The payload if this is a [`MetaProperty`], `None` otherwise.
9787    pub fn as_meta_property(&self) -> Option<&MetaProperty<'gc>> {
9788        if let Node::MetaProperty(n) = self { Some(n) } else { None }
9789    }
9790
9791    /// The payload if this is a [`SwitchCase`], `None` otherwise.
9792    pub fn as_switch_case(&self) -> Option<&SwitchCase<'gc>> {
9793        if let Node::SwitchCase(n) = self { Some(n) } else { None }
9794    }
9795
9796    /// The payload if this is a [`CatchClause`], `None` otherwise.
9797    pub fn as_catch_clause(&self) -> Option<&CatchClause<'gc>> {
9798        if let Node::CatchClause(n) = self { Some(n) } else { None }
9799    }
9800
9801    /// The payload if this is a [`VariableDeclarator`], `None` otherwise.
9802    pub fn as_variable_declarator(&self) -> Option<&VariableDeclarator<'gc>> {
9803        if let Node::VariableDeclarator(n) = self { Some(n) } else { None }
9804    }
9805
9806    /// The payload if this is a [`VariableDeclaration`], `None` otherwise.
9807    pub fn as_variable_declaration(&self) -> Option<&VariableDeclaration<'gc>> {
9808        if let Node::VariableDeclaration(n) = self { Some(n) } else { None }
9809    }
9810
9811    /// The payload if this is a [`TemplateLiteral`], `None` otherwise.
9812    pub fn as_template_literal(&self) -> Option<&TemplateLiteral<'gc>> {
9813        if let Node::TemplateLiteral(n) = self { Some(n) } else { None }
9814    }
9815
9816    /// The payload if this is a [`TaggedTemplateExpression`], `None` otherwise.
9817    pub fn as_tagged_template_expression(&self) -> Option<&TaggedTemplateExpression<'gc>> {
9818        if let Node::TaggedTemplateExpression(n) = self { Some(n) } else { None }
9819    }
9820
9821    /// The payload if this is a [`TemplateElement`], `None` otherwise.
9822    pub fn as_template_element(&self) -> Option<&TemplateElement<'gc>> {
9823        if let Node::TemplateElement(n) = self { Some(n) } else { None }
9824    }
9825
9826    /// The payload if this is a [`Property`], `None` otherwise.
9827    pub fn as_property(&self) -> Option<&Property<'gc>> {
9828        if let Node::Property(n) = self { Some(n) } else { None }
9829    }
9830
9831    /// The payload if this is a [`Decorator`], `None` otherwise.
9832    pub fn as_decorator(&self) -> Option<&Decorator<'gc>> {
9833        if let Node::Decorator(n) = self { Some(n) } else { None }
9834    }
9835
9836    /// The payload if this is a [`ClassDeclaration`], `None` otherwise.
9837    pub fn as_class_declaration(&self) -> Option<&ClassDeclaration<'gc>> {
9838        if let Node::ClassDeclaration(n) = self { Some(n) } else { None }
9839    }
9840
9841    /// The payload if this is a [`ClassExpression`], `None` otherwise.
9842    pub fn as_class_expression(&self) -> Option<&ClassExpression<'gc>> {
9843        if let Node::ClassExpression(n) = self { Some(n) } else { None }
9844    }
9845
9846    /// The payload if this is a [`ClassBody`], `None` otherwise.
9847    pub fn as_class_body(&self) -> Option<&ClassBody<'gc>> {
9848        if let Node::ClassBody(n) = self { Some(n) } else { None }
9849    }
9850
9851    /// The payload if this is a [`ClassProperty`], `None` otherwise.
9852    pub fn as_class_property(&self) -> Option<&ClassProperty<'gc>> {
9853        if let Node::ClassProperty(n) = self { Some(n) } else { None }
9854    }
9855
9856    /// The payload if this is a [`ClassPrivateProperty`], `None` otherwise.
9857    pub fn as_class_private_property(&self) -> Option<&ClassPrivateProperty<'gc>> {
9858        if let Node::ClassPrivateProperty(n) = self { Some(n) } else { None }
9859    }
9860
9861    /// The payload if this is a [`MethodDefinition`], `None` otherwise.
9862    pub fn as_method_definition(&self) -> Option<&MethodDefinition<'gc>> {
9863        if let Node::MethodDefinition(n) = self { Some(n) } else { None }
9864    }
9865
9866    /// The payload if this is a [`ImportDeclaration`], `None` otherwise.
9867    pub fn as_import_declaration(&self) -> Option<&ImportDeclaration<'gc>> {
9868        if let Node::ImportDeclaration(n) = self { Some(n) } else { None }
9869    }
9870
9871    /// The payload if this is a [`ImportSpecifier`], `None` otherwise.
9872    pub fn as_import_specifier(&self) -> Option<&ImportSpecifier<'gc>> {
9873        if let Node::ImportSpecifier(n) = self { Some(n) } else { None }
9874    }
9875
9876    /// The payload if this is a [`ImportDefaultSpecifier`], `None` otherwise.
9877    pub fn as_import_default_specifier(&self) -> Option<&ImportDefaultSpecifier<'gc>> {
9878        if let Node::ImportDefaultSpecifier(n) = self { Some(n) } else { None }
9879    }
9880
9881    /// The payload if this is a [`ImportNamespaceSpecifier`], `None` otherwise.
9882    pub fn as_import_namespace_specifier(&self) -> Option<&ImportNamespaceSpecifier<'gc>> {
9883        if let Node::ImportNamespaceSpecifier(n) = self { Some(n) } else { None }
9884    }
9885
9886    /// The payload if this is a [`ImportAttribute`], `None` otherwise.
9887    pub fn as_import_attribute(&self) -> Option<&ImportAttribute<'gc>> {
9888        if let Node::ImportAttribute(n) = self { Some(n) } else { None }
9889    }
9890
9891    /// The payload if this is a [`ExportNamedDeclaration`], `None` otherwise.
9892    pub fn as_export_named_declaration(&self) -> Option<&ExportNamedDeclaration<'gc>> {
9893        if let Node::ExportNamedDeclaration(n) = self { Some(n) } else { None }
9894    }
9895
9896    /// The payload if this is a [`ExportSpecifier`], `None` otherwise.
9897    pub fn as_export_specifier(&self) -> Option<&ExportSpecifier<'gc>> {
9898        if let Node::ExportSpecifier(n) = self { Some(n) } else { None }
9899    }
9900
9901    /// The payload if this is a [`ExportNamespaceSpecifier`], `None` otherwise.
9902    pub fn as_export_namespace_specifier(&self) -> Option<&ExportNamespaceSpecifier<'gc>> {
9903        if let Node::ExportNamespaceSpecifier(n) = self { Some(n) } else { None }
9904    }
9905
9906    /// The payload if this is a [`ExportDefaultDeclaration`], `None` otherwise.
9907    pub fn as_export_default_declaration(&self) -> Option<&ExportDefaultDeclaration<'gc>> {
9908        if let Node::ExportDefaultDeclaration(n) = self { Some(n) } else { None }
9909    }
9910
9911    /// The payload if this is a [`ExportAllDeclaration`], `None` otherwise.
9912    pub fn as_export_all_declaration(&self) -> Option<&ExportAllDeclaration<'gc>> {
9913        if let Node::ExportAllDeclaration(n) = self { Some(n) } else { None }
9914    }
9915
9916    /// The payload if this is a [`ObjectPattern`], `None` otherwise.
9917    pub fn as_object_pattern(&self) -> Option<&ObjectPattern<'gc>> {
9918        if let Node::ObjectPattern(n) = self { Some(n) } else { None }
9919    }
9920
9921    /// The payload if this is a [`ArrayPattern`], `None` otherwise.
9922    pub fn as_array_pattern(&self) -> Option<&ArrayPattern<'gc>> {
9923        if let Node::ArrayPattern(n) = self { Some(n) } else { None }
9924    }
9925
9926    /// The payload if this is a [`RestElement`], `None` otherwise.
9927    pub fn as_rest_element(&self) -> Option<&RestElement<'gc>> {
9928        if let Node::RestElement(n) = self { Some(n) } else { None }
9929    }
9930
9931    /// The payload if this is a [`AssignmentPattern`], `None` otherwise.
9932    pub fn as_assignment_pattern(&self) -> Option<&AssignmentPattern<'gc>> {
9933        if let Node::AssignmentPattern(n) = self { Some(n) } else { None }
9934    }
9935
9936    /// The payload if this is a [`MatchStatementCase`], `None` otherwise.
9937    pub fn as_match_statement_case(&self) -> Option<&MatchStatementCase<'gc>> {
9938        if let Node::MatchStatementCase(n) = self { Some(n) } else { None }
9939    }
9940
9941    /// The payload if this is a [`MatchExpression`], `None` otherwise.
9942    pub fn as_match_expression(&self) -> Option<&MatchExpression<'gc>> {
9943        if let Node::MatchExpression(n) = self { Some(n) } else { None }
9944    }
9945
9946    /// The payload if this is a [`MatchExpressionCase`], `None` otherwise.
9947    pub fn as_match_expression_case(&self) -> Option<&MatchExpressionCase<'gc>> {
9948        if let Node::MatchExpressionCase(n) = self { Some(n) } else { None }
9949    }
9950
9951    /// The payload if this is a [`MatchWildcardPattern`], `None` otherwise.
9952    pub fn as_match_wildcard_pattern(&self) -> Option<&MatchWildcardPattern<'gc>> {
9953        if let Node::MatchWildcardPattern(n) = self { Some(n) } else { None }
9954    }
9955
9956    /// The payload if this is a [`MatchLiteralPattern`], `None` otherwise.
9957    pub fn as_match_literal_pattern(&self) -> Option<&MatchLiteralPattern<'gc>> {
9958        if let Node::MatchLiteralPattern(n) = self { Some(n) } else { None }
9959    }
9960
9961    /// The payload if this is a [`MatchUnaryPattern`], `None` otherwise.
9962    pub fn as_match_unary_pattern(&self) -> Option<&MatchUnaryPattern<'gc>> {
9963        if let Node::MatchUnaryPattern(n) = self { Some(n) } else { None }
9964    }
9965
9966    /// The payload if this is a [`MatchIdentifierPattern`], `None` otherwise.
9967    pub fn as_match_identifier_pattern(&self) -> Option<&MatchIdentifierPattern<'gc>> {
9968        if let Node::MatchIdentifierPattern(n) = self { Some(n) } else { None }
9969    }
9970
9971    /// The payload if this is a [`MatchBindingPattern`], `None` otherwise.
9972    pub fn as_match_binding_pattern(&self) -> Option<&MatchBindingPattern<'gc>> {
9973        if let Node::MatchBindingPattern(n) = self { Some(n) } else { None }
9974    }
9975
9976    /// The payload if this is a [`MatchObjectPattern`], `None` otherwise.
9977    pub fn as_match_object_pattern(&self) -> Option<&MatchObjectPattern<'gc>> {
9978        if let Node::MatchObjectPattern(n) = self { Some(n) } else { None }
9979    }
9980
9981    /// The payload if this is a [`MatchArrayPattern`], `None` otherwise.
9982    pub fn as_match_array_pattern(&self) -> Option<&MatchArrayPattern<'gc>> {
9983        if let Node::MatchArrayPattern(n) = self { Some(n) } else { None }
9984    }
9985
9986    /// The payload if this is a [`MatchOrPattern`], `None` otherwise.
9987    pub fn as_match_or_pattern(&self) -> Option<&MatchOrPattern<'gc>> {
9988        if let Node::MatchOrPattern(n) = self { Some(n) } else { None }
9989    }
9990
9991    /// The payload if this is a [`MatchAsPattern`], `None` otherwise.
9992    pub fn as_match_as_pattern(&self) -> Option<&MatchAsPattern<'gc>> {
9993        if let Node::MatchAsPattern(n) = self { Some(n) } else { None }
9994    }
9995
9996    /// The payload if this is a [`MatchMemberPattern`], `None` otherwise.
9997    pub fn as_match_member_pattern(&self) -> Option<&MatchMemberPattern<'gc>> {
9998        if let Node::MatchMemberPattern(n) = self { Some(n) } else { None }
9999    }
10000
10001    /// The payload if this is a [`MatchInstancePattern`], `None` otherwise.
10002    pub fn as_match_instance_pattern(&self) -> Option<&MatchInstancePattern<'gc>> {
10003        if let Node::MatchInstancePattern(n) = self { Some(n) } else { None }
10004    }
10005
10006    /// The payload if this is a [`MatchObjectPatternProperty`], `None`
10007    /// otherwise.
10008    pub fn as_match_object_pattern_property(&self) -> Option<&MatchObjectPatternProperty<'gc>> {
10009        if let Node::MatchObjectPatternProperty(n) = self { Some(n) } else { None }
10010    }
10011
10012    /// The payload if this is a [`MatchInstanceObjectPattern`], `None`
10013    /// otherwise.
10014    pub fn as_match_instance_object_pattern(&self) -> Option<&MatchInstanceObjectPattern<'gc>> {
10015        if let Node::MatchInstanceObjectPattern(n) = self { Some(n) } else { None }
10016    }
10017
10018    /// The payload if this is a [`MatchRestPattern`], `None` otherwise.
10019    pub fn as_match_rest_pattern(&self) -> Option<&MatchRestPattern<'gc>> {
10020        if let Node::MatchRestPattern(n) = self { Some(n) } else { None }
10021    }
10022
10023    /// The payload if this is a [`JSXIdentifier`], `None` otherwise.
10024    pub fn as_jsx_identifier(&self) -> Option<&JSXIdentifier<'gc>> {
10025        if let Node::JSXIdentifier(n) = self { Some(n) } else { None }
10026    }
10027
10028    /// The payload if this is a [`JSXMemberExpression`], `None` otherwise.
10029    pub fn as_jsx_member_expression(&self) -> Option<&JSXMemberExpression<'gc>> {
10030        if let Node::JSXMemberExpression(n) = self { Some(n) } else { None }
10031    }
10032
10033    /// The payload if this is a [`JSXNamespacedName`], `None` otherwise.
10034    pub fn as_jsx_namespaced_name(&self) -> Option<&JSXNamespacedName<'gc>> {
10035        if let Node::JSXNamespacedName(n) = self { Some(n) } else { None }
10036    }
10037
10038    /// The payload if this is a [`JSXEmptyExpression`], `None` otherwise.
10039    pub fn as_jsx_empty_expression(&self) -> Option<&JSXEmptyExpression<'gc>> {
10040        if let Node::JSXEmptyExpression(n) = self { Some(n) } else { None }
10041    }
10042
10043    /// The payload if this is a [`JSXExpressionContainer`], `None` otherwise.
10044    pub fn as_jsx_expression_container(&self) -> Option<&JSXExpressionContainer<'gc>> {
10045        if let Node::JSXExpressionContainer(n) = self { Some(n) } else { None }
10046    }
10047
10048    /// The payload if this is a [`JSXSpreadChild`], `None` otherwise.
10049    pub fn as_jsx_spread_child(&self) -> Option<&JSXSpreadChild<'gc>> {
10050        if let Node::JSXSpreadChild(n) = self { Some(n) } else { None }
10051    }
10052
10053    /// The payload if this is a [`JSXOpeningElement`], `None` otherwise.
10054    pub fn as_jsx_opening_element(&self) -> Option<&JSXOpeningElement<'gc>> {
10055        if let Node::JSXOpeningElement(n) = self { Some(n) } else { None }
10056    }
10057
10058    /// The payload if this is a [`JSXClosingElement`], `None` otherwise.
10059    pub fn as_jsx_closing_element(&self) -> Option<&JSXClosingElement<'gc>> {
10060        if let Node::JSXClosingElement(n) = self { Some(n) } else { None }
10061    }
10062
10063    /// The payload if this is a [`JSXAttribute`], `None` otherwise.
10064    pub fn as_jsx_attribute(&self) -> Option<&JSXAttribute<'gc>> {
10065        if let Node::JSXAttribute(n) = self { Some(n) } else { None }
10066    }
10067
10068    /// The payload if this is a [`JSXSpreadAttribute`], `None` otherwise.
10069    pub fn as_jsx_spread_attribute(&self) -> Option<&JSXSpreadAttribute<'gc>> {
10070        if let Node::JSXSpreadAttribute(n) = self { Some(n) } else { None }
10071    }
10072
10073    /// The payload if this is a [`JSXStringLiteral`], `None` otherwise.
10074    pub fn as_jsx_string_literal(&self) -> Option<&JSXStringLiteral<'gc>> {
10075        if let Node::JSXStringLiteral(n) = self { Some(n) } else { None }
10076    }
10077
10078    /// The payload if this is a [`JSXText`], `None` otherwise.
10079    pub fn as_jsx_text(&self) -> Option<&JSXText<'gc>> {
10080        if let Node::JSXText(n) = self { Some(n) } else { None }
10081    }
10082
10083    /// The payload if this is a [`JSXElement`], `None` otherwise.
10084    pub fn as_jsx_element(&self) -> Option<&JSXElement<'gc>> {
10085        if let Node::JSXElement(n) = self { Some(n) } else { None }
10086    }
10087
10088    /// The payload if this is a [`JSXFragment`], `None` otherwise.
10089    pub fn as_jsx_fragment(&self) -> Option<&JSXFragment<'gc>> {
10090        if let Node::JSXFragment(n) = self { Some(n) } else { None }
10091    }
10092
10093    /// The payload if this is a [`JSXOpeningFragment`], `None` otherwise.
10094    pub fn as_jsx_opening_fragment(&self) -> Option<&JSXOpeningFragment<'gc>> {
10095        if let Node::JSXOpeningFragment(n) = self { Some(n) } else { None }
10096    }
10097
10098    /// The payload if this is a [`JSXClosingFragment`], `None` otherwise.
10099    pub fn as_jsx_closing_fragment(&self) -> Option<&JSXClosingFragment<'gc>> {
10100        if let Node::JSXClosingFragment(n) = self { Some(n) } else { None }
10101    }
10102
10103    /// The payload if this is a [`ExistsTypeAnnotation`], `None` otherwise.
10104    pub fn as_exists_type_annotation(&self) -> Option<&ExistsTypeAnnotation<'gc>> {
10105        if let Node::ExistsTypeAnnotation(n) = self { Some(n) } else { None }
10106    }
10107
10108    /// The payload if this is a [`EmptyTypeAnnotation`], `None` otherwise.
10109    pub fn as_empty_type_annotation(&self) -> Option<&EmptyTypeAnnotation<'gc>> {
10110        if let Node::EmptyTypeAnnotation(n) = self { Some(n) } else { None }
10111    }
10112
10113    /// The payload if this is a [`StringTypeAnnotation`], `None` otherwise.
10114    pub fn as_string_type_annotation(&self) -> Option<&StringTypeAnnotation<'gc>> {
10115        if let Node::StringTypeAnnotation(n) = self { Some(n) } else { None }
10116    }
10117
10118    /// The payload if this is a [`NumberTypeAnnotation`], `None` otherwise.
10119    pub fn as_number_type_annotation(&self) -> Option<&NumberTypeAnnotation<'gc>> {
10120        if let Node::NumberTypeAnnotation(n) = self { Some(n) } else { None }
10121    }
10122
10123    /// The payload if this is a [`StringLiteralTypeAnnotation`], `None`
10124    /// otherwise.
10125    pub fn as_string_literal_type_annotation(&self) -> Option<&StringLiteralTypeAnnotation<'gc>> {
10126        if let Node::StringLiteralTypeAnnotation(n) = self { Some(n) } else { None }
10127    }
10128
10129    /// The payload if this is a [`NumberLiteralTypeAnnotation`], `None`
10130    /// otherwise.
10131    pub fn as_number_literal_type_annotation(&self) -> Option<&NumberLiteralTypeAnnotation<'gc>> {
10132        if let Node::NumberLiteralTypeAnnotation(n) = self { Some(n) } else { None }
10133    }
10134
10135    /// The payload if this is a [`BigIntLiteralTypeAnnotation`], `None`
10136    /// otherwise.
10137    pub fn as_big_int_literal_type_annotation(&self) -> Option<&BigIntLiteralTypeAnnotation<'gc>> {
10138        if let Node::BigIntLiteralTypeAnnotation(n) = self { Some(n) } else { None }
10139    }
10140
10141    /// The payload if this is a [`BooleanTypeAnnotation`], `None` otherwise.
10142    pub fn as_boolean_type_annotation(&self) -> Option<&BooleanTypeAnnotation<'gc>> {
10143        if let Node::BooleanTypeAnnotation(n) = self { Some(n) } else { None }
10144    }
10145
10146    /// The payload if this is a [`BooleanLiteralTypeAnnotation`], `None`
10147    /// otherwise.
10148    pub fn as_boolean_literal_type_annotation(&self) -> Option<&BooleanLiteralTypeAnnotation<'gc>> {
10149        if let Node::BooleanLiteralTypeAnnotation(n) = self { Some(n) } else { None }
10150    }
10151
10152    /// The payload if this is a [`NullLiteralTypeAnnotation`], `None`
10153    /// otherwise.
10154    pub fn as_null_literal_type_annotation(&self) -> Option<&NullLiteralTypeAnnotation<'gc>> {
10155        if let Node::NullLiteralTypeAnnotation(n) = self { Some(n) } else { None }
10156    }
10157
10158    /// The payload if this is a [`SymbolTypeAnnotation`], `None` otherwise.
10159    pub fn as_symbol_type_annotation(&self) -> Option<&SymbolTypeAnnotation<'gc>> {
10160        if let Node::SymbolTypeAnnotation(n) = self { Some(n) } else { None }
10161    }
10162
10163    /// The payload if this is a [`AnyTypeAnnotation`], `None` otherwise.
10164    pub fn as_any_type_annotation(&self) -> Option<&AnyTypeAnnotation<'gc>> {
10165        if let Node::AnyTypeAnnotation(n) = self { Some(n) } else { None }
10166    }
10167
10168    /// The payload if this is a [`MixedTypeAnnotation`], `None` otherwise.
10169    pub fn as_mixed_type_annotation(&self) -> Option<&MixedTypeAnnotation<'gc>> {
10170        if let Node::MixedTypeAnnotation(n) = self { Some(n) } else { None }
10171    }
10172
10173    /// The payload if this is a [`BigIntTypeAnnotation`], `None` otherwise.
10174    pub fn as_big_int_type_annotation(&self) -> Option<&BigIntTypeAnnotation<'gc>> {
10175        if let Node::BigIntTypeAnnotation(n) = self { Some(n) } else { None }
10176    }
10177
10178    /// The payload if this is a [`VoidTypeAnnotation`], `None` otherwise.
10179    pub fn as_void_type_annotation(&self) -> Option<&VoidTypeAnnotation<'gc>> {
10180        if let Node::VoidTypeAnnotation(n) = self { Some(n) } else { None }
10181    }
10182
10183    /// The payload if this is a [`NeverTypeAnnotation`], `None` otherwise.
10184    pub fn as_never_type_annotation(&self) -> Option<&NeverTypeAnnotation<'gc>> {
10185        if let Node::NeverTypeAnnotation(n) = self { Some(n) } else { None }
10186    }
10187
10188    /// The payload if this is a [`UnknownTypeAnnotation`], `None` otherwise.
10189    pub fn as_unknown_type_annotation(&self) -> Option<&UnknownTypeAnnotation<'gc>> {
10190        if let Node::UnknownTypeAnnotation(n) = self { Some(n) } else { None }
10191    }
10192
10193    /// The payload if this is a [`UndefinedTypeAnnotation`], `None` otherwise.
10194    pub fn as_undefined_type_annotation(&self) -> Option<&UndefinedTypeAnnotation<'gc>> {
10195        if let Node::UndefinedTypeAnnotation(n) = self { Some(n) } else { None }
10196    }
10197
10198    /// The payload if this is a [`FunctionTypeAnnotation`], `None` otherwise.
10199    pub fn as_function_type_annotation(&self) -> Option<&FunctionTypeAnnotation<'gc>> {
10200        if let Node::FunctionTypeAnnotation(n) = self { Some(n) } else { None }
10201    }
10202
10203    /// The payload if this is a [`HookTypeAnnotation`], `None` otherwise.
10204    pub fn as_hook_type_annotation(&self) -> Option<&HookTypeAnnotation<'gc>> {
10205        if let Node::HookTypeAnnotation(n) = self { Some(n) } else { None }
10206    }
10207
10208    /// The payload if this is a [`FunctionTypeParam`], `None` otherwise.
10209    pub fn as_function_type_param(&self) -> Option<&FunctionTypeParam<'gc>> {
10210        if let Node::FunctionTypeParam(n) = self { Some(n) } else { None }
10211    }
10212
10213    /// The payload if this is a [`ComponentTypeAnnotation`], `None` otherwise.
10214    pub fn as_component_type_annotation(&self) -> Option<&ComponentTypeAnnotation<'gc>> {
10215        if let Node::ComponentTypeAnnotation(n) = self { Some(n) } else { None }
10216    }
10217
10218    /// The payload if this is a [`ComponentTypeParameter`], `None` otherwise.
10219    pub fn as_component_type_parameter(&self) -> Option<&ComponentTypeParameter<'gc>> {
10220        if let Node::ComponentTypeParameter(n) = self { Some(n) } else { None }
10221    }
10222
10223    /// The payload if this is a [`NullableTypeAnnotation`], `None` otherwise.
10224    pub fn as_nullable_type_annotation(&self) -> Option<&NullableTypeAnnotation<'gc>> {
10225        if let Node::NullableTypeAnnotation(n) = self { Some(n) } else { None }
10226    }
10227
10228    /// The payload if this is a [`QualifiedTypeIdentifier`], `None` otherwise.
10229    pub fn as_qualified_type_identifier(&self) -> Option<&QualifiedTypeIdentifier<'gc>> {
10230        if let Node::QualifiedTypeIdentifier(n) = self { Some(n) } else { None }
10231    }
10232
10233    /// The payload if this is a [`TypeofTypeAnnotation`], `None` otherwise.
10234    pub fn as_typeof_type_annotation(&self) -> Option<&TypeofTypeAnnotation<'gc>> {
10235        if let Node::TypeofTypeAnnotation(n) = self { Some(n) } else { None }
10236    }
10237
10238    /// The payload if this is a [`KeyofTypeAnnotation`], `None` otherwise.
10239    pub fn as_keyof_type_annotation(&self) -> Option<&KeyofTypeAnnotation<'gc>> {
10240        if let Node::KeyofTypeAnnotation(n) = self { Some(n) } else { None }
10241    }
10242
10243    /// The payload if this is a [`TypeOperator`], `None` otherwise.
10244    pub fn as_type_operator(&self) -> Option<&TypeOperator<'gc>> {
10245        if let Node::TypeOperator(n) = self { Some(n) } else { None }
10246    }
10247
10248    /// The payload if this is a [`QualifiedTypeofIdentifier`], `None`
10249    /// otherwise.
10250    pub fn as_qualified_typeof_identifier(&self) -> Option<&QualifiedTypeofIdentifier<'gc>> {
10251        if let Node::QualifiedTypeofIdentifier(n) = self { Some(n) } else { None }
10252    }
10253
10254    /// The payload if this is a [`TupleTypeAnnotation`], `None` otherwise.
10255    pub fn as_tuple_type_annotation(&self) -> Option<&TupleTypeAnnotation<'gc>> {
10256        if let Node::TupleTypeAnnotation(n) = self { Some(n) } else { None }
10257    }
10258
10259    /// The payload if this is a [`TupleTypeSpreadElement`], `None` otherwise.
10260    pub fn as_tuple_type_spread_element(&self) -> Option<&TupleTypeSpreadElement<'gc>> {
10261        if let Node::TupleTypeSpreadElement(n) = self { Some(n) } else { None }
10262    }
10263
10264    /// The payload if this is a [`TupleTypeLabeledElement`], `None` otherwise.
10265    pub fn as_tuple_type_labeled_element(&self) -> Option<&TupleTypeLabeledElement<'gc>> {
10266        if let Node::TupleTypeLabeledElement(n) = self { Some(n) } else { None }
10267    }
10268
10269    /// The payload if this is a [`ArrayTypeAnnotation`], `None` otherwise.
10270    pub fn as_array_type_annotation(&self) -> Option<&ArrayTypeAnnotation<'gc>> {
10271        if let Node::ArrayTypeAnnotation(n) = self { Some(n) } else { None }
10272    }
10273
10274    /// The payload if this is a [`InferTypeAnnotation`], `None` otherwise.
10275    pub fn as_infer_type_annotation(&self) -> Option<&InferTypeAnnotation<'gc>> {
10276        if let Node::InferTypeAnnotation(n) = self { Some(n) } else { None }
10277    }
10278
10279    /// The payload if this is a [`UnionTypeAnnotation`], `None` otherwise.
10280    pub fn as_union_type_annotation(&self) -> Option<&UnionTypeAnnotation<'gc>> {
10281        if let Node::UnionTypeAnnotation(n) = self { Some(n) } else { None }
10282    }
10283
10284    /// The payload if this is a [`IntersectionTypeAnnotation`], `None`
10285    /// otherwise.
10286    pub fn as_intersection_type_annotation(&self) -> Option<&IntersectionTypeAnnotation<'gc>> {
10287        if let Node::IntersectionTypeAnnotation(n) = self { Some(n) } else { None }
10288    }
10289
10290    /// The payload if this is a [`GenericTypeAnnotation`], `None` otherwise.
10291    pub fn as_generic_type_annotation(&self) -> Option<&GenericTypeAnnotation<'gc>> {
10292        if let Node::GenericTypeAnnotation(n) = self { Some(n) } else { None }
10293    }
10294
10295    /// The payload if this is a [`IndexedAccessType`], `None` otherwise.
10296    pub fn as_indexed_access_type(&self) -> Option<&IndexedAccessType<'gc>> {
10297        if let Node::IndexedAccessType(n) = self { Some(n) } else { None }
10298    }
10299
10300    /// The payload if this is a [`OptionalIndexedAccessType`], `None`
10301    /// otherwise.
10302    pub fn as_optional_indexed_access_type(&self) -> Option<&OptionalIndexedAccessType<'gc>> {
10303        if let Node::OptionalIndexedAccessType(n) = self { Some(n) } else { None }
10304    }
10305
10306    /// The payload if this is a [`ConditionalTypeAnnotation`], `None`
10307    /// otherwise.
10308    pub fn as_conditional_type_annotation(&self) -> Option<&ConditionalTypeAnnotation<'gc>> {
10309        if let Node::ConditionalTypeAnnotation(n) = self { Some(n) } else { None }
10310    }
10311
10312    /// The payload if this is a [`TypePredicate`], `None` otherwise.
10313    pub fn as_type_predicate(&self) -> Option<&TypePredicate<'gc>> {
10314        if let Node::TypePredicate(n) = self { Some(n) } else { None }
10315    }
10316
10317    /// The payload if this is a [`InterfaceTypeAnnotation`], `None` otherwise.
10318    pub fn as_interface_type_annotation(&self) -> Option<&InterfaceTypeAnnotation<'gc>> {
10319        if let Node::InterfaceTypeAnnotation(n) = self { Some(n) } else { None }
10320    }
10321
10322    /// The payload if this is a [`TypeAlias`], `None` otherwise.
10323    pub fn as_type_alias(&self) -> Option<&TypeAlias<'gc>> {
10324        if let Node::TypeAlias(n) = self { Some(n) } else { None }
10325    }
10326
10327    /// The payload if this is a [`OpaqueType`], `None` otherwise.
10328    pub fn as_opaque_type(&self) -> Option<&OpaqueType<'gc>> {
10329        if let Node::OpaqueType(n) = self { Some(n) } else { None }
10330    }
10331
10332    /// The payload if this is a [`InterfaceDeclaration`], `None` otherwise.
10333    pub fn as_interface_declaration(&self) -> Option<&InterfaceDeclaration<'gc>> {
10334        if let Node::InterfaceDeclaration(n) = self { Some(n) } else { None }
10335    }
10336
10337    /// The payload if this is a [`DeclareTypeAlias`], `None` otherwise.
10338    pub fn as_declare_type_alias(&self) -> Option<&DeclareTypeAlias<'gc>> {
10339        if let Node::DeclareTypeAlias(n) = self { Some(n) } else { None }
10340    }
10341
10342    /// The payload if this is a [`DeclareOpaqueType`], `None` otherwise.
10343    pub fn as_declare_opaque_type(&self) -> Option<&DeclareOpaqueType<'gc>> {
10344        if let Node::DeclareOpaqueType(n) = self { Some(n) } else { None }
10345    }
10346
10347    /// The payload if this is a [`DeclareInterface`], `None` otherwise.
10348    pub fn as_declare_interface(&self) -> Option<&DeclareInterface<'gc>> {
10349        if let Node::DeclareInterface(n) = self { Some(n) } else { None }
10350    }
10351
10352    /// The payload if this is a [`DeclareClass`], `None` otherwise.
10353    pub fn as_declare_class(&self) -> Option<&DeclareClass<'gc>> {
10354        if let Node::DeclareClass(n) = self { Some(n) } else { None }
10355    }
10356
10357    /// The payload if this is a [`DeclareFunction`], `None` otherwise.
10358    pub fn as_declare_function(&self) -> Option<&DeclareFunction<'gc>> {
10359        if let Node::DeclareFunction(n) = self { Some(n) } else { None }
10360    }
10361
10362    /// The payload if this is a [`DeclareHook`], `None` otherwise.
10363    pub fn as_declare_hook(&self) -> Option<&DeclareHook<'gc>> {
10364        if let Node::DeclareHook(n) = self { Some(n) } else { None }
10365    }
10366
10367    /// The payload if this is a [`DeclareComponent`], `None` otherwise.
10368    pub fn as_declare_component(&self) -> Option<&DeclareComponent<'gc>> {
10369        if let Node::DeclareComponent(n) = self { Some(n) } else { None }
10370    }
10371
10372    /// The payload if this is a [`DeclareVariable`], `None` otherwise.
10373    pub fn as_declare_variable(&self) -> Option<&DeclareVariable<'gc>> {
10374        if let Node::DeclareVariable(n) = self { Some(n) } else { None }
10375    }
10376
10377    /// The payload if this is a [`DeclareEnum`], `None` otherwise.
10378    pub fn as_declare_enum(&self) -> Option<&DeclareEnum<'gc>> {
10379        if let Node::DeclareEnum(n) = self { Some(n) } else { None }
10380    }
10381
10382    /// The payload if this is a [`DeclareExportDeclaration`], `None` otherwise.
10383    pub fn as_declare_export_declaration(&self) -> Option<&DeclareExportDeclaration<'gc>> {
10384        if let Node::DeclareExportDeclaration(n) = self { Some(n) } else { None }
10385    }
10386
10387    /// The payload if this is a [`DeclareExportAllDeclaration`], `None`
10388    /// otherwise.
10389    pub fn as_declare_export_all_declaration(&self) -> Option<&DeclareExportAllDeclaration<'gc>> {
10390        if let Node::DeclareExportAllDeclaration(n) = self { Some(n) } else { None }
10391    }
10392
10393    /// The payload if this is a [`DeclareModule`], `None` otherwise.
10394    pub fn as_declare_module(&self) -> Option<&DeclareModule<'gc>> {
10395        if let Node::DeclareModule(n) = self { Some(n) } else { None }
10396    }
10397
10398    /// The payload if this is a [`DeclareNamespace`], `None` otherwise.
10399    pub fn as_declare_namespace(&self) -> Option<&DeclareNamespace<'gc>> {
10400        if let Node::DeclareNamespace(n) = self { Some(n) } else { None }
10401    }
10402
10403    /// The payload if this is a [`DeclareModuleExports`], `None` otherwise.
10404    pub fn as_declare_module_exports(&self) -> Option<&DeclareModuleExports<'gc>> {
10405        if let Node::DeclareModuleExports(n) = self { Some(n) } else { None }
10406    }
10407
10408    /// The payload if this is a [`InterfaceExtends`], `None` otherwise.
10409    pub fn as_interface_extends(&self) -> Option<&InterfaceExtends<'gc>> {
10410        if let Node::InterfaceExtends(n) = self { Some(n) } else { None }
10411    }
10412
10413    /// The payload if this is a [`ClassImplements`], `None` otherwise.
10414    pub fn as_class_implements(&self) -> Option<&ClassImplements<'gc>> {
10415        if let Node::ClassImplements(n) = self { Some(n) } else { None }
10416    }
10417
10418    /// The payload if this is a [`TypeAnnotation`], `None` otherwise.
10419    pub fn as_type_annotation(&self) -> Option<&TypeAnnotation<'gc>> {
10420        if let Node::TypeAnnotation(n) = self { Some(n) } else { None }
10421    }
10422
10423    /// The payload if this is a [`ObjectTypeAnnotation`], `None` otherwise.
10424    pub fn as_object_type_annotation(&self) -> Option<&ObjectTypeAnnotation<'gc>> {
10425        if let Node::ObjectTypeAnnotation(n) = self { Some(n) } else { None }
10426    }
10427
10428    /// The payload if this is a [`ObjectTypeProperty`], `None` otherwise.
10429    pub fn as_object_type_property(&self) -> Option<&ObjectTypeProperty<'gc>> {
10430        if let Node::ObjectTypeProperty(n) = self { Some(n) } else { None }
10431    }
10432
10433    /// The payload if this is a [`ObjectTypeSpreadProperty`], `None` otherwise.
10434    pub fn as_object_type_spread_property(&self) -> Option<&ObjectTypeSpreadProperty<'gc>> {
10435        if let Node::ObjectTypeSpreadProperty(n) = self { Some(n) } else { None }
10436    }
10437
10438    /// The payload if this is a [`ObjectTypeInternalSlot`], `None` otherwise.
10439    pub fn as_object_type_internal_slot(&self) -> Option<&ObjectTypeInternalSlot<'gc>> {
10440        if let Node::ObjectTypeInternalSlot(n) = self { Some(n) } else { None }
10441    }
10442
10443    /// The payload if this is a [`ObjectTypeCallProperty`], `None` otherwise.
10444    pub fn as_object_type_call_property(&self) -> Option<&ObjectTypeCallProperty<'gc>> {
10445        if let Node::ObjectTypeCallProperty(n) = self { Some(n) } else { None }
10446    }
10447
10448    /// The payload if this is a [`ObjectTypeIndexer`], `None` otherwise.
10449    pub fn as_object_type_indexer(&self) -> Option<&ObjectTypeIndexer<'gc>> {
10450        if let Node::ObjectTypeIndexer(n) = self { Some(n) } else { None }
10451    }
10452
10453    /// The payload if this is a [`ObjectTypeMappedTypeProperty`], `None`
10454    /// otherwise.
10455    pub fn as_object_type_mapped_type_property(&self) -> Option<&ObjectTypeMappedTypeProperty<'gc>> {
10456        if let Node::ObjectTypeMappedTypeProperty(n) = self { Some(n) } else { None }
10457    }
10458
10459    /// The payload if this is a [`Variance`], `None` otherwise.
10460    pub fn as_variance(&self) -> Option<&Variance<'gc>> {
10461        if let Node::Variance(n) = self { Some(n) } else { None }
10462    }
10463
10464    /// The payload if this is a [`TypeParameterDeclaration`], `None` otherwise.
10465    pub fn as_type_parameter_declaration(&self) -> Option<&TypeParameterDeclaration<'gc>> {
10466        if let Node::TypeParameterDeclaration(n) = self { Some(n) } else { None }
10467    }
10468
10469    /// The payload if this is a [`TypeParameter`], `None` otherwise.
10470    pub fn as_type_parameter(&self) -> Option<&TypeParameter<'gc>> {
10471        if let Node::TypeParameter(n) = self { Some(n) } else { None }
10472    }
10473
10474    /// The payload if this is a [`TypeParameterInstantiation`], `None`
10475    /// otherwise.
10476    pub fn as_type_parameter_instantiation(&self) -> Option<&TypeParameterInstantiation<'gc>> {
10477        if let Node::TypeParameterInstantiation(n) = self { Some(n) } else { None }
10478    }
10479
10480    /// The payload if this is a [`TypeCastExpression`], `None` otherwise.
10481    pub fn as_type_cast_expression(&self) -> Option<&TypeCastExpression<'gc>> {
10482        if let Node::TypeCastExpression(n) = self { Some(n) } else { None }
10483    }
10484
10485    /// The payload if this is a [`AsExpression`], `None` otherwise.
10486    pub fn as_as_expression(&self) -> Option<&AsExpression<'gc>> {
10487        if let Node::AsExpression(n) = self { Some(n) } else { None }
10488    }
10489
10490    /// The payload if this is a [`AsConstExpression`], `None` otherwise.
10491    pub fn as_as_const_expression(&self) -> Option<&AsConstExpression<'gc>> {
10492        if let Node::AsConstExpression(n) = self { Some(n) } else { None }
10493    }
10494
10495    /// The payload if this is a [`InferredPredicate`], `None` otherwise.
10496    pub fn as_inferred_predicate(&self) -> Option<&InferredPredicate<'gc>> {
10497        if let Node::InferredPredicate(n) = self { Some(n) } else { None }
10498    }
10499
10500    /// The payload if this is a [`DeclaredPredicate`], `None` otherwise.
10501    pub fn as_declared_predicate(&self) -> Option<&DeclaredPredicate<'gc>> {
10502        if let Node::DeclaredPredicate(n) = self { Some(n) } else { None }
10503    }
10504
10505    /// The payload if this is a [`EnumDeclaration`], `None` otherwise.
10506    pub fn as_enum_declaration(&self) -> Option<&EnumDeclaration<'gc>> {
10507        if let Node::EnumDeclaration(n) = self { Some(n) } else { None }
10508    }
10509
10510    /// The payload if this is a [`EnumStringBody`], `None` otherwise.
10511    pub fn as_enum_string_body(&self) -> Option<&EnumStringBody<'gc>> {
10512        if let Node::EnumStringBody(n) = self { Some(n) } else { None }
10513    }
10514
10515    /// The payload if this is a [`EnumNumberBody`], `None` otherwise.
10516    pub fn as_enum_number_body(&self) -> Option<&EnumNumberBody<'gc>> {
10517        if let Node::EnumNumberBody(n) = self { Some(n) } else { None }
10518    }
10519
10520    /// The payload if this is a [`EnumBigIntBody`], `None` otherwise.
10521    pub fn as_enum_big_int_body(&self) -> Option<&EnumBigIntBody<'gc>> {
10522        if let Node::EnumBigIntBody(n) = self { Some(n) } else { None }
10523    }
10524
10525    /// The payload if this is a [`EnumBooleanBody`], `None` otherwise.
10526    pub fn as_enum_boolean_body(&self) -> Option<&EnumBooleanBody<'gc>> {
10527        if let Node::EnumBooleanBody(n) = self { Some(n) } else { None }
10528    }
10529
10530    /// The payload if this is a [`EnumSymbolBody`], `None` otherwise.
10531    pub fn as_enum_symbol_body(&self) -> Option<&EnumSymbolBody<'gc>> {
10532        if let Node::EnumSymbolBody(n) = self { Some(n) } else { None }
10533    }
10534
10535    /// The payload if this is a [`EnumDefaultedMember`], `None` otherwise.
10536    pub fn as_enum_defaulted_member(&self) -> Option<&EnumDefaultedMember<'gc>> {
10537        if let Node::EnumDefaultedMember(n) = self { Some(n) } else { None }
10538    }
10539
10540    /// The payload if this is a [`EnumStringMember`], `None` otherwise.
10541    pub fn as_enum_string_member(&self) -> Option<&EnumStringMember<'gc>> {
10542        if let Node::EnumStringMember(n) = self { Some(n) } else { None }
10543    }
10544
10545    /// The payload if this is a [`EnumNumberMember`], `None` otherwise.
10546    pub fn as_enum_number_member(&self) -> Option<&EnumNumberMember<'gc>> {
10547        if let Node::EnumNumberMember(n) = self { Some(n) } else { None }
10548    }
10549
10550    /// The payload if this is a [`EnumBigIntMember`], `None` otherwise.
10551    pub fn as_enum_big_int_member(&self) -> Option<&EnumBigIntMember<'gc>> {
10552        if let Node::EnumBigIntMember(n) = self { Some(n) } else { None }
10553    }
10554
10555    /// The payload if this is a [`EnumBooleanMember`], `None` otherwise.
10556    pub fn as_enum_boolean_member(&self) -> Option<&EnumBooleanMember<'gc>> {
10557        if let Node::EnumBooleanMember(n) = self { Some(n) } else { None }
10558    }
10559
10560    /// The payload if this is a [`ComponentParameter`], `None` otherwise.
10561    pub fn as_component_parameter(&self) -> Option<&ComponentParameter<'gc>> {
10562        if let Node::ComponentParameter(n) = self { Some(n) } else { None }
10563    }
10564
10565    /// The payload if this is a [`RecordDeclaration`], `None` otherwise.
10566    pub fn as_record_declaration(&self) -> Option<&RecordDeclaration<'gc>> {
10567        if let Node::RecordDeclaration(n) = self { Some(n) } else { None }
10568    }
10569
10570    /// The payload if this is a [`RecordDeclarationImplements`], `None`
10571    /// otherwise.
10572    pub fn as_record_declaration_implements(&self) -> Option<&RecordDeclarationImplements<'gc>> {
10573        if let Node::RecordDeclarationImplements(n) = self { Some(n) } else { None }
10574    }
10575
10576    /// The payload if this is a [`RecordDeclarationBody`], `None` otherwise.
10577    pub fn as_record_declaration_body(&self) -> Option<&RecordDeclarationBody<'gc>> {
10578        if let Node::RecordDeclarationBody(n) = self { Some(n) } else { None }
10579    }
10580
10581    /// The payload if this is a [`RecordDeclarationProperty`], `None`
10582    /// otherwise.
10583    pub fn as_record_declaration_property(&self) -> Option<&RecordDeclarationProperty<'gc>> {
10584        if let Node::RecordDeclarationProperty(n) = self { Some(n) } else { None }
10585    }
10586
10587    /// The payload if this is a [`RecordDeclarationStaticProperty`], `None`
10588    /// otherwise.
10589    pub fn as_record_declaration_static_property(&self) -> Option<&RecordDeclarationStaticProperty<'gc>> {
10590        if let Node::RecordDeclarationStaticProperty(n) = self { Some(n) } else { None }
10591    }
10592
10593    /// The payload if this is a [`RecordExpression`], `None` otherwise.
10594    pub fn as_record_expression(&self) -> Option<&RecordExpression<'gc>> {
10595        if let Node::RecordExpression(n) = self { Some(n) } else { None }
10596    }
10597
10598    /// The payload if this is a [`RecordExpressionProperties`], `None`
10599    /// otherwise.
10600    pub fn as_record_expression_properties(&self) -> Option<&RecordExpressionProperties<'gc>> {
10601        if let Node::RecordExpressionProperties(n) = self { Some(n) } else { None }
10602    }
10603
10604    /// The payload if this is a [`TSTypeAnnotation`], `None` otherwise.
10605    pub fn as_ts_type_annotation(&self) -> Option<&TSTypeAnnotation<'gc>> {
10606        if let Node::TSTypeAnnotation(n) = self { Some(n) } else { None }
10607    }
10608
10609    /// The payload if this is a [`TSAnyKeyword`], `None` otherwise.
10610    pub fn as_ts_any_keyword(&self) -> Option<&TSAnyKeyword<'gc>> {
10611        if let Node::TSAnyKeyword(n) = self { Some(n) } else { None }
10612    }
10613
10614    /// The payload if this is a [`TSNumberKeyword`], `None` otherwise.
10615    pub fn as_ts_number_keyword(&self) -> Option<&TSNumberKeyword<'gc>> {
10616        if let Node::TSNumberKeyword(n) = self { Some(n) } else { None }
10617    }
10618
10619    /// The payload if this is a [`TSBooleanKeyword`], `None` otherwise.
10620    pub fn as_ts_boolean_keyword(&self) -> Option<&TSBooleanKeyword<'gc>> {
10621        if let Node::TSBooleanKeyword(n) = self { Some(n) } else { None }
10622    }
10623
10624    /// The payload if this is a [`TSStringKeyword`], `None` otherwise.
10625    pub fn as_ts_string_keyword(&self) -> Option<&TSStringKeyword<'gc>> {
10626        if let Node::TSStringKeyword(n) = self { Some(n) } else { None }
10627    }
10628
10629    /// The payload if this is a [`TSSymbolKeyword`], `None` otherwise.
10630    pub fn as_ts_symbol_keyword(&self) -> Option<&TSSymbolKeyword<'gc>> {
10631        if let Node::TSSymbolKeyword(n) = self { Some(n) } else { None }
10632    }
10633
10634    /// The payload if this is a [`TSVoidKeyword`], `None` otherwise.
10635    pub fn as_ts_void_keyword(&self) -> Option<&TSVoidKeyword<'gc>> {
10636        if let Node::TSVoidKeyword(n) = self { Some(n) } else { None }
10637    }
10638
10639    /// The payload if this is a [`TSUndefinedKeyword`], `None` otherwise.
10640    pub fn as_ts_undefined_keyword(&self) -> Option<&TSUndefinedKeyword<'gc>> {
10641        if let Node::TSUndefinedKeyword(n) = self { Some(n) } else { None }
10642    }
10643
10644    /// The payload if this is a [`TSUnknownKeyword`], `None` otherwise.
10645    pub fn as_ts_unknown_keyword(&self) -> Option<&TSUnknownKeyword<'gc>> {
10646        if let Node::TSUnknownKeyword(n) = self { Some(n) } else { None }
10647    }
10648
10649    /// The payload if this is a [`TSNeverKeyword`], `None` otherwise.
10650    pub fn as_ts_never_keyword(&self) -> Option<&TSNeverKeyword<'gc>> {
10651        if let Node::TSNeverKeyword(n) = self { Some(n) } else { None }
10652    }
10653
10654    /// The payload if this is a [`TSBigIntKeyword`], `None` otherwise.
10655    pub fn as_ts_big_int_keyword(&self) -> Option<&TSBigIntKeyword<'gc>> {
10656        if let Node::TSBigIntKeyword(n) = self { Some(n) } else { None }
10657    }
10658
10659    /// The payload if this is a [`TSThisType`], `None` otherwise.
10660    pub fn as_ts_this_type(&self) -> Option<&TSThisType<'gc>> {
10661        if let Node::TSThisType(n) = self { Some(n) } else { None }
10662    }
10663
10664    /// The payload if this is a [`TSLiteralType`], `None` otherwise.
10665    pub fn as_ts_literal_type(&self) -> Option<&TSLiteralType<'gc>> {
10666        if let Node::TSLiteralType(n) = self { Some(n) } else { None }
10667    }
10668
10669    /// The payload if this is a [`TSIndexedAccessType`], `None` otherwise.
10670    pub fn as_ts_indexed_access_type(&self) -> Option<&TSIndexedAccessType<'gc>> {
10671        if let Node::TSIndexedAccessType(n) = self { Some(n) } else { None }
10672    }
10673
10674    /// The payload if this is a [`TSArrayType`], `None` otherwise.
10675    pub fn as_ts_array_type(&self) -> Option<&TSArrayType<'gc>> {
10676        if let Node::TSArrayType(n) = self { Some(n) } else { None }
10677    }
10678
10679    /// The payload if this is a [`TSTypeReference`], `None` otherwise.
10680    pub fn as_ts_type_reference(&self) -> Option<&TSTypeReference<'gc>> {
10681        if let Node::TSTypeReference(n) = self { Some(n) } else { None }
10682    }
10683
10684    /// The payload if this is a [`TSQualifiedName`], `None` otherwise.
10685    pub fn as_ts_qualified_name(&self) -> Option<&TSQualifiedName<'gc>> {
10686        if let Node::TSQualifiedName(n) = self { Some(n) } else { None }
10687    }
10688
10689    /// The payload if this is a [`TSFunctionType`], `None` otherwise.
10690    pub fn as_ts_function_type(&self) -> Option<&TSFunctionType<'gc>> {
10691        if let Node::TSFunctionType(n) = self { Some(n) } else { None }
10692    }
10693
10694    /// The payload if this is a [`TSConstructorType`], `None` otherwise.
10695    pub fn as_ts_constructor_type(&self) -> Option<&TSConstructorType<'gc>> {
10696        if let Node::TSConstructorType(n) = self { Some(n) } else { None }
10697    }
10698
10699    /// The payload if this is a [`TSTypePredicate`], `None` otherwise.
10700    pub fn as_ts_type_predicate(&self) -> Option<&TSTypePredicate<'gc>> {
10701        if let Node::TSTypePredicate(n) = self { Some(n) } else { None }
10702    }
10703
10704    /// The payload if this is a [`TSTupleType`], `None` otherwise.
10705    pub fn as_ts_tuple_type(&self) -> Option<&TSTupleType<'gc>> {
10706        if let Node::TSTupleType(n) = self { Some(n) } else { None }
10707    }
10708
10709    /// The payload if this is a [`TSTypeAssertion`], `None` otherwise.
10710    pub fn as_ts_type_assertion(&self) -> Option<&TSTypeAssertion<'gc>> {
10711        if let Node::TSTypeAssertion(n) = self { Some(n) } else { None }
10712    }
10713
10714    /// The payload if this is a [`TSAsExpression`], `None` otherwise.
10715    pub fn as_ts_as_expression(&self) -> Option<&TSAsExpression<'gc>> {
10716        if let Node::TSAsExpression(n) = self { Some(n) } else { None }
10717    }
10718
10719    /// The payload if this is a [`TSParameterProperty`], `None` otherwise.
10720    pub fn as_ts_parameter_property(&self) -> Option<&TSParameterProperty<'gc>> {
10721        if let Node::TSParameterProperty(n) = self { Some(n) } else { None }
10722    }
10723
10724    /// The payload if this is a [`TSTypeAliasDeclaration`], `None` otherwise.
10725    pub fn as_ts_type_alias_declaration(&self) -> Option<&TSTypeAliasDeclaration<'gc>> {
10726        if let Node::TSTypeAliasDeclaration(n) = self { Some(n) } else { None }
10727    }
10728
10729    /// The payload if this is a [`TSInterfaceDeclaration`], `None` otherwise.
10730    pub fn as_ts_interface_declaration(&self) -> Option<&TSInterfaceDeclaration<'gc>> {
10731        if let Node::TSInterfaceDeclaration(n) = self { Some(n) } else { None }
10732    }
10733
10734    /// The payload if this is a [`TSInterfaceHeritage`], `None` otherwise.
10735    pub fn as_ts_interface_heritage(&self) -> Option<&TSInterfaceHeritage<'gc>> {
10736        if let Node::TSInterfaceHeritage(n) = self { Some(n) } else { None }
10737    }
10738
10739    /// The payload if this is a [`TSInterfaceBody`], `None` otherwise.
10740    pub fn as_ts_interface_body(&self) -> Option<&TSInterfaceBody<'gc>> {
10741        if let Node::TSInterfaceBody(n) = self { Some(n) } else { None }
10742    }
10743
10744    /// The payload if this is a [`TSEnumDeclaration`], `None` otherwise.
10745    pub fn as_ts_enum_declaration(&self) -> Option<&TSEnumDeclaration<'gc>> {
10746        if let Node::TSEnumDeclaration(n) = self { Some(n) } else { None }
10747    }
10748
10749    /// The payload if this is a [`TSEnumMember`], `None` otherwise.
10750    pub fn as_ts_enum_member(&self) -> Option<&TSEnumMember<'gc>> {
10751        if let Node::TSEnumMember(n) = self { Some(n) } else { None }
10752    }
10753
10754    /// The payload if this is a [`TSModuleDeclaration`], `None` otherwise.
10755    pub fn as_ts_module_declaration(&self) -> Option<&TSModuleDeclaration<'gc>> {
10756        if let Node::TSModuleDeclaration(n) = self { Some(n) } else { None }
10757    }
10758
10759    /// The payload if this is a [`TSModuleBlock`], `None` otherwise.
10760    pub fn as_ts_module_block(&self) -> Option<&TSModuleBlock<'gc>> {
10761        if let Node::TSModuleBlock(n) = self { Some(n) } else { None }
10762    }
10763
10764    /// The payload if this is a [`TSModuleMember`], `None` otherwise.
10765    pub fn as_ts_module_member(&self) -> Option<&TSModuleMember<'gc>> {
10766        if let Node::TSModuleMember(n) = self { Some(n) } else { None }
10767    }
10768
10769    /// The payload if this is a [`TSTypeParameterDeclaration`], `None`
10770    /// otherwise.
10771    pub fn as_ts_type_parameter_declaration(&self) -> Option<&TSTypeParameterDeclaration<'gc>> {
10772        if let Node::TSTypeParameterDeclaration(n) = self { Some(n) } else { None }
10773    }
10774
10775    /// The payload if this is a [`TSTypeParameter`], `None` otherwise.
10776    pub fn as_ts_type_parameter(&self) -> Option<&TSTypeParameter<'gc>> {
10777        if let Node::TSTypeParameter(n) = self { Some(n) } else { None }
10778    }
10779
10780    /// The payload if this is a [`TSTypeParameterInstantiation`], `None`
10781    /// otherwise.
10782    pub fn as_ts_type_parameter_instantiation(&self) -> Option<&TSTypeParameterInstantiation<'gc>> {
10783        if let Node::TSTypeParameterInstantiation(n) = self { Some(n) } else { None }
10784    }
10785
10786    /// The payload if this is a [`TSUnionType`], `None` otherwise.
10787    pub fn as_ts_union_type(&self) -> Option<&TSUnionType<'gc>> {
10788        if let Node::TSUnionType(n) = self { Some(n) } else { None }
10789    }
10790
10791    /// The payload if this is a [`TSIntersectionType`], `None` otherwise.
10792    pub fn as_ts_intersection_type(&self) -> Option<&TSIntersectionType<'gc>> {
10793        if let Node::TSIntersectionType(n) = self { Some(n) } else { None }
10794    }
10795
10796    /// The payload if this is a [`TSTypeQuery`], `None` otherwise.
10797    pub fn as_ts_type_query(&self) -> Option<&TSTypeQuery<'gc>> {
10798        if let Node::TSTypeQuery(n) = self { Some(n) } else { None }
10799    }
10800
10801    /// The payload if this is a [`TSConditionalType`], `None` otherwise.
10802    pub fn as_ts_conditional_type(&self) -> Option<&TSConditionalType<'gc>> {
10803        if let Node::TSConditionalType(n) = self { Some(n) } else { None }
10804    }
10805
10806    /// The payload if this is a [`TSTypeLiteral`], `None` otherwise.
10807    pub fn as_ts_type_literal(&self) -> Option<&TSTypeLiteral<'gc>> {
10808        if let Node::TSTypeLiteral(n) = self { Some(n) } else { None }
10809    }
10810
10811    /// The payload if this is a [`TSPropertySignature`], `None` otherwise.
10812    pub fn as_ts_property_signature(&self) -> Option<&TSPropertySignature<'gc>> {
10813        if let Node::TSPropertySignature(n) = self { Some(n) } else { None }
10814    }
10815
10816    /// The payload if this is a [`TSMethodSignature`], `None` otherwise.
10817    pub fn as_ts_method_signature(&self) -> Option<&TSMethodSignature<'gc>> {
10818        if let Node::TSMethodSignature(n) = self { Some(n) } else { None }
10819    }
10820
10821    /// The payload if this is a [`TSIndexSignature`], `None` otherwise.
10822    pub fn as_ts_index_signature(&self) -> Option<&TSIndexSignature<'gc>> {
10823        if let Node::TSIndexSignature(n) = self { Some(n) } else { None }
10824    }
10825
10826    /// The payload if this is a [`TSCallSignatureDeclaration`], `None`
10827    /// otherwise.
10828    pub fn as_ts_call_signature_declaration(&self) -> Option<&TSCallSignatureDeclaration<'gc>> {
10829        if let Node::TSCallSignatureDeclaration(n) = self { Some(n) } else { None }
10830    }
10831
10832    /// The payload if this is a [`TSModifiers`], `None` otherwise.
10833    pub fn as_ts_modifiers(&self) -> Option<&TSModifiers<'gc>> {
10834        if let Node::TSModifiers(n) = self { Some(n) } else { None }
10835    }
10836
10837    /// The payload if this is a [`CoverEmptyArgs`], `None` otherwise.
10838    pub fn as_cover_empty_args(&self) -> Option<&CoverEmptyArgs<'gc>> {
10839        if let Node::CoverEmptyArgs(n) = self { Some(n) } else { None }
10840    }
10841
10842    /// The payload if this is a [`CoverTrailingComma`], `None` otherwise.
10843    pub fn as_cover_trailing_comma(&self) -> Option<&CoverTrailingComma<'gc>> {
10844        if let Node::CoverTrailingComma(n) = self { Some(n) } else { None }
10845    }
10846
10847    /// The payload if this is a [`CoverInitializer`], `None` otherwise.
10848    pub fn as_cover_initializer(&self) -> Option<&CoverInitializer<'gc>> {
10849        if let Node::CoverInitializer(n) = self { Some(n) } else { None }
10850    }
10851
10852    /// The payload if this is a [`CoverRestElement`], `None` otherwise.
10853    pub fn as_cover_rest_element(&self) -> Option<&CoverRestElement<'gc>> {
10854        if let Node::CoverRestElement(n) = self { Some(n) } else { None }
10855    }
10856
10857    /// The payload if this is a [`CoverTypedIdentifier`], `None` otherwise.
10858    pub fn as_cover_typed_identifier(&self) -> Option<&CoverTypedIdentifier<'gc>> {
10859        if let Node::CoverTypedIdentifier(n) = self { Some(n) } else { None }
10860    }
10861
10862    /// The payload if this is a [`SHBuiltin`], `None` otherwise.
10863    pub fn as_sh_builtin(&self) -> Option<&SHBuiltin<'gc>> {
10864        if let Node::SHBuiltin(n) = self { Some(n) } else { None }
10865    }
10866
10867    /// The payload if this is a [`ImplicitCheckedCast`], `None` otherwise.
10868    pub fn as_implicit_checked_cast(&self) -> Option<&ImplicitCheckedCast<'gc>> {
10869        if let Node::ImplicitCheckedCast(n) = self { Some(n) } else { None }
10870    }
10871
10872    /// Visit every child node in declared order: the `ESTree.def`
10873    /// fields plus the decoration lists the GC marker must trace.
10874    pub fn visit_children<V: Visitor<'gc> + ?Sized>(&'gc self, v: &mut V) {
10875        match self {
10876            Node::Empty(_) => {}
10877            Node::Metadata(_) => {}
10878            Node::Program(n) => {
10879                for c in n.body.iter() { v.visit_node(c); }
10880                for c in n.decorations.get().iter() { v.visit_node(c); }
10881                for c in n.dummy_param_list.get().iter() { v.visit_node(c); }
10882            }
10883            Node::FunctionExpression(n) => {
10884                if let Some(c) = n.id { v.visit_node(c); }
10885                for c in n.params.iter() { v.visit_node(c); }
10886                v.visit_node(n.body);
10887                if let Some(c) = n.type_parameters { v.visit_node(c); }
10888                if let Some(c) = n.return_type { v.visit_node(c); }
10889                if let Some(c) = n.predicate { v.visit_node(c); }
10890                for c in n.decorations.get().iter() { v.visit_node(c); }
10891            }
10892            Node::ArrowFunctionExpression(n) => {
10893                for c in n.params.iter() { v.visit_node(c); }
10894                v.visit_node(n.body);
10895                if let Some(c) = n.type_parameters { v.visit_node(c); }
10896                if let Some(c) = n.return_type { v.visit_node(c); }
10897                if let Some(c) = n.predicate { v.visit_node(c); }
10898                for c in n.decorations.get().iter() { v.visit_node(c); }
10899            }
10900            Node::FunctionDeclaration(n) => {
10901                if let Some(c) = n.id { v.visit_node(c); }
10902                for c in n.params.iter() { v.visit_node(c); }
10903                v.visit_node(n.body);
10904                if let Some(c) = n.type_parameters { v.visit_node(c); }
10905                if let Some(c) = n.return_type { v.visit_node(c); }
10906                if let Some(c) = n.predicate { v.visit_node(c); }
10907                for c in n.decorations.get().iter() { v.visit_node(c); }
10908            }
10909            Node::ComponentDeclaration(n) => {
10910                v.visit_node(n.id);
10911                for c in n.params.iter() { v.visit_node(c); }
10912                v.visit_node(n.body);
10913                if let Some(c) = n.type_parameters { v.visit_node(c); }
10914                if let Some(c) = n.renders_type { v.visit_node(c); }
10915                for c in n.decorations.get().iter() { v.visit_node(c); }
10916            }
10917            Node::HookDeclaration(n) => {
10918                v.visit_node(n.id);
10919                for c in n.params.iter() { v.visit_node(c); }
10920                v.visit_node(n.body);
10921                if let Some(c) = n.type_parameters { v.visit_node(c); }
10922                if let Some(c) = n.return_type { v.visit_node(c); }
10923                for c in n.decorations.get().iter() { v.visit_node(c); }
10924            }
10925            Node::MatchStatement(n) => {
10926                v.visit_node(n.argument);
10927                for c in n.cases.iter() { v.visit_node(c); }
10928            }
10929            Node::WhileStatement(n) => {
10930                v.visit_node(n.body);
10931                v.visit_node(n.test);
10932            }
10933            Node::DoWhileStatement(n) => {
10934                v.visit_node(n.body);
10935                v.visit_node(n.test);
10936            }
10937            Node::ForInStatement(n) => {
10938                v.visit_node(n.left);
10939                v.visit_node(n.right);
10940                v.visit_node(n.body);
10941            }
10942            Node::ForOfStatement(n) => {
10943                v.visit_node(n.left);
10944                v.visit_node(n.right);
10945                v.visit_node(n.body);
10946            }
10947            Node::ForStatement(n) => {
10948                if let Some(c) = n.init { v.visit_node(c); }
10949                if let Some(c) = n.test { v.visit_node(c); }
10950                if let Some(c) = n.update { v.visit_node(c); }
10951                v.visit_node(n.body);
10952            }
10953            Node::DebuggerStatement(_) => {}
10954            Node::EmptyStatement(_) => {}
10955            Node::BlockStatement(n) => {
10956                for c in n.body.iter() { v.visit_node(c); }
10957            }
10958            Node::StaticBlock(n) => {
10959                for c in n.body.iter() { v.visit_node(c); }
10960            }
10961            Node::BreakStatement(n) => {
10962                if let Some(c) = n.label { v.visit_node(c); }
10963            }
10964            Node::ContinueStatement(n) => {
10965                if let Some(c) = n.label { v.visit_node(c); }
10966            }
10967            Node::ThrowStatement(n) => {
10968                v.visit_node(n.argument);
10969            }
10970            Node::ReturnStatement(n) => {
10971                if let Some(c) = n.argument { v.visit_node(c); }
10972            }
10973            Node::WithStatement(n) => {
10974                v.visit_node(n.object);
10975                v.visit_node(n.body);
10976            }
10977            Node::SwitchStatement(n) => {
10978                v.visit_node(n.discriminant);
10979                for c in n.cases.iter() { v.visit_node(c); }
10980            }
10981            Node::LabeledStatement(n) => {
10982                v.visit_node(n.label);
10983                v.visit_node(n.body);
10984            }
10985            Node::ExpressionStatement(n) => {
10986                v.visit_node(n.expression);
10987            }
10988            Node::TryStatement(n) => {
10989                v.visit_node(n.block);
10990                if let Some(c) = n.handler { v.visit_node(c); }
10991                if let Some(c) = n.finalizer { v.visit_node(c); }
10992            }
10993            Node::IfStatement(n) => {
10994                v.visit_node(n.test);
10995                v.visit_node(n.consequent);
10996                if let Some(c) = n.alternate { v.visit_node(c); }
10997            }
10998            Node::NullLiteral(_) => {}
10999            Node::BooleanLiteral(_) => {}
11000            Node::StringLiteral(_) => {}
11001            Node::NumericLiteral(_) => {}
11002            Node::RegExpLiteral(_) => {}
11003            Node::BigIntLiteral(_) => {}
11004            Node::ThisExpression(_) => {}
11005            Node::Super(_) => {}
11006            Node::SequenceExpression(n) => {
11007                for c in n.expressions.iter() { v.visit_node(c); }
11008            }
11009            Node::ObjectExpression(n) => {
11010                for c in n.properties.iter() { v.visit_node(c); }
11011            }
11012            Node::ArrayExpression(n) => {
11013                for c in n.elements.iter() { v.visit_node(c); }
11014            }
11015            Node::SpreadElement(n) => {
11016                v.visit_node(n.argument);
11017            }
11018            Node::NewExpression(n) => {
11019                v.visit_node(n.callee);
11020                if let Some(c) = n.type_arguments { v.visit_node(c); }
11021                for c in n.arguments.iter() { v.visit_node(c); }
11022            }
11023            Node::YieldExpression(n) => {
11024                if let Some(c) = n.argument { v.visit_node(c); }
11025            }
11026            Node::AwaitExpression(n) => {
11027                v.visit_node(n.argument);
11028            }
11029            Node::ImportExpression(n) => {
11030                v.visit_node(n.source);
11031                if let Some(c) = n.options { v.visit_node(c); }
11032            }
11033            Node::CallExpression(n) => {
11034                v.visit_node(n.callee);
11035                if let Some(c) = n.type_arguments { v.visit_node(c); }
11036                for c in n.arguments.iter() { v.visit_node(c); }
11037            }
11038            Node::OptionalCallExpression(n) => {
11039                v.visit_node(n.callee);
11040                if let Some(c) = n.type_arguments { v.visit_node(c); }
11041                for c in n.arguments.iter() { v.visit_node(c); }
11042            }
11043            Node::AssignmentExpression(n) => {
11044                v.visit_node(n.left);
11045                v.visit_node(n.right);
11046            }
11047            Node::UnaryExpression(n) => {
11048                v.visit_node(n.argument);
11049            }
11050            Node::UpdateExpression(n) => {
11051                v.visit_node(n.argument);
11052            }
11053            Node::MemberExpression(n) => {
11054                v.visit_node(n.object);
11055                v.visit_node(n.property);
11056            }
11057            Node::OptionalMemberExpression(n) => {
11058                v.visit_node(n.object);
11059                v.visit_node(n.property);
11060            }
11061            Node::LogicalExpression(n) => {
11062                v.visit_node(n.left);
11063                v.visit_node(n.right);
11064            }
11065            Node::ConditionalExpression(n) => {
11066                v.visit_node(n.test);
11067                v.visit_node(n.alternate);
11068                v.visit_node(n.consequent);
11069            }
11070            Node::BinaryExpression(n) => {
11071                v.visit_node(n.left);
11072                v.visit_node(n.right);
11073            }
11074            Node::Directive(n) => {
11075                v.visit_node(n.value);
11076            }
11077            Node::DirectiveLiteral(_) => {}
11078            Node::Identifier(n) => {
11079                if let Some(c) = n.type_annotation { v.visit_node(c); }
11080            }
11081            Node::PrivateName(n) => {
11082                v.visit_node(n.id);
11083            }
11084            Node::MetaProperty(n) => {
11085                v.visit_node(n.meta);
11086                v.visit_node(n.property);
11087            }
11088            Node::SwitchCase(n) => {
11089                if let Some(c) = n.test { v.visit_node(c); }
11090                for c in n.consequent.iter() { v.visit_node(c); }
11091            }
11092            Node::CatchClause(n) => {
11093                if let Some(c) = n.param { v.visit_node(c); }
11094                v.visit_node(n.body);
11095            }
11096            Node::VariableDeclarator(n) => {
11097                if let Some(c) = n.init { v.visit_node(c); }
11098                v.visit_node(n.id);
11099            }
11100            Node::VariableDeclaration(n) => {
11101                for c in n.declarations.iter() { v.visit_node(c); }
11102            }
11103            Node::TemplateLiteral(n) => {
11104                for c in n.quasis.iter() { v.visit_node(c); }
11105                for c in n.expressions.iter() { v.visit_node(c); }
11106            }
11107            Node::TaggedTemplateExpression(n) => {
11108                v.visit_node(n.tag);
11109                v.visit_node(n.quasi);
11110            }
11111            Node::TemplateElement(_) => {}
11112            Node::Property(n) => {
11113                v.visit_node(n.key);
11114                v.visit_node(n.value);
11115            }
11116            Node::Decorator(n) => {
11117                v.visit_node(n.expression);
11118            }
11119            Node::ClassDeclaration(n) => {
11120                if let Some(c) = n.id { v.visit_node(c); }
11121                if let Some(c) = n.type_parameters { v.visit_node(c); }
11122                if let Some(c) = n.super_class { v.visit_node(c); }
11123                if let Some(c) = n.super_type_arguments { v.visit_node(c); }
11124                for c in n.implements.iter() { v.visit_node(c); }
11125                for c in n.decorators.iter() { v.visit_node(c); }
11126                v.visit_node(n.body);
11127            }
11128            Node::ClassExpression(n) => {
11129                if let Some(c) = n.id { v.visit_node(c); }
11130                if let Some(c) = n.type_parameters { v.visit_node(c); }
11131                if let Some(c) = n.super_class { v.visit_node(c); }
11132                if let Some(c) = n.super_type_arguments { v.visit_node(c); }
11133                for c in n.implements.iter() { v.visit_node(c); }
11134                for c in n.decorators.iter() { v.visit_node(c); }
11135                v.visit_node(n.body);
11136            }
11137            Node::ClassBody(n) => {
11138                for c in n.body.iter() { v.visit_node(c); }
11139            }
11140            Node::ClassProperty(n) => {
11141                v.visit_node(n.key);
11142                if let Some(c) = n.value { v.visit_node(c); }
11143                for c in n.decorators.iter() { v.visit_node(c); }
11144                if let Some(c) = n.variance { v.visit_node(c); }
11145                if let Some(c) = n.type_annotation { v.visit_node(c); }
11146                if let Some(c) = n.ts_modifiers { v.visit_node(c); }
11147            }
11148            Node::ClassPrivateProperty(n) => {
11149                v.visit_node(n.key);
11150                if let Some(c) = n.value { v.visit_node(c); }
11151                for c in n.decorators.iter() { v.visit_node(c); }
11152                if let Some(c) = n.variance { v.visit_node(c); }
11153                if let Some(c) = n.type_annotation { v.visit_node(c); }
11154                if let Some(c) = n.ts_modifiers { v.visit_node(c); }
11155            }
11156            Node::MethodDefinition(n) => {
11157                v.visit_node(n.key);
11158                v.visit_node(n.value);
11159                for c in n.decorators.iter() { v.visit_node(c); }
11160            }
11161            Node::ImportDeclaration(n) => {
11162                for c in n.specifiers.iter() { v.visit_node(c); }
11163                v.visit_node(n.source);
11164                for c in n.attributes.iter() { v.visit_node(c); }
11165            }
11166            Node::ImportSpecifier(n) => {
11167                v.visit_node(n.imported);
11168                v.visit_node(n.local);
11169            }
11170            Node::ImportDefaultSpecifier(n) => {
11171                v.visit_node(n.local);
11172            }
11173            Node::ImportNamespaceSpecifier(n) => {
11174                v.visit_node(n.local);
11175            }
11176            Node::ImportAttribute(n) => {
11177                v.visit_node(n.key);
11178                v.visit_node(n.value);
11179            }
11180            Node::ExportNamedDeclaration(n) => {
11181                if let Some(c) = n.declaration { v.visit_node(c); }
11182                for c in n.specifiers.iter() { v.visit_node(c); }
11183                if let Some(c) = n.source { v.visit_node(c); }
11184            }
11185            Node::ExportSpecifier(n) => {
11186                v.visit_node(n.exported);
11187                v.visit_node(n.local);
11188            }
11189            Node::ExportNamespaceSpecifier(n) => {
11190                v.visit_node(n.exported);
11191            }
11192            Node::ExportDefaultDeclaration(n) => {
11193                v.visit_node(n.declaration);
11194            }
11195            Node::ExportAllDeclaration(n) => {
11196                v.visit_node(n.source);
11197            }
11198            Node::ObjectPattern(n) => {
11199                for c in n.properties.iter() { v.visit_node(c); }
11200                if let Some(c) = n.type_annotation { v.visit_node(c); }
11201            }
11202            Node::ArrayPattern(n) => {
11203                for c in n.elements.iter() { v.visit_node(c); }
11204                if let Some(c) = n.type_annotation { v.visit_node(c); }
11205            }
11206            Node::RestElement(n) => {
11207                v.visit_node(n.argument);
11208            }
11209            Node::AssignmentPattern(n) => {
11210                v.visit_node(n.left);
11211                v.visit_node(n.right);
11212            }
11213            Node::MatchStatementCase(n) => {
11214                v.visit_node(n.pattern);
11215                v.visit_node(n.body);
11216                if let Some(c) = n.guard { v.visit_node(c); }
11217            }
11218            Node::MatchExpression(n) => {
11219                v.visit_node(n.argument);
11220                for c in n.cases.iter() { v.visit_node(c); }
11221            }
11222            Node::MatchExpressionCase(n) => {
11223                v.visit_node(n.pattern);
11224                v.visit_node(n.body);
11225                if let Some(c) = n.guard { v.visit_node(c); }
11226            }
11227            Node::MatchWildcardPattern(_) => {}
11228            Node::MatchLiteralPattern(n) => {
11229                v.visit_node(n.literal);
11230            }
11231            Node::MatchUnaryPattern(n) => {
11232                v.visit_node(n.argument);
11233            }
11234            Node::MatchIdentifierPattern(n) => {
11235                v.visit_node(n.id);
11236            }
11237            Node::MatchBindingPattern(n) => {
11238                v.visit_node(n.id);
11239            }
11240            Node::MatchObjectPattern(n) => {
11241                for c in n.properties.iter() { v.visit_node(c); }
11242                if let Some(c) = n.rest { v.visit_node(c); }
11243            }
11244            Node::MatchArrayPattern(n) => {
11245                for c in n.elements.iter() { v.visit_node(c); }
11246                if let Some(c) = n.rest { v.visit_node(c); }
11247            }
11248            Node::MatchOrPattern(n) => {
11249                for c in n.patterns.iter() { v.visit_node(c); }
11250            }
11251            Node::MatchAsPattern(n) => {
11252                v.visit_node(n.pattern);
11253                v.visit_node(n.target);
11254            }
11255            Node::MatchMemberPattern(n) => {
11256                v.visit_node(n.base);
11257                v.visit_node(n.property);
11258            }
11259            Node::MatchInstancePattern(n) => {
11260                v.visit_node(n.target_constructor);
11261                v.visit_node(n.properties);
11262            }
11263            Node::MatchObjectPatternProperty(n) => {
11264                v.visit_node(n.key);
11265                v.visit_node(n.pattern);
11266            }
11267            Node::MatchInstanceObjectPattern(n) => {
11268                for c in n.properties.iter() { v.visit_node(c); }
11269                if let Some(c) = n.rest { v.visit_node(c); }
11270            }
11271            Node::MatchRestPattern(n) => {
11272                if let Some(c) = n.argument { v.visit_node(c); }
11273            }
11274            Node::JSXIdentifier(_) => {}
11275            Node::JSXMemberExpression(n) => {
11276                v.visit_node(n.object);
11277                v.visit_node(n.property);
11278            }
11279            Node::JSXNamespacedName(n) => {
11280                v.visit_node(n.namespace);
11281                v.visit_node(n.name);
11282            }
11283            Node::JSXEmptyExpression(_) => {}
11284            Node::JSXExpressionContainer(n) => {
11285                v.visit_node(n.expression);
11286            }
11287            Node::JSXSpreadChild(n) => {
11288                v.visit_node(n.expression);
11289            }
11290            Node::JSXOpeningElement(n) => {
11291                v.visit_node(n.name);
11292                for c in n.attributes.iter() { v.visit_node(c); }
11293                if let Some(c) = n.type_arguments { v.visit_node(c); }
11294            }
11295            Node::JSXClosingElement(n) => {
11296                v.visit_node(n.name);
11297            }
11298            Node::JSXAttribute(n) => {
11299                v.visit_node(n.name);
11300                if let Some(c) = n.value { v.visit_node(c); }
11301            }
11302            Node::JSXSpreadAttribute(n) => {
11303                v.visit_node(n.argument);
11304            }
11305            Node::JSXStringLiteral(_) => {}
11306            Node::JSXText(_) => {}
11307            Node::JSXElement(n) => {
11308                v.visit_node(n.opening_element);
11309                for c in n.children.iter() { v.visit_node(c); }
11310                if let Some(c) = n.closing_element { v.visit_node(c); }
11311            }
11312            Node::JSXFragment(n) => {
11313                v.visit_node(n.opening_fragment);
11314                for c in n.children.iter() { v.visit_node(c); }
11315                v.visit_node(n.closing_fragment);
11316            }
11317            Node::JSXOpeningFragment(_) => {}
11318            Node::JSXClosingFragment(_) => {}
11319            Node::ExistsTypeAnnotation(_) => {}
11320            Node::EmptyTypeAnnotation(_) => {}
11321            Node::StringTypeAnnotation(_) => {}
11322            Node::NumberTypeAnnotation(_) => {}
11323            Node::StringLiteralTypeAnnotation(_) => {}
11324            Node::NumberLiteralTypeAnnotation(_) => {}
11325            Node::BigIntLiteralTypeAnnotation(_) => {}
11326            Node::BooleanTypeAnnotation(_) => {}
11327            Node::BooleanLiteralTypeAnnotation(_) => {}
11328            Node::NullLiteralTypeAnnotation(_) => {}
11329            Node::SymbolTypeAnnotation(_) => {}
11330            Node::AnyTypeAnnotation(_) => {}
11331            Node::MixedTypeAnnotation(_) => {}
11332            Node::BigIntTypeAnnotation(_) => {}
11333            Node::VoidTypeAnnotation(_) => {}
11334            Node::NeverTypeAnnotation(_) => {}
11335            Node::UnknownTypeAnnotation(_) => {}
11336            Node::UndefinedTypeAnnotation(_) => {}
11337            Node::FunctionTypeAnnotation(n) => {
11338                for c in n.params.iter() { v.visit_node(c); }
11339                if let Some(c) = n.this { v.visit_node(c); }
11340                v.visit_node(n.return_type);
11341                if let Some(c) = n.rest { v.visit_node(c); }
11342                if let Some(c) = n.type_parameters { v.visit_node(c); }
11343            }
11344            Node::HookTypeAnnotation(n) => {
11345                for c in n.params.iter() { v.visit_node(c); }
11346                v.visit_node(n.return_type);
11347                if let Some(c) = n.rest { v.visit_node(c); }
11348                if let Some(c) = n.type_parameters { v.visit_node(c); }
11349            }
11350            Node::FunctionTypeParam(n) => {
11351                if let Some(c) = n.name { v.visit_node(c); }
11352                v.visit_node(n.type_annotation);
11353            }
11354            Node::ComponentTypeAnnotation(n) => {
11355                for c in n.params.iter() { v.visit_node(c); }
11356                if let Some(c) = n.rest { v.visit_node(c); }
11357                if let Some(c) = n.type_parameters { v.visit_node(c); }
11358                if let Some(c) = n.renders_type { v.visit_node(c); }
11359            }
11360            Node::ComponentTypeParameter(n) => {
11361                if let Some(c) = n.name { v.visit_node(c); }
11362                v.visit_node(n.type_annotation);
11363            }
11364            Node::NullableTypeAnnotation(n) => {
11365                v.visit_node(n.type_annotation);
11366            }
11367            Node::QualifiedTypeIdentifier(n) => {
11368                v.visit_node(n.qualification);
11369                v.visit_node(n.id);
11370            }
11371            Node::TypeofTypeAnnotation(n) => {
11372                v.visit_node(n.argument);
11373                if let Some(c) = n.type_arguments { v.visit_node(c); }
11374            }
11375            Node::KeyofTypeAnnotation(n) => {
11376                v.visit_node(n.argument);
11377            }
11378            Node::TypeOperator(n) => {
11379                v.visit_node(n.type_annotation);
11380            }
11381            Node::QualifiedTypeofIdentifier(n) => {
11382                v.visit_node(n.qualification);
11383                v.visit_node(n.id);
11384            }
11385            Node::TupleTypeAnnotation(n) => {
11386                for c in n.element_types.iter() { v.visit_node(c); }
11387            }
11388            Node::TupleTypeSpreadElement(n) => {
11389                if let Some(c) = n.label { v.visit_node(c); }
11390                v.visit_node(n.type_annotation);
11391            }
11392            Node::TupleTypeLabeledElement(n) => {
11393                v.visit_node(n.label);
11394                v.visit_node(n.element_type);
11395                if let Some(c) = n.variance { v.visit_node(c); }
11396            }
11397            Node::ArrayTypeAnnotation(n) => {
11398                v.visit_node(n.element_type);
11399            }
11400            Node::InferTypeAnnotation(n) => {
11401                v.visit_node(n.type_parameter);
11402            }
11403            Node::UnionTypeAnnotation(n) => {
11404                for c in n.types.iter() { v.visit_node(c); }
11405            }
11406            Node::IntersectionTypeAnnotation(n) => {
11407                for c in n.types.iter() { v.visit_node(c); }
11408            }
11409            Node::GenericTypeAnnotation(n) => {
11410                v.visit_node(n.id);
11411                if let Some(c) = n.type_parameters { v.visit_node(c); }
11412            }
11413            Node::IndexedAccessType(n) => {
11414                v.visit_node(n.object_type);
11415                v.visit_node(n.index_type);
11416            }
11417            Node::OptionalIndexedAccessType(n) => {
11418                v.visit_node(n.object_type);
11419                v.visit_node(n.index_type);
11420            }
11421            Node::ConditionalTypeAnnotation(n) => {
11422                v.visit_node(n.check_type);
11423                v.visit_node(n.extends_type);
11424                v.visit_node(n.true_type);
11425                v.visit_node(n.false_type);
11426            }
11427            Node::TypePredicate(n) => {
11428                v.visit_node(n.parameter_name);
11429                if let Some(c) = n.type_annotation { v.visit_node(c); }
11430            }
11431            Node::InterfaceTypeAnnotation(n) => {
11432                for c in n.extends.iter() { v.visit_node(c); }
11433                if let Some(c) = n.body { v.visit_node(c); }
11434            }
11435            Node::TypeAlias(n) => {
11436                v.visit_node(n.id);
11437                if let Some(c) = n.type_parameters { v.visit_node(c); }
11438                v.visit_node(n.right);
11439            }
11440            Node::OpaqueType(n) => {
11441                v.visit_node(n.id);
11442                if let Some(c) = n.type_parameters { v.visit_node(c); }
11443                v.visit_node(n.impltype);
11444                if let Some(c) = n.lower_bound { v.visit_node(c); }
11445                if let Some(c) = n.upper_bound { v.visit_node(c); }
11446                if let Some(c) = n.supertype { v.visit_node(c); }
11447            }
11448            Node::InterfaceDeclaration(n) => {
11449                v.visit_node(n.id);
11450                if let Some(c) = n.type_parameters { v.visit_node(c); }
11451                for c in n.extends.iter() { v.visit_node(c); }
11452                v.visit_node(n.body);
11453            }
11454            Node::DeclareTypeAlias(n) => {
11455                v.visit_node(n.id);
11456                if let Some(c) = n.type_parameters { v.visit_node(c); }
11457                v.visit_node(n.right);
11458            }
11459            Node::DeclareOpaqueType(n) => {
11460                v.visit_node(n.id);
11461                if let Some(c) = n.type_parameters { v.visit_node(c); }
11462                if let Some(c) = n.impltype { v.visit_node(c); }
11463                if let Some(c) = n.lower_bound { v.visit_node(c); }
11464                if let Some(c) = n.upper_bound { v.visit_node(c); }
11465                if let Some(c) = n.supertype { v.visit_node(c); }
11466            }
11467            Node::DeclareInterface(n) => {
11468                v.visit_node(n.id);
11469                if let Some(c) = n.type_parameters { v.visit_node(c); }
11470                for c in n.extends.iter() { v.visit_node(c); }
11471                v.visit_node(n.body);
11472            }
11473            Node::DeclareClass(n) => {
11474                v.visit_node(n.id);
11475                if let Some(c) = n.type_parameters { v.visit_node(c); }
11476                for c in n.extends.iter() { v.visit_node(c); }
11477                for c in n.implements.iter() { v.visit_node(c); }
11478                for c in n.mixins.iter() { v.visit_node(c); }
11479                v.visit_node(n.body);
11480            }
11481            Node::DeclareFunction(n) => {
11482                v.visit_node(n.id);
11483                if let Some(c) = n.predicate { v.visit_node(c); }
11484            }
11485            Node::DeclareHook(n) => {
11486                v.visit_node(n.id);
11487            }
11488            Node::DeclareComponent(n) => {
11489                v.visit_node(n.id);
11490                for c in n.params.iter() { v.visit_node(c); }
11491                if let Some(c) = n.rest { v.visit_node(c); }
11492                if let Some(c) = n.type_parameters { v.visit_node(c); }
11493                if let Some(c) = n.renders_type { v.visit_node(c); }
11494            }
11495            Node::DeclareVariable(n) => {
11496                v.visit_node(n.id);
11497            }
11498            Node::DeclareEnum(n) => {
11499                v.visit_node(n.id);
11500                v.visit_node(n.body);
11501            }
11502            Node::DeclareExportDeclaration(n) => {
11503                if let Some(c) = n.declaration { v.visit_node(c); }
11504                for c in n.specifiers.iter() { v.visit_node(c); }
11505                if let Some(c) = n.source { v.visit_node(c); }
11506            }
11507            Node::DeclareExportAllDeclaration(n) => {
11508                v.visit_node(n.source);
11509            }
11510            Node::DeclareModule(n) => {
11511                v.visit_node(n.id);
11512                v.visit_node(n.body);
11513            }
11514            Node::DeclareNamespace(n) => {
11515                v.visit_node(n.id);
11516                v.visit_node(n.body);
11517            }
11518            Node::DeclareModuleExports(n) => {
11519                v.visit_node(n.type_annotation);
11520            }
11521            Node::InterfaceExtends(n) => {
11522                v.visit_node(n.id);
11523                if let Some(c) = n.type_parameters { v.visit_node(c); }
11524            }
11525            Node::ClassImplements(n) => {
11526                v.visit_node(n.id);
11527                if let Some(c) = n.type_parameters { v.visit_node(c); }
11528            }
11529            Node::TypeAnnotation(n) => {
11530                v.visit_node(n.type_annotation);
11531            }
11532            Node::ObjectTypeAnnotation(n) => {
11533                for c in n.properties.iter() { v.visit_node(c); }
11534                for c in n.indexers.iter() { v.visit_node(c); }
11535                for c in n.call_properties.iter() { v.visit_node(c); }
11536                for c in n.internal_slots.iter() { v.visit_node(c); }
11537            }
11538            Node::ObjectTypeProperty(n) => {
11539                v.visit_node(n.key);
11540                v.visit_node(n.value);
11541                if let Some(c) = n.variance { v.visit_node(c); }
11542            }
11543            Node::ObjectTypeSpreadProperty(n) => {
11544                v.visit_node(n.argument);
11545            }
11546            Node::ObjectTypeInternalSlot(n) => {
11547                v.visit_node(n.id);
11548                v.visit_node(n.value);
11549            }
11550            Node::ObjectTypeCallProperty(n) => {
11551                v.visit_node(n.value);
11552            }
11553            Node::ObjectTypeIndexer(n) => {
11554                if let Some(c) = n.id { v.visit_node(c); }
11555                v.visit_node(n.key);
11556                v.visit_node(n.value);
11557                if let Some(c) = n.variance { v.visit_node(c); }
11558            }
11559            Node::ObjectTypeMappedTypeProperty(n) => {
11560                v.visit_node(n.key_tparam);
11561                v.visit_node(n.prop_type);
11562                v.visit_node(n.source_type);
11563                if let Some(c) = n.variance { v.visit_node(c); }
11564            }
11565            Node::Variance(_) => {}
11566            Node::TypeParameterDeclaration(n) => {
11567                for c in n.params.iter() { v.visit_node(c); }
11568            }
11569            Node::TypeParameter(n) => {
11570                if let Some(c) = n.bound { v.visit_node(c); }
11571                if let Some(c) = n.variance { v.visit_node(c); }
11572                if let Some(c) = n.default { v.visit_node(c); }
11573            }
11574            Node::TypeParameterInstantiation(n) => {
11575                for c in n.params.iter() { v.visit_node(c); }
11576            }
11577            Node::TypeCastExpression(n) => {
11578                v.visit_node(n.expression);
11579                v.visit_node(n.type_annotation);
11580            }
11581            Node::AsExpression(n) => {
11582                v.visit_node(n.expression);
11583                v.visit_node(n.type_annotation);
11584            }
11585            Node::AsConstExpression(n) => {
11586                v.visit_node(n.expression);
11587            }
11588            Node::InferredPredicate(_) => {}
11589            Node::DeclaredPredicate(n) => {
11590                v.visit_node(n.value);
11591            }
11592            Node::EnumDeclaration(n) => {
11593                v.visit_node(n.id);
11594                v.visit_node(n.body);
11595            }
11596            Node::EnumStringBody(n) => {
11597                for c in n.members.iter() { v.visit_node(c); }
11598            }
11599            Node::EnumNumberBody(n) => {
11600                for c in n.members.iter() { v.visit_node(c); }
11601            }
11602            Node::EnumBigIntBody(n) => {
11603                for c in n.members.iter() { v.visit_node(c); }
11604            }
11605            Node::EnumBooleanBody(n) => {
11606                for c in n.members.iter() { v.visit_node(c); }
11607            }
11608            Node::EnumSymbolBody(n) => {
11609                for c in n.members.iter() { v.visit_node(c); }
11610            }
11611            Node::EnumDefaultedMember(n) => {
11612                v.visit_node(n.id);
11613            }
11614            Node::EnumStringMember(n) => {
11615                v.visit_node(n.id);
11616                v.visit_node(n.init);
11617            }
11618            Node::EnumNumberMember(n) => {
11619                v.visit_node(n.id);
11620                v.visit_node(n.init);
11621            }
11622            Node::EnumBigIntMember(n) => {
11623                v.visit_node(n.id);
11624                v.visit_node(n.init);
11625            }
11626            Node::EnumBooleanMember(n) => {
11627                v.visit_node(n.id);
11628                v.visit_node(n.init);
11629            }
11630            Node::ComponentParameter(n) => {
11631                v.visit_node(n.name);
11632                v.visit_node(n.local);
11633            }
11634            Node::RecordDeclaration(n) => {
11635                v.visit_node(n.id);
11636                if let Some(c) = n.type_parameters { v.visit_node(c); }
11637                for c in n.implements.iter() { v.visit_node(c); }
11638                v.visit_node(n.body);
11639            }
11640            Node::RecordDeclarationImplements(n) => {
11641                v.visit_node(n.id);
11642                if let Some(c) = n.type_arguments { v.visit_node(c); }
11643            }
11644            Node::RecordDeclarationBody(n) => {
11645                for c in n.elements.iter() { v.visit_node(c); }
11646            }
11647            Node::RecordDeclarationProperty(n) => {
11648                v.visit_node(n.key);
11649                v.visit_node(n.type_annotation);
11650                if let Some(c) = n.default_value { v.visit_node(c); }
11651            }
11652            Node::RecordDeclarationStaticProperty(n) => {
11653                v.visit_node(n.key);
11654                v.visit_node(n.type_annotation);
11655                v.visit_node(n.value);
11656            }
11657            Node::RecordExpression(n) => {
11658                v.visit_node(n.record_constructor);
11659                if let Some(c) = n.type_arguments { v.visit_node(c); }
11660                v.visit_node(n.properties);
11661            }
11662            Node::RecordExpressionProperties(n) => {
11663                for c in n.properties.iter() { v.visit_node(c); }
11664            }
11665            Node::TSTypeAnnotation(n) => {
11666                v.visit_node(n.type_annotation);
11667            }
11668            Node::TSAnyKeyword(_) => {}
11669            Node::TSNumberKeyword(_) => {}
11670            Node::TSBooleanKeyword(_) => {}
11671            Node::TSStringKeyword(_) => {}
11672            Node::TSSymbolKeyword(_) => {}
11673            Node::TSVoidKeyword(_) => {}
11674            Node::TSUndefinedKeyword(_) => {}
11675            Node::TSUnknownKeyword(_) => {}
11676            Node::TSNeverKeyword(_) => {}
11677            Node::TSBigIntKeyword(_) => {}
11678            Node::TSThisType(_) => {}
11679            Node::TSLiteralType(n) => {
11680                v.visit_node(n.literal);
11681            }
11682            Node::TSIndexedAccessType(n) => {
11683                v.visit_node(n.object_type);
11684                v.visit_node(n.index_type);
11685            }
11686            Node::TSArrayType(n) => {
11687                v.visit_node(n.element_type);
11688            }
11689            Node::TSTypeReference(n) => {
11690                v.visit_node(n.type_name);
11691                if let Some(c) = n.type_parameters { v.visit_node(c); }
11692            }
11693            Node::TSQualifiedName(n) => {
11694                v.visit_node(n.left);
11695                if let Some(c) = n.right { v.visit_node(c); }
11696            }
11697            Node::TSFunctionType(n) => {
11698                for c in n.params.iter() { v.visit_node(c); }
11699                v.visit_node(n.return_type);
11700                if let Some(c) = n.type_parameters { v.visit_node(c); }
11701            }
11702            Node::TSConstructorType(n) => {
11703                for c in n.params.iter() { v.visit_node(c); }
11704                v.visit_node(n.return_type);
11705                if let Some(c) = n.type_parameters { v.visit_node(c); }
11706            }
11707            Node::TSTypePredicate(n) => {
11708                v.visit_node(n.parameter_name);
11709                v.visit_node(n.type_annotation);
11710            }
11711            Node::TSTupleType(n) => {
11712                for c in n.element_types.iter() { v.visit_node(c); }
11713            }
11714            Node::TSTypeAssertion(n) => {
11715                v.visit_node(n.type_annotation);
11716                v.visit_node(n.expression);
11717            }
11718            Node::TSAsExpression(n) => {
11719                v.visit_node(n.expression);
11720                v.visit_node(n.type_annotation);
11721            }
11722            Node::TSParameterProperty(n) => {
11723                v.visit_node(n.parameter);
11724            }
11725            Node::TSTypeAliasDeclaration(n) => {
11726                v.visit_node(n.id);
11727                if let Some(c) = n.type_parameters { v.visit_node(c); }
11728                v.visit_node(n.type_annotation);
11729            }
11730            Node::TSInterfaceDeclaration(n) => {
11731                v.visit_node(n.id);
11732                v.visit_node(n.body);
11733                for c in n.extends.iter() { v.visit_node(c); }
11734                if let Some(c) = n.type_parameters { v.visit_node(c); }
11735            }
11736            Node::TSInterfaceHeritage(n) => {
11737                v.visit_node(n.expression);
11738                if let Some(c) = n.type_parameters { v.visit_node(c); }
11739            }
11740            Node::TSInterfaceBody(n) => {
11741                for c in n.body.iter() { v.visit_node(c); }
11742            }
11743            Node::TSEnumDeclaration(n) => {
11744                v.visit_node(n.id);
11745                for c in n.members.iter() { v.visit_node(c); }
11746            }
11747            Node::TSEnumMember(n) => {
11748                v.visit_node(n.id);
11749                if let Some(c) = n.initializer { v.visit_node(c); }
11750            }
11751            Node::TSModuleDeclaration(n) => {
11752                v.visit_node(n.id);
11753                v.visit_node(n.body);
11754            }
11755            Node::TSModuleBlock(n) => {
11756                for c in n.body.iter() { v.visit_node(c); }
11757            }
11758            Node::TSModuleMember(n) => {
11759                v.visit_node(n.id);
11760                if let Some(c) = n.initializer { v.visit_node(c); }
11761            }
11762            Node::TSTypeParameterDeclaration(n) => {
11763                for c in n.params.iter() { v.visit_node(c); }
11764            }
11765            Node::TSTypeParameter(n) => {
11766                v.visit_node(n.name);
11767                if let Some(c) = n.constraint { v.visit_node(c); }
11768                if let Some(c) = n.default { v.visit_node(c); }
11769            }
11770            Node::TSTypeParameterInstantiation(n) => {
11771                for c in n.params.iter() { v.visit_node(c); }
11772            }
11773            Node::TSUnionType(n) => {
11774                for c in n.types.iter() { v.visit_node(c); }
11775            }
11776            Node::TSIntersectionType(n) => {
11777                for c in n.types.iter() { v.visit_node(c); }
11778            }
11779            Node::TSTypeQuery(n) => {
11780                v.visit_node(n.expr_name);
11781            }
11782            Node::TSConditionalType(n) => {
11783                v.visit_node(n.check_type);
11784                v.visit_node(n.extends_type);
11785                v.visit_node(n.true_type);
11786                v.visit_node(n.false_type);
11787            }
11788            Node::TSTypeLiteral(n) => {
11789                for c in n.members.iter() { v.visit_node(c); }
11790            }
11791            Node::TSPropertySignature(n) => {
11792                v.visit_node(n.key);
11793                if let Some(c) = n.type_annotation { v.visit_node(c); }
11794                if let Some(c) = n.initializer { v.visit_node(c); }
11795            }
11796            Node::TSMethodSignature(n) => {
11797                v.visit_node(n.key);
11798                for c in n.params.iter() { v.visit_node(c); }
11799                if let Some(c) = n.return_type { v.visit_node(c); }
11800            }
11801            Node::TSIndexSignature(n) => {
11802                for c in n.parameters.iter() { v.visit_node(c); }
11803                if let Some(c) = n.type_annotation { v.visit_node(c); }
11804            }
11805            Node::TSCallSignatureDeclaration(n) => {
11806                for c in n.params.iter() { v.visit_node(c); }
11807                if let Some(c) = n.return_type { v.visit_node(c); }
11808            }
11809            Node::TSModifiers(_) => {}
11810            Node::CoverEmptyArgs(_) => {}
11811            Node::CoverTrailingComma(_) => {}
11812            Node::CoverInitializer(n) => {
11813                v.visit_node(n.init);
11814            }
11815            Node::CoverRestElement(n) => {
11816                v.visit_node(n.rest);
11817            }
11818            Node::CoverTypedIdentifier(n) => {
11819                v.visit_node(n.left);
11820                if let Some(c) = n.right { v.visit_node(c); }
11821            }
11822            Node::SHBuiltin(_) => {}
11823            Node::ImplicitCheckedCast(n) => {
11824                v.visit_node(n.argument);
11825            }
11826        }
11827    }
11828
11829    /// Transform this node's children with `visitor`, rebuilding it only if
11830    /// a child changed. `self` is the original parent.
11831    pub fn visit_children_mut<V: VisitorMut<'gc>>(
11832        &'gc self,
11833        ctx: &'gc crate::context::GCLock<'_, '_>,
11834        visitor: &mut V,
11835    ) -> TransformResult<&'gc Node<'gc>> {
11836        let builder = builder::Builder::from_node(self);
11837        #[allow(unused_mut)]
11838        match builder {
11839            builder::Builder::Empty(mut b) => b.build(ctx),
11840            builder::Builder::Metadata(mut b) => b.build(ctx),
11841            builder::Builder::Program(mut b) => {
11842                if let TransformResult::Changed(v) =
11843                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
11844                    b.body(v);
11845                }
11846                b.build(ctx)
11847            }
11848            builder::Builder::FunctionExpression(mut b) => {
11849                if let TransformResult::Changed(v) =
11850                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
11851                    b.id(v);
11852                }
11853                if let TransformResult::Changed(v) =
11854                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
11855                    b.params(v);
11856                }
11857                if let TransformResult::Changed(v) =
11858                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
11859                    b.body(v);
11860                }
11861                if let TransformResult::Changed(v) =
11862                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
11863                    b.type_parameters(v);
11864                }
11865                if let TransformResult::Changed(v) =
11866                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
11867                    b.return_type(v);
11868                }
11869                if let TransformResult::Changed(v) =
11870                    b.inner.predicate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::predicate)) {
11871                    b.predicate(v);
11872                }
11873                b.build(ctx)
11874            }
11875            builder::Builder::ArrowFunctionExpression(mut b) => {
11876                if let TransformResult::Changed(v) =
11877                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
11878                    b.params(v);
11879                }
11880                if let TransformResult::Changed(v) =
11881                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
11882                    b.body(v);
11883                }
11884                if let TransformResult::Changed(v) =
11885                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
11886                    b.type_parameters(v);
11887                }
11888                if let TransformResult::Changed(v) =
11889                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
11890                    b.return_type(v);
11891                }
11892                if let TransformResult::Changed(v) =
11893                    b.inner.predicate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::predicate)) {
11894                    b.predicate(v);
11895                }
11896                b.build(ctx)
11897            }
11898            builder::Builder::FunctionDeclaration(mut b) => {
11899                if let TransformResult::Changed(v) =
11900                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
11901                    b.id(v);
11902                }
11903                if let TransformResult::Changed(v) =
11904                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
11905                    b.params(v);
11906                }
11907                if let TransformResult::Changed(v) =
11908                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
11909                    b.body(v);
11910                }
11911                if let TransformResult::Changed(v) =
11912                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
11913                    b.type_parameters(v);
11914                }
11915                if let TransformResult::Changed(v) =
11916                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
11917                    b.return_type(v);
11918                }
11919                if let TransformResult::Changed(v) =
11920                    b.inner.predicate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::predicate)) {
11921                    b.predicate(v);
11922                }
11923                b.build(ctx)
11924            }
11925            builder::Builder::ComponentDeclaration(mut b) => {
11926                if let TransformResult::Changed(v) =
11927                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
11928                    b.id(v);
11929                }
11930                if let TransformResult::Changed(v) =
11931                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
11932                    b.params(v);
11933                }
11934                if let TransformResult::Changed(v) =
11935                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
11936                    b.body(v);
11937                }
11938                if let TransformResult::Changed(v) =
11939                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
11940                    b.type_parameters(v);
11941                }
11942                if let TransformResult::Changed(v) =
11943                    b.inner.renders_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::renders_type)) {
11944                    b.renders_type(v);
11945                }
11946                b.build(ctx)
11947            }
11948            builder::Builder::HookDeclaration(mut b) => {
11949                if let TransformResult::Changed(v) =
11950                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
11951                    b.id(v);
11952                }
11953                if let TransformResult::Changed(v) =
11954                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
11955                    b.params(v);
11956                }
11957                if let TransformResult::Changed(v) =
11958                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
11959                    b.body(v);
11960                }
11961                if let TransformResult::Changed(v) =
11962                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
11963                    b.type_parameters(v);
11964                }
11965                if let TransformResult::Changed(v) =
11966                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
11967                    b.return_type(v);
11968                }
11969                b.build(ctx)
11970            }
11971            builder::Builder::MatchStatement(mut b) => {
11972                if let TransformResult::Changed(v) =
11973                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
11974                    b.argument(v);
11975                }
11976                if let TransformResult::Changed(v) =
11977                    b.inner.cases.visit_child_mut(ctx, visitor, Path::new(self, NodeField::cases)) {
11978                    b.cases(v);
11979                }
11980                b.build(ctx)
11981            }
11982            builder::Builder::WhileStatement(mut b) => {
11983                if let TransformResult::Changed(v) =
11984                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
11985                    b.body(v);
11986                }
11987                if let TransformResult::Changed(v) =
11988                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
11989                    b.test(v);
11990                }
11991                b.build(ctx)
11992            }
11993            builder::Builder::DoWhileStatement(mut b) => {
11994                if let TransformResult::Changed(v) =
11995                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
11996                    b.body(v);
11997                }
11998                if let TransformResult::Changed(v) =
11999                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
12000                    b.test(v);
12001                }
12002                b.build(ctx)
12003            }
12004            builder::Builder::ForInStatement(mut b) => {
12005                if let TransformResult::Changed(v) =
12006                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
12007                    b.left(v);
12008                }
12009                if let TransformResult::Changed(v) =
12010                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
12011                    b.right(v);
12012                }
12013                if let TransformResult::Changed(v) =
12014                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12015                    b.body(v);
12016                }
12017                b.build(ctx)
12018            }
12019            builder::Builder::ForOfStatement(mut b) => {
12020                if let TransformResult::Changed(v) =
12021                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
12022                    b.left(v);
12023                }
12024                if let TransformResult::Changed(v) =
12025                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
12026                    b.right(v);
12027                }
12028                if let TransformResult::Changed(v) =
12029                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12030                    b.body(v);
12031                }
12032                b.build(ctx)
12033            }
12034            builder::Builder::ForStatement(mut b) => {
12035                if let TransformResult::Changed(v) =
12036                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
12037                    b.init(v);
12038                }
12039                if let TransformResult::Changed(v) =
12040                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
12041                    b.test(v);
12042                }
12043                if let TransformResult::Changed(v) =
12044                    b.inner.update.visit_child_mut(ctx, visitor, Path::new(self, NodeField::update)) {
12045                    b.update(v);
12046                }
12047                if let TransformResult::Changed(v) =
12048                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12049                    b.body(v);
12050                }
12051                b.build(ctx)
12052            }
12053            builder::Builder::DebuggerStatement(mut b) => b.build(ctx),
12054            builder::Builder::EmptyStatement(mut b) => b.build(ctx),
12055            builder::Builder::BlockStatement(mut b) => {
12056                if let TransformResult::Changed(v) =
12057                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12058                    b.body(v);
12059                }
12060                b.build(ctx)
12061            }
12062            builder::Builder::StaticBlock(mut b) => {
12063                if let TransformResult::Changed(v) =
12064                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12065                    b.body(v);
12066                }
12067                b.build(ctx)
12068            }
12069            builder::Builder::BreakStatement(mut b) => {
12070                if let TransformResult::Changed(v) =
12071                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
12072                    b.label(v);
12073                }
12074                b.build(ctx)
12075            }
12076            builder::Builder::ContinueStatement(mut b) => {
12077                if let TransformResult::Changed(v) =
12078                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
12079                    b.label(v);
12080                }
12081                b.build(ctx)
12082            }
12083            builder::Builder::ThrowStatement(mut b) => {
12084                if let TransformResult::Changed(v) =
12085                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12086                    b.argument(v);
12087                }
12088                b.build(ctx)
12089            }
12090            builder::Builder::ReturnStatement(mut b) => {
12091                if let TransformResult::Changed(v) =
12092                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12093                    b.argument(v);
12094                }
12095                b.build(ctx)
12096            }
12097            builder::Builder::WithStatement(mut b) => {
12098                if let TransformResult::Changed(v) =
12099                    b.inner.object.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object)) {
12100                    b.object(v);
12101                }
12102                if let TransformResult::Changed(v) =
12103                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12104                    b.body(v);
12105                }
12106                b.build(ctx)
12107            }
12108            builder::Builder::SwitchStatement(mut b) => {
12109                if let TransformResult::Changed(v) =
12110                    b.inner.discriminant.visit_child_mut(ctx, visitor, Path::new(self, NodeField::discriminant)) {
12111                    b.discriminant(v);
12112                }
12113                if let TransformResult::Changed(v) =
12114                    b.inner.cases.visit_child_mut(ctx, visitor, Path::new(self, NodeField::cases)) {
12115                    b.cases(v);
12116                }
12117                b.build(ctx)
12118            }
12119            builder::Builder::LabeledStatement(mut b) => {
12120                if let TransformResult::Changed(v) =
12121                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
12122                    b.label(v);
12123                }
12124                if let TransformResult::Changed(v) =
12125                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12126                    b.body(v);
12127                }
12128                b.build(ctx)
12129            }
12130            builder::Builder::ExpressionStatement(mut b) => {
12131                if let TransformResult::Changed(v) =
12132                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
12133                    b.expression(v);
12134                }
12135                b.build(ctx)
12136            }
12137            builder::Builder::TryStatement(mut b) => {
12138                if let TransformResult::Changed(v) =
12139                    b.inner.block.visit_child_mut(ctx, visitor, Path::new(self, NodeField::block)) {
12140                    b.block(v);
12141                }
12142                if let TransformResult::Changed(v) =
12143                    b.inner.handler.visit_child_mut(ctx, visitor, Path::new(self, NodeField::handler)) {
12144                    b.handler(v);
12145                }
12146                if let TransformResult::Changed(v) =
12147                    b.inner.finalizer.visit_child_mut(ctx, visitor, Path::new(self, NodeField::finalizer)) {
12148                    b.finalizer(v);
12149                }
12150                b.build(ctx)
12151            }
12152            builder::Builder::IfStatement(mut b) => {
12153                if let TransformResult::Changed(v) =
12154                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
12155                    b.test(v);
12156                }
12157                if let TransformResult::Changed(v) =
12158                    b.inner.consequent.visit_child_mut(ctx, visitor, Path::new(self, NodeField::consequent)) {
12159                    b.consequent(v);
12160                }
12161                if let TransformResult::Changed(v) =
12162                    b.inner.alternate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::alternate)) {
12163                    b.alternate(v);
12164                }
12165                b.build(ctx)
12166            }
12167            builder::Builder::NullLiteral(mut b) => b.build(ctx),
12168            builder::Builder::BooleanLiteral(mut b) => b.build(ctx),
12169            builder::Builder::StringLiteral(mut b) => b.build(ctx),
12170            builder::Builder::NumericLiteral(mut b) => b.build(ctx),
12171            builder::Builder::RegExpLiteral(mut b) => b.build(ctx),
12172            builder::Builder::BigIntLiteral(mut b) => b.build(ctx),
12173            builder::Builder::ThisExpression(mut b) => b.build(ctx),
12174            builder::Builder::Super(mut b) => b.build(ctx),
12175            builder::Builder::SequenceExpression(mut b) => {
12176                if let TransformResult::Changed(v) =
12177                    b.inner.expressions.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expressions)) {
12178                    b.expressions(v);
12179                }
12180                b.build(ctx)
12181            }
12182            builder::Builder::ObjectExpression(mut b) => {
12183                if let TransformResult::Changed(v) =
12184                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
12185                    b.properties(v);
12186                }
12187                b.build(ctx)
12188            }
12189            builder::Builder::ArrayExpression(mut b) => {
12190                if let TransformResult::Changed(v) =
12191                    b.inner.elements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::elements)) {
12192                    b.elements(v);
12193                }
12194                b.build(ctx)
12195            }
12196            builder::Builder::SpreadElement(mut b) => {
12197                if let TransformResult::Changed(v) =
12198                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12199                    b.argument(v);
12200                }
12201                b.build(ctx)
12202            }
12203            builder::Builder::NewExpression(mut b) => {
12204                if let TransformResult::Changed(v) =
12205                    b.inner.callee.visit_child_mut(ctx, visitor, Path::new(self, NodeField::callee)) {
12206                    b.callee(v);
12207                }
12208                if let TransformResult::Changed(v) =
12209                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
12210                    b.type_arguments(v);
12211                }
12212                if let TransformResult::Changed(v) =
12213                    b.inner.arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::arguments)) {
12214                    b.arguments(v);
12215                }
12216                b.build(ctx)
12217            }
12218            builder::Builder::YieldExpression(mut b) => {
12219                if let TransformResult::Changed(v) =
12220                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12221                    b.argument(v);
12222                }
12223                b.build(ctx)
12224            }
12225            builder::Builder::AwaitExpression(mut b) => {
12226                if let TransformResult::Changed(v) =
12227                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12228                    b.argument(v);
12229                }
12230                b.build(ctx)
12231            }
12232            builder::Builder::ImportExpression(mut b) => {
12233                if let TransformResult::Changed(v) =
12234                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
12235                    b.source(v);
12236                }
12237                if let TransformResult::Changed(v) =
12238                    b.inner.options.visit_child_mut(ctx, visitor, Path::new(self, NodeField::options)) {
12239                    b.options(v);
12240                }
12241                b.build(ctx)
12242            }
12243            builder::Builder::CallExpression(mut b) => {
12244                if let TransformResult::Changed(v) =
12245                    b.inner.callee.visit_child_mut(ctx, visitor, Path::new(self, NodeField::callee)) {
12246                    b.callee(v);
12247                }
12248                if let TransformResult::Changed(v) =
12249                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
12250                    b.type_arguments(v);
12251                }
12252                if let TransformResult::Changed(v) =
12253                    b.inner.arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::arguments)) {
12254                    b.arguments(v);
12255                }
12256                b.build(ctx)
12257            }
12258            builder::Builder::OptionalCallExpression(mut b) => {
12259                if let TransformResult::Changed(v) =
12260                    b.inner.callee.visit_child_mut(ctx, visitor, Path::new(self, NodeField::callee)) {
12261                    b.callee(v);
12262                }
12263                if let TransformResult::Changed(v) =
12264                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
12265                    b.type_arguments(v);
12266                }
12267                if let TransformResult::Changed(v) =
12268                    b.inner.arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::arguments)) {
12269                    b.arguments(v);
12270                }
12271                b.build(ctx)
12272            }
12273            builder::Builder::AssignmentExpression(mut b) => {
12274                if let TransformResult::Changed(v) =
12275                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
12276                    b.left(v);
12277                }
12278                if let TransformResult::Changed(v) =
12279                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
12280                    b.right(v);
12281                }
12282                b.build(ctx)
12283            }
12284            builder::Builder::UnaryExpression(mut b) => {
12285                if let TransformResult::Changed(v) =
12286                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12287                    b.argument(v);
12288                }
12289                b.build(ctx)
12290            }
12291            builder::Builder::UpdateExpression(mut b) => {
12292                if let TransformResult::Changed(v) =
12293                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12294                    b.argument(v);
12295                }
12296                b.build(ctx)
12297            }
12298            builder::Builder::MemberExpression(mut b) => {
12299                if let TransformResult::Changed(v) =
12300                    b.inner.object.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object)) {
12301                    b.object(v);
12302                }
12303                if let TransformResult::Changed(v) =
12304                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
12305                    b.property(v);
12306                }
12307                b.build(ctx)
12308            }
12309            builder::Builder::OptionalMemberExpression(mut b) => {
12310                if let TransformResult::Changed(v) =
12311                    b.inner.object.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object)) {
12312                    b.object(v);
12313                }
12314                if let TransformResult::Changed(v) =
12315                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
12316                    b.property(v);
12317                }
12318                b.build(ctx)
12319            }
12320            builder::Builder::LogicalExpression(mut b) => {
12321                if let TransformResult::Changed(v) =
12322                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
12323                    b.left(v);
12324                }
12325                if let TransformResult::Changed(v) =
12326                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
12327                    b.right(v);
12328                }
12329                b.build(ctx)
12330            }
12331            builder::Builder::ConditionalExpression(mut b) => {
12332                if let TransformResult::Changed(v) =
12333                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
12334                    b.test(v);
12335                }
12336                if let TransformResult::Changed(v) =
12337                    b.inner.alternate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::alternate)) {
12338                    b.alternate(v);
12339                }
12340                if let TransformResult::Changed(v) =
12341                    b.inner.consequent.visit_child_mut(ctx, visitor, Path::new(self, NodeField::consequent)) {
12342                    b.consequent(v);
12343                }
12344                b.build(ctx)
12345            }
12346            builder::Builder::BinaryExpression(mut b) => {
12347                if let TransformResult::Changed(v) =
12348                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
12349                    b.left(v);
12350                }
12351                if let TransformResult::Changed(v) =
12352                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
12353                    b.right(v);
12354                }
12355                b.build(ctx)
12356            }
12357            builder::Builder::Directive(mut b) => {
12358                if let TransformResult::Changed(v) =
12359                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
12360                    b.value(v);
12361                }
12362                b.build(ctx)
12363            }
12364            builder::Builder::DirectiveLiteral(mut b) => b.build(ctx),
12365            builder::Builder::Identifier(mut b) => {
12366                if let TransformResult::Changed(v) =
12367                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
12368                    b.type_annotation(v);
12369                }
12370                b.build(ctx)
12371            }
12372            builder::Builder::PrivateName(mut b) => {
12373                if let TransformResult::Changed(v) =
12374                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
12375                    b.id(v);
12376                }
12377                b.build(ctx)
12378            }
12379            builder::Builder::MetaProperty(mut b) => {
12380                if let TransformResult::Changed(v) =
12381                    b.inner.meta.visit_child_mut(ctx, visitor, Path::new(self, NodeField::meta)) {
12382                    b.meta(v);
12383                }
12384                if let TransformResult::Changed(v) =
12385                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
12386                    b.property(v);
12387                }
12388                b.build(ctx)
12389            }
12390            builder::Builder::SwitchCase(mut b) => {
12391                if let TransformResult::Changed(v) =
12392                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
12393                    b.test(v);
12394                }
12395                if let TransformResult::Changed(v) =
12396                    b.inner.consequent.visit_child_mut(ctx, visitor, Path::new(self, NodeField::consequent)) {
12397                    b.consequent(v);
12398                }
12399                b.build(ctx)
12400            }
12401            builder::Builder::CatchClause(mut b) => {
12402                if let TransformResult::Changed(v) =
12403                    b.inner.param.visit_child_mut(ctx, visitor, Path::new(self, NodeField::param)) {
12404                    b.param(v);
12405                }
12406                if let TransformResult::Changed(v) =
12407                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12408                    b.body(v);
12409                }
12410                b.build(ctx)
12411            }
12412            builder::Builder::VariableDeclarator(mut b) => {
12413                if let TransformResult::Changed(v) =
12414                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
12415                    b.init(v);
12416                }
12417                if let TransformResult::Changed(v) =
12418                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
12419                    b.id(v);
12420                }
12421                b.build(ctx)
12422            }
12423            builder::Builder::VariableDeclaration(mut b) => {
12424                if let TransformResult::Changed(v) =
12425                    b.inner.declarations.visit_child_mut(ctx, visitor, Path::new(self, NodeField::declarations)) {
12426                    b.declarations(v);
12427                }
12428                b.build(ctx)
12429            }
12430            builder::Builder::TemplateLiteral(mut b) => {
12431                if let TransformResult::Changed(v) =
12432                    b.inner.quasis.visit_child_mut(ctx, visitor, Path::new(self, NodeField::quasis)) {
12433                    b.quasis(v);
12434                }
12435                if let TransformResult::Changed(v) =
12436                    b.inner.expressions.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expressions)) {
12437                    b.expressions(v);
12438                }
12439                b.build(ctx)
12440            }
12441            builder::Builder::TaggedTemplateExpression(mut b) => {
12442                if let TransformResult::Changed(v) =
12443                    b.inner.tag.visit_child_mut(ctx, visitor, Path::new(self, NodeField::tag)) {
12444                    b.tag(v);
12445                }
12446                if let TransformResult::Changed(v) =
12447                    b.inner.quasi.visit_child_mut(ctx, visitor, Path::new(self, NodeField::quasi)) {
12448                    b.quasi(v);
12449                }
12450                b.build(ctx)
12451            }
12452            builder::Builder::TemplateElement(mut b) => b.build(ctx),
12453            builder::Builder::Property(mut b) => {
12454                if let TransformResult::Changed(v) =
12455                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
12456                    b.key(v);
12457                }
12458                if let TransformResult::Changed(v) =
12459                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
12460                    b.value(v);
12461                }
12462                b.build(ctx)
12463            }
12464            builder::Builder::Decorator(mut b) => {
12465                if let TransformResult::Changed(v) =
12466                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
12467                    b.expression(v);
12468                }
12469                b.build(ctx)
12470            }
12471            builder::Builder::ClassDeclaration(mut b) => {
12472                if let TransformResult::Changed(v) =
12473                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
12474                    b.id(v);
12475                }
12476                if let TransformResult::Changed(v) =
12477                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
12478                    b.type_parameters(v);
12479                }
12480                if let TransformResult::Changed(v) =
12481                    b.inner.super_class.visit_child_mut(ctx, visitor, Path::new(self, NodeField::super_class)) {
12482                    b.super_class(v);
12483                }
12484                if let TransformResult::Changed(v) =
12485                    b.inner.super_type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::super_type_arguments)) {
12486                    b.super_type_arguments(v);
12487                }
12488                if let TransformResult::Changed(v) =
12489                    b.inner.implements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::implements)) {
12490                    b.implements(v);
12491                }
12492                if let TransformResult::Changed(v) =
12493                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
12494                    b.decorators(v);
12495                }
12496                if let TransformResult::Changed(v) =
12497                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12498                    b.body(v);
12499                }
12500                b.build(ctx)
12501            }
12502            builder::Builder::ClassExpression(mut b) => {
12503                if let TransformResult::Changed(v) =
12504                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
12505                    b.id(v);
12506                }
12507                if let TransformResult::Changed(v) =
12508                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
12509                    b.type_parameters(v);
12510                }
12511                if let TransformResult::Changed(v) =
12512                    b.inner.super_class.visit_child_mut(ctx, visitor, Path::new(self, NodeField::super_class)) {
12513                    b.super_class(v);
12514                }
12515                if let TransformResult::Changed(v) =
12516                    b.inner.super_type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::super_type_arguments)) {
12517                    b.super_type_arguments(v);
12518                }
12519                if let TransformResult::Changed(v) =
12520                    b.inner.implements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::implements)) {
12521                    b.implements(v);
12522                }
12523                if let TransformResult::Changed(v) =
12524                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
12525                    b.decorators(v);
12526                }
12527                if let TransformResult::Changed(v) =
12528                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12529                    b.body(v);
12530                }
12531                b.build(ctx)
12532            }
12533            builder::Builder::ClassBody(mut b) => {
12534                if let TransformResult::Changed(v) =
12535                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12536                    b.body(v);
12537                }
12538                b.build(ctx)
12539            }
12540            builder::Builder::ClassProperty(mut b) => {
12541                if let TransformResult::Changed(v) =
12542                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
12543                    b.key(v);
12544                }
12545                if let TransformResult::Changed(v) =
12546                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
12547                    b.value(v);
12548                }
12549                if let TransformResult::Changed(v) =
12550                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
12551                    b.decorators(v);
12552                }
12553                if let TransformResult::Changed(v) =
12554                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
12555                    b.variance(v);
12556                }
12557                if let TransformResult::Changed(v) =
12558                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
12559                    b.type_annotation(v);
12560                }
12561                if let TransformResult::Changed(v) =
12562                    b.inner.ts_modifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::ts_modifiers)) {
12563                    b.ts_modifiers(v);
12564                }
12565                b.build(ctx)
12566            }
12567            builder::Builder::ClassPrivateProperty(mut b) => {
12568                if let TransformResult::Changed(v) =
12569                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
12570                    b.key(v);
12571                }
12572                if let TransformResult::Changed(v) =
12573                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
12574                    b.value(v);
12575                }
12576                if let TransformResult::Changed(v) =
12577                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
12578                    b.decorators(v);
12579                }
12580                if let TransformResult::Changed(v) =
12581                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
12582                    b.variance(v);
12583                }
12584                if let TransformResult::Changed(v) =
12585                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
12586                    b.type_annotation(v);
12587                }
12588                if let TransformResult::Changed(v) =
12589                    b.inner.ts_modifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::ts_modifiers)) {
12590                    b.ts_modifiers(v);
12591                }
12592                b.build(ctx)
12593            }
12594            builder::Builder::MethodDefinition(mut b) => {
12595                if let TransformResult::Changed(v) =
12596                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
12597                    b.key(v);
12598                }
12599                if let TransformResult::Changed(v) =
12600                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
12601                    b.value(v);
12602                }
12603                if let TransformResult::Changed(v) =
12604                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
12605                    b.decorators(v);
12606                }
12607                b.build(ctx)
12608            }
12609            builder::Builder::ImportDeclaration(mut b) => {
12610                if let TransformResult::Changed(v) =
12611                    b.inner.specifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::specifiers)) {
12612                    b.specifiers(v);
12613                }
12614                if let TransformResult::Changed(v) =
12615                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
12616                    b.source(v);
12617                }
12618                if let TransformResult::Changed(v) =
12619                    b.inner.attributes.visit_child_mut(ctx, visitor, Path::new(self, NodeField::attributes)) {
12620                    b.attributes(v);
12621                }
12622                b.build(ctx)
12623            }
12624            builder::Builder::ImportSpecifier(mut b) => {
12625                if let TransformResult::Changed(v) =
12626                    b.inner.imported.visit_child_mut(ctx, visitor, Path::new(self, NodeField::imported)) {
12627                    b.imported(v);
12628                }
12629                if let TransformResult::Changed(v) =
12630                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
12631                    b.local(v);
12632                }
12633                b.build(ctx)
12634            }
12635            builder::Builder::ImportDefaultSpecifier(mut b) => {
12636                if let TransformResult::Changed(v) =
12637                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
12638                    b.local(v);
12639                }
12640                b.build(ctx)
12641            }
12642            builder::Builder::ImportNamespaceSpecifier(mut b) => {
12643                if let TransformResult::Changed(v) =
12644                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
12645                    b.local(v);
12646                }
12647                b.build(ctx)
12648            }
12649            builder::Builder::ImportAttribute(mut b) => {
12650                if let TransformResult::Changed(v) =
12651                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
12652                    b.key(v);
12653                }
12654                if let TransformResult::Changed(v) =
12655                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
12656                    b.value(v);
12657                }
12658                b.build(ctx)
12659            }
12660            builder::Builder::ExportNamedDeclaration(mut b) => {
12661                if let TransformResult::Changed(v) =
12662                    b.inner.declaration.visit_child_mut(ctx, visitor, Path::new(self, NodeField::declaration)) {
12663                    b.declaration(v);
12664                }
12665                if let TransformResult::Changed(v) =
12666                    b.inner.specifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::specifiers)) {
12667                    b.specifiers(v);
12668                }
12669                if let TransformResult::Changed(v) =
12670                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
12671                    b.source(v);
12672                }
12673                b.build(ctx)
12674            }
12675            builder::Builder::ExportSpecifier(mut b) => {
12676                if let TransformResult::Changed(v) =
12677                    b.inner.exported.visit_child_mut(ctx, visitor, Path::new(self, NodeField::exported)) {
12678                    b.exported(v);
12679                }
12680                if let TransformResult::Changed(v) =
12681                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
12682                    b.local(v);
12683                }
12684                b.build(ctx)
12685            }
12686            builder::Builder::ExportNamespaceSpecifier(mut b) => {
12687                if let TransformResult::Changed(v) =
12688                    b.inner.exported.visit_child_mut(ctx, visitor, Path::new(self, NodeField::exported)) {
12689                    b.exported(v);
12690                }
12691                b.build(ctx)
12692            }
12693            builder::Builder::ExportDefaultDeclaration(mut b) => {
12694                if let TransformResult::Changed(v) =
12695                    b.inner.declaration.visit_child_mut(ctx, visitor, Path::new(self, NodeField::declaration)) {
12696                    b.declaration(v);
12697                }
12698                b.build(ctx)
12699            }
12700            builder::Builder::ExportAllDeclaration(mut b) => {
12701                if let TransformResult::Changed(v) =
12702                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
12703                    b.source(v);
12704                }
12705                b.build(ctx)
12706            }
12707            builder::Builder::ObjectPattern(mut b) => {
12708                if let TransformResult::Changed(v) =
12709                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
12710                    b.properties(v);
12711                }
12712                if let TransformResult::Changed(v) =
12713                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
12714                    b.type_annotation(v);
12715                }
12716                b.build(ctx)
12717            }
12718            builder::Builder::ArrayPattern(mut b) => {
12719                if let TransformResult::Changed(v) =
12720                    b.inner.elements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::elements)) {
12721                    b.elements(v);
12722                }
12723                if let TransformResult::Changed(v) =
12724                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
12725                    b.type_annotation(v);
12726                }
12727                b.build(ctx)
12728            }
12729            builder::Builder::RestElement(mut b) => {
12730                if let TransformResult::Changed(v) =
12731                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12732                    b.argument(v);
12733                }
12734                b.build(ctx)
12735            }
12736            builder::Builder::AssignmentPattern(mut b) => {
12737                if let TransformResult::Changed(v) =
12738                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
12739                    b.left(v);
12740                }
12741                if let TransformResult::Changed(v) =
12742                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
12743                    b.right(v);
12744                }
12745                b.build(ctx)
12746            }
12747            builder::Builder::MatchStatementCase(mut b) => {
12748                if let TransformResult::Changed(v) =
12749                    b.inner.pattern.visit_child_mut(ctx, visitor, Path::new(self, NodeField::pattern)) {
12750                    b.pattern(v);
12751                }
12752                if let TransformResult::Changed(v) =
12753                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12754                    b.body(v);
12755                }
12756                if let TransformResult::Changed(v) =
12757                    b.inner.guard.visit_child_mut(ctx, visitor, Path::new(self, NodeField::guard)) {
12758                    b.guard(v);
12759                }
12760                b.build(ctx)
12761            }
12762            builder::Builder::MatchExpression(mut b) => {
12763                if let TransformResult::Changed(v) =
12764                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12765                    b.argument(v);
12766                }
12767                if let TransformResult::Changed(v) =
12768                    b.inner.cases.visit_child_mut(ctx, visitor, Path::new(self, NodeField::cases)) {
12769                    b.cases(v);
12770                }
12771                b.build(ctx)
12772            }
12773            builder::Builder::MatchExpressionCase(mut b) => {
12774                if let TransformResult::Changed(v) =
12775                    b.inner.pattern.visit_child_mut(ctx, visitor, Path::new(self, NodeField::pattern)) {
12776                    b.pattern(v);
12777                }
12778                if let TransformResult::Changed(v) =
12779                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
12780                    b.body(v);
12781                }
12782                if let TransformResult::Changed(v) =
12783                    b.inner.guard.visit_child_mut(ctx, visitor, Path::new(self, NodeField::guard)) {
12784                    b.guard(v);
12785                }
12786                b.build(ctx)
12787            }
12788            builder::Builder::MatchWildcardPattern(mut b) => b.build(ctx),
12789            builder::Builder::MatchLiteralPattern(mut b) => {
12790                if let TransformResult::Changed(v) =
12791                    b.inner.literal.visit_child_mut(ctx, visitor, Path::new(self, NodeField::literal)) {
12792                    b.literal(v);
12793                }
12794                b.build(ctx)
12795            }
12796            builder::Builder::MatchUnaryPattern(mut b) => {
12797                if let TransformResult::Changed(v) =
12798                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12799                    b.argument(v);
12800                }
12801                b.build(ctx)
12802            }
12803            builder::Builder::MatchIdentifierPattern(mut b) => {
12804                if let TransformResult::Changed(v) =
12805                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
12806                    b.id(v);
12807                }
12808                b.build(ctx)
12809            }
12810            builder::Builder::MatchBindingPattern(mut b) => {
12811                if let TransformResult::Changed(v) =
12812                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
12813                    b.id(v);
12814                }
12815                b.build(ctx)
12816            }
12817            builder::Builder::MatchObjectPattern(mut b) => {
12818                if let TransformResult::Changed(v) =
12819                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
12820                    b.properties(v);
12821                }
12822                if let TransformResult::Changed(v) =
12823                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
12824                    b.rest(v);
12825                }
12826                b.build(ctx)
12827            }
12828            builder::Builder::MatchArrayPattern(mut b) => {
12829                if let TransformResult::Changed(v) =
12830                    b.inner.elements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::elements)) {
12831                    b.elements(v);
12832                }
12833                if let TransformResult::Changed(v) =
12834                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
12835                    b.rest(v);
12836                }
12837                b.build(ctx)
12838            }
12839            builder::Builder::MatchOrPattern(mut b) => {
12840                if let TransformResult::Changed(v) =
12841                    b.inner.patterns.visit_child_mut(ctx, visitor, Path::new(self, NodeField::patterns)) {
12842                    b.patterns(v);
12843                }
12844                b.build(ctx)
12845            }
12846            builder::Builder::MatchAsPattern(mut b) => {
12847                if let TransformResult::Changed(v) =
12848                    b.inner.pattern.visit_child_mut(ctx, visitor, Path::new(self, NodeField::pattern)) {
12849                    b.pattern(v);
12850                }
12851                if let TransformResult::Changed(v) =
12852                    b.inner.target.visit_child_mut(ctx, visitor, Path::new(self, NodeField::target)) {
12853                    b.target(v);
12854                }
12855                b.build(ctx)
12856            }
12857            builder::Builder::MatchMemberPattern(mut b) => {
12858                if let TransformResult::Changed(v) =
12859                    b.inner.base.visit_child_mut(ctx, visitor, Path::new(self, NodeField::base)) {
12860                    b.base(v);
12861                }
12862                if let TransformResult::Changed(v) =
12863                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
12864                    b.property(v);
12865                }
12866                b.build(ctx)
12867            }
12868            builder::Builder::MatchInstancePattern(mut b) => {
12869                if let TransformResult::Changed(v) =
12870                    b.inner.target_constructor.visit_child_mut(ctx, visitor, Path::new(self, NodeField::target_constructor)) {
12871                    b.target_constructor(v);
12872                }
12873                if let TransformResult::Changed(v) =
12874                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
12875                    b.properties(v);
12876                }
12877                b.build(ctx)
12878            }
12879            builder::Builder::MatchObjectPatternProperty(mut b) => {
12880                if let TransformResult::Changed(v) =
12881                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
12882                    b.key(v);
12883                }
12884                if let TransformResult::Changed(v) =
12885                    b.inner.pattern.visit_child_mut(ctx, visitor, Path::new(self, NodeField::pattern)) {
12886                    b.pattern(v);
12887                }
12888                b.build(ctx)
12889            }
12890            builder::Builder::MatchInstanceObjectPattern(mut b) => {
12891                if let TransformResult::Changed(v) =
12892                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
12893                    b.properties(v);
12894                }
12895                if let TransformResult::Changed(v) =
12896                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
12897                    b.rest(v);
12898                }
12899                b.build(ctx)
12900            }
12901            builder::Builder::MatchRestPattern(mut b) => {
12902                if let TransformResult::Changed(v) =
12903                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12904                    b.argument(v);
12905                }
12906                b.build(ctx)
12907            }
12908            builder::Builder::JSXIdentifier(mut b) => b.build(ctx),
12909            builder::Builder::JSXMemberExpression(mut b) => {
12910                if let TransformResult::Changed(v) =
12911                    b.inner.object.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object)) {
12912                    b.object(v);
12913                }
12914                if let TransformResult::Changed(v) =
12915                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
12916                    b.property(v);
12917                }
12918                b.build(ctx)
12919            }
12920            builder::Builder::JSXNamespacedName(mut b) => {
12921                if let TransformResult::Changed(v) =
12922                    b.inner.namespace.visit_child_mut(ctx, visitor, Path::new(self, NodeField::namespace)) {
12923                    b.namespace(v);
12924                }
12925                if let TransformResult::Changed(v) =
12926                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
12927                    b.name(v);
12928                }
12929                b.build(ctx)
12930            }
12931            builder::Builder::JSXEmptyExpression(mut b) => b.build(ctx),
12932            builder::Builder::JSXExpressionContainer(mut b) => {
12933                if let TransformResult::Changed(v) =
12934                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
12935                    b.expression(v);
12936                }
12937                b.build(ctx)
12938            }
12939            builder::Builder::JSXSpreadChild(mut b) => {
12940                if let TransformResult::Changed(v) =
12941                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
12942                    b.expression(v);
12943                }
12944                b.build(ctx)
12945            }
12946            builder::Builder::JSXOpeningElement(mut b) => {
12947                if let TransformResult::Changed(v) =
12948                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
12949                    b.name(v);
12950                }
12951                if let TransformResult::Changed(v) =
12952                    b.inner.attributes.visit_child_mut(ctx, visitor, Path::new(self, NodeField::attributes)) {
12953                    b.attributes(v);
12954                }
12955                if let TransformResult::Changed(v) =
12956                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
12957                    b.type_arguments(v);
12958                }
12959                b.build(ctx)
12960            }
12961            builder::Builder::JSXClosingElement(mut b) => {
12962                if let TransformResult::Changed(v) =
12963                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
12964                    b.name(v);
12965                }
12966                b.build(ctx)
12967            }
12968            builder::Builder::JSXAttribute(mut b) => {
12969                if let TransformResult::Changed(v) =
12970                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
12971                    b.name(v);
12972                }
12973                if let TransformResult::Changed(v) =
12974                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
12975                    b.value(v);
12976                }
12977                b.build(ctx)
12978            }
12979            builder::Builder::JSXSpreadAttribute(mut b) => {
12980                if let TransformResult::Changed(v) =
12981                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
12982                    b.argument(v);
12983                }
12984                b.build(ctx)
12985            }
12986            builder::Builder::JSXStringLiteral(mut b) => b.build(ctx),
12987            builder::Builder::JSXText(mut b) => b.build(ctx),
12988            builder::Builder::JSXElement(mut b) => {
12989                if let TransformResult::Changed(v) =
12990                    b.inner.opening_element.visit_child_mut(ctx, visitor, Path::new(self, NodeField::opening_element)) {
12991                    b.opening_element(v);
12992                }
12993                if let TransformResult::Changed(v) =
12994                    b.inner.children.visit_child_mut(ctx, visitor, Path::new(self, NodeField::children)) {
12995                    b.children(v);
12996                }
12997                if let TransformResult::Changed(v) =
12998                    b.inner.closing_element.visit_child_mut(ctx, visitor, Path::new(self, NodeField::closing_element)) {
12999                    b.closing_element(v);
13000                }
13001                b.build(ctx)
13002            }
13003            builder::Builder::JSXFragment(mut b) => {
13004                if let TransformResult::Changed(v) =
13005                    b.inner.opening_fragment.visit_child_mut(ctx, visitor, Path::new(self, NodeField::opening_fragment)) {
13006                    b.opening_fragment(v);
13007                }
13008                if let TransformResult::Changed(v) =
13009                    b.inner.children.visit_child_mut(ctx, visitor, Path::new(self, NodeField::children)) {
13010                    b.children(v);
13011                }
13012                if let TransformResult::Changed(v) =
13013                    b.inner.closing_fragment.visit_child_mut(ctx, visitor, Path::new(self, NodeField::closing_fragment)) {
13014                    b.closing_fragment(v);
13015                }
13016                b.build(ctx)
13017            }
13018            builder::Builder::JSXOpeningFragment(mut b) => b.build(ctx),
13019            builder::Builder::JSXClosingFragment(mut b) => b.build(ctx),
13020            builder::Builder::ExistsTypeAnnotation(mut b) => b.build(ctx),
13021            builder::Builder::EmptyTypeAnnotation(mut b) => b.build(ctx),
13022            builder::Builder::StringTypeAnnotation(mut b) => b.build(ctx),
13023            builder::Builder::NumberTypeAnnotation(mut b) => b.build(ctx),
13024            builder::Builder::StringLiteralTypeAnnotation(mut b) => b.build(ctx),
13025            builder::Builder::NumberLiteralTypeAnnotation(mut b) => b.build(ctx),
13026            builder::Builder::BigIntLiteralTypeAnnotation(mut b) => b.build(ctx),
13027            builder::Builder::BooleanTypeAnnotation(mut b) => b.build(ctx),
13028            builder::Builder::BooleanLiteralTypeAnnotation(mut b) => b.build(ctx),
13029            builder::Builder::NullLiteralTypeAnnotation(mut b) => b.build(ctx),
13030            builder::Builder::SymbolTypeAnnotation(mut b) => b.build(ctx),
13031            builder::Builder::AnyTypeAnnotation(mut b) => b.build(ctx),
13032            builder::Builder::MixedTypeAnnotation(mut b) => b.build(ctx),
13033            builder::Builder::BigIntTypeAnnotation(mut b) => b.build(ctx),
13034            builder::Builder::VoidTypeAnnotation(mut b) => b.build(ctx),
13035            builder::Builder::NeverTypeAnnotation(mut b) => b.build(ctx),
13036            builder::Builder::UnknownTypeAnnotation(mut b) => b.build(ctx),
13037            builder::Builder::UndefinedTypeAnnotation(mut b) => b.build(ctx),
13038            builder::Builder::FunctionTypeAnnotation(mut b) => {
13039                if let TransformResult::Changed(v) =
13040                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13041                    b.params(v);
13042                }
13043                if let TransformResult::Changed(v) =
13044                    b.inner.this.visit_child_mut(ctx, visitor, Path::new(self, NodeField::this)) {
13045                    b.this(v);
13046                }
13047                if let TransformResult::Changed(v) =
13048                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
13049                    b.return_type(v);
13050                }
13051                if let TransformResult::Changed(v) =
13052                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
13053                    b.rest(v);
13054                }
13055                if let TransformResult::Changed(v) =
13056                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13057                    b.type_parameters(v);
13058                }
13059                b.build(ctx)
13060            }
13061            builder::Builder::HookTypeAnnotation(mut b) => {
13062                if let TransformResult::Changed(v) =
13063                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13064                    b.params(v);
13065                }
13066                if let TransformResult::Changed(v) =
13067                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
13068                    b.return_type(v);
13069                }
13070                if let TransformResult::Changed(v) =
13071                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
13072                    b.rest(v);
13073                }
13074                if let TransformResult::Changed(v) =
13075                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13076                    b.type_parameters(v);
13077                }
13078                b.build(ctx)
13079            }
13080            builder::Builder::FunctionTypeParam(mut b) => {
13081                if let TransformResult::Changed(v) =
13082                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
13083                    b.name(v);
13084                }
13085                if let TransformResult::Changed(v) =
13086                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13087                    b.type_annotation(v);
13088                }
13089                b.build(ctx)
13090            }
13091            builder::Builder::ComponentTypeAnnotation(mut b) => {
13092                if let TransformResult::Changed(v) =
13093                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13094                    b.params(v);
13095                }
13096                if let TransformResult::Changed(v) =
13097                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
13098                    b.rest(v);
13099                }
13100                if let TransformResult::Changed(v) =
13101                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13102                    b.type_parameters(v);
13103                }
13104                if let TransformResult::Changed(v) =
13105                    b.inner.renders_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::renders_type)) {
13106                    b.renders_type(v);
13107                }
13108                b.build(ctx)
13109            }
13110            builder::Builder::ComponentTypeParameter(mut b) => {
13111                if let TransformResult::Changed(v) =
13112                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
13113                    b.name(v);
13114                }
13115                if let TransformResult::Changed(v) =
13116                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13117                    b.type_annotation(v);
13118                }
13119                b.build(ctx)
13120            }
13121            builder::Builder::NullableTypeAnnotation(mut b) => {
13122                if let TransformResult::Changed(v) =
13123                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13124                    b.type_annotation(v);
13125                }
13126                b.build(ctx)
13127            }
13128            builder::Builder::QualifiedTypeIdentifier(mut b) => {
13129                if let TransformResult::Changed(v) =
13130                    b.inner.qualification.visit_child_mut(ctx, visitor, Path::new(self, NodeField::qualification)) {
13131                    b.qualification(v);
13132                }
13133                if let TransformResult::Changed(v) =
13134                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13135                    b.id(v);
13136                }
13137                b.build(ctx)
13138            }
13139            builder::Builder::TypeofTypeAnnotation(mut b) => {
13140                if let TransformResult::Changed(v) =
13141                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13142                    b.argument(v);
13143                }
13144                if let TransformResult::Changed(v) =
13145                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
13146                    b.type_arguments(v);
13147                }
13148                b.build(ctx)
13149            }
13150            builder::Builder::KeyofTypeAnnotation(mut b) => {
13151                if let TransformResult::Changed(v) =
13152                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13153                    b.argument(v);
13154                }
13155                b.build(ctx)
13156            }
13157            builder::Builder::TypeOperator(mut b) => {
13158                if let TransformResult::Changed(v) =
13159                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13160                    b.type_annotation(v);
13161                }
13162                b.build(ctx)
13163            }
13164            builder::Builder::QualifiedTypeofIdentifier(mut b) => {
13165                if let TransformResult::Changed(v) =
13166                    b.inner.qualification.visit_child_mut(ctx, visitor, Path::new(self, NodeField::qualification)) {
13167                    b.qualification(v);
13168                }
13169                if let TransformResult::Changed(v) =
13170                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13171                    b.id(v);
13172                }
13173                b.build(ctx)
13174            }
13175            builder::Builder::TupleTypeAnnotation(mut b) => {
13176                if let TransformResult::Changed(v) =
13177                    b.inner.element_types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_types)) {
13178                    b.element_types(v);
13179                }
13180                b.build(ctx)
13181            }
13182            builder::Builder::TupleTypeSpreadElement(mut b) => {
13183                if let TransformResult::Changed(v) =
13184                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
13185                    b.label(v);
13186                }
13187                if let TransformResult::Changed(v) =
13188                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13189                    b.type_annotation(v);
13190                }
13191                b.build(ctx)
13192            }
13193            builder::Builder::TupleTypeLabeledElement(mut b) => {
13194                if let TransformResult::Changed(v) =
13195                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
13196                    b.label(v);
13197                }
13198                if let TransformResult::Changed(v) =
13199                    b.inner.element_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_type)) {
13200                    b.element_type(v);
13201                }
13202                if let TransformResult::Changed(v) =
13203                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
13204                    b.variance(v);
13205                }
13206                b.build(ctx)
13207            }
13208            builder::Builder::ArrayTypeAnnotation(mut b) => {
13209                if let TransformResult::Changed(v) =
13210                    b.inner.element_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_type)) {
13211                    b.element_type(v);
13212                }
13213                b.build(ctx)
13214            }
13215            builder::Builder::InferTypeAnnotation(mut b) => {
13216                if let TransformResult::Changed(v) =
13217                    b.inner.type_parameter.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameter)) {
13218                    b.type_parameter(v);
13219                }
13220                b.build(ctx)
13221            }
13222            builder::Builder::UnionTypeAnnotation(mut b) => {
13223                if let TransformResult::Changed(v) =
13224                    b.inner.types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::types)) {
13225                    b.types(v);
13226                }
13227                b.build(ctx)
13228            }
13229            builder::Builder::IntersectionTypeAnnotation(mut b) => {
13230                if let TransformResult::Changed(v) =
13231                    b.inner.types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::types)) {
13232                    b.types(v);
13233                }
13234                b.build(ctx)
13235            }
13236            builder::Builder::GenericTypeAnnotation(mut b) => {
13237                if let TransformResult::Changed(v) =
13238                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13239                    b.id(v);
13240                }
13241                if let TransformResult::Changed(v) =
13242                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13243                    b.type_parameters(v);
13244                }
13245                b.build(ctx)
13246            }
13247            builder::Builder::IndexedAccessType(mut b) => {
13248                if let TransformResult::Changed(v) =
13249                    b.inner.object_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object_type)) {
13250                    b.object_type(v);
13251                }
13252                if let TransformResult::Changed(v) =
13253                    b.inner.index_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::index_type)) {
13254                    b.index_type(v);
13255                }
13256                b.build(ctx)
13257            }
13258            builder::Builder::OptionalIndexedAccessType(mut b) => {
13259                if let TransformResult::Changed(v) =
13260                    b.inner.object_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object_type)) {
13261                    b.object_type(v);
13262                }
13263                if let TransformResult::Changed(v) =
13264                    b.inner.index_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::index_type)) {
13265                    b.index_type(v);
13266                }
13267                b.build(ctx)
13268            }
13269            builder::Builder::ConditionalTypeAnnotation(mut b) => {
13270                if let TransformResult::Changed(v) =
13271                    b.inner.check_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::check_type)) {
13272                    b.check_type(v);
13273                }
13274                if let TransformResult::Changed(v) =
13275                    b.inner.extends_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends_type)) {
13276                    b.extends_type(v);
13277                }
13278                if let TransformResult::Changed(v) =
13279                    b.inner.true_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::true_type)) {
13280                    b.true_type(v);
13281                }
13282                if let TransformResult::Changed(v) =
13283                    b.inner.false_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::false_type)) {
13284                    b.false_type(v);
13285                }
13286                b.build(ctx)
13287            }
13288            builder::Builder::TypePredicate(mut b) => {
13289                if let TransformResult::Changed(v) =
13290                    b.inner.parameter_name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::parameter_name)) {
13291                    b.parameter_name(v);
13292                }
13293                if let TransformResult::Changed(v) =
13294                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13295                    b.type_annotation(v);
13296                }
13297                b.build(ctx)
13298            }
13299            builder::Builder::InterfaceTypeAnnotation(mut b) => {
13300                if let TransformResult::Changed(v) =
13301                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
13302                    b.extends(v);
13303                }
13304                if let TransformResult::Changed(v) =
13305                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13306                    b.body(v);
13307                }
13308                b.build(ctx)
13309            }
13310            builder::Builder::TypeAlias(mut b) => {
13311                if let TransformResult::Changed(v) =
13312                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13313                    b.id(v);
13314                }
13315                if let TransformResult::Changed(v) =
13316                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13317                    b.type_parameters(v);
13318                }
13319                if let TransformResult::Changed(v) =
13320                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
13321                    b.right(v);
13322                }
13323                b.build(ctx)
13324            }
13325            builder::Builder::OpaqueType(mut b) => {
13326                if let TransformResult::Changed(v) =
13327                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13328                    b.id(v);
13329                }
13330                if let TransformResult::Changed(v) =
13331                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13332                    b.type_parameters(v);
13333                }
13334                if let TransformResult::Changed(v) =
13335                    b.inner.impltype.visit_child_mut(ctx, visitor, Path::new(self, NodeField::impltype)) {
13336                    b.impltype(v);
13337                }
13338                if let TransformResult::Changed(v) =
13339                    b.inner.lower_bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::lower_bound)) {
13340                    b.lower_bound(v);
13341                }
13342                if let TransformResult::Changed(v) =
13343                    b.inner.upper_bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::upper_bound)) {
13344                    b.upper_bound(v);
13345                }
13346                if let TransformResult::Changed(v) =
13347                    b.inner.supertype.visit_child_mut(ctx, visitor, Path::new(self, NodeField::supertype)) {
13348                    b.supertype(v);
13349                }
13350                b.build(ctx)
13351            }
13352            builder::Builder::InterfaceDeclaration(mut b) => {
13353                if let TransformResult::Changed(v) =
13354                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13355                    b.id(v);
13356                }
13357                if let TransformResult::Changed(v) =
13358                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13359                    b.type_parameters(v);
13360                }
13361                if let TransformResult::Changed(v) =
13362                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
13363                    b.extends(v);
13364                }
13365                if let TransformResult::Changed(v) =
13366                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13367                    b.body(v);
13368                }
13369                b.build(ctx)
13370            }
13371            builder::Builder::DeclareTypeAlias(mut b) => {
13372                if let TransformResult::Changed(v) =
13373                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13374                    b.id(v);
13375                }
13376                if let TransformResult::Changed(v) =
13377                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13378                    b.type_parameters(v);
13379                }
13380                if let TransformResult::Changed(v) =
13381                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
13382                    b.right(v);
13383                }
13384                b.build(ctx)
13385            }
13386            builder::Builder::DeclareOpaqueType(mut b) => {
13387                if let TransformResult::Changed(v) =
13388                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13389                    b.id(v);
13390                }
13391                if let TransformResult::Changed(v) =
13392                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13393                    b.type_parameters(v);
13394                }
13395                if let TransformResult::Changed(v) =
13396                    b.inner.impltype.visit_child_mut(ctx, visitor, Path::new(self, NodeField::impltype)) {
13397                    b.impltype(v);
13398                }
13399                if let TransformResult::Changed(v) =
13400                    b.inner.lower_bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::lower_bound)) {
13401                    b.lower_bound(v);
13402                }
13403                if let TransformResult::Changed(v) =
13404                    b.inner.upper_bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::upper_bound)) {
13405                    b.upper_bound(v);
13406                }
13407                if let TransformResult::Changed(v) =
13408                    b.inner.supertype.visit_child_mut(ctx, visitor, Path::new(self, NodeField::supertype)) {
13409                    b.supertype(v);
13410                }
13411                b.build(ctx)
13412            }
13413            builder::Builder::DeclareInterface(mut b) => {
13414                if let TransformResult::Changed(v) =
13415                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13416                    b.id(v);
13417                }
13418                if let TransformResult::Changed(v) =
13419                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13420                    b.type_parameters(v);
13421                }
13422                if let TransformResult::Changed(v) =
13423                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
13424                    b.extends(v);
13425                }
13426                if let TransformResult::Changed(v) =
13427                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13428                    b.body(v);
13429                }
13430                b.build(ctx)
13431            }
13432            builder::Builder::DeclareClass(mut b) => {
13433                if let TransformResult::Changed(v) =
13434                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13435                    b.id(v);
13436                }
13437                if let TransformResult::Changed(v) =
13438                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13439                    b.type_parameters(v);
13440                }
13441                if let TransformResult::Changed(v) =
13442                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
13443                    b.extends(v);
13444                }
13445                if let TransformResult::Changed(v) =
13446                    b.inner.implements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::implements)) {
13447                    b.implements(v);
13448                }
13449                if let TransformResult::Changed(v) =
13450                    b.inner.mixins.visit_child_mut(ctx, visitor, Path::new(self, NodeField::mixins)) {
13451                    b.mixins(v);
13452                }
13453                if let TransformResult::Changed(v) =
13454                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13455                    b.body(v);
13456                }
13457                b.build(ctx)
13458            }
13459            builder::Builder::DeclareFunction(mut b) => {
13460                if let TransformResult::Changed(v) =
13461                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13462                    b.id(v);
13463                }
13464                if let TransformResult::Changed(v) =
13465                    b.inner.predicate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::predicate)) {
13466                    b.predicate(v);
13467                }
13468                b.build(ctx)
13469            }
13470            builder::Builder::DeclareHook(mut b) => {
13471                if let TransformResult::Changed(v) =
13472                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13473                    b.id(v);
13474                }
13475                b.build(ctx)
13476            }
13477            builder::Builder::DeclareComponent(mut b) => {
13478                if let TransformResult::Changed(v) =
13479                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13480                    b.id(v);
13481                }
13482                if let TransformResult::Changed(v) =
13483                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13484                    b.params(v);
13485                }
13486                if let TransformResult::Changed(v) =
13487                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
13488                    b.rest(v);
13489                }
13490                if let TransformResult::Changed(v) =
13491                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13492                    b.type_parameters(v);
13493                }
13494                if let TransformResult::Changed(v) =
13495                    b.inner.renders_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::renders_type)) {
13496                    b.renders_type(v);
13497                }
13498                b.build(ctx)
13499            }
13500            builder::Builder::DeclareVariable(mut b) => {
13501                if let TransformResult::Changed(v) =
13502                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13503                    b.id(v);
13504                }
13505                b.build(ctx)
13506            }
13507            builder::Builder::DeclareEnum(mut b) => {
13508                if let TransformResult::Changed(v) =
13509                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13510                    b.id(v);
13511                }
13512                if let TransformResult::Changed(v) =
13513                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13514                    b.body(v);
13515                }
13516                b.build(ctx)
13517            }
13518            builder::Builder::DeclareExportDeclaration(mut b) => {
13519                if let TransformResult::Changed(v) =
13520                    b.inner.declaration.visit_child_mut(ctx, visitor, Path::new(self, NodeField::declaration)) {
13521                    b.declaration(v);
13522                }
13523                if let TransformResult::Changed(v) =
13524                    b.inner.specifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::specifiers)) {
13525                    b.specifiers(v);
13526                }
13527                if let TransformResult::Changed(v) =
13528                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
13529                    b.source(v);
13530                }
13531                b.build(ctx)
13532            }
13533            builder::Builder::DeclareExportAllDeclaration(mut b) => {
13534                if let TransformResult::Changed(v) =
13535                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
13536                    b.source(v);
13537                }
13538                b.build(ctx)
13539            }
13540            builder::Builder::DeclareModule(mut b) => {
13541                if let TransformResult::Changed(v) =
13542                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13543                    b.id(v);
13544                }
13545                if let TransformResult::Changed(v) =
13546                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13547                    b.body(v);
13548                }
13549                b.build(ctx)
13550            }
13551            builder::Builder::DeclareNamespace(mut b) => {
13552                if let TransformResult::Changed(v) =
13553                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13554                    b.id(v);
13555                }
13556                if let TransformResult::Changed(v) =
13557                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13558                    b.body(v);
13559                }
13560                b.build(ctx)
13561            }
13562            builder::Builder::DeclareModuleExports(mut b) => {
13563                if let TransformResult::Changed(v) =
13564                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13565                    b.type_annotation(v);
13566                }
13567                b.build(ctx)
13568            }
13569            builder::Builder::InterfaceExtends(mut b) => {
13570                if let TransformResult::Changed(v) =
13571                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13572                    b.id(v);
13573                }
13574                if let TransformResult::Changed(v) =
13575                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13576                    b.type_parameters(v);
13577                }
13578                b.build(ctx)
13579            }
13580            builder::Builder::ClassImplements(mut b) => {
13581                if let TransformResult::Changed(v) =
13582                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13583                    b.id(v);
13584                }
13585                if let TransformResult::Changed(v) =
13586                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13587                    b.type_parameters(v);
13588                }
13589                b.build(ctx)
13590            }
13591            builder::Builder::TypeAnnotation(mut b) => {
13592                if let TransformResult::Changed(v) =
13593                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13594                    b.type_annotation(v);
13595                }
13596                b.build(ctx)
13597            }
13598            builder::Builder::ObjectTypeAnnotation(mut b) => {
13599                if let TransformResult::Changed(v) =
13600                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
13601                    b.properties(v);
13602                }
13603                if let TransformResult::Changed(v) =
13604                    b.inner.indexers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::indexers)) {
13605                    b.indexers(v);
13606                }
13607                if let TransformResult::Changed(v) =
13608                    b.inner.call_properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::call_properties)) {
13609                    b.call_properties(v);
13610                }
13611                if let TransformResult::Changed(v) =
13612                    b.inner.internal_slots.visit_child_mut(ctx, visitor, Path::new(self, NodeField::internal_slots)) {
13613                    b.internal_slots(v);
13614                }
13615                b.build(ctx)
13616            }
13617            builder::Builder::ObjectTypeProperty(mut b) => {
13618                if let TransformResult::Changed(v) =
13619                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
13620                    b.key(v);
13621                }
13622                if let TransformResult::Changed(v) =
13623                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13624                    b.value(v);
13625                }
13626                if let TransformResult::Changed(v) =
13627                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
13628                    b.variance(v);
13629                }
13630                b.build(ctx)
13631            }
13632            builder::Builder::ObjectTypeSpreadProperty(mut b) => {
13633                if let TransformResult::Changed(v) =
13634                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13635                    b.argument(v);
13636                }
13637                b.build(ctx)
13638            }
13639            builder::Builder::ObjectTypeInternalSlot(mut b) => {
13640                if let TransformResult::Changed(v) =
13641                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13642                    b.id(v);
13643                }
13644                if let TransformResult::Changed(v) =
13645                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13646                    b.value(v);
13647                }
13648                b.build(ctx)
13649            }
13650            builder::Builder::ObjectTypeCallProperty(mut b) => {
13651                if let TransformResult::Changed(v) =
13652                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13653                    b.value(v);
13654                }
13655                b.build(ctx)
13656            }
13657            builder::Builder::ObjectTypeIndexer(mut b) => {
13658                if let TransformResult::Changed(v) =
13659                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13660                    b.id(v);
13661                }
13662                if let TransformResult::Changed(v) =
13663                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
13664                    b.key(v);
13665                }
13666                if let TransformResult::Changed(v) =
13667                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13668                    b.value(v);
13669                }
13670                if let TransformResult::Changed(v) =
13671                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
13672                    b.variance(v);
13673                }
13674                b.build(ctx)
13675            }
13676            builder::Builder::ObjectTypeMappedTypeProperty(mut b) => {
13677                if let TransformResult::Changed(v) =
13678                    b.inner.key_tparam.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key_tparam)) {
13679                    b.key_tparam(v);
13680                }
13681                if let TransformResult::Changed(v) =
13682                    b.inner.prop_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::prop_type)) {
13683                    b.prop_type(v);
13684                }
13685                if let TransformResult::Changed(v) =
13686                    b.inner.source_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source_type)) {
13687                    b.source_type(v);
13688                }
13689                if let TransformResult::Changed(v) =
13690                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
13691                    b.variance(v);
13692                }
13693                b.build(ctx)
13694            }
13695            builder::Builder::Variance(mut b) => b.build(ctx),
13696            builder::Builder::TypeParameterDeclaration(mut b) => {
13697                if let TransformResult::Changed(v) =
13698                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13699                    b.params(v);
13700                }
13701                b.build(ctx)
13702            }
13703            builder::Builder::TypeParameter(mut b) => {
13704                if let TransformResult::Changed(v) =
13705                    b.inner.bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::bound)) {
13706                    b.bound(v);
13707                }
13708                if let TransformResult::Changed(v) =
13709                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
13710                    b.variance(v);
13711                }
13712                if let TransformResult::Changed(v) =
13713                    b.inner.default.visit_child_mut(ctx, visitor, Path::new(self, NodeField::default)) {
13714                    b.default(v);
13715                }
13716                b.build(ctx)
13717            }
13718            builder::Builder::TypeParameterInstantiation(mut b) => {
13719                if let TransformResult::Changed(v) =
13720                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13721                    b.params(v);
13722                }
13723                b.build(ctx)
13724            }
13725            builder::Builder::TypeCastExpression(mut b) => {
13726                if let TransformResult::Changed(v) =
13727                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
13728                    b.expression(v);
13729                }
13730                if let TransformResult::Changed(v) =
13731                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13732                    b.type_annotation(v);
13733                }
13734                b.build(ctx)
13735            }
13736            builder::Builder::AsExpression(mut b) => {
13737                if let TransformResult::Changed(v) =
13738                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
13739                    b.expression(v);
13740                }
13741                if let TransformResult::Changed(v) =
13742                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13743                    b.type_annotation(v);
13744                }
13745                b.build(ctx)
13746            }
13747            builder::Builder::AsConstExpression(mut b) => {
13748                if let TransformResult::Changed(v) =
13749                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
13750                    b.expression(v);
13751                }
13752                b.build(ctx)
13753            }
13754            builder::Builder::InferredPredicate(mut b) => b.build(ctx),
13755            builder::Builder::DeclaredPredicate(mut b) => {
13756                if let TransformResult::Changed(v) =
13757                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13758                    b.value(v);
13759                }
13760                b.build(ctx)
13761            }
13762            builder::Builder::EnumDeclaration(mut b) => {
13763                if let TransformResult::Changed(v) =
13764                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13765                    b.id(v);
13766                }
13767                if let TransformResult::Changed(v) =
13768                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13769                    b.body(v);
13770                }
13771                b.build(ctx)
13772            }
13773            builder::Builder::EnumStringBody(mut b) => {
13774                if let TransformResult::Changed(v) =
13775                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
13776                    b.members(v);
13777                }
13778                b.build(ctx)
13779            }
13780            builder::Builder::EnumNumberBody(mut b) => {
13781                if let TransformResult::Changed(v) =
13782                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
13783                    b.members(v);
13784                }
13785                b.build(ctx)
13786            }
13787            builder::Builder::EnumBigIntBody(mut b) => {
13788                if let TransformResult::Changed(v) =
13789                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
13790                    b.members(v);
13791                }
13792                b.build(ctx)
13793            }
13794            builder::Builder::EnumBooleanBody(mut b) => {
13795                if let TransformResult::Changed(v) =
13796                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
13797                    b.members(v);
13798                }
13799                b.build(ctx)
13800            }
13801            builder::Builder::EnumSymbolBody(mut b) => {
13802                if let TransformResult::Changed(v) =
13803                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
13804                    b.members(v);
13805                }
13806                b.build(ctx)
13807            }
13808            builder::Builder::EnumDefaultedMember(mut b) => {
13809                if let TransformResult::Changed(v) =
13810                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13811                    b.id(v);
13812                }
13813                b.build(ctx)
13814            }
13815            builder::Builder::EnumStringMember(mut b) => {
13816                if let TransformResult::Changed(v) =
13817                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13818                    b.id(v);
13819                }
13820                if let TransformResult::Changed(v) =
13821                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
13822                    b.init(v);
13823                }
13824                b.build(ctx)
13825            }
13826            builder::Builder::EnumNumberMember(mut b) => {
13827                if let TransformResult::Changed(v) =
13828                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13829                    b.id(v);
13830                }
13831                if let TransformResult::Changed(v) =
13832                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
13833                    b.init(v);
13834                }
13835                b.build(ctx)
13836            }
13837            builder::Builder::EnumBigIntMember(mut b) => {
13838                if let TransformResult::Changed(v) =
13839                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13840                    b.id(v);
13841                }
13842                if let TransformResult::Changed(v) =
13843                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
13844                    b.init(v);
13845                }
13846                b.build(ctx)
13847            }
13848            builder::Builder::EnumBooleanMember(mut b) => {
13849                if let TransformResult::Changed(v) =
13850                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13851                    b.id(v);
13852                }
13853                if let TransformResult::Changed(v) =
13854                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
13855                    b.init(v);
13856                }
13857                b.build(ctx)
13858            }
13859            builder::Builder::ComponentParameter(mut b) => {
13860                if let TransformResult::Changed(v) =
13861                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
13862                    b.name(v);
13863                }
13864                if let TransformResult::Changed(v) =
13865                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
13866                    b.local(v);
13867                }
13868                b.build(ctx)
13869            }
13870            builder::Builder::RecordDeclaration(mut b) => {
13871                if let TransformResult::Changed(v) =
13872                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13873                    b.id(v);
13874                }
13875                if let TransformResult::Changed(v) =
13876                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13877                    b.type_parameters(v);
13878                }
13879                if let TransformResult::Changed(v) =
13880                    b.inner.implements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::implements)) {
13881                    b.implements(v);
13882                }
13883                if let TransformResult::Changed(v) =
13884                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13885                    b.body(v);
13886                }
13887                b.build(ctx)
13888            }
13889            builder::Builder::RecordDeclarationImplements(mut b) => {
13890                if let TransformResult::Changed(v) =
13891                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13892                    b.id(v);
13893                }
13894                if let TransformResult::Changed(v) =
13895                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
13896                    b.type_arguments(v);
13897                }
13898                b.build(ctx)
13899            }
13900            builder::Builder::RecordDeclarationBody(mut b) => {
13901                if let TransformResult::Changed(v) =
13902                    b.inner.elements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::elements)) {
13903                    b.elements(v);
13904                }
13905                b.build(ctx)
13906            }
13907            builder::Builder::RecordDeclarationProperty(mut b) => {
13908                if let TransformResult::Changed(v) =
13909                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
13910                    b.key(v);
13911                }
13912                if let TransformResult::Changed(v) =
13913                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13914                    b.type_annotation(v);
13915                }
13916                if let TransformResult::Changed(v) =
13917                    b.inner.default_value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::default_value)) {
13918                    b.default_value(v);
13919                }
13920                b.build(ctx)
13921            }
13922            builder::Builder::RecordDeclarationStaticProperty(mut b) => {
13923                if let TransformResult::Changed(v) =
13924                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
13925                    b.key(v);
13926                }
13927                if let TransformResult::Changed(v) =
13928                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13929                    b.type_annotation(v);
13930                }
13931                if let TransformResult::Changed(v) =
13932                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13933                    b.value(v);
13934                }
13935                b.build(ctx)
13936            }
13937            builder::Builder::RecordExpression(mut b) => {
13938                if let TransformResult::Changed(v) =
13939                    b.inner.record_constructor.visit_child_mut(ctx, visitor, Path::new(self, NodeField::record_constructor)) {
13940                    b.record_constructor(v);
13941                }
13942                if let TransformResult::Changed(v) =
13943                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
13944                    b.type_arguments(v);
13945                }
13946                if let TransformResult::Changed(v) =
13947                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
13948                    b.properties(v);
13949                }
13950                b.build(ctx)
13951            }
13952            builder::Builder::RecordExpressionProperties(mut b) => {
13953                if let TransformResult::Changed(v) =
13954                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
13955                    b.properties(v);
13956                }
13957                b.build(ctx)
13958            }
13959            builder::Builder::TSTypeAnnotation(mut b) => {
13960                if let TransformResult::Changed(v) =
13961                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13962                    b.type_annotation(v);
13963                }
13964                b.build(ctx)
13965            }
13966            builder::Builder::TSAnyKeyword(mut b) => b.build(ctx),
13967            builder::Builder::TSNumberKeyword(mut b) => b.build(ctx),
13968            builder::Builder::TSBooleanKeyword(mut b) => b.build(ctx),
13969            builder::Builder::TSStringKeyword(mut b) => b.build(ctx),
13970            builder::Builder::TSSymbolKeyword(mut b) => b.build(ctx),
13971            builder::Builder::TSVoidKeyword(mut b) => b.build(ctx),
13972            builder::Builder::TSUndefinedKeyword(mut b) => b.build(ctx),
13973            builder::Builder::TSUnknownKeyword(mut b) => b.build(ctx),
13974            builder::Builder::TSNeverKeyword(mut b) => b.build(ctx),
13975            builder::Builder::TSBigIntKeyword(mut b) => b.build(ctx),
13976            builder::Builder::TSThisType(mut b) => b.build(ctx),
13977            builder::Builder::TSLiteralType(mut b) => {
13978                if let TransformResult::Changed(v) =
13979                    b.inner.literal.visit_child_mut(ctx, visitor, Path::new(self, NodeField::literal)) {
13980                    b.literal(v);
13981                }
13982                b.build(ctx)
13983            }
13984            builder::Builder::TSIndexedAccessType(mut b) => {
13985                if let TransformResult::Changed(v) =
13986                    b.inner.object_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object_type)) {
13987                    b.object_type(v);
13988                }
13989                if let TransformResult::Changed(v) =
13990                    b.inner.index_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::index_type)) {
13991                    b.index_type(v);
13992                }
13993                b.build(ctx)
13994            }
13995            builder::Builder::TSArrayType(mut b) => {
13996                if let TransformResult::Changed(v) =
13997                    b.inner.element_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_type)) {
13998                    b.element_type(v);
13999                }
14000                b.build(ctx)
14001            }
14002            builder::Builder::TSTypeReference(mut b) => {
14003                if let TransformResult::Changed(v) =
14004                    b.inner.type_name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_name)) {
14005                    b.type_name(v);
14006                }
14007                if let TransformResult::Changed(v) =
14008                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14009                    b.type_parameters(v);
14010                }
14011                b.build(ctx)
14012            }
14013            builder::Builder::TSQualifiedName(mut b) => {
14014                if let TransformResult::Changed(v) =
14015                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
14016                    b.left(v);
14017                }
14018                if let TransformResult::Changed(v) =
14019                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
14020                    b.right(v);
14021                }
14022                b.build(ctx)
14023            }
14024            builder::Builder::TSFunctionType(mut b) => {
14025                if let TransformResult::Changed(v) =
14026                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14027                    b.params(v);
14028                }
14029                if let TransformResult::Changed(v) =
14030                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
14031                    b.return_type(v);
14032                }
14033                if let TransformResult::Changed(v) =
14034                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14035                    b.type_parameters(v);
14036                }
14037                b.build(ctx)
14038            }
14039            builder::Builder::TSConstructorType(mut b) => {
14040                if let TransformResult::Changed(v) =
14041                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14042                    b.params(v);
14043                }
14044                if let TransformResult::Changed(v) =
14045                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
14046                    b.return_type(v);
14047                }
14048                if let TransformResult::Changed(v) =
14049                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14050                    b.type_parameters(v);
14051                }
14052                b.build(ctx)
14053            }
14054            builder::Builder::TSTypePredicate(mut b) => {
14055                if let TransformResult::Changed(v) =
14056                    b.inner.parameter_name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::parameter_name)) {
14057                    b.parameter_name(v);
14058                }
14059                if let TransformResult::Changed(v) =
14060                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14061                    b.type_annotation(v);
14062                }
14063                b.build(ctx)
14064            }
14065            builder::Builder::TSTupleType(mut b) => {
14066                if let TransformResult::Changed(v) =
14067                    b.inner.element_types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_types)) {
14068                    b.element_types(v);
14069                }
14070                b.build(ctx)
14071            }
14072            builder::Builder::TSTypeAssertion(mut b) => {
14073                if let TransformResult::Changed(v) =
14074                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14075                    b.type_annotation(v);
14076                }
14077                if let TransformResult::Changed(v) =
14078                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
14079                    b.expression(v);
14080                }
14081                b.build(ctx)
14082            }
14083            builder::Builder::TSAsExpression(mut b) => {
14084                if let TransformResult::Changed(v) =
14085                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
14086                    b.expression(v);
14087                }
14088                if let TransformResult::Changed(v) =
14089                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14090                    b.type_annotation(v);
14091                }
14092                b.build(ctx)
14093            }
14094            builder::Builder::TSParameterProperty(mut b) => {
14095                if let TransformResult::Changed(v) =
14096                    b.inner.parameter.visit_child_mut(ctx, visitor, Path::new(self, NodeField::parameter)) {
14097                    b.parameter(v);
14098                }
14099                b.build(ctx)
14100            }
14101            builder::Builder::TSTypeAliasDeclaration(mut b) => {
14102                if let TransformResult::Changed(v) =
14103                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14104                    b.id(v);
14105                }
14106                if let TransformResult::Changed(v) =
14107                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14108                    b.type_parameters(v);
14109                }
14110                if let TransformResult::Changed(v) =
14111                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14112                    b.type_annotation(v);
14113                }
14114                b.build(ctx)
14115            }
14116            builder::Builder::TSInterfaceDeclaration(mut b) => {
14117                if let TransformResult::Changed(v) =
14118                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14119                    b.id(v);
14120                }
14121                if let TransformResult::Changed(v) =
14122                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14123                    b.body(v);
14124                }
14125                if let TransformResult::Changed(v) =
14126                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
14127                    b.extends(v);
14128                }
14129                if let TransformResult::Changed(v) =
14130                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14131                    b.type_parameters(v);
14132                }
14133                b.build(ctx)
14134            }
14135            builder::Builder::TSInterfaceHeritage(mut b) => {
14136                if let TransformResult::Changed(v) =
14137                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
14138                    b.expression(v);
14139                }
14140                if let TransformResult::Changed(v) =
14141                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14142                    b.type_parameters(v);
14143                }
14144                b.build(ctx)
14145            }
14146            builder::Builder::TSInterfaceBody(mut b) => {
14147                if let TransformResult::Changed(v) =
14148                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14149                    b.body(v);
14150                }
14151                b.build(ctx)
14152            }
14153            builder::Builder::TSEnumDeclaration(mut b) => {
14154                if let TransformResult::Changed(v) =
14155                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14156                    b.id(v);
14157                }
14158                if let TransformResult::Changed(v) =
14159                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
14160                    b.members(v);
14161                }
14162                b.build(ctx)
14163            }
14164            builder::Builder::TSEnumMember(mut b) => {
14165                if let TransformResult::Changed(v) =
14166                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14167                    b.id(v);
14168                }
14169                if let TransformResult::Changed(v) =
14170                    b.inner.initializer.visit_child_mut(ctx, visitor, Path::new(self, NodeField::initializer)) {
14171                    b.initializer(v);
14172                }
14173                b.build(ctx)
14174            }
14175            builder::Builder::TSModuleDeclaration(mut b) => {
14176                if let TransformResult::Changed(v) =
14177                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14178                    b.id(v);
14179                }
14180                if let TransformResult::Changed(v) =
14181                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14182                    b.body(v);
14183                }
14184                b.build(ctx)
14185            }
14186            builder::Builder::TSModuleBlock(mut b) => {
14187                if let TransformResult::Changed(v) =
14188                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14189                    b.body(v);
14190                }
14191                b.build(ctx)
14192            }
14193            builder::Builder::TSModuleMember(mut b) => {
14194                if let TransformResult::Changed(v) =
14195                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14196                    b.id(v);
14197                }
14198                if let TransformResult::Changed(v) =
14199                    b.inner.initializer.visit_child_mut(ctx, visitor, Path::new(self, NodeField::initializer)) {
14200                    b.initializer(v);
14201                }
14202                b.build(ctx)
14203            }
14204            builder::Builder::TSTypeParameterDeclaration(mut b) => {
14205                if let TransformResult::Changed(v) =
14206                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14207                    b.params(v);
14208                }
14209                b.build(ctx)
14210            }
14211            builder::Builder::TSTypeParameter(mut b) => {
14212                if let TransformResult::Changed(v) =
14213                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
14214                    b.name(v);
14215                }
14216                if let TransformResult::Changed(v) =
14217                    b.inner.constraint.visit_child_mut(ctx, visitor, Path::new(self, NodeField::constraint)) {
14218                    b.constraint(v);
14219                }
14220                if let TransformResult::Changed(v) =
14221                    b.inner.default.visit_child_mut(ctx, visitor, Path::new(self, NodeField::default)) {
14222                    b.default(v);
14223                }
14224                b.build(ctx)
14225            }
14226            builder::Builder::TSTypeParameterInstantiation(mut b) => {
14227                if let TransformResult::Changed(v) =
14228                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14229                    b.params(v);
14230                }
14231                b.build(ctx)
14232            }
14233            builder::Builder::TSUnionType(mut b) => {
14234                if let TransformResult::Changed(v) =
14235                    b.inner.types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::types)) {
14236                    b.types(v);
14237                }
14238                b.build(ctx)
14239            }
14240            builder::Builder::TSIntersectionType(mut b) => {
14241                if let TransformResult::Changed(v) =
14242                    b.inner.types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::types)) {
14243                    b.types(v);
14244                }
14245                b.build(ctx)
14246            }
14247            builder::Builder::TSTypeQuery(mut b) => {
14248                if let TransformResult::Changed(v) =
14249                    b.inner.expr_name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expr_name)) {
14250                    b.expr_name(v);
14251                }
14252                b.build(ctx)
14253            }
14254            builder::Builder::TSConditionalType(mut b) => {
14255                if let TransformResult::Changed(v) =
14256                    b.inner.check_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::check_type)) {
14257                    b.check_type(v);
14258                }
14259                if let TransformResult::Changed(v) =
14260                    b.inner.extends_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends_type)) {
14261                    b.extends_type(v);
14262                }
14263                if let TransformResult::Changed(v) =
14264                    b.inner.true_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::true_type)) {
14265                    b.true_type(v);
14266                }
14267                if let TransformResult::Changed(v) =
14268                    b.inner.false_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::false_type)) {
14269                    b.false_type(v);
14270                }
14271                b.build(ctx)
14272            }
14273            builder::Builder::TSTypeLiteral(mut b) => {
14274                if let TransformResult::Changed(v) =
14275                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
14276                    b.members(v);
14277                }
14278                b.build(ctx)
14279            }
14280            builder::Builder::TSPropertySignature(mut b) => {
14281                if let TransformResult::Changed(v) =
14282                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
14283                    b.key(v);
14284                }
14285                if let TransformResult::Changed(v) =
14286                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14287                    b.type_annotation(v);
14288                }
14289                if let TransformResult::Changed(v) =
14290                    b.inner.initializer.visit_child_mut(ctx, visitor, Path::new(self, NodeField::initializer)) {
14291                    b.initializer(v);
14292                }
14293                b.build(ctx)
14294            }
14295            builder::Builder::TSMethodSignature(mut b) => {
14296                if let TransformResult::Changed(v) =
14297                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
14298                    b.key(v);
14299                }
14300                if let TransformResult::Changed(v) =
14301                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14302                    b.params(v);
14303                }
14304                if let TransformResult::Changed(v) =
14305                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
14306                    b.return_type(v);
14307                }
14308                b.build(ctx)
14309            }
14310            builder::Builder::TSIndexSignature(mut b) => {
14311                if let TransformResult::Changed(v) =
14312                    b.inner.parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::parameters)) {
14313                    b.parameters(v);
14314                }
14315                if let TransformResult::Changed(v) =
14316                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14317                    b.type_annotation(v);
14318                }
14319                b.build(ctx)
14320            }
14321            builder::Builder::TSCallSignatureDeclaration(mut b) => {
14322                if let TransformResult::Changed(v) =
14323                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14324                    b.params(v);
14325                }
14326                if let TransformResult::Changed(v) =
14327                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
14328                    b.return_type(v);
14329                }
14330                b.build(ctx)
14331            }
14332            builder::Builder::TSModifiers(mut b) => b.build(ctx),
14333            builder::Builder::CoverEmptyArgs(mut b) => b.build(ctx),
14334            builder::Builder::CoverTrailingComma(mut b) => b.build(ctx),
14335            builder::Builder::CoverInitializer(mut b) => {
14336                if let TransformResult::Changed(v) =
14337                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
14338                    b.init(v);
14339                }
14340                b.build(ctx)
14341            }
14342            builder::Builder::CoverRestElement(mut b) => {
14343                if let TransformResult::Changed(v) =
14344                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
14345                    b.rest(v);
14346                }
14347                b.build(ctx)
14348            }
14349            builder::Builder::CoverTypedIdentifier(mut b) => {
14350                if let TransformResult::Changed(v) =
14351                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
14352                    b.left(v);
14353                }
14354                if let TransformResult::Changed(v) =
14355                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
14356                    b.right(v);
14357                }
14358                b.build(ctx)
14359            }
14360            builder::Builder::SHBuiltin(mut b) => b.build(ctx),
14361            builder::Builder::ImplicitCheckedCast(mut b) => {
14362                if let TransformResult::Changed(v) =
14363                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
14364                    b.argument(v);
14365                }
14366                b.build(ctx)
14367            }
14368        }
14369    }
14370
14371    /// Call `cb` on every `NodeList` field of this node, including
14372    /// decoration lists. Used by the GC to mark list elements.
14373    pub fn mark_lists<F: FnMut(&NodeList<'gc>)>(&'gc self, cb: &mut F) {
14374        match self {
14375            Node::Program(n) => { cb(&n.body); cb(&n.decorations.get()); cb(&n.dummy_param_list.get()); }
14376            Node::FunctionExpression(n) => { cb(&n.params); cb(&n.decorations.get()); }
14377            Node::ArrowFunctionExpression(n) => { cb(&n.params); cb(&n.decorations.get()); }
14378            Node::FunctionDeclaration(n) => { cb(&n.params); cb(&n.decorations.get()); }
14379            Node::ComponentDeclaration(n) => { cb(&n.params); cb(&n.decorations.get()); }
14380            Node::HookDeclaration(n) => { cb(&n.params); cb(&n.decorations.get()); }
14381            Node::MatchStatement(n) => { cb(&n.cases); }
14382            Node::BlockStatement(n) => { cb(&n.body); }
14383            Node::StaticBlock(n) => { cb(&n.body); }
14384            Node::SwitchStatement(n) => { cb(&n.cases); }
14385            Node::SequenceExpression(n) => { cb(&n.expressions); }
14386            Node::ObjectExpression(n) => { cb(&n.properties); }
14387            Node::ArrayExpression(n) => { cb(&n.elements); }
14388            Node::NewExpression(n) => { cb(&n.arguments); }
14389            Node::CallExpression(n) => { cb(&n.arguments); }
14390            Node::OptionalCallExpression(n) => { cb(&n.arguments); }
14391            Node::SwitchCase(n) => { cb(&n.consequent); }
14392            Node::VariableDeclaration(n) => { cb(&n.declarations); }
14393            Node::TemplateLiteral(n) => { cb(&n.quasis); cb(&n.expressions); }
14394            Node::ClassDeclaration(n) => { cb(&n.implements); cb(&n.decorators); }
14395            Node::ClassExpression(n) => { cb(&n.implements); cb(&n.decorators); }
14396            Node::ClassBody(n) => { cb(&n.body); }
14397            Node::ClassProperty(n) => { cb(&n.decorators); }
14398            Node::ClassPrivateProperty(n) => { cb(&n.decorators); }
14399            Node::MethodDefinition(n) => { cb(&n.decorators); }
14400            Node::ImportDeclaration(n) => { cb(&n.specifiers); cb(&n.attributes); }
14401            Node::ExportNamedDeclaration(n) => { cb(&n.specifiers); }
14402            Node::ObjectPattern(n) => { cb(&n.properties); }
14403            Node::ArrayPattern(n) => { cb(&n.elements); }
14404            Node::MatchExpression(n) => { cb(&n.cases); }
14405            Node::MatchObjectPattern(n) => { cb(&n.properties); }
14406            Node::MatchArrayPattern(n) => { cb(&n.elements); }
14407            Node::MatchOrPattern(n) => { cb(&n.patterns); }
14408            Node::MatchInstanceObjectPattern(n) => { cb(&n.properties); }
14409            Node::JSXOpeningElement(n) => { cb(&n.attributes); }
14410            Node::JSXElement(n) => { cb(&n.children); }
14411            Node::JSXFragment(n) => { cb(&n.children); }
14412            Node::FunctionTypeAnnotation(n) => { cb(&n.params); }
14413            Node::HookTypeAnnotation(n) => { cb(&n.params); }
14414            Node::ComponentTypeAnnotation(n) => { cb(&n.params); }
14415            Node::TupleTypeAnnotation(n) => { cb(&n.element_types); }
14416            Node::UnionTypeAnnotation(n) => { cb(&n.types); }
14417            Node::IntersectionTypeAnnotation(n) => { cb(&n.types); }
14418            Node::InterfaceTypeAnnotation(n) => { cb(&n.extends); }
14419            Node::InterfaceDeclaration(n) => { cb(&n.extends); }
14420            Node::DeclareInterface(n) => { cb(&n.extends); }
14421            Node::DeclareClass(n) => { cb(&n.extends); cb(&n.implements); cb(&n.mixins); }
14422            Node::DeclareComponent(n) => { cb(&n.params); }
14423            Node::DeclareExportDeclaration(n) => { cb(&n.specifiers); }
14424            Node::ObjectTypeAnnotation(n) => { cb(&n.properties); cb(&n.indexers); cb(&n.call_properties); cb(&n.internal_slots); }
14425            Node::TypeParameterDeclaration(n) => { cb(&n.params); }
14426            Node::TypeParameterInstantiation(n) => { cb(&n.params); }
14427            Node::EnumStringBody(n) => { cb(&n.members); }
14428            Node::EnumNumberBody(n) => { cb(&n.members); }
14429            Node::EnumBigIntBody(n) => { cb(&n.members); }
14430            Node::EnumBooleanBody(n) => { cb(&n.members); }
14431            Node::EnumSymbolBody(n) => { cb(&n.members); }
14432            Node::RecordDeclaration(n) => { cb(&n.implements); }
14433            Node::RecordDeclarationBody(n) => { cb(&n.elements); }
14434            Node::RecordExpressionProperties(n) => { cb(&n.properties); }
14435            Node::TSFunctionType(n) => { cb(&n.params); }
14436            Node::TSConstructorType(n) => { cb(&n.params); }
14437            Node::TSTupleType(n) => { cb(&n.element_types); }
14438            Node::TSInterfaceDeclaration(n) => { cb(&n.extends); }
14439            Node::TSInterfaceBody(n) => { cb(&n.body); }
14440            Node::TSEnumDeclaration(n) => { cb(&n.members); }
14441            Node::TSModuleBlock(n) => { cb(&n.body); }
14442            Node::TSTypeParameterDeclaration(n) => { cb(&n.params); }
14443            Node::TSTypeParameterInstantiation(n) => { cb(&n.params); }
14444            Node::TSUnionType(n) => { cb(&n.types); }
14445            Node::TSIntersectionType(n) => { cb(&n.types); }
14446            Node::TSTypeLiteral(n) => { cb(&n.members); }
14447            Node::TSMethodSignature(n) => { cb(&n.params); }
14448            Node::TSIndexSignature(n) => { cb(&n.parameters); }
14449            Node::TSCallSignatureDeclaration(n) => { cb(&n.params); }
14450            _ => {}
14451        }
14452    }
14453
14454    /// The ESTree node type name — the JSON `"type"` value.
14455    pub fn node_type_str(&self) -> &'static str {
14456        match self {
14457            Node::Empty(_) => "Empty",
14458            Node::Metadata(_) => "Metadata",
14459            Node::Program(_) => "Program",
14460            Node::FunctionExpression(_) => "FunctionExpression",
14461            Node::ArrowFunctionExpression(_) => "ArrowFunctionExpression",
14462            Node::FunctionDeclaration(_) => "FunctionDeclaration",
14463            Node::ComponentDeclaration(_) => "ComponentDeclaration",
14464            Node::HookDeclaration(_) => "HookDeclaration",
14465            Node::MatchStatement(_) => "MatchStatement",
14466            Node::WhileStatement(_) => "WhileStatement",
14467            Node::DoWhileStatement(_) => "DoWhileStatement",
14468            Node::ForInStatement(_) => "ForInStatement",
14469            Node::ForOfStatement(_) => "ForOfStatement",
14470            Node::ForStatement(_) => "ForStatement",
14471            Node::DebuggerStatement(_) => "DebuggerStatement",
14472            Node::EmptyStatement(_) => "EmptyStatement",
14473            Node::BlockStatement(_) => "BlockStatement",
14474            Node::StaticBlock(_) => "StaticBlock",
14475            Node::BreakStatement(_) => "BreakStatement",
14476            Node::ContinueStatement(_) => "ContinueStatement",
14477            Node::ThrowStatement(_) => "ThrowStatement",
14478            Node::ReturnStatement(_) => "ReturnStatement",
14479            Node::WithStatement(_) => "WithStatement",
14480            Node::SwitchStatement(_) => "SwitchStatement",
14481            Node::LabeledStatement(_) => "LabeledStatement",
14482            Node::ExpressionStatement(_) => "ExpressionStatement",
14483            Node::TryStatement(_) => "TryStatement",
14484            Node::IfStatement(_) => "IfStatement",
14485            Node::NullLiteral(_) => "NullLiteral",
14486            Node::BooleanLiteral(_) => "BooleanLiteral",
14487            Node::StringLiteral(_) => "StringLiteral",
14488            Node::NumericLiteral(_) => "NumericLiteral",
14489            Node::RegExpLiteral(_) => "RegExpLiteral",
14490            Node::BigIntLiteral(_) => "BigIntLiteral",
14491            Node::ThisExpression(_) => "ThisExpression",
14492            Node::Super(_) => "Super",
14493            Node::SequenceExpression(_) => "SequenceExpression",
14494            Node::ObjectExpression(_) => "ObjectExpression",
14495            Node::ArrayExpression(_) => "ArrayExpression",
14496            Node::SpreadElement(_) => "SpreadElement",
14497            Node::NewExpression(_) => "NewExpression",
14498            Node::YieldExpression(_) => "YieldExpression",
14499            Node::AwaitExpression(_) => "AwaitExpression",
14500            Node::ImportExpression(_) => "ImportExpression",
14501            Node::CallExpression(_) => "CallExpression",
14502            Node::OptionalCallExpression(_) => "OptionalCallExpression",
14503            Node::AssignmentExpression(_) => "AssignmentExpression",
14504            Node::UnaryExpression(_) => "UnaryExpression",
14505            Node::UpdateExpression(_) => "UpdateExpression",
14506            Node::MemberExpression(_) => "MemberExpression",
14507            Node::OptionalMemberExpression(_) => "OptionalMemberExpression",
14508            Node::LogicalExpression(_) => "LogicalExpression",
14509            Node::ConditionalExpression(_) => "ConditionalExpression",
14510            Node::BinaryExpression(_) => "BinaryExpression",
14511            Node::Directive(_) => "Directive",
14512            Node::DirectiveLiteral(_) => "DirectiveLiteral",
14513            Node::Identifier(_) => "Identifier",
14514            Node::PrivateName(_) => "PrivateName",
14515            Node::MetaProperty(_) => "MetaProperty",
14516            Node::SwitchCase(_) => "SwitchCase",
14517            Node::CatchClause(_) => "CatchClause",
14518            Node::VariableDeclarator(_) => "VariableDeclarator",
14519            Node::VariableDeclaration(_) => "VariableDeclaration",
14520            Node::TemplateLiteral(_) => "TemplateLiteral",
14521            Node::TaggedTemplateExpression(_) => "TaggedTemplateExpression",
14522            Node::TemplateElement(_) => "TemplateElement",
14523            Node::Property(_) => "Property",
14524            Node::Decorator(_) => "Decorator",
14525            Node::ClassDeclaration(_) => "ClassDeclaration",
14526            Node::ClassExpression(_) => "ClassExpression",
14527            Node::ClassBody(_) => "ClassBody",
14528            Node::ClassProperty(_) => "ClassProperty",
14529            Node::ClassPrivateProperty(_) => "ClassPrivateProperty",
14530            Node::MethodDefinition(_) => "MethodDefinition",
14531            Node::ImportDeclaration(_) => "ImportDeclaration",
14532            Node::ImportSpecifier(_) => "ImportSpecifier",
14533            Node::ImportDefaultSpecifier(_) => "ImportDefaultSpecifier",
14534            Node::ImportNamespaceSpecifier(_) => "ImportNamespaceSpecifier",
14535            Node::ImportAttribute(_) => "ImportAttribute",
14536            Node::ExportNamedDeclaration(_) => "ExportNamedDeclaration",
14537            Node::ExportSpecifier(_) => "ExportSpecifier",
14538            Node::ExportNamespaceSpecifier(_) => "ExportNamespaceSpecifier",
14539            Node::ExportDefaultDeclaration(_) => "ExportDefaultDeclaration",
14540            Node::ExportAllDeclaration(_) => "ExportAllDeclaration",
14541            Node::ObjectPattern(_) => "ObjectPattern",
14542            Node::ArrayPattern(_) => "ArrayPattern",
14543            Node::RestElement(_) => "RestElement",
14544            Node::AssignmentPattern(_) => "AssignmentPattern",
14545            Node::MatchStatementCase(_) => "MatchStatementCase",
14546            Node::MatchExpression(_) => "MatchExpression",
14547            Node::MatchExpressionCase(_) => "MatchExpressionCase",
14548            Node::MatchWildcardPattern(_) => "MatchWildcardPattern",
14549            Node::MatchLiteralPattern(_) => "MatchLiteralPattern",
14550            Node::MatchUnaryPattern(_) => "MatchUnaryPattern",
14551            Node::MatchIdentifierPattern(_) => "MatchIdentifierPattern",
14552            Node::MatchBindingPattern(_) => "MatchBindingPattern",
14553            Node::MatchObjectPattern(_) => "MatchObjectPattern",
14554            Node::MatchArrayPattern(_) => "MatchArrayPattern",
14555            Node::MatchOrPattern(_) => "MatchOrPattern",
14556            Node::MatchAsPattern(_) => "MatchAsPattern",
14557            Node::MatchMemberPattern(_) => "MatchMemberPattern",
14558            Node::MatchInstancePattern(_) => "MatchInstancePattern",
14559            Node::MatchObjectPatternProperty(_) => "MatchObjectPatternProperty",
14560            Node::MatchInstanceObjectPattern(_) => "MatchInstanceObjectPattern",
14561            Node::MatchRestPattern(_) => "MatchRestPattern",
14562            Node::JSXIdentifier(_) => "JSXIdentifier",
14563            Node::JSXMemberExpression(_) => "JSXMemberExpression",
14564            Node::JSXNamespacedName(_) => "JSXNamespacedName",
14565            Node::JSXEmptyExpression(_) => "JSXEmptyExpression",
14566            Node::JSXExpressionContainer(_) => "JSXExpressionContainer",
14567            Node::JSXSpreadChild(_) => "JSXSpreadChild",
14568            Node::JSXOpeningElement(_) => "JSXOpeningElement",
14569            Node::JSXClosingElement(_) => "JSXClosingElement",
14570            Node::JSXAttribute(_) => "JSXAttribute",
14571            Node::JSXSpreadAttribute(_) => "JSXSpreadAttribute",
14572            Node::JSXStringLiteral(_) => "JSXStringLiteral",
14573            Node::JSXText(_) => "JSXText",
14574            Node::JSXElement(_) => "JSXElement",
14575            Node::JSXFragment(_) => "JSXFragment",
14576            Node::JSXOpeningFragment(_) => "JSXOpeningFragment",
14577            Node::JSXClosingFragment(_) => "JSXClosingFragment",
14578            Node::ExistsTypeAnnotation(_) => "ExistsTypeAnnotation",
14579            Node::EmptyTypeAnnotation(_) => "EmptyTypeAnnotation",
14580            Node::StringTypeAnnotation(_) => "StringTypeAnnotation",
14581            Node::NumberTypeAnnotation(_) => "NumberTypeAnnotation",
14582            Node::StringLiteralTypeAnnotation(_) => "StringLiteralTypeAnnotation",
14583            Node::NumberLiteralTypeAnnotation(_) => "NumberLiteralTypeAnnotation",
14584            Node::BigIntLiteralTypeAnnotation(_) => "BigIntLiteralTypeAnnotation",
14585            Node::BooleanTypeAnnotation(_) => "BooleanTypeAnnotation",
14586            Node::BooleanLiteralTypeAnnotation(_) => "BooleanLiteralTypeAnnotation",
14587            Node::NullLiteralTypeAnnotation(_) => "NullLiteralTypeAnnotation",
14588            Node::SymbolTypeAnnotation(_) => "SymbolTypeAnnotation",
14589            Node::AnyTypeAnnotation(_) => "AnyTypeAnnotation",
14590            Node::MixedTypeAnnotation(_) => "MixedTypeAnnotation",
14591            Node::BigIntTypeAnnotation(_) => "BigIntTypeAnnotation",
14592            Node::VoidTypeAnnotation(_) => "VoidTypeAnnotation",
14593            Node::NeverTypeAnnotation(_) => "NeverTypeAnnotation",
14594            Node::UnknownTypeAnnotation(_) => "UnknownTypeAnnotation",
14595            Node::UndefinedTypeAnnotation(_) => "UndefinedTypeAnnotation",
14596            Node::FunctionTypeAnnotation(_) => "FunctionTypeAnnotation",
14597            Node::HookTypeAnnotation(_) => "HookTypeAnnotation",
14598            Node::FunctionTypeParam(_) => "FunctionTypeParam",
14599            Node::ComponentTypeAnnotation(_) => "ComponentTypeAnnotation",
14600            Node::ComponentTypeParameter(_) => "ComponentTypeParameter",
14601            Node::NullableTypeAnnotation(_) => "NullableTypeAnnotation",
14602            Node::QualifiedTypeIdentifier(_) => "QualifiedTypeIdentifier",
14603            Node::TypeofTypeAnnotation(_) => "TypeofTypeAnnotation",
14604            Node::KeyofTypeAnnotation(_) => "KeyofTypeAnnotation",
14605            Node::TypeOperator(_) => "TypeOperator",
14606            Node::QualifiedTypeofIdentifier(_) => "QualifiedTypeofIdentifier",
14607            Node::TupleTypeAnnotation(_) => "TupleTypeAnnotation",
14608            Node::TupleTypeSpreadElement(_) => "TupleTypeSpreadElement",
14609            Node::TupleTypeLabeledElement(_) => "TupleTypeLabeledElement",
14610            Node::ArrayTypeAnnotation(_) => "ArrayTypeAnnotation",
14611            Node::InferTypeAnnotation(_) => "InferTypeAnnotation",
14612            Node::UnionTypeAnnotation(_) => "UnionTypeAnnotation",
14613            Node::IntersectionTypeAnnotation(_) => "IntersectionTypeAnnotation",
14614            Node::GenericTypeAnnotation(_) => "GenericTypeAnnotation",
14615            Node::IndexedAccessType(_) => "IndexedAccessType",
14616            Node::OptionalIndexedAccessType(_) => "OptionalIndexedAccessType",
14617            Node::ConditionalTypeAnnotation(_) => "ConditionalTypeAnnotation",
14618            Node::TypePredicate(_) => "TypePredicate",
14619            Node::InterfaceTypeAnnotation(_) => "InterfaceTypeAnnotation",
14620            Node::TypeAlias(_) => "TypeAlias",
14621            Node::OpaqueType(_) => "OpaqueType",
14622            Node::InterfaceDeclaration(_) => "InterfaceDeclaration",
14623            Node::DeclareTypeAlias(_) => "DeclareTypeAlias",
14624            Node::DeclareOpaqueType(_) => "DeclareOpaqueType",
14625            Node::DeclareInterface(_) => "DeclareInterface",
14626            Node::DeclareClass(_) => "DeclareClass",
14627            Node::DeclareFunction(_) => "DeclareFunction",
14628            Node::DeclareHook(_) => "DeclareHook",
14629            Node::DeclareComponent(_) => "DeclareComponent",
14630            Node::DeclareVariable(_) => "DeclareVariable",
14631            Node::DeclareEnum(_) => "DeclareEnum",
14632            Node::DeclareExportDeclaration(_) => "DeclareExportDeclaration",
14633            Node::DeclareExportAllDeclaration(_) => "DeclareExportAllDeclaration",
14634            Node::DeclareModule(_) => "DeclareModule",
14635            Node::DeclareNamespace(_) => "DeclareNamespace",
14636            Node::DeclareModuleExports(_) => "DeclareModuleExports",
14637            Node::InterfaceExtends(_) => "InterfaceExtends",
14638            Node::ClassImplements(_) => "ClassImplements",
14639            Node::TypeAnnotation(_) => "TypeAnnotation",
14640            Node::ObjectTypeAnnotation(_) => "ObjectTypeAnnotation",
14641            Node::ObjectTypeProperty(_) => "ObjectTypeProperty",
14642            Node::ObjectTypeSpreadProperty(_) => "ObjectTypeSpreadProperty",
14643            Node::ObjectTypeInternalSlot(_) => "ObjectTypeInternalSlot",
14644            Node::ObjectTypeCallProperty(_) => "ObjectTypeCallProperty",
14645            Node::ObjectTypeIndexer(_) => "ObjectTypeIndexer",
14646            Node::ObjectTypeMappedTypeProperty(_) => "ObjectTypeMappedTypeProperty",
14647            Node::Variance(_) => "Variance",
14648            Node::TypeParameterDeclaration(_) => "TypeParameterDeclaration",
14649            Node::TypeParameter(_) => "TypeParameter",
14650            Node::TypeParameterInstantiation(_) => "TypeParameterInstantiation",
14651            Node::TypeCastExpression(_) => "TypeCastExpression",
14652            Node::AsExpression(_) => "AsExpression",
14653            Node::AsConstExpression(_) => "AsConstExpression",
14654            Node::InferredPredicate(_) => "InferredPredicate",
14655            Node::DeclaredPredicate(_) => "DeclaredPredicate",
14656            Node::EnumDeclaration(_) => "EnumDeclaration",
14657            Node::EnumStringBody(_) => "EnumStringBody",
14658            Node::EnumNumberBody(_) => "EnumNumberBody",
14659            Node::EnumBigIntBody(_) => "EnumBigIntBody",
14660            Node::EnumBooleanBody(_) => "EnumBooleanBody",
14661            Node::EnumSymbolBody(_) => "EnumSymbolBody",
14662            Node::EnumDefaultedMember(_) => "EnumDefaultedMember",
14663            Node::EnumStringMember(_) => "EnumStringMember",
14664            Node::EnumNumberMember(_) => "EnumNumberMember",
14665            Node::EnumBigIntMember(_) => "EnumBigIntMember",
14666            Node::EnumBooleanMember(_) => "EnumBooleanMember",
14667            Node::ComponentParameter(_) => "ComponentParameter",
14668            Node::RecordDeclaration(_) => "RecordDeclaration",
14669            Node::RecordDeclarationImplements(_) => "RecordDeclarationImplements",
14670            Node::RecordDeclarationBody(_) => "RecordDeclarationBody",
14671            Node::RecordDeclarationProperty(_) => "RecordDeclarationProperty",
14672            Node::RecordDeclarationStaticProperty(_) => "RecordDeclarationStaticProperty",
14673            Node::RecordExpression(_) => "RecordExpression",
14674            Node::RecordExpressionProperties(_) => "RecordExpressionProperties",
14675            Node::TSTypeAnnotation(_) => "TSTypeAnnotation",
14676            Node::TSAnyKeyword(_) => "TSAnyKeyword",
14677            Node::TSNumberKeyword(_) => "TSNumberKeyword",
14678            Node::TSBooleanKeyword(_) => "TSBooleanKeyword",
14679            Node::TSStringKeyword(_) => "TSStringKeyword",
14680            Node::TSSymbolKeyword(_) => "TSSymbolKeyword",
14681            Node::TSVoidKeyword(_) => "TSVoidKeyword",
14682            Node::TSUndefinedKeyword(_) => "TSUndefinedKeyword",
14683            Node::TSUnknownKeyword(_) => "TSUnknownKeyword",
14684            Node::TSNeverKeyword(_) => "TSNeverKeyword",
14685            Node::TSBigIntKeyword(_) => "TSBigIntKeyword",
14686            Node::TSThisType(_) => "TSThisType",
14687            Node::TSLiteralType(_) => "TSLiteralType",
14688            Node::TSIndexedAccessType(_) => "TSIndexedAccessType",
14689            Node::TSArrayType(_) => "TSArrayType",
14690            Node::TSTypeReference(_) => "TSTypeReference",
14691            Node::TSQualifiedName(_) => "TSQualifiedName",
14692            Node::TSFunctionType(_) => "TSFunctionType",
14693            Node::TSConstructorType(_) => "TSConstructorType",
14694            Node::TSTypePredicate(_) => "TSTypePredicate",
14695            Node::TSTupleType(_) => "TSTupleType",
14696            Node::TSTypeAssertion(_) => "TSTypeAssertion",
14697            Node::TSAsExpression(_) => "TSAsExpression",
14698            Node::TSParameterProperty(_) => "TSParameterProperty",
14699            Node::TSTypeAliasDeclaration(_) => "TSTypeAliasDeclaration",
14700            Node::TSInterfaceDeclaration(_) => "TSInterfaceDeclaration",
14701            Node::TSInterfaceHeritage(_) => "TSInterfaceHeritage",
14702            Node::TSInterfaceBody(_) => "TSInterfaceBody",
14703            Node::TSEnumDeclaration(_) => "TSEnumDeclaration",
14704            Node::TSEnumMember(_) => "TSEnumMember",
14705            Node::TSModuleDeclaration(_) => "TSModuleDeclaration",
14706            Node::TSModuleBlock(_) => "TSModuleBlock",
14707            Node::TSModuleMember(_) => "TSModuleMember",
14708            Node::TSTypeParameterDeclaration(_) => "TSTypeParameterDeclaration",
14709            Node::TSTypeParameter(_) => "TSTypeParameter",
14710            Node::TSTypeParameterInstantiation(_) => "TSTypeParameterInstantiation",
14711            Node::TSUnionType(_) => "TSUnionType",
14712            Node::TSIntersectionType(_) => "TSIntersectionType",
14713            Node::TSTypeQuery(_) => "TSTypeQuery",
14714            Node::TSConditionalType(_) => "TSConditionalType",
14715            Node::TSTypeLiteral(_) => "TSTypeLiteral",
14716            Node::TSPropertySignature(_) => "TSPropertySignature",
14717            Node::TSMethodSignature(_) => "TSMethodSignature",
14718            Node::TSIndexSignature(_) => "TSIndexSignature",
14719            Node::TSCallSignatureDeclaration(_) => "TSCallSignatureDeclaration",
14720            Node::TSModifiers(_) => "TSModifiers",
14721            Node::CoverEmptyArgs(_) => "CoverEmptyArgs",
14722            Node::CoverTrailingComma(_) => "CoverTrailingComma",
14723            Node::CoverInitializer(_) => "CoverInitializer",
14724            Node::CoverRestElement(_) => "CoverRestElement",
14725            Node::CoverTypedIdentifier(_) => "CoverTypedIdentifier",
14726            Node::SHBuiltin(_) => "SHBuiltin",
14727            Node::ImplicitCheckedCast(_) => "ImplicitCheckedCast",
14728        }
14729    }
14730
14731    /// Emit this node's `.def` child fields as JSON key/values,
14732    /// in declared order. Mirrors C++ `visitChildren`.
14733    pub fn dump_children<'a, 'w>(
14734        &'gc self,
14735        d: &mut crate::dump::ESTreeJSONDumper<'a, 'w>,
14736    ) {
14737        match self {
14738            Node::Empty(_) => {}
14739            Node::Metadata(_) => {}
14740            Node::Program(n) => {
14741                d.field_list("body", n.body, false);
14742            }
14743            Node::FunctionExpression(n) => {
14744                d.field_node("id", n.id, false);
14745                d.field_list("params", n.params, false);
14746                d.field_node("body", Some(n.body), false);
14747                d.field_node("typeParameters", n.type_parameters, true);
14748                d.field_node("returnType", n.return_type, true);
14749                d.field_node("predicate", n.predicate, true);
14750                d.field_bool("generator", n.generator.get(), false);
14751                d.field_bool("async", n.r#async.get(), false);
14752            }
14753            Node::ArrowFunctionExpression(n) => {
14754                d.field_list("params", n.params, false);
14755                d.field_node("body", Some(n.body), false);
14756                d.field_node("typeParameters", n.type_parameters, true);
14757                d.field_node("returnType", n.return_type, true);
14758                d.field_node("predicate", n.predicate, true);
14759                d.field_bool("expression", n.expression.get(), false);
14760                d.field_bool("async", n.r#async.get(), false);
14761            }
14762            Node::FunctionDeclaration(n) => {
14763                d.field_node("id", n.id, false);
14764                d.field_list("params", n.params, false);
14765                d.field_node("body", Some(n.body), false);
14766                d.field_node("typeParameters", n.type_parameters, true);
14767                d.field_node("returnType", n.return_type, true);
14768                d.field_node("predicate", n.predicate, true);
14769                d.field_bool("generator", n.generator.get(), false);
14770                d.field_bool("async", n.r#async.get(), false);
14771            }
14772            Node::ComponentDeclaration(n) => {
14773                d.field_node("id", Some(n.id), false);
14774                d.field_list("params", n.params, false);
14775                d.field_node("body", Some(n.body), false);
14776                d.field_node("typeParameters", n.type_parameters, true);
14777                d.field_node("rendersType", n.renders_type, true);
14778                d.field_bool("async", n.r#async.get(), false);
14779            }
14780            Node::HookDeclaration(n) => {
14781                d.field_node("id", Some(n.id), false);
14782                d.field_list("params", n.params, false);
14783                d.field_node("body", Some(n.body), false);
14784                d.field_node("typeParameters", n.type_parameters, true);
14785                d.field_node("returnType", n.return_type, true);
14786                d.field_bool("async", n.r#async.get(), false);
14787            }
14788            Node::MatchStatement(n) => {
14789                d.field_node("argument", Some(n.argument), false);
14790                d.field_list("cases", n.cases, false);
14791            }
14792            Node::WhileStatement(n) => {
14793                d.field_node("body", Some(n.body), false);
14794                d.field_node("test", Some(n.test), false);
14795            }
14796            Node::DoWhileStatement(n) => {
14797                d.field_node("body", Some(n.body), false);
14798                d.field_node("test", Some(n.test), false);
14799            }
14800            Node::ForInStatement(n) => {
14801                d.field_node("left", Some(n.left), false);
14802                d.field_node("right", Some(n.right), false);
14803                d.field_node("body", Some(n.body), false);
14804            }
14805            Node::ForOfStatement(n) => {
14806                d.field_node("left", Some(n.left), false);
14807                d.field_node("right", Some(n.right), false);
14808                d.field_node("body", Some(n.body), false);
14809                d.field_bool("await", n.r#await.get(), false);
14810            }
14811            Node::ForStatement(n) => {
14812                d.field_node("init", n.init, false);
14813                d.field_node("test", n.test, false);
14814                d.field_node("update", n.update, false);
14815                d.field_node("body", Some(n.body), false);
14816            }
14817            Node::DebuggerStatement(_) => {}
14818            Node::EmptyStatement(_) => {}
14819            Node::BlockStatement(n) => {
14820                d.field_list("body", n.body, false);
14821                d.field_bool("implicit", n.implicit.get(), true);
14822            }
14823            Node::StaticBlock(n) => {
14824                d.field_list("body", n.body, false);
14825            }
14826            Node::BreakStatement(n) => {
14827                d.field_node("label", n.label, false);
14828            }
14829            Node::ContinueStatement(n) => {
14830                d.field_node("label", n.label, false);
14831            }
14832            Node::ThrowStatement(n) => {
14833                d.field_node("argument", Some(n.argument), false);
14834            }
14835            Node::ReturnStatement(n) => {
14836                d.field_node("argument", n.argument, false);
14837            }
14838            Node::WithStatement(n) => {
14839                d.field_node("object", Some(n.object), false);
14840                d.field_node("body", Some(n.body), false);
14841            }
14842            Node::SwitchStatement(n) => {
14843                d.field_node("discriminant", Some(n.discriminant), false);
14844                d.field_list("cases", n.cases, false);
14845            }
14846            Node::LabeledStatement(n) => {
14847                d.field_node("label", Some(n.label), false);
14848                d.field_node("body", Some(n.body), false);
14849            }
14850            Node::ExpressionStatement(n) => {
14851                d.field_node("expression", Some(n.expression), false);
14852                d.field_label("directive", n.directive.get(), false);
14853            }
14854            Node::TryStatement(n) => {
14855                d.field_node("block", Some(n.block), false);
14856                d.field_node("handler", n.handler, false);
14857                d.field_node("finalizer", n.finalizer, false);
14858            }
14859            Node::IfStatement(n) => {
14860                d.field_node("test", Some(n.test), false);
14861                d.field_node("consequent", Some(n.consequent), false);
14862                d.field_node("alternate", n.alternate, false);
14863            }
14864            Node::NullLiteral(_) => {}
14865            Node::BooleanLiteral(n) => {
14866                d.field_bool("value", n.value.get(), false);
14867            }
14868            Node::StringLiteral(n) => {
14869                d.field_label("value", n.value.get(), false);
14870            }
14871            Node::NumericLiteral(n) => {
14872                d.field_number("value", n.value.get(), false);
14873            }
14874            Node::RegExpLiteral(n) => {
14875                d.field_label("pattern", n.pattern.get(), false);
14876                d.field_label("flags", n.flags.get(), false);
14877            }
14878            Node::BigIntLiteral(n) => {
14879                d.field_label("bigint", n.bigint.get(), false);
14880            }
14881            Node::ThisExpression(_) => {}
14882            Node::Super(_) => {}
14883            Node::SequenceExpression(n) => {
14884                d.field_list("expressions", n.expressions, false);
14885            }
14886            Node::ObjectExpression(n) => {
14887                d.field_list("properties", n.properties, false);
14888            }
14889            Node::ArrayExpression(n) => {
14890                d.field_list("elements", n.elements, false);
14891                d.field_bool("trailingComma", n.trailing_comma.get(), false);
14892            }
14893            Node::SpreadElement(n) => {
14894                d.field_node("argument", Some(n.argument), false);
14895            }
14896            Node::NewExpression(n) => {
14897                d.field_node("callee", Some(n.callee), false);
14898                d.field_node("typeArguments", n.type_arguments, true);
14899                d.field_list("arguments", n.arguments, false);
14900            }
14901            Node::YieldExpression(n) => {
14902                d.field_node("argument", n.argument, false);
14903                d.field_bool("delegate", n.delegate.get(), false);
14904            }
14905            Node::AwaitExpression(n) => {
14906                d.field_node("argument", Some(n.argument), false);
14907            }
14908            Node::ImportExpression(n) => {
14909                d.field_node("source", Some(n.source), false);
14910                d.field_node("options", n.options, false);
14911            }
14912            Node::CallExpression(n) => {
14913                d.field_node("callee", Some(n.callee), false);
14914                d.field_node("typeArguments", n.type_arguments, true);
14915                d.field_list("arguments", n.arguments, false);
14916            }
14917            Node::OptionalCallExpression(n) => {
14918                d.field_node("callee", Some(n.callee), false);
14919                d.field_node("typeArguments", n.type_arguments, true);
14920                d.field_list("arguments", n.arguments, false);
14921                d.field_bool("optional", n.optional.get(), false);
14922            }
14923            Node::AssignmentExpression(n) => {
14924                d.field_label("operator", n.operator.get(), false);
14925                d.field_node("left", Some(n.left), false);
14926                d.field_node("right", Some(n.right), false);
14927            }
14928            Node::UnaryExpression(n) => {
14929                d.field_label("operator", n.operator.get(), false);
14930                d.field_node("argument", Some(n.argument), false);
14931                d.field_bool("prefix", n.prefix.get(), false);
14932            }
14933            Node::UpdateExpression(n) => {
14934                d.field_label("operator", n.operator.get(), false);
14935                d.field_node("argument", Some(n.argument), false);
14936                d.field_bool("prefix", n.prefix.get(), false);
14937            }
14938            Node::MemberExpression(n) => {
14939                d.field_node("object", Some(n.object), false);
14940                d.field_node("property", Some(n.property), false);
14941                d.field_bool("computed", n.computed.get(), false);
14942            }
14943            Node::OptionalMemberExpression(n) => {
14944                d.field_node("object", Some(n.object), false);
14945                d.field_node("property", Some(n.property), false);
14946                d.field_bool("computed", n.computed.get(), false);
14947                d.field_bool("optional", n.optional.get(), false);
14948            }
14949            Node::LogicalExpression(n) => {
14950                d.field_node("left", Some(n.left), false);
14951                d.field_node("right", Some(n.right), false);
14952                d.field_label("operator", n.operator.get(), false);
14953            }
14954            Node::ConditionalExpression(n) => {
14955                d.field_node("test", Some(n.test), false);
14956                d.field_node("alternate", Some(n.alternate), false);
14957                d.field_node("consequent", Some(n.consequent), false);
14958            }
14959            Node::BinaryExpression(n) => {
14960                d.field_node("left", Some(n.left), false);
14961                d.field_node("right", Some(n.right), false);
14962                d.field_label("operator", n.operator.get(), false);
14963            }
14964            Node::Directive(n) => {
14965                d.field_node("value", Some(n.value), false);
14966            }
14967            Node::DirectiveLiteral(n) => {
14968                d.field_label("value", n.value.get(), false);
14969            }
14970            Node::Identifier(n) => {
14971                d.field_label("name", n.name.get(), false);
14972                d.field_node("typeAnnotation", n.type_annotation, true);
14973                d.field_bool("optional", n.optional.get(), true);
14974            }
14975            Node::PrivateName(n) => {
14976                d.field_node("id", Some(n.id), false);
14977            }
14978            Node::MetaProperty(n) => {
14979                d.field_node("meta", Some(n.meta), false);
14980                d.field_node("property", Some(n.property), false);
14981            }
14982            Node::SwitchCase(n) => {
14983                d.field_node("test", n.test, false);
14984                d.field_list("consequent", n.consequent, false);
14985            }
14986            Node::CatchClause(n) => {
14987                d.field_node("param", n.param, false);
14988                d.field_node("body", Some(n.body), false);
14989            }
14990            Node::VariableDeclarator(n) => {
14991                d.field_node("init", n.init, false);
14992                d.field_node("id", Some(n.id), false);
14993            }
14994            Node::VariableDeclaration(n) => {
14995                d.field_label("kind", n.kind.get(), false);
14996                d.field_list("declarations", n.declarations, false);
14997            }
14998            Node::TemplateLiteral(n) => {
14999                d.field_list("quasis", n.quasis, false);
15000                d.field_list("expressions", n.expressions, false);
15001            }
15002            Node::TaggedTemplateExpression(n) => {
15003                d.field_node("tag", Some(n.tag), false);
15004                d.field_node("quasi", Some(n.quasi), false);
15005            }
15006            Node::TemplateElement(n) => {
15007                d.field_bool("tail", n.tail.get(), false);
15008                d.field_label("cooked", n.cooked.get(), false);
15009                d.field_label("raw", n.raw.get(), false);
15010            }
15011            Node::Property(n) => {
15012                d.field_node("key", Some(n.key), false);
15013                d.field_node("value", Some(n.value), false);
15014                d.field_label("kind", n.kind.get(), false);
15015                d.field_bool("computed", n.computed.get(), false);
15016                d.field_bool("method", n.method.get(), false);
15017                d.field_bool("shorthand", n.shorthand.get(), false);
15018            }
15019            Node::Decorator(n) => {
15020                d.field_node("expression", Some(n.expression), false);
15021            }
15022            Node::ClassDeclaration(n) => {
15023                d.field_node("id", n.id, false);
15024                d.field_node("typeParameters", n.type_parameters, true);
15025                d.field_node("superClass", n.super_class, false);
15026                d.field_node("superTypeArguments", n.super_type_arguments, true);
15027                d.field_list("implements", n.implements, true);
15028                d.field_list("decorators", n.decorators, true);
15029                d.field_node("body", Some(n.body), false);
15030            }
15031            Node::ClassExpression(n) => {
15032                d.field_node("id", n.id, false);
15033                d.field_node("typeParameters", n.type_parameters, true);
15034                d.field_node("superClass", n.super_class, false);
15035                d.field_node("superTypeArguments", n.super_type_arguments, true);
15036                d.field_list("implements", n.implements, true);
15037                d.field_list("decorators", n.decorators, true);
15038                d.field_node("body", Some(n.body), false);
15039            }
15040            Node::ClassBody(n) => {
15041                d.field_list("body", n.body, false);
15042            }
15043            Node::ClassProperty(n) => {
15044                d.field_node("key", Some(n.key), false);
15045                d.field_node("value", n.value, false);
15046                d.field_bool("computed", n.computed.get(), false);
15047                d.field_bool("static", n.r#static.get(), false);
15048                d.field_list("decorators", n.decorators, true);
15049                d.field_bool("declare", n.declare.get(), false);
15050                d.field_bool("optional", n.optional.get(), true);
15051                d.field_node("variance", n.variance, true);
15052                d.field_node("typeAnnotation", n.type_annotation, true);
15053                d.field_node("tsModifiers", n.ts_modifiers, true);
15054            }
15055            Node::ClassPrivateProperty(n) => {
15056                d.field_node("key", Some(n.key), false);
15057                d.field_node("value", n.value, false);
15058                d.field_bool("static", n.r#static.get(), false);
15059                d.field_list("decorators", n.decorators, true);
15060                d.field_bool("declare", n.declare.get(), false);
15061                d.field_bool("optional", n.optional.get(), true);
15062                d.field_node("variance", n.variance, true);
15063                d.field_node("typeAnnotation", n.type_annotation, true);
15064                d.field_node("tsModifiers", n.ts_modifiers, true);
15065            }
15066            Node::MethodDefinition(n) => {
15067                d.field_node("key", Some(n.key), false);
15068                d.field_node("value", Some(n.value), false);
15069                d.field_label("kind", n.kind.get(), false);
15070                d.field_bool("computed", n.computed.get(), false);
15071                d.field_bool("static", n.r#static.get(), false);
15072                d.field_list("decorators", n.decorators, true);
15073            }
15074            Node::ImportDeclaration(n) => {
15075                d.field_list("specifiers", n.specifiers, false);
15076                d.field_node("source", Some(n.source), false);
15077                d.field_list("attributes", n.attributes, false);
15078                d.field_label("importKind", n.import_kind.get(), false);
15079            }
15080            Node::ImportSpecifier(n) => {
15081                d.field_node("imported", Some(n.imported), false);
15082                d.field_node("local", Some(n.local), false);
15083                d.field_label("importKind", n.import_kind.get(), false);
15084            }
15085            Node::ImportDefaultSpecifier(n) => {
15086                d.field_node("local", Some(n.local), false);
15087            }
15088            Node::ImportNamespaceSpecifier(n) => {
15089                d.field_node("local", Some(n.local), false);
15090            }
15091            Node::ImportAttribute(n) => {
15092                d.field_node("key", Some(n.key), false);
15093                d.field_node("value", Some(n.value), false);
15094            }
15095            Node::ExportNamedDeclaration(n) => {
15096                d.field_node("declaration", n.declaration, false);
15097                d.field_list("specifiers", n.specifiers, false);
15098                d.field_node("source", n.source, false);
15099                d.field_label("exportKind", n.export_kind.get(), false);
15100            }
15101            Node::ExportSpecifier(n) => {
15102                d.field_node("exported", Some(n.exported), false);
15103                d.field_node("local", Some(n.local), false);
15104            }
15105            Node::ExportNamespaceSpecifier(n) => {
15106                d.field_node("exported", Some(n.exported), false);
15107            }
15108            Node::ExportDefaultDeclaration(n) => {
15109                d.field_node("declaration", Some(n.declaration), false);
15110            }
15111            Node::ExportAllDeclaration(n) => {
15112                d.field_node("source", Some(n.source), false);
15113                d.field_label("exportKind", n.export_kind.get(), false);
15114            }
15115            Node::ObjectPattern(n) => {
15116                d.field_list("properties", n.properties, false);
15117                d.field_node("typeAnnotation", n.type_annotation, true);
15118            }
15119            Node::ArrayPattern(n) => {
15120                d.field_list("elements", n.elements, false);
15121                d.field_node("typeAnnotation", n.type_annotation, true);
15122            }
15123            Node::RestElement(n) => {
15124                d.field_node("argument", Some(n.argument), false);
15125            }
15126            Node::AssignmentPattern(n) => {
15127                d.field_node("left", Some(n.left), false);
15128                d.field_node("right", Some(n.right), false);
15129            }
15130            Node::MatchStatementCase(n) => {
15131                d.field_node("pattern", Some(n.pattern), false);
15132                d.field_node("body", Some(n.body), false);
15133                d.field_node("guard", n.guard, false);
15134            }
15135            Node::MatchExpression(n) => {
15136                d.field_node("argument", Some(n.argument), false);
15137                d.field_list("cases", n.cases, false);
15138            }
15139            Node::MatchExpressionCase(n) => {
15140                d.field_node("pattern", Some(n.pattern), false);
15141                d.field_node("body", Some(n.body), false);
15142                d.field_node("guard", n.guard, false);
15143            }
15144            Node::MatchWildcardPattern(_) => {}
15145            Node::MatchLiteralPattern(n) => {
15146                d.field_node("literal", Some(n.literal), false);
15147            }
15148            Node::MatchUnaryPattern(n) => {
15149                d.field_node("argument", Some(n.argument), false);
15150                d.field_label("operator", n.operator.get(), false);
15151            }
15152            Node::MatchIdentifierPattern(n) => {
15153                d.field_node("id", Some(n.id), false);
15154            }
15155            Node::MatchBindingPattern(n) => {
15156                d.field_node("id", Some(n.id), false);
15157                d.field_label("kind", n.kind.get(), false);
15158            }
15159            Node::MatchObjectPattern(n) => {
15160                d.field_list("properties", n.properties, false);
15161                d.field_node("rest", n.rest, false);
15162            }
15163            Node::MatchArrayPattern(n) => {
15164                d.field_list("elements", n.elements, false);
15165                d.field_node("rest", n.rest, false);
15166            }
15167            Node::MatchOrPattern(n) => {
15168                d.field_list("patterns", n.patterns, false);
15169            }
15170            Node::MatchAsPattern(n) => {
15171                d.field_node("pattern", Some(n.pattern), false);
15172                d.field_node("target", Some(n.target), false);
15173            }
15174            Node::MatchMemberPattern(n) => {
15175                d.field_node("base", Some(n.base), false);
15176                d.field_node("property", Some(n.property), false);
15177            }
15178            Node::MatchInstancePattern(n) => {
15179                d.field_node("targetConstructor", Some(n.target_constructor), false);
15180                d.field_node("properties", Some(n.properties), false);
15181            }
15182            Node::MatchObjectPatternProperty(n) => {
15183                d.field_node("key", Some(n.key), false);
15184                d.field_node("pattern", Some(n.pattern), false);
15185                d.field_bool("shorthand", n.shorthand.get(), false);
15186            }
15187            Node::MatchInstanceObjectPattern(n) => {
15188                d.field_list("properties", n.properties, false);
15189                d.field_node("rest", n.rest, false);
15190            }
15191            Node::MatchRestPattern(n) => {
15192                d.field_node("argument", n.argument, false);
15193            }
15194            Node::JSXIdentifier(n) => {
15195                d.field_label("name", n.name.get(), false);
15196            }
15197            Node::JSXMemberExpression(n) => {
15198                d.field_node("object", Some(n.object), false);
15199                d.field_node("property", Some(n.property), false);
15200            }
15201            Node::JSXNamespacedName(n) => {
15202                d.field_node("namespace", Some(n.namespace), false);
15203                d.field_node("name", Some(n.name), false);
15204            }
15205            Node::JSXEmptyExpression(_) => {}
15206            Node::JSXExpressionContainer(n) => {
15207                d.field_node("expression", Some(n.expression), false);
15208            }
15209            Node::JSXSpreadChild(n) => {
15210                d.field_node("expression", Some(n.expression), false);
15211            }
15212            Node::JSXOpeningElement(n) => {
15213                d.field_node("name", Some(n.name), false);
15214                d.field_list("attributes", n.attributes, false);
15215                d.field_bool("selfClosing", n.self_closing.get(), false);
15216                d.field_node("typeArguments", n.type_arguments, true);
15217            }
15218            Node::JSXClosingElement(n) => {
15219                d.field_node("name", Some(n.name), false);
15220            }
15221            Node::JSXAttribute(n) => {
15222                d.field_node("name", Some(n.name), false);
15223                d.field_node("value", n.value, false);
15224            }
15225            Node::JSXSpreadAttribute(n) => {
15226                d.field_node("argument", Some(n.argument), false);
15227            }
15228            Node::JSXStringLiteral(n) => {
15229                d.field_label("value", n.value.get(), false);
15230                d.field_label("raw", n.raw.get(), false);
15231            }
15232            Node::JSXText(n) => {
15233                d.field_label("value", n.value.get(), false);
15234                d.field_label("raw", n.raw.get(), false);
15235            }
15236            Node::JSXElement(n) => {
15237                d.field_node("openingElement", Some(n.opening_element), false);
15238                d.field_list("children", n.children, false);
15239                d.field_node("closingElement", n.closing_element, false);
15240            }
15241            Node::JSXFragment(n) => {
15242                d.field_node("openingFragment", Some(n.opening_fragment), false);
15243                d.field_list("children", n.children, false);
15244                d.field_node("closingFragment", Some(n.closing_fragment), false);
15245            }
15246            Node::JSXOpeningFragment(_) => {}
15247            Node::JSXClosingFragment(_) => {}
15248            Node::ExistsTypeAnnotation(_) => {}
15249            Node::EmptyTypeAnnotation(_) => {}
15250            Node::StringTypeAnnotation(_) => {}
15251            Node::NumberTypeAnnotation(_) => {}
15252            Node::StringLiteralTypeAnnotation(n) => {
15253                d.field_label("value", n.value.get(), false);
15254                d.field_label("raw", n.raw.get(), false);
15255            }
15256            Node::NumberLiteralTypeAnnotation(n) => {
15257                d.field_number("value", n.value.get(), false);
15258                d.field_label("raw", n.raw.get(), false);
15259            }
15260            Node::BigIntLiteralTypeAnnotation(n) => {
15261                d.field_label("raw", n.raw.get(), false);
15262            }
15263            Node::BooleanTypeAnnotation(_) => {}
15264            Node::BooleanLiteralTypeAnnotation(n) => {
15265                d.field_bool("value", n.value.get(), false);
15266                d.field_label("raw", n.raw.get(), false);
15267            }
15268            Node::NullLiteralTypeAnnotation(_) => {}
15269            Node::SymbolTypeAnnotation(_) => {}
15270            Node::AnyTypeAnnotation(_) => {}
15271            Node::MixedTypeAnnotation(_) => {}
15272            Node::BigIntTypeAnnotation(_) => {}
15273            Node::VoidTypeAnnotation(_) => {}
15274            Node::NeverTypeAnnotation(_) => {}
15275            Node::UnknownTypeAnnotation(_) => {}
15276            Node::UndefinedTypeAnnotation(_) => {}
15277            Node::FunctionTypeAnnotation(n) => {
15278                d.field_list("params", n.params, false);
15279                d.field_node("this", n.this, false);
15280                d.field_node("returnType", Some(n.return_type), false);
15281                d.field_node("rest", n.rest, false);
15282                d.field_node("typeParameters", n.type_parameters, false);
15283            }
15284            Node::HookTypeAnnotation(n) => {
15285                d.field_list("params", n.params, false);
15286                d.field_node("returnType", Some(n.return_type), false);
15287                d.field_node("rest", n.rest, false);
15288                d.field_node("typeParameters", n.type_parameters, false);
15289            }
15290            Node::FunctionTypeParam(n) => {
15291                d.field_node("name", n.name, false);
15292                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15293                d.field_bool("optional", n.optional.get(), false);
15294            }
15295            Node::ComponentTypeAnnotation(n) => {
15296                d.field_list("params", n.params, false);
15297                d.field_node("rest", n.rest, false);
15298                d.field_node("typeParameters", n.type_parameters, false);
15299                d.field_node("rendersType", n.renders_type, false);
15300            }
15301            Node::ComponentTypeParameter(n) => {
15302                d.field_node("name", n.name, false);
15303                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15304                d.field_bool("optional", n.optional.get(), false);
15305            }
15306            Node::NullableTypeAnnotation(n) => {
15307                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15308            }
15309            Node::QualifiedTypeIdentifier(n) => {
15310                d.field_node("qualification", Some(n.qualification), false);
15311                d.field_node("id", Some(n.id), false);
15312            }
15313            Node::TypeofTypeAnnotation(n) => {
15314                d.field_node("argument", Some(n.argument), false);
15315                d.field_node("typeArguments", n.type_arguments, true);
15316            }
15317            Node::KeyofTypeAnnotation(n) => {
15318                d.field_node("argument", Some(n.argument), false);
15319            }
15320            Node::TypeOperator(n) => {
15321                d.field_label("operator", n.operator.get(), false);
15322                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15323            }
15324            Node::QualifiedTypeofIdentifier(n) => {
15325                d.field_node("qualification", Some(n.qualification), false);
15326                d.field_node("id", Some(n.id), false);
15327            }
15328            Node::TupleTypeAnnotation(n) => {
15329                d.field_list("elementTypes", n.element_types, false);
15330                d.field_bool("inexact", n.inexact.get(), false);
15331            }
15332            Node::TupleTypeSpreadElement(n) => {
15333                d.field_node("label", n.label, false);
15334                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15335            }
15336            Node::TupleTypeLabeledElement(n) => {
15337                d.field_node("label", Some(n.label), false);
15338                d.field_node("elementType", Some(n.element_type), false);
15339                d.field_bool("optional", n.optional.get(), false);
15340                d.field_node("variance", n.variance, false);
15341            }
15342            Node::ArrayTypeAnnotation(n) => {
15343                d.field_node("elementType", Some(n.element_type), false);
15344            }
15345            Node::InferTypeAnnotation(n) => {
15346                d.field_node("typeParameter", Some(n.type_parameter), false);
15347            }
15348            Node::UnionTypeAnnotation(n) => {
15349                d.field_list("types", n.types, false);
15350            }
15351            Node::IntersectionTypeAnnotation(n) => {
15352                d.field_list("types", n.types, false);
15353            }
15354            Node::GenericTypeAnnotation(n) => {
15355                d.field_node("id", Some(n.id), false);
15356                d.field_node("typeParameters", n.type_parameters, false);
15357            }
15358            Node::IndexedAccessType(n) => {
15359                d.field_node("objectType", Some(n.object_type), false);
15360                d.field_node("indexType", Some(n.index_type), false);
15361            }
15362            Node::OptionalIndexedAccessType(n) => {
15363                d.field_node("objectType", Some(n.object_type), false);
15364                d.field_node("indexType", Some(n.index_type), false);
15365                d.field_bool("optional", n.optional.get(), false);
15366            }
15367            Node::ConditionalTypeAnnotation(n) => {
15368                d.field_node("checkType", Some(n.check_type), false);
15369                d.field_node("extendsType", Some(n.extends_type), false);
15370                d.field_node("trueType", Some(n.true_type), false);
15371                d.field_node("falseType", Some(n.false_type), false);
15372            }
15373            Node::TypePredicate(n) => {
15374                d.field_node("parameterName", Some(n.parameter_name), false);
15375                d.field_node("typeAnnotation", n.type_annotation, false);
15376                d.field_label("kind", n.kind.get(), false);
15377            }
15378            Node::InterfaceTypeAnnotation(n) => {
15379                d.field_list("extends", n.extends, false);
15380                d.field_node("body", n.body, false);
15381            }
15382            Node::TypeAlias(n) => {
15383                d.field_node("id", Some(n.id), false);
15384                d.field_node("typeParameters", n.type_parameters, false);
15385                d.field_node("right", Some(n.right), false);
15386            }
15387            Node::OpaqueType(n) => {
15388                d.field_node("id", Some(n.id), false);
15389                d.field_node("typeParameters", n.type_parameters, false);
15390                d.field_node("impltype", Some(n.impltype), false);
15391                d.field_node("lowerBound", n.lower_bound, false);
15392                d.field_node("upperBound", n.upper_bound, false);
15393                d.field_node("supertype", n.supertype, false);
15394            }
15395            Node::InterfaceDeclaration(n) => {
15396                d.field_node("id", Some(n.id), false);
15397                d.field_node("typeParameters", n.type_parameters, false);
15398                d.field_list("extends", n.extends, false);
15399                d.field_node("body", Some(n.body), false);
15400            }
15401            Node::DeclareTypeAlias(n) => {
15402                d.field_node("id", Some(n.id), false);
15403                d.field_node("typeParameters", n.type_parameters, false);
15404                d.field_node("right", Some(n.right), false);
15405            }
15406            Node::DeclareOpaqueType(n) => {
15407                d.field_node("id", Some(n.id), false);
15408                d.field_node("typeParameters", n.type_parameters, false);
15409                d.field_node("impltype", n.impltype, false);
15410                d.field_node("lowerBound", n.lower_bound, false);
15411                d.field_node("upperBound", n.upper_bound, false);
15412                d.field_node("supertype", n.supertype, false);
15413            }
15414            Node::DeclareInterface(n) => {
15415                d.field_node("id", Some(n.id), false);
15416                d.field_node("typeParameters", n.type_parameters, false);
15417                d.field_list("extends", n.extends, false);
15418                d.field_node("body", Some(n.body), false);
15419            }
15420            Node::DeclareClass(n) => {
15421                d.field_node("id", Some(n.id), false);
15422                d.field_node("typeParameters", n.type_parameters, false);
15423                d.field_list("extends", n.extends, false);
15424                d.field_list("implements", n.implements, false);
15425                d.field_list("mixins", n.mixins, false);
15426                d.field_node("body", Some(n.body), false);
15427            }
15428            Node::DeclareFunction(n) => {
15429                d.field_node("id", Some(n.id), false);
15430                d.field_node("predicate", n.predicate, false);
15431            }
15432            Node::DeclareHook(n) => {
15433                d.field_node("id", Some(n.id), false);
15434            }
15435            Node::DeclareComponent(n) => {
15436                d.field_node("id", Some(n.id), false);
15437                d.field_list("params", n.params, false);
15438                d.field_node("rest", n.rest, false);
15439                d.field_node("typeParameters", n.type_parameters, false);
15440                d.field_node("rendersType", n.renders_type, false);
15441            }
15442            Node::DeclareVariable(n) => {
15443                d.field_node("id", Some(n.id), false);
15444                d.field_label("kind", n.kind.get(), false);
15445            }
15446            Node::DeclareEnum(n) => {
15447                d.field_node("id", Some(n.id), false);
15448                d.field_node("body", Some(n.body), false);
15449            }
15450            Node::DeclareExportDeclaration(n) => {
15451                d.field_node("declaration", n.declaration, false);
15452                d.field_list("specifiers", n.specifiers, false);
15453                d.field_node("source", n.source, false);
15454                d.field_bool("default", n.default.get(), false);
15455            }
15456            Node::DeclareExportAllDeclaration(n) => {
15457                d.field_node("source", Some(n.source), false);
15458            }
15459            Node::DeclareModule(n) => {
15460                d.field_node("id", Some(n.id), false);
15461                d.field_node("body", Some(n.body), false);
15462            }
15463            Node::DeclareNamespace(n) => {
15464                d.field_node("id", Some(n.id), false);
15465                d.field_node("body", Some(n.body), false);
15466            }
15467            Node::DeclareModuleExports(n) => {
15468                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15469            }
15470            Node::InterfaceExtends(n) => {
15471                d.field_node("id", Some(n.id), false);
15472                d.field_node("typeParameters", n.type_parameters, false);
15473            }
15474            Node::ClassImplements(n) => {
15475                d.field_node("id", Some(n.id), false);
15476                d.field_node("typeParameters", n.type_parameters, false);
15477            }
15478            Node::TypeAnnotation(n) => {
15479                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15480            }
15481            Node::ObjectTypeAnnotation(n) => {
15482                d.field_list("properties", n.properties, false);
15483                d.field_list("indexers", n.indexers, false);
15484                d.field_list("callProperties", n.call_properties, false);
15485                d.field_list("internalSlots", n.internal_slots, false);
15486                d.field_bool("inexact", n.inexact.get(), false);
15487                d.field_bool("exact", n.exact.get(), false);
15488            }
15489            Node::ObjectTypeProperty(n) => {
15490                d.field_node("key", Some(n.key), false);
15491                d.field_node("value", Some(n.value), false);
15492                d.field_bool("method", n.method.get(), false);
15493                d.field_bool("optional", n.optional.get(), false);
15494                d.field_bool("static", n.r#static.get(), false);
15495                d.field_bool("proto", n.proto.get(), false);
15496                d.field_node("variance", n.variance, false);
15497                d.field_label("kind", n.kind.get(), false);
15498            }
15499            Node::ObjectTypeSpreadProperty(n) => {
15500                d.field_node("argument", Some(n.argument), false);
15501            }
15502            Node::ObjectTypeInternalSlot(n) => {
15503                d.field_node("id", Some(n.id), false);
15504                d.field_node("value", Some(n.value), false);
15505                d.field_bool("optional", n.optional.get(), false);
15506                d.field_bool("static", n.r#static.get(), false);
15507                d.field_bool("method", n.method.get(), false);
15508            }
15509            Node::ObjectTypeCallProperty(n) => {
15510                d.field_node("value", Some(n.value), false);
15511                d.field_bool("static", n.r#static.get(), false);
15512            }
15513            Node::ObjectTypeIndexer(n) => {
15514                d.field_node("id", n.id, false);
15515                d.field_node("key", Some(n.key), false);
15516                d.field_node("value", Some(n.value), false);
15517                d.field_bool("static", n.r#static.get(), false);
15518                d.field_node("variance", n.variance, false);
15519            }
15520            Node::ObjectTypeMappedTypeProperty(n) => {
15521                d.field_node("keyTparam", Some(n.key_tparam), false);
15522                d.field_node("propType", Some(n.prop_type), false);
15523                d.field_node("sourceType", Some(n.source_type), false);
15524                d.field_node("variance", n.variance, false);
15525                d.field_label("optional", n.optional.get(), false);
15526            }
15527            Node::Variance(n) => {
15528                d.field_label("kind", n.kind.get(), false);
15529            }
15530            Node::TypeParameterDeclaration(n) => {
15531                d.field_list("params", n.params, false);
15532            }
15533            Node::TypeParameter(n) => {
15534                d.field_label("name", n.name.get(), false);
15535                d.field_bool("const", n.r#const.get(), true);
15536                d.field_node("bound", n.bound, false);
15537                d.field_node("variance", n.variance, false);
15538                d.field_node("default", n.default, false);
15539                d.field_bool("usesExtendsBound", n.uses_extends_bound.get(), true);
15540            }
15541            Node::TypeParameterInstantiation(n) => {
15542                d.field_list("params", n.params, false);
15543            }
15544            Node::TypeCastExpression(n) => {
15545                d.field_node("expression", Some(n.expression), false);
15546                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15547            }
15548            Node::AsExpression(n) => {
15549                d.field_node("expression", Some(n.expression), false);
15550                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15551            }
15552            Node::AsConstExpression(n) => {
15553                d.field_node("expression", Some(n.expression), false);
15554            }
15555            Node::InferredPredicate(_) => {}
15556            Node::DeclaredPredicate(n) => {
15557                d.field_node("value", Some(n.value), false);
15558            }
15559            Node::EnumDeclaration(n) => {
15560                d.field_node("id", Some(n.id), false);
15561                d.field_node("body", Some(n.body), false);
15562            }
15563            Node::EnumStringBody(n) => {
15564                d.field_list("members", n.members, false);
15565                d.field_bool("explicitType", n.explicit_type.get(), false);
15566                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
15567            }
15568            Node::EnumNumberBody(n) => {
15569                d.field_list("members", n.members, false);
15570                d.field_bool("explicitType", n.explicit_type.get(), false);
15571                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
15572            }
15573            Node::EnumBigIntBody(n) => {
15574                d.field_list("members", n.members, false);
15575                d.field_bool("explicitType", n.explicit_type.get(), false);
15576                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
15577            }
15578            Node::EnumBooleanBody(n) => {
15579                d.field_list("members", n.members, false);
15580                d.field_bool("explicitType", n.explicit_type.get(), false);
15581                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
15582            }
15583            Node::EnumSymbolBody(n) => {
15584                d.field_list("members", n.members, false);
15585                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
15586            }
15587            Node::EnumDefaultedMember(n) => {
15588                d.field_node("id", Some(n.id), false);
15589            }
15590            Node::EnumStringMember(n) => {
15591                d.field_node("id", Some(n.id), false);
15592                d.field_node("init", Some(n.init), false);
15593            }
15594            Node::EnumNumberMember(n) => {
15595                d.field_node("id", Some(n.id), false);
15596                d.field_node("init", Some(n.init), false);
15597            }
15598            Node::EnumBigIntMember(n) => {
15599                d.field_node("id", Some(n.id), false);
15600                d.field_node("init", Some(n.init), false);
15601            }
15602            Node::EnumBooleanMember(n) => {
15603                d.field_node("id", Some(n.id), false);
15604                d.field_node("init", Some(n.init), false);
15605            }
15606            Node::ComponentParameter(n) => {
15607                d.field_node("name", Some(n.name), false);
15608                d.field_node("local", Some(n.local), false);
15609                d.field_bool("shorthand", n.shorthand.get(), false);
15610            }
15611            Node::RecordDeclaration(n) => {
15612                d.field_node("id", Some(n.id), false);
15613                d.field_node("typeParameters", n.type_parameters, false);
15614                d.field_list("implements", n.implements, false);
15615                d.field_node("body", Some(n.body), false);
15616            }
15617            Node::RecordDeclarationImplements(n) => {
15618                d.field_node("id", Some(n.id), false);
15619                d.field_node("typeArguments", n.type_arguments, false);
15620            }
15621            Node::RecordDeclarationBody(n) => {
15622                d.field_list("elements", n.elements, false);
15623            }
15624            Node::RecordDeclarationProperty(n) => {
15625                d.field_node("key", Some(n.key), false);
15626                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15627                d.field_node("defaultValue", n.default_value, false);
15628            }
15629            Node::RecordDeclarationStaticProperty(n) => {
15630                d.field_node("key", Some(n.key), false);
15631                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15632                d.field_node("value", Some(n.value), false);
15633            }
15634            Node::RecordExpression(n) => {
15635                d.field_node("recordConstructor", Some(n.record_constructor), false);
15636                d.field_node("typeArguments", n.type_arguments, false);
15637                d.field_node("properties", Some(n.properties), false);
15638            }
15639            Node::RecordExpressionProperties(n) => {
15640                d.field_list("properties", n.properties, false);
15641            }
15642            Node::TSTypeAnnotation(n) => {
15643                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15644            }
15645            Node::TSAnyKeyword(_) => {}
15646            Node::TSNumberKeyword(_) => {}
15647            Node::TSBooleanKeyword(_) => {}
15648            Node::TSStringKeyword(_) => {}
15649            Node::TSSymbolKeyword(_) => {}
15650            Node::TSVoidKeyword(_) => {}
15651            Node::TSUndefinedKeyword(_) => {}
15652            Node::TSUnknownKeyword(_) => {}
15653            Node::TSNeverKeyword(_) => {}
15654            Node::TSBigIntKeyword(_) => {}
15655            Node::TSThisType(_) => {}
15656            Node::TSLiteralType(n) => {
15657                d.field_node("literal", Some(n.literal), false);
15658            }
15659            Node::TSIndexedAccessType(n) => {
15660                d.field_node("objectType", Some(n.object_type), false);
15661                d.field_node("indexType", Some(n.index_type), false);
15662            }
15663            Node::TSArrayType(n) => {
15664                d.field_node("elementType", Some(n.element_type), false);
15665            }
15666            Node::TSTypeReference(n) => {
15667                d.field_node("typeName", Some(n.type_name), false);
15668                d.field_node("typeParameters", n.type_parameters, false);
15669            }
15670            Node::TSQualifiedName(n) => {
15671                d.field_node("left", Some(n.left), false);
15672                d.field_node("right", n.right, false);
15673            }
15674            Node::TSFunctionType(n) => {
15675                d.field_list("params", n.params, false);
15676                d.field_node("returnType", Some(n.return_type), false);
15677                d.field_node("typeParameters", n.type_parameters, false);
15678            }
15679            Node::TSConstructorType(n) => {
15680                d.field_list("params", n.params, false);
15681                d.field_node("returnType", Some(n.return_type), false);
15682                d.field_node("typeParameters", n.type_parameters, false);
15683            }
15684            Node::TSTypePredicate(n) => {
15685                d.field_node("parameterName", Some(n.parameter_name), false);
15686                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15687            }
15688            Node::TSTupleType(n) => {
15689                d.field_list("elementTypes", n.element_types, false);
15690            }
15691            Node::TSTypeAssertion(n) => {
15692                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15693                d.field_node("expression", Some(n.expression), false);
15694            }
15695            Node::TSAsExpression(n) => {
15696                d.field_node("expression", Some(n.expression), false);
15697                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15698            }
15699            Node::TSParameterProperty(n) => {
15700                d.field_node("parameter", Some(n.parameter), false);
15701                d.field_label("accessibility", n.accessibility.get(), false);
15702                d.field_bool("readonly", n.readonly.get(), false);
15703                d.field_bool("static", n.r#static.get(), false);
15704                d.field_bool("export", n.export.get(), false);
15705            }
15706            Node::TSTypeAliasDeclaration(n) => {
15707                d.field_node("id", Some(n.id), false);
15708                d.field_node("typeParameters", n.type_parameters, false);
15709                d.field_node("typeAnnotation", Some(n.type_annotation), false);
15710            }
15711            Node::TSInterfaceDeclaration(n) => {
15712                d.field_node("id", Some(n.id), false);
15713                d.field_node("body", Some(n.body), false);
15714                d.field_list("extends", n.extends, false);
15715                d.field_node("typeParameters", n.type_parameters, false);
15716            }
15717            Node::TSInterfaceHeritage(n) => {
15718                d.field_node("expression", Some(n.expression), false);
15719                d.field_node("typeParameters", n.type_parameters, false);
15720            }
15721            Node::TSInterfaceBody(n) => {
15722                d.field_list("body", n.body, false);
15723            }
15724            Node::TSEnumDeclaration(n) => {
15725                d.field_node("id", Some(n.id), false);
15726                d.field_list("members", n.members, false);
15727            }
15728            Node::TSEnumMember(n) => {
15729                d.field_node("id", Some(n.id), false);
15730                d.field_node("initializer", n.initializer, false);
15731            }
15732            Node::TSModuleDeclaration(n) => {
15733                d.field_node("id", Some(n.id), false);
15734                d.field_node("body", Some(n.body), false);
15735            }
15736            Node::TSModuleBlock(n) => {
15737                d.field_list("body", n.body, false);
15738            }
15739            Node::TSModuleMember(n) => {
15740                d.field_node("id", Some(n.id), false);
15741                d.field_node("initializer", n.initializer, false);
15742            }
15743            Node::TSTypeParameterDeclaration(n) => {
15744                d.field_list("params", n.params, false);
15745            }
15746            Node::TSTypeParameter(n) => {
15747                d.field_node("name", Some(n.name), false);
15748                d.field_node("constraint", n.constraint, false);
15749                d.field_node("default", n.default, false);
15750            }
15751            Node::TSTypeParameterInstantiation(n) => {
15752                d.field_list("params", n.params, false);
15753            }
15754            Node::TSUnionType(n) => {
15755                d.field_list("types", n.types, false);
15756            }
15757            Node::TSIntersectionType(n) => {
15758                d.field_list("types", n.types, false);
15759            }
15760            Node::TSTypeQuery(n) => {
15761                d.field_node("exprName", Some(n.expr_name), false);
15762            }
15763            Node::TSConditionalType(n) => {
15764                d.field_node("checkType", Some(n.check_type), false);
15765                d.field_node("extendsType", Some(n.extends_type), false);
15766                d.field_node("trueType", Some(n.true_type), false);
15767                d.field_node("falseType", Some(n.false_type), false);
15768            }
15769            Node::TSTypeLiteral(n) => {
15770                d.field_list("members", n.members, false);
15771            }
15772            Node::TSPropertySignature(n) => {
15773                d.field_node("key", Some(n.key), false);
15774                d.field_node("typeAnnotation", n.type_annotation, false);
15775                d.field_node("initializer", n.initializer, false);
15776                d.field_bool("optional", n.optional.get(), false);
15777                d.field_bool("computed", n.computed.get(), false);
15778                d.field_bool("readonly", n.readonly.get(), false);
15779                d.field_bool("static", n.r#static.get(), false);
15780                d.field_bool("export", n.export.get(), false);
15781            }
15782            Node::TSMethodSignature(n) => {
15783                d.field_node("key", Some(n.key), false);
15784                d.field_list("params", n.params, false);
15785                d.field_node("returnType", n.return_type, false);
15786                d.field_bool("computed", n.computed.get(), false);
15787            }
15788            Node::TSIndexSignature(n) => {
15789                d.field_list("parameters", n.parameters, false);
15790                d.field_node("typeAnnotation", n.type_annotation, false);
15791            }
15792            Node::TSCallSignatureDeclaration(n) => {
15793                d.field_list("params", n.params, false);
15794                d.field_node("returnType", n.return_type, false);
15795            }
15796            Node::TSModifiers(n) => {
15797                d.field_label("accessibility", n.accessibility.get(), false);
15798                d.field_bool("readonly", n.readonly.get(), false);
15799            }
15800            Node::CoverEmptyArgs(_) => {}
15801            Node::CoverTrailingComma(_) => {}
15802            Node::CoverInitializer(n) => {
15803                d.field_node("init", Some(n.init), false);
15804            }
15805            Node::CoverRestElement(n) => {
15806                d.field_node("rest", Some(n.rest), false);
15807            }
15808            Node::CoverTypedIdentifier(n) => {
15809                d.field_node("left", Some(n.left), false);
15810                d.field_node("right", n.right, false);
15811                d.field_bool("optional", n.optional.get(), false);
15812            }
15813            Node::SHBuiltin(_) => {}
15814            Node::ImplicitCheckedCast(n) => {
15815                d.field_node("argument", Some(n.argument), false);
15816            }
15817        }
15818    }
15819}
15820
15821/// Per-kind node builders: clone a node with (optionally) one
15822/// structural-child field changed. The rebuild primitive used by
15823/// `Node::visit_children_mut`.
15824pub mod builder {
15825    use std::cell::Cell;
15826    use super::*;
15827    use crate::node_child::NodeChild;
15828    use crate::visitor::TransformResult;
15829
15830    /// One builder per node kind; clone-with-one-field-changed.
15831    #[derive(Debug)]
15832    pub enum Builder<'gc> {
15833        /// Builder for [`super::Empty`].
15834        Empty(self::Empty<'gc>),
15835        /// Builder for [`super::Metadata`].
15836        Metadata(self::Metadata<'gc>),
15837        /// Builder for [`super::Program`].
15838        Program(self::Program<'gc>),
15839        /// Builder for [`super::FunctionExpression`].
15840        FunctionExpression(self::FunctionExpression<'gc>),
15841        /// Builder for [`super::ArrowFunctionExpression`].
15842        ArrowFunctionExpression(self::ArrowFunctionExpression<'gc>),
15843        /// Builder for [`super::FunctionDeclaration`].
15844        FunctionDeclaration(self::FunctionDeclaration<'gc>),
15845        /// Builder for [`super::ComponentDeclaration`].
15846        ComponentDeclaration(self::ComponentDeclaration<'gc>),
15847        /// Builder for [`super::HookDeclaration`].
15848        HookDeclaration(self::HookDeclaration<'gc>),
15849        /// Builder for [`super::MatchStatement`].
15850        MatchStatement(self::MatchStatement<'gc>),
15851        /// Builder for [`super::WhileStatement`].
15852        WhileStatement(self::WhileStatement<'gc>),
15853        /// Builder for [`super::DoWhileStatement`].
15854        DoWhileStatement(self::DoWhileStatement<'gc>),
15855        /// Builder for [`super::ForInStatement`].
15856        ForInStatement(self::ForInStatement<'gc>),
15857        /// Builder for [`super::ForOfStatement`].
15858        ForOfStatement(self::ForOfStatement<'gc>),
15859        /// Builder for [`super::ForStatement`].
15860        ForStatement(self::ForStatement<'gc>),
15861        /// Builder for [`super::DebuggerStatement`].
15862        DebuggerStatement(self::DebuggerStatement<'gc>),
15863        /// Builder for [`super::EmptyStatement`].
15864        EmptyStatement(self::EmptyStatement<'gc>),
15865        /// Builder for [`super::BlockStatement`].
15866        BlockStatement(self::BlockStatement<'gc>),
15867        /// Builder for [`super::StaticBlock`].
15868        StaticBlock(self::StaticBlock<'gc>),
15869        /// Builder for [`super::BreakStatement`].
15870        BreakStatement(self::BreakStatement<'gc>),
15871        /// Builder for [`super::ContinueStatement`].
15872        ContinueStatement(self::ContinueStatement<'gc>),
15873        /// Builder for [`super::ThrowStatement`].
15874        ThrowStatement(self::ThrowStatement<'gc>),
15875        /// Builder for [`super::ReturnStatement`].
15876        ReturnStatement(self::ReturnStatement<'gc>),
15877        /// Builder for [`super::WithStatement`].
15878        WithStatement(self::WithStatement<'gc>),
15879        /// Builder for [`super::SwitchStatement`].
15880        SwitchStatement(self::SwitchStatement<'gc>),
15881        /// Builder for [`super::LabeledStatement`].
15882        LabeledStatement(self::LabeledStatement<'gc>),
15883        /// Builder for [`super::ExpressionStatement`].
15884        ExpressionStatement(self::ExpressionStatement<'gc>),
15885        /// Builder for [`super::TryStatement`].
15886        TryStatement(self::TryStatement<'gc>),
15887        /// Builder for [`super::IfStatement`].
15888        IfStatement(self::IfStatement<'gc>),
15889        /// Builder for [`super::NullLiteral`].
15890        NullLiteral(self::NullLiteral<'gc>),
15891        /// Builder for [`super::BooleanLiteral`].
15892        BooleanLiteral(self::BooleanLiteral<'gc>),
15893        /// Builder for [`super::StringLiteral`].
15894        StringLiteral(self::StringLiteral<'gc>),
15895        /// Builder for [`super::NumericLiteral`].
15896        NumericLiteral(self::NumericLiteral<'gc>),
15897        /// Builder for [`super::RegExpLiteral`].
15898        RegExpLiteral(self::RegExpLiteral<'gc>),
15899        /// Builder for [`super::BigIntLiteral`].
15900        BigIntLiteral(self::BigIntLiteral<'gc>),
15901        /// Builder for [`super::ThisExpression`].
15902        ThisExpression(self::ThisExpression<'gc>),
15903        /// Builder for [`super::Super`].
15904        Super(self::Super<'gc>),
15905        /// Builder for [`super::SequenceExpression`].
15906        SequenceExpression(self::SequenceExpression<'gc>),
15907        /// Builder for [`super::ObjectExpression`].
15908        ObjectExpression(self::ObjectExpression<'gc>),
15909        /// Builder for [`super::ArrayExpression`].
15910        ArrayExpression(self::ArrayExpression<'gc>),
15911        /// Builder for [`super::SpreadElement`].
15912        SpreadElement(self::SpreadElement<'gc>),
15913        /// Builder for [`super::NewExpression`].
15914        NewExpression(self::NewExpression<'gc>),
15915        /// Builder for [`super::YieldExpression`].
15916        YieldExpression(self::YieldExpression<'gc>),
15917        /// Builder for [`super::AwaitExpression`].
15918        AwaitExpression(self::AwaitExpression<'gc>),
15919        /// Builder for [`super::ImportExpression`].
15920        ImportExpression(self::ImportExpression<'gc>),
15921        /// Builder for [`super::CallExpression`].
15922        CallExpression(self::CallExpression<'gc>),
15923        /// Builder for [`super::OptionalCallExpression`].
15924        OptionalCallExpression(self::OptionalCallExpression<'gc>),
15925        /// Builder for [`super::AssignmentExpression`].
15926        AssignmentExpression(self::AssignmentExpression<'gc>),
15927        /// Builder for [`super::UnaryExpression`].
15928        UnaryExpression(self::UnaryExpression<'gc>),
15929        /// Builder for [`super::UpdateExpression`].
15930        UpdateExpression(self::UpdateExpression<'gc>),
15931        /// Builder for [`super::MemberExpression`].
15932        MemberExpression(self::MemberExpression<'gc>),
15933        /// Builder for [`super::OptionalMemberExpression`].
15934        OptionalMemberExpression(self::OptionalMemberExpression<'gc>),
15935        /// Builder for [`super::LogicalExpression`].
15936        LogicalExpression(self::LogicalExpression<'gc>),
15937        /// Builder for [`super::ConditionalExpression`].
15938        ConditionalExpression(self::ConditionalExpression<'gc>),
15939        /// Builder for [`super::BinaryExpression`].
15940        BinaryExpression(self::BinaryExpression<'gc>),
15941        /// Builder for [`super::Directive`].
15942        Directive(self::Directive<'gc>),
15943        /// Builder for [`super::DirectiveLiteral`].
15944        DirectiveLiteral(self::DirectiveLiteral<'gc>),
15945        /// Builder for [`super::Identifier`].
15946        Identifier(self::Identifier<'gc>),
15947        /// Builder for [`super::PrivateName`].
15948        PrivateName(self::PrivateName<'gc>),
15949        /// Builder for [`super::MetaProperty`].
15950        MetaProperty(self::MetaProperty<'gc>),
15951        /// Builder for [`super::SwitchCase`].
15952        SwitchCase(self::SwitchCase<'gc>),
15953        /// Builder for [`super::CatchClause`].
15954        CatchClause(self::CatchClause<'gc>),
15955        /// Builder for [`super::VariableDeclarator`].
15956        VariableDeclarator(self::VariableDeclarator<'gc>),
15957        /// Builder for [`super::VariableDeclaration`].
15958        VariableDeclaration(self::VariableDeclaration<'gc>),
15959        /// Builder for [`super::TemplateLiteral`].
15960        TemplateLiteral(self::TemplateLiteral<'gc>),
15961        /// Builder for [`super::TaggedTemplateExpression`].
15962        TaggedTemplateExpression(self::TaggedTemplateExpression<'gc>),
15963        /// Builder for [`super::TemplateElement`].
15964        TemplateElement(self::TemplateElement<'gc>),
15965        /// Builder for [`super::Property`].
15966        Property(self::Property<'gc>),
15967        /// Builder for [`super::Decorator`].
15968        Decorator(self::Decorator<'gc>),
15969        /// Builder for [`super::ClassDeclaration`].
15970        ClassDeclaration(self::ClassDeclaration<'gc>),
15971        /// Builder for [`super::ClassExpression`].
15972        ClassExpression(self::ClassExpression<'gc>),
15973        /// Builder for [`super::ClassBody`].
15974        ClassBody(self::ClassBody<'gc>),
15975        /// Builder for [`super::ClassProperty`].
15976        ClassProperty(self::ClassProperty<'gc>),
15977        /// Builder for [`super::ClassPrivateProperty`].
15978        ClassPrivateProperty(self::ClassPrivateProperty<'gc>),
15979        /// Builder for [`super::MethodDefinition`].
15980        MethodDefinition(self::MethodDefinition<'gc>),
15981        /// Builder for [`super::ImportDeclaration`].
15982        ImportDeclaration(self::ImportDeclaration<'gc>),
15983        /// Builder for [`super::ImportSpecifier`].
15984        ImportSpecifier(self::ImportSpecifier<'gc>),
15985        /// Builder for [`super::ImportDefaultSpecifier`].
15986        ImportDefaultSpecifier(self::ImportDefaultSpecifier<'gc>),
15987        /// Builder for [`super::ImportNamespaceSpecifier`].
15988        ImportNamespaceSpecifier(self::ImportNamespaceSpecifier<'gc>),
15989        /// Builder for [`super::ImportAttribute`].
15990        ImportAttribute(self::ImportAttribute<'gc>),
15991        /// Builder for [`super::ExportNamedDeclaration`].
15992        ExportNamedDeclaration(self::ExportNamedDeclaration<'gc>),
15993        /// Builder for [`super::ExportSpecifier`].
15994        ExportSpecifier(self::ExportSpecifier<'gc>),
15995        /// Builder for [`super::ExportNamespaceSpecifier`].
15996        ExportNamespaceSpecifier(self::ExportNamespaceSpecifier<'gc>),
15997        /// Builder for [`super::ExportDefaultDeclaration`].
15998        ExportDefaultDeclaration(self::ExportDefaultDeclaration<'gc>),
15999        /// Builder for [`super::ExportAllDeclaration`].
16000        ExportAllDeclaration(self::ExportAllDeclaration<'gc>),
16001        /// Builder for [`super::ObjectPattern`].
16002        ObjectPattern(self::ObjectPattern<'gc>),
16003        /// Builder for [`super::ArrayPattern`].
16004        ArrayPattern(self::ArrayPattern<'gc>),
16005        /// Builder for [`super::RestElement`].
16006        RestElement(self::RestElement<'gc>),
16007        /// Builder for [`super::AssignmentPattern`].
16008        AssignmentPattern(self::AssignmentPattern<'gc>),
16009        /// Builder for [`super::MatchStatementCase`].
16010        MatchStatementCase(self::MatchStatementCase<'gc>),
16011        /// Builder for [`super::MatchExpression`].
16012        MatchExpression(self::MatchExpression<'gc>),
16013        /// Builder for [`super::MatchExpressionCase`].
16014        MatchExpressionCase(self::MatchExpressionCase<'gc>),
16015        /// Builder for [`super::MatchWildcardPattern`].
16016        MatchWildcardPattern(self::MatchWildcardPattern<'gc>),
16017        /// Builder for [`super::MatchLiteralPattern`].
16018        MatchLiteralPattern(self::MatchLiteralPattern<'gc>),
16019        /// Builder for [`super::MatchUnaryPattern`].
16020        MatchUnaryPattern(self::MatchUnaryPattern<'gc>),
16021        /// Builder for [`super::MatchIdentifierPattern`].
16022        MatchIdentifierPattern(self::MatchIdentifierPattern<'gc>),
16023        /// Builder for [`super::MatchBindingPattern`].
16024        MatchBindingPattern(self::MatchBindingPattern<'gc>),
16025        /// Builder for [`super::MatchObjectPattern`].
16026        MatchObjectPattern(self::MatchObjectPattern<'gc>),
16027        /// Builder for [`super::MatchArrayPattern`].
16028        MatchArrayPattern(self::MatchArrayPattern<'gc>),
16029        /// Builder for [`super::MatchOrPattern`].
16030        MatchOrPattern(self::MatchOrPattern<'gc>),
16031        /// Builder for [`super::MatchAsPattern`].
16032        MatchAsPattern(self::MatchAsPattern<'gc>),
16033        /// Builder for [`super::MatchMemberPattern`].
16034        MatchMemberPattern(self::MatchMemberPattern<'gc>),
16035        /// Builder for [`super::MatchInstancePattern`].
16036        MatchInstancePattern(self::MatchInstancePattern<'gc>),
16037        /// Builder for [`super::MatchObjectPatternProperty`].
16038        MatchObjectPatternProperty(self::MatchObjectPatternProperty<'gc>),
16039        /// Builder for [`super::MatchInstanceObjectPattern`].
16040        MatchInstanceObjectPattern(self::MatchInstanceObjectPattern<'gc>),
16041        /// Builder for [`super::MatchRestPattern`].
16042        MatchRestPattern(self::MatchRestPattern<'gc>),
16043        /// Builder for [`super::JSXIdentifier`].
16044        JSXIdentifier(self::JSXIdentifier<'gc>),
16045        /// Builder for [`super::JSXMemberExpression`].
16046        JSXMemberExpression(self::JSXMemberExpression<'gc>),
16047        /// Builder for [`super::JSXNamespacedName`].
16048        JSXNamespacedName(self::JSXNamespacedName<'gc>),
16049        /// Builder for [`super::JSXEmptyExpression`].
16050        JSXEmptyExpression(self::JSXEmptyExpression<'gc>),
16051        /// Builder for [`super::JSXExpressionContainer`].
16052        JSXExpressionContainer(self::JSXExpressionContainer<'gc>),
16053        /// Builder for [`super::JSXSpreadChild`].
16054        JSXSpreadChild(self::JSXSpreadChild<'gc>),
16055        /// Builder for [`super::JSXOpeningElement`].
16056        JSXOpeningElement(self::JSXOpeningElement<'gc>),
16057        /// Builder for [`super::JSXClosingElement`].
16058        JSXClosingElement(self::JSXClosingElement<'gc>),
16059        /// Builder for [`super::JSXAttribute`].
16060        JSXAttribute(self::JSXAttribute<'gc>),
16061        /// Builder for [`super::JSXSpreadAttribute`].
16062        JSXSpreadAttribute(self::JSXSpreadAttribute<'gc>),
16063        /// Builder for [`super::JSXStringLiteral`].
16064        JSXStringLiteral(self::JSXStringLiteral<'gc>),
16065        /// Builder for [`super::JSXText`].
16066        JSXText(self::JSXText<'gc>),
16067        /// Builder for [`super::JSXElement`].
16068        JSXElement(self::JSXElement<'gc>),
16069        /// Builder for [`super::JSXFragment`].
16070        JSXFragment(self::JSXFragment<'gc>),
16071        /// Builder for [`super::JSXOpeningFragment`].
16072        JSXOpeningFragment(self::JSXOpeningFragment<'gc>),
16073        /// Builder for [`super::JSXClosingFragment`].
16074        JSXClosingFragment(self::JSXClosingFragment<'gc>),
16075        /// Builder for [`super::ExistsTypeAnnotation`].
16076        ExistsTypeAnnotation(self::ExistsTypeAnnotation<'gc>),
16077        /// Builder for [`super::EmptyTypeAnnotation`].
16078        EmptyTypeAnnotation(self::EmptyTypeAnnotation<'gc>),
16079        /// Builder for [`super::StringTypeAnnotation`].
16080        StringTypeAnnotation(self::StringTypeAnnotation<'gc>),
16081        /// Builder for [`super::NumberTypeAnnotation`].
16082        NumberTypeAnnotation(self::NumberTypeAnnotation<'gc>),
16083        /// Builder for [`super::StringLiteralTypeAnnotation`].
16084        StringLiteralTypeAnnotation(self::StringLiteralTypeAnnotation<'gc>),
16085        /// Builder for [`super::NumberLiteralTypeAnnotation`].
16086        NumberLiteralTypeAnnotation(self::NumberLiteralTypeAnnotation<'gc>),
16087        /// Builder for [`super::BigIntLiteralTypeAnnotation`].
16088        BigIntLiteralTypeAnnotation(self::BigIntLiteralTypeAnnotation<'gc>),
16089        /// Builder for [`super::BooleanTypeAnnotation`].
16090        BooleanTypeAnnotation(self::BooleanTypeAnnotation<'gc>),
16091        /// Builder for [`super::BooleanLiteralTypeAnnotation`].
16092        BooleanLiteralTypeAnnotation(self::BooleanLiteralTypeAnnotation<'gc>),
16093        /// Builder for [`super::NullLiteralTypeAnnotation`].
16094        NullLiteralTypeAnnotation(self::NullLiteralTypeAnnotation<'gc>),
16095        /// Builder for [`super::SymbolTypeAnnotation`].
16096        SymbolTypeAnnotation(self::SymbolTypeAnnotation<'gc>),
16097        /// Builder for [`super::AnyTypeAnnotation`].
16098        AnyTypeAnnotation(self::AnyTypeAnnotation<'gc>),
16099        /// Builder for [`super::MixedTypeAnnotation`].
16100        MixedTypeAnnotation(self::MixedTypeAnnotation<'gc>),
16101        /// Builder for [`super::BigIntTypeAnnotation`].
16102        BigIntTypeAnnotation(self::BigIntTypeAnnotation<'gc>),
16103        /// Builder for [`super::VoidTypeAnnotation`].
16104        VoidTypeAnnotation(self::VoidTypeAnnotation<'gc>),
16105        /// Builder for [`super::NeverTypeAnnotation`].
16106        NeverTypeAnnotation(self::NeverTypeAnnotation<'gc>),
16107        /// Builder for [`super::UnknownTypeAnnotation`].
16108        UnknownTypeAnnotation(self::UnknownTypeAnnotation<'gc>),
16109        /// Builder for [`super::UndefinedTypeAnnotation`].
16110        UndefinedTypeAnnotation(self::UndefinedTypeAnnotation<'gc>),
16111        /// Builder for [`super::FunctionTypeAnnotation`].
16112        FunctionTypeAnnotation(self::FunctionTypeAnnotation<'gc>),
16113        /// Builder for [`super::HookTypeAnnotation`].
16114        HookTypeAnnotation(self::HookTypeAnnotation<'gc>),
16115        /// Builder for [`super::FunctionTypeParam`].
16116        FunctionTypeParam(self::FunctionTypeParam<'gc>),
16117        /// Builder for [`super::ComponentTypeAnnotation`].
16118        ComponentTypeAnnotation(self::ComponentTypeAnnotation<'gc>),
16119        /// Builder for [`super::ComponentTypeParameter`].
16120        ComponentTypeParameter(self::ComponentTypeParameter<'gc>),
16121        /// Builder for [`super::NullableTypeAnnotation`].
16122        NullableTypeAnnotation(self::NullableTypeAnnotation<'gc>),
16123        /// Builder for [`super::QualifiedTypeIdentifier`].
16124        QualifiedTypeIdentifier(self::QualifiedTypeIdentifier<'gc>),
16125        /// Builder for [`super::TypeofTypeAnnotation`].
16126        TypeofTypeAnnotation(self::TypeofTypeAnnotation<'gc>),
16127        /// Builder for [`super::KeyofTypeAnnotation`].
16128        KeyofTypeAnnotation(self::KeyofTypeAnnotation<'gc>),
16129        /// Builder for [`super::TypeOperator`].
16130        TypeOperator(self::TypeOperator<'gc>),
16131        /// Builder for [`super::QualifiedTypeofIdentifier`].
16132        QualifiedTypeofIdentifier(self::QualifiedTypeofIdentifier<'gc>),
16133        /// Builder for [`super::TupleTypeAnnotation`].
16134        TupleTypeAnnotation(self::TupleTypeAnnotation<'gc>),
16135        /// Builder for [`super::TupleTypeSpreadElement`].
16136        TupleTypeSpreadElement(self::TupleTypeSpreadElement<'gc>),
16137        /// Builder for [`super::TupleTypeLabeledElement`].
16138        TupleTypeLabeledElement(self::TupleTypeLabeledElement<'gc>),
16139        /// Builder for [`super::ArrayTypeAnnotation`].
16140        ArrayTypeAnnotation(self::ArrayTypeAnnotation<'gc>),
16141        /// Builder for [`super::InferTypeAnnotation`].
16142        InferTypeAnnotation(self::InferTypeAnnotation<'gc>),
16143        /// Builder for [`super::UnionTypeAnnotation`].
16144        UnionTypeAnnotation(self::UnionTypeAnnotation<'gc>),
16145        /// Builder for [`super::IntersectionTypeAnnotation`].
16146        IntersectionTypeAnnotation(self::IntersectionTypeAnnotation<'gc>),
16147        /// Builder for [`super::GenericTypeAnnotation`].
16148        GenericTypeAnnotation(self::GenericTypeAnnotation<'gc>),
16149        /// Builder for [`super::IndexedAccessType`].
16150        IndexedAccessType(self::IndexedAccessType<'gc>),
16151        /// Builder for [`super::OptionalIndexedAccessType`].
16152        OptionalIndexedAccessType(self::OptionalIndexedAccessType<'gc>),
16153        /// Builder for [`super::ConditionalTypeAnnotation`].
16154        ConditionalTypeAnnotation(self::ConditionalTypeAnnotation<'gc>),
16155        /// Builder for [`super::TypePredicate`].
16156        TypePredicate(self::TypePredicate<'gc>),
16157        /// Builder for [`super::InterfaceTypeAnnotation`].
16158        InterfaceTypeAnnotation(self::InterfaceTypeAnnotation<'gc>),
16159        /// Builder for [`super::TypeAlias`].
16160        TypeAlias(self::TypeAlias<'gc>),
16161        /// Builder for [`super::OpaqueType`].
16162        OpaqueType(self::OpaqueType<'gc>),
16163        /// Builder for [`super::InterfaceDeclaration`].
16164        InterfaceDeclaration(self::InterfaceDeclaration<'gc>),
16165        /// Builder for [`super::DeclareTypeAlias`].
16166        DeclareTypeAlias(self::DeclareTypeAlias<'gc>),
16167        /// Builder for [`super::DeclareOpaqueType`].
16168        DeclareOpaqueType(self::DeclareOpaqueType<'gc>),
16169        /// Builder for [`super::DeclareInterface`].
16170        DeclareInterface(self::DeclareInterface<'gc>),
16171        /// Builder for [`super::DeclareClass`].
16172        DeclareClass(self::DeclareClass<'gc>),
16173        /// Builder for [`super::DeclareFunction`].
16174        DeclareFunction(self::DeclareFunction<'gc>),
16175        /// Builder for [`super::DeclareHook`].
16176        DeclareHook(self::DeclareHook<'gc>),
16177        /// Builder for [`super::DeclareComponent`].
16178        DeclareComponent(self::DeclareComponent<'gc>),
16179        /// Builder for [`super::DeclareVariable`].
16180        DeclareVariable(self::DeclareVariable<'gc>),
16181        /// Builder for [`super::DeclareEnum`].
16182        DeclareEnum(self::DeclareEnum<'gc>),
16183        /// Builder for [`super::DeclareExportDeclaration`].
16184        DeclareExportDeclaration(self::DeclareExportDeclaration<'gc>),
16185        /// Builder for [`super::DeclareExportAllDeclaration`].
16186        DeclareExportAllDeclaration(self::DeclareExportAllDeclaration<'gc>),
16187        /// Builder for [`super::DeclareModule`].
16188        DeclareModule(self::DeclareModule<'gc>),
16189        /// Builder for [`super::DeclareNamespace`].
16190        DeclareNamespace(self::DeclareNamespace<'gc>),
16191        /// Builder for [`super::DeclareModuleExports`].
16192        DeclareModuleExports(self::DeclareModuleExports<'gc>),
16193        /// Builder for [`super::InterfaceExtends`].
16194        InterfaceExtends(self::InterfaceExtends<'gc>),
16195        /// Builder for [`super::ClassImplements`].
16196        ClassImplements(self::ClassImplements<'gc>),
16197        /// Builder for [`super::TypeAnnotation`].
16198        TypeAnnotation(self::TypeAnnotation<'gc>),
16199        /// Builder for [`super::ObjectTypeAnnotation`].
16200        ObjectTypeAnnotation(self::ObjectTypeAnnotation<'gc>),
16201        /// Builder for [`super::ObjectTypeProperty`].
16202        ObjectTypeProperty(self::ObjectTypeProperty<'gc>),
16203        /// Builder for [`super::ObjectTypeSpreadProperty`].
16204        ObjectTypeSpreadProperty(self::ObjectTypeSpreadProperty<'gc>),
16205        /// Builder for [`super::ObjectTypeInternalSlot`].
16206        ObjectTypeInternalSlot(self::ObjectTypeInternalSlot<'gc>),
16207        /// Builder for [`super::ObjectTypeCallProperty`].
16208        ObjectTypeCallProperty(self::ObjectTypeCallProperty<'gc>),
16209        /// Builder for [`super::ObjectTypeIndexer`].
16210        ObjectTypeIndexer(self::ObjectTypeIndexer<'gc>),
16211        /// Builder for [`super::ObjectTypeMappedTypeProperty`].
16212        ObjectTypeMappedTypeProperty(self::ObjectTypeMappedTypeProperty<'gc>),
16213        /// Builder for [`super::Variance`].
16214        Variance(self::Variance<'gc>),
16215        /// Builder for [`super::TypeParameterDeclaration`].
16216        TypeParameterDeclaration(self::TypeParameterDeclaration<'gc>),
16217        /// Builder for [`super::TypeParameter`].
16218        TypeParameter(self::TypeParameter<'gc>),
16219        /// Builder for [`super::TypeParameterInstantiation`].
16220        TypeParameterInstantiation(self::TypeParameterInstantiation<'gc>),
16221        /// Builder for [`super::TypeCastExpression`].
16222        TypeCastExpression(self::TypeCastExpression<'gc>),
16223        /// Builder for [`super::AsExpression`].
16224        AsExpression(self::AsExpression<'gc>),
16225        /// Builder for [`super::AsConstExpression`].
16226        AsConstExpression(self::AsConstExpression<'gc>),
16227        /// Builder for [`super::InferredPredicate`].
16228        InferredPredicate(self::InferredPredicate<'gc>),
16229        /// Builder for [`super::DeclaredPredicate`].
16230        DeclaredPredicate(self::DeclaredPredicate<'gc>),
16231        /// Builder for [`super::EnumDeclaration`].
16232        EnumDeclaration(self::EnumDeclaration<'gc>),
16233        /// Builder for [`super::EnumStringBody`].
16234        EnumStringBody(self::EnumStringBody<'gc>),
16235        /// Builder for [`super::EnumNumberBody`].
16236        EnumNumberBody(self::EnumNumberBody<'gc>),
16237        /// Builder for [`super::EnumBigIntBody`].
16238        EnumBigIntBody(self::EnumBigIntBody<'gc>),
16239        /// Builder for [`super::EnumBooleanBody`].
16240        EnumBooleanBody(self::EnumBooleanBody<'gc>),
16241        /// Builder for [`super::EnumSymbolBody`].
16242        EnumSymbolBody(self::EnumSymbolBody<'gc>),
16243        /// Builder for [`super::EnumDefaultedMember`].
16244        EnumDefaultedMember(self::EnumDefaultedMember<'gc>),
16245        /// Builder for [`super::EnumStringMember`].
16246        EnumStringMember(self::EnumStringMember<'gc>),
16247        /// Builder for [`super::EnumNumberMember`].
16248        EnumNumberMember(self::EnumNumberMember<'gc>),
16249        /// Builder for [`super::EnumBigIntMember`].
16250        EnumBigIntMember(self::EnumBigIntMember<'gc>),
16251        /// Builder for [`super::EnumBooleanMember`].
16252        EnumBooleanMember(self::EnumBooleanMember<'gc>),
16253        /// Builder for [`super::ComponentParameter`].
16254        ComponentParameter(self::ComponentParameter<'gc>),
16255        /// Builder for [`super::RecordDeclaration`].
16256        RecordDeclaration(self::RecordDeclaration<'gc>),
16257        /// Builder for [`super::RecordDeclarationImplements`].
16258        RecordDeclarationImplements(self::RecordDeclarationImplements<'gc>),
16259        /// Builder for [`super::RecordDeclarationBody`].
16260        RecordDeclarationBody(self::RecordDeclarationBody<'gc>),
16261        /// Builder for [`super::RecordDeclarationProperty`].
16262        RecordDeclarationProperty(self::RecordDeclarationProperty<'gc>),
16263        /// Builder for [`super::RecordDeclarationStaticProperty`].
16264        RecordDeclarationStaticProperty(self::RecordDeclarationStaticProperty<'gc>),
16265        /// Builder for [`super::RecordExpression`].
16266        RecordExpression(self::RecordExpression<'gc>),
16267        /// Builder for [`super::RecordExpressionProperties`].
16268        RecordExpressionProperties(self::RecordExpressionProperties<'gc>),
16269        /// Builder for [`super::TSTypeAnnotation`].
16270        TSTypeAnnotation(self::TSTypeAnnotation<'gc>),
16271        /// Builder for [`super::TSAnyKeyword`].
16272        TSAnyKeyword(self::TSAnyKeyword<'gc>),
16273        /// Builder for [`super::TSNumberKeyword`].
16274        TSNumberKeyword(self::TSNumberKeyword<'gc>),
16275        /// Builder for [`super::TSBooleanKeyword`].
16276        TSBooleanKeyword(self::TSBooleanKeyword<'gc>),
16277        /// Builder for [`super::TSStringKeyword`].
16278        TSStringKeyword(self::TSStringKeyword<'gc>),
16279        /// Builder for [`super::TSSymbolKeyword`].
16280        TSSymbolKeyword(self::TSSymbolKeyword<'gc>),
16281        /// Builder for [`super::TSVoidKeyword`].
16282        TSVoidKeyword(self::TSVoidKeyword<'gc>),
16283        /// Builder for [`super::TSUndefinedKeyword`].
16284        TSUndefinedKeyword(self::TSUndefinedKeyword<'gc>),
16285        /// Builder for [`super::TSUnknownKeyword`].
16286        TSUnknownKeyword(self::TSUnknownKeyword<'gc>),
16287        /// Builder for [`super::TSNeverKeyword`].
16288        TSNeverKeyword(self::TSNeverKeyword<'gc>),
16289        /// Builder for [`super::TSBigIntKeyword`].
16290        TSBigIntKeyword(self::TSBigIntKeyword<'gc>),
16291        /// Builder for [`super::TSThisType`].
16292        TSThisType(self::TSThisType<'gc>),
16293        /// Builder for [`super::TSLiteralType`].
16294        TSLiteralType(self::TSLiteralType<'gc>),
16295        /// Builder for [`super::TSIndexedAccessType`].
16296        TSIndexedAccessType(self::TSIndexedAccessType<'gc>),
16297        /// Builder for [`super::TSArrayType`].
16298        TSArrayType(self::TSArrayType<'gc>),
16299        /// Builder for [`super::TSTypeReference`].
16300        TSTypeReference(self::TSTypeReference<'gc>),
16301        /// Builder for [`super::TSQualifiedName`].
16302        TSQualifiedName(self::TSQualifiedName<'gc>),
16303        /// Builder for [`super::TSFunctionType`].
16304        TSFunctionType(self::TSFunctionType<'gc>),
16305        /// Builder for [`super::TSConstructorType`].
16306        TSConstructorType(self::TSConstructorType<'gc>),
16307        /// Builder for [`super::TSTypePredicate`].
16308        TSTypePredicate(self::TSTypePredicate<'gc>),
16309        /// Builder for [`super::TSTupleType`].
16310        TSTupleType(self::TSTupleType<'gc>),
16311        /// Builder for [`super::TSTypeAssertion`].
16312        TSTypeAssertion(self::TSTypeAssertion<'gc>),
16313        /// Builder for [`super::TSAsExpression`].
16314        TSAsExpression(self::TSAsExpression<'gc>),
16315        /// Builder for [`super::TSParameterProperty`].
16316        TSParameterProperty(self::TSParameterProperty<'gc>),
16317        /// Builder for [`super::TSTypeAliasDeclaration`].
16318        TSTypeAliasDeclaration(self::TSTypeAliasDeclaration<'gc>),
16319        /// Builder for [`super::TSInterfaceDeclaration`].
16320        TSInterfaceDeclaration(self::TSInterfaceDeclaration<'gc>),
16321        /// Builder for [`super::TSInterfaceHeritage`].
16322        TSInterfaceHeritage(self::TSInterfaceHeritage<'gc>),
16323        /// Builder for [`super::TSInterfaceBody`].
16324        TSInterfaceBody(self::TSInterfaceBody<'gc>),
16325        /// Builder for [`super::TSEnumDeclaration`].
16326        TSEnumDeclaration(self::TSEnumDeclaration<'gc>),
16327        /// Builder for [`super::TSEnumMember`].
16328        TSEnumMember(self::TSEnumMember<'gc>),
16329        /// Builder for [`super::TSModuleDeclaration`].
16330        TSModuleDeclaration(self::TSModuleDeclaration<'gc>),
16331        /// Builder for [`super::TSModuleBlock`].
16332        TSModuleBlock(self::TSModuleBlock<'gc>),
16333        /// Builder for [`super::TSModuleMember`].
16334        TSModuleMember(self::TSModuleMember<'gc>),
16335        /// Builder for [`super::TSTypeParameterDeclaration`].
16336        TSTypeParameterDeclaration(self::TSTypeParameterDeclaration<'gc>),
16337        /// Builder for [`super::TSTypeParameter`].
16338        TSTypeParameter(self::TSTypeParameter<'gc>),
16339        /// Builder for [`super::TSTypeParameterInstantiation`].
16340        TSTypeParameterInstantiation(self::TSTypeParameterInstantiation<'gc>),
16341        /// Builder for [`super::TSUnionType`].
16342        TSUnionType(self::TSUnionType<'gc>),
16343        /// Builder for [`super::TSIntersectionType`].
16344        TSIntersectionType(self::TSIntersectionType<'gc>),
16345        /// Builder for [`super::TSTypeQuery`].
16346        TSTypeQuery(self::TSTypeQuery<'gc>),
16347        /// Builder for [`super::TSConditionalType`].
16348        TSConditionalType(self::TSConditionalType<'gc>),
16349        /// Builder for [`super::TSTypeLiteral`].
16350        TSTypeLiteral(self::TSTypeLiteral<'gc>),
16351        /// Builder for [`super::TSPropertySignature`].
16352        TSPropertySignature(self::TSPropertySignature<'gc>),
16353        /// Builder for [`super::TSMethodSignature`].
16354        TSMethodSignature(self::TSMethodSignature<'gc>),
16355        /// Builder for [`super::TSIndexSignature`].
16356        TSIndexSignature(self::TSIndexSignature<'gc>),
16357        /// Builder for [`super::TSCallSignatureDeclaration`].
16358        TSCallSignatureDeclaration(self::TSCallSignatureDeclaration<'gc>),
16359        /// Builder for [`super::TSModifiers`].
16360        TSModifiers(self::TSModifiers<'gc>),
16361        /// Builder for [`super::CoverEmptyArgs`].
16362        CoverEmptyArgs(self::CoverEmptyArgs<'gc>),
16363        /// Builder for [`super::CoverTrailingComma`].
16364        CoverTrailingComma(self::CoverTrailingComma<'gc>),
16365        /// Builder for [`super::CoverInitializer`].
16366        CoverInitializer(self::CoverInitializer<'gc>),
16367        /// Builder for [`super::CoverRestElement`].
16368        CoverRestElement(self::CoverRestElement<'gc>),
16369        /// Builder for [`super::CoverTypedIdentifier`].
16370        CoverTypedIdentifier(self::CoverTypedIdentifier<'gc>),
16371        /// Builder for [`super::SHBuiltin`].
16372        SHBuiltin(self::SHBuiltin<'gc>),
16373        /// Builder for [`super::ImplicitCheckedCast`].
16374        ImplicitCheckedCast(self::ImplicitCheckedCast<'gc>),
16375    }
16376
16377    impl<'gc> Builder<'gc> {
16378        /// Start a builder for `node`, dispatching on its kind.
16379        pub fn from_node(node: &'gc Node<'gc>) -> Self {
16380            match node {
16381                Node::Empty(n) => Builder::Empty(self::Empty::from_node(n)),
16382                Node::Metadata(n) => Builder::Metadata(self::Metadata::from_node(n)),
16383                Node::Program(n) => Builder::Program(self::Program::from_node(n)),
16384                Node::FunctionExpression(n) => Builder::FunctionExpression(self::FunctionExpression::from_node(n)),
16385                Node::ArrowFunctionExpression(n) => Builder::ArrowFunctionExpression(self::ArrowFunctionExpression::from_node(n)),
16386                Node::FunctionDeclaration(n) => Builder::FunctionDeclaration(self::FunctionDeclaration::from_node(n)),
16387                Node::ComponentDeclaration(n) => Builder::ComponentDeclaration(self::ComponentDeclaration::from_node(n)),
16388                Node::HookDeclaration(n) => Builder::HookDeclaration(self::HookDeclaration::from_node(n)),
16389                Node::MatchStatement(n) => Builder::MatchStatement(self::MatchStatement::from_node(n)),
16390                Node::WhileStatement(n) => Builder::WhileStatement(self::WhileStatement::from_node(n)),
16391                Node::DoWhileStatement(n) => Builder::DoWhileStatement(self::DoWhileStatement::from_node(n)),
16392                Node::ForInStatement(n) => Builder::ForInStatement(self::ForInStatement::from_node(n)),
16393                Node::ForOfStatement(n) => Builder::ForOfStatement(self::ForOfStatement::from_node(n)),
16394                Node::ForStatement(n) => Builder::ForStatement(self::ForStatement::from_node(n)),
16395                Node::DebuggerStatement(n) => Builder::DebuggerStatement(self::DebuggerStatement::from_node(n)),
16396                Node::EmptyStatement(n) => Builder::EmptyStatement(self::EmptyStatement::from_node(n)),
16397                Node::BlockStatement(n) => Builder::BlockStatement(self::BlockStatement::from_node(n)),
16398                Node::StaticBlock(n) => Builder::StaticBlock(self::StaticBlock::from_node(n)),
16399                Node::BreakStatement(n) => Builder::BreakStatement(self::BreakStatement::from_node(n)),
16400                Node::ContinueStatement(n) => Builder::ContinueStatement(self::ContinueStatement::from_node(n)),
16401                Node::ThrowStatement(n) => Builder::ThrowStatement(self::ThrowStatement::from_node(n)),
16402                Node::ReturnStatement(n) => Builder::ReturnStatement(self::ReturnStatement::from_node(n)),
16403                Node::WithStatement(n) => Builder::WithStatement(self::WithStatement::from_node(n)),
16404                Node::SwitchStatement(n) => Builder::SwitchStatement(self::SwitchStatement::from_node(n)),
16405                Node::LabeledStatement(n) => Builder::LabeledStatement(self::LabeledStatement::from_node(n)),
16406                Node::ExpressionStatement(n) => Builder::ExpressionStatement(self::ExpressionStatement::from_node(n)),
16407                Node::TryStatement(n) => Builder::TryStatement(self::TryStatement::from_node(n)),
16408                Node::IfStatement(n) => Builder::IfStatement(self::IfStatement::from_node(n)),
16409                Node::NullLiteral(n) => Builder::NullLiteral(self::NullLiteral::from_node(n)),
16410                Node::BooleanLiteral(n) => Builder::BooleanLiteral(self::BooleanLiteral::from_node(n)),
16411                Node::StringLiteral(n) => Builder::StringLiteral(self::StringLiteral::from_node(n)),
16412                Node::NumericLiteral(n) => Builder::NumericLiteral(self::NumericLiteral::from_node(n)),
16413                Node::RegExpLiteral(n) => Builder::RegExpLiteral(self::RegExpLiteral::from_node(n)),
16414                Node::BigIntLiteral(n) => Builder::BigIntLiteral(self::BigIntLiteral::from_node(n)),
16415                Node::ThisExpression(n) => Builder::ThisExpression(self::ThisExpression::from_node(n)),
16416                Node::Super(n) => Builder::Super(self::Super::from_node(n)),
16417                Node::SequenceExpression(n) => Builder::SequenceExpression(self::SequenceExpression::from_node(n)),
16418                Node::ObjectExpression(n) => Builder::ObjectExpression(self::ObjectExpression::from_node(n)),
16419                Node::ArrayExpression(n) => Builder::ArrayExpression(self::ArrayExpression::from_node(n)),
16420                Node::SpreadElement(n) => Builder::SpreadElement(self::SpreadElement::from_node(n)),
16421                Node::NewExpression(n) => Builder::NewExpression(self::NewExpression::from_node(n)),
16422                Node::YieldExpression(n) => Builder::YieldExpression(self::YieldExpression::from_node(n)),
16423                Node::AwaitExpression(n) => Builder::AwaitExpression(self::AwaitExpression::from_node(n)),
16424                Node::ImportExpression(n) => Builder::ImportExpression(self::ImportExpression::from_node(n)),
16425                Node::CallExpression(n) => Builder::CallExpression(self::CallExpression::from_node(n)),
16426                Node::OptionalCallExpression(n) => Builder::OptionalCallExpression(self::OptionalCallExpression::from_node(n)),
16427                Node::AssignmentExpression(n) => Builder::AssignmentExpression(self::AssignmentExpression::from_node(n)),
16428                Node::UnaryExpression(n) => Builder::UnaryExpression(self::UnaryExpression::from_node(n)),
16429                Node::UpdateExpression(n) => Builder::UpdateExpression(self::UpdateExpression::from_node(n)),
16430                Node::MemberExpression(n) => Builder::MemberExpression(self::MemberExpression::from_node(n)),
16431                Node::OptionalMemberExpression(n) => Builder::OptionalMemberExpression(self::OptionalMemberExpression::from_node(n)),
16432                Node::LogicalExpression(n) => Builder::LogicalExpression(self::LogicalExpression::from_node(n)),
16433                Node::ConditionalExpression(n) => Builder::ConditionalExpression(self::ConditionalExpression::from_node(n)),
16434                Node::BinaryExpression(n) => Builder::BinaryExpression(self::BinaryExpression::from_node(n)),
16435                Node::Directive(n) => Builder::Directive(self::Directive::from_node(n)),
16436                Node::DirectiveLiteral(n) => Builder::DirectiveLiteral(self::DirectiveLiteral::from_node(n)),
16437                Node::Identifier(n) => Builder::Identifier(self::Identifier::from_node(n)),
16438                Node::PrivateName(n) => Builder::PrivateName(self::PrivateName::from_node(n)),
16439                Node::MetaProperty(n) => Builder::MetaProperty(self::MetaProperty::from_node(n)),
16440                Node::SwitchCase(n) => Builder::SwitchCase(self::SwitchCase::from_node(n)),
16441                Node::CatchClause(n) => Builder::CatchClause(self::CatchClause::from_node(n)),
16442                Node::VariableDeclarator(n) => Builder::VariableDeclarator(self::VariableDeclarator::from_node(n)),
16443                Node::VariableDeclaration(n) => Builder::VariableDeclaration(self::VariableDeclaration::from_node(n)),
16444                Node::TemplateLiteral(n) => Builder::TemplateLiteral(self::TemplateLiteral::from_node(n)),
16445                Node::TaggedTemplateExpression(n) => Builder::TaggedTemplateExpression(self::TaggedTemplateExpression::from_node(n)),
16446                Node::TemplateElement(n) => Builder::TemplateElement(self::TemplateElement::from_node(n)),
16447                Node::Property(n) => Builder::Property(self::Property::from_node(n)),
16448                Node::Decorator(n) => Builder::Decorator(self::Decorator::from_node(n)),
16449                Node::ClassDeclaration(n) => Builder::ClassDeclaration(self::ClassDeclaration::from_node(n)),
16450                Node::ClassExpression(n) => Builder::ClassExpression(self::ClassExpression::from_node(n)),
16451                Node::ClassBody(n) => Builder::ClassBody(self::ClassBody::from_node(n)),
16452                Node::ClassProperty(n) => Builder::ClassProperty(self::ClassProperty::from_node(n)),
16453                Node::ClassPrivateProperty(n) => Builder::ClassPrivateProperty(self::ClassPrivateProperty::from_node(n)),
16454                Node::MethodDefinition(n) => Builder::MethodDefinition(self::MethodDefinition::from_node(n)),
16455                Node::ImportDeclaration(n) => Builder::ImportDeclaration(self::ImportDeclaration::from_node(n)),
16456                Node::ImportSpecifier(n) => Builder::ImportSpecifier(self::ImportSpecifier::from_node(n)),
16457                Node::ImportDefaultSpecifier(n) => Builder::ImportDefaultSpecifier(self::ImportDefaultSpecifier::from_node(n)),
16458                Node::ImportNamespaceSpecifier(n) => Builder::ImportNamespaceSpecifier(self::ImportNamespaceSpecifier::from_node(n)),
16459                Node::ImportAttribute(n) => Builder::ImportAttribute(self::ImportAttribute::from_node(n)),
16460                Node::ExportNamedDeclaration(n) => Builder::ExportNamedDeclaration(self::ExportNamedDeclaration::from_node(n)),
16461                Node::ExportSpecifier(n) => Builder::ExportSpecifier(self::ExportSpecifier::from_node(n)),
16462                Node::ExportNamespaceSpecifier(n) => Builder::ExportNamespaceSpecifier(self::ExportNamespaceSpecifier::from_node(n)),
16463                Node::ExportDefaultDeclaration(n) => Builder::ExportDefaultDeclaration(self::ExportDefaultDeclaration::from_node(n)),
16464                Node::ExportAllDeclaration(n) => Builder::ExportAllDeclaration(self::ExportAllDeclaration::from_node(n)),
16465                Node::ObjectPattern(n) => Builder::ObjectPattern(self::ObjectPattern::from_node(n)),
16466                Node::ArrayPattern(n) => Builder::ArrayPattern(self::ArrayPattern::from_node(n)),
16467                Node::RestElement(n) => Builder::RestElement(self::RestElement::from_node(n)),
16468                Node::AssignmentPattern(n) => Builder::AssignmentPattern(self::AssignmentPattern::from_node(n)),
16469                Node::MatchStatementCase(n) => Builder::MatchStatementCase(self::MatchStatementCase::from_node(n)),
16470                Node::MatchExpression(n) => Builder::MatchExpression(self::MatchExpression::from_node(n)),
16471                Node::MatchExpressionCase(n) => Builder::MatchExpressionCase(self::MatchExpressionCase::from_node(n)),
16472                Node::MatchWildcardPattern(n) => Builder::MatchWildcardPattern(self::MatchWildcardPattern::from_node(n)),
16473                Node::MatchLiteralPattern(n) => Builder::MatchLiteralPattern(self::MatchLiteralPattern::from_node(n)),
16474                Node::MatchUnaryPattern(n) => Builder::MatchUnaryPattern(self::MatchUnaryPattern::from_node(n)),
16475                Node::MatchIdentifierPattern(n) => Builder::MatchIdentifierPattern(self::MatchIdentifierPattern::from_node(n)),
16476                Node::MatchBindingPattern(n) => Builder::MatchBindingPattern(self::MatchBindingPattern::from_node(n)),
16477                Node::MatchObjectPattern(n) => Builder::MatchObjectPattern(self::MatchObjectPattern::from_node(n)),
16478                Node::MatchArrayPattern(n) => Builder::MatchArrayPattern(self::MatchArrayPattern::from_node(n)),
16479                Node::MatchOrPattern(n) => Builder::MatchOrPattern(self::MatchOrPattern::from_node(n)),
16480                Node::MatchAsPattern(n) => Builder::MatchAsPattern(self::MatchAsPattern::from_node(n)),
16481                Node::MatchMemberPattern(n) => Builder::MatchMemberPattern(self::MatchMemberPattern::from_node(n)),
16482                Node::MatchInstancePattern(n) => Builder::MatchInstancePattern(self::MatchInstancePattern::from_node(n)),
16483                Node::MatchObjectPatternProperty(n) => Builder::MatchObjectPatternProperty(self::MatchObjectPatternProperty::from_node(n)),
16484                Node::MatchInstanceObjectPattern(n) => Builder::MatchInstanceObjectPattern(self::MatchInstanceObjectPattern::from_node(n)),
16485                Node::MatchRestPattern(n) => Builder::MatchRestPattern(self::MatchRestPattern::from_node(n)),
16486                Node::JSXIdentifier(n) => Builder::JSXIdentifier(self::JSXIdentifier::from_node(n)),
16487                Node::JSXMemberExpression(n) => Builder::JSXMemberExpression(self::JSXMemberExpression::from_node(n)),
16488                Node::JSXNamespacedName(n) => Builder::JSXNamespacedName(self::JSXNamespacedName::from_node(n)),
16489                Node::JSXEmptyExpression(n) => Builder::JSXEmptyExpression(self::JSXEmptyExpression::from_node(n)),
16490                Node::JSXExpressionContainer(n) => Builder::JSXExpressionContainer(self::JSXExpressionContainer::from_node(n)),
16491                Node::JSXSpreadChild(n) => Builder::JSXSpreadChild(self::JSXSpreadChild::from_node(n)),
16492                Node::JSXOpeningElement(n) => Builder::JSXOpeningElement(self::JSXOpeningElement::from_node(n)),
16493                Node::JSXClosingElement(n) => Builder::JSXClosingElement(self::JSXClosingElement::from_node(n)),
16494                Node::JSXAttribute(n) => Builder::JSXAttribute(self::JSXAttribute::from_node(n)),
16495                Node::JSXSpreadAttribute(n) => Builder::JSXSpreadAttribute(self::JSXSpreadAttribute::from_node(n)),
16496                Node::JSXStringLiteral(n) => Builder::JSXStringLiteral(self::JSXStringLiteral::from_node(n)),
16497                Node::JSXText(n) => Builder::JSXText(self::JSXText::from_node(n)),
16498                Node::JSXElement(n) => Builder::JSXElement(self::JSXElement::from_node(n)),
16499                Node::JSXFragment(n) => Builder::JSXFragment(self::JSXFragment::from_node(n)),
16500                Node::JSXOpeningFragment(n) => Builder::JSXOpeningFragment(self::JSXOpeningFragment::from_node(n)),
16501                Node::JSXClosingFragment(n) => Builder::JSXClosingFragment(self::JSXClosingFragment::from_node(n)),
16502                Node::ExistsTypeAnnotation(n) => Builder::ExistsTypeAnnotation(self::ExistsTypeAnnotation::from_node(n)),
16503                Node::EmptyTypeAnnotation(n) => Builder::EmptyTypeAnnotation(self::EmptyTypeAnnotation::from_node(n)),
16504                Node::StringTypeAnnotation(n) => Builder::StringTypeAnnotation(self::StringTypeAnnotation::from_node(n)),
16505                Node::NumberTypeAnnotation(n) => Builder::NumberTypeAnnotation(self::NumberTypeAnnotation::from_node(n)),
16506                Node::StringLiteralTypeAnnotation(n) => Builder::StringLiteralTypeAnnotation(self::StringLiteralTypeAnnotation::from_node(n)),
16507                Node::NumberLiteralTypeAnnotation(n) => Builder::NumberLiteralTypeAnnotation(self::NumberLiteralTypeAnnotation::from_node(n)),
16508                Node::BigIntLiteralTypeAnnotation(n) => Builder::BigIntLiteralTypeAnnotation(self::BigIntLiteralTypeAnnotation::from_node(n)),
16509                Node::BooleanTypeAnnotation(n) => Builder::BooleanTypeAnnotation(self::BooleanTypeAnnotation::from_node(n)),
16510                Node::BooleanLiteralTypeAnnotation(n) => Builder::BooleanLiteralTypeAnnotation(self::BooleanLiteralTypeAnnotation::from_node(n)),
16511                Node::NullLiteralTypeAnnotation(n) => Builder::NullLiteralTypeAnnotation(self::NullLiteralTypeAnnotation::from_node(n)),
16512                Node::SymbolTypeAnnotation(n) => Builder::SymbolTypeAnnotation(self::SymbolTypeAnnotation::from_node(n)),
16513                Node::AnyTypeAnnotation(n) => Builder::AnyTypeAnnotation(self::AnyTypeAnnotation::from_node(n)),
16514                Node::MixedTypeAnnotation(n) => Builder::MixedTypeAnnotation(self::MixedTypeAnnotation::from_node(n)),
16515                Node::BigIntTypeAnnotation(n) => Builder::BigIntTypeAnnotation(self::BigIntTypeAnnotation::from_node(n)),
16516                Node::VoidTypeAnnotation(n) => Builder::VoidTypeAnnotation(self::VoidTypeAnnotation::from_node(n)),
16517                Node::NeverTypeAnnotation(n) => Builder::NeverTypeAnnotation(self::NeverTypeAnnotation::from_node(n)),
16518                Node::UnknownTypeAnnotation(n) => Builder::UnknownTypeAnnotation(self::UnknownTypeAnnotation::from_node(n)),
16519                Node::UndefinedTypeAnnotation(n) => Builder::UndefinedTypeAnnotation(self::UndefinedTypeAnnotation::from_node(n)),
16520                Node::FunctionTypeAnnotation(n) => Builder::FunctionTypeAnnotation(self::FunctionTypeAnnotation::from_node(n)),
16521                Node::HookTypeAnnotation(n) => Builder::HookTypeAnnotation(self::HookTypeAnnotation::from_node(n)),
16522                Node::FunctionTypeParam(n) => Builder::FunctionTypeParam(self::FunctionTypeParam::from_node(n)),
16523                Node::ComponentTypeAnnotation(n) => Builder::ComponentTypeAnnotation(self::ComponentTypeAnnotation::from_node(n)),
16524                Node::ComponentTypeParameter(n) => Builder::ComponentTypeParameter(self::ComponentTypeParameter::from_node(n)),
16525                Node::NullableTypeAnnotation(n) => Builder::NullableTypeAnnotation(self::NullableTypeAnnotation::from_node(n)),
16526                Node::QualifiedTypeIdentifier(n) => Builder::QualifiedTypeIdentifier(self::QualifiedTypeIdentifier::from_node(n)),
16527                Node::TypeofTypeAnnotation(n) => Builder::TypeofTypeAnnotation(self::TypeofTypeAnnotation::from_node(n)),
16528                Node::KeyofTypeAnnotation(n) => Builder::KeyofTypeAnnotation(self::KeyofTypeAnnotation::from_node(n)),
16529                Node::TypeOperator(n) => Builder::TypeOperator(self::TypeOperator::from_node(n)),
16530                Node::QualifiedTypeofIdentifier(n) => Builder::QualifiedTypeofIdentifier(self::QualifiedTypeofIdentifier::from_node(n)),
16531                Node::TupleTypeAnnotation(n) => Builder::TupleTypeAnnotation(self::TupleTypeAnnotation::from_node(n)),
16532                Node::TupleTypeSpreadElement(n) => Builder::TupleTypeSpreadElement(self::TupleTypeSpreadElement::from_node(n)),
16533                Node::TupleTypeLabeledElement(n) => Builder::TupleTypeLabeledElement(self::TupleTypeLabeledElement::from_node(n)),
16534                Node::ArrayTypeAnnotation(n) => Builder::ArrayTypeAnnotation(self::ArrayTypeAnnotation::from_node(n)),
16535                Node::InferTypeAnnotation(n) => Builder::InferTypeAnnotation(self::InferTypeAnnotation::from_node(n)),
16536                Node::UnionTypeAnnotation(n) => Builder::UnionTypeAnnotation(self::UnionTypeAnnotation::from_node(n)),
16537                Node::IntersectionTypeAnnotation(n) => Builder::IntersectionTypeAnnotation(self::IntersectionTypeAnnotation::from_node(n)),
16538                Node::GenericTypeAnnotation(n) => Builder::GenericTypeAnnotation(self::GenericTypeAnnotation::from_node(n)),
16539                Node::IndexedAccessType(n) => Builder::IndexedAccessType(self::IndexedAccessType::from_node(n)),
16540                Node::OptionalIndexedAccessType(n) => Builder::OptionalIndexedAccessType(self::OptionalIndexedAccessType::from_node(n)),
16541                Node::ConditionalTypeAnnotation(n) => Builder::ConditionalTypeAnnotation(self::ConditionalTypeAnnotation::from_node(n)),
16542                Node::TypePredicate(n) => Builder::TypePredicate(self::TypePredicate::from_node(n)),
16543                Node::InterfaceTypeAnnotation(n) => Builder::InterfaceTypeAnnotation(self::InterfaceTypeAnnotation::from_node(n)),
16544                Node::TypeAlias(n) => Builder::TypeAlias(self::TypeAlias::from_node(n)),
16545                Node::OpaqueType(n) => Builder::OpaqueType(self::OpaqueType::from_node(n)),
16546                Node::InterfaceDeclaration(n) => Builder::InterfaceDeclaration(self::InterfaceDeclaration::from_node(n)),
16547                Node::DeclareTypeAlias(n) => Builder::DeclareTypeAlias(self::DeclareTypeAlias::from_node(n)),
16548                Node::DeclareOpaqueType(n) => Builder::DeclareOpaqueType(self::DeclareOpaqueType::from_node(n)),
16549                Node::DeclareInterface(n) => Builder::DeclareInterface(self::DeclareInterface::from_node(n)),
16550                Node::DeclareClass(n) => Builder::DeclareClass(self::DeclareClass::from_node(n)),
16551                Node::DeclareFunction(n) => Builder::DeclareFunction(self::DeclareFunction::from_node(n)),
16552                Node::DeclareHook(n) => Builder::DeclareHook(self::DeclareHook::from_node(n)),
16553                Node::DeclareComponent(n) => Builder::DeclareComponent(self::DeclareComponent::from_node(n)),
16554                Node::DeclareVariable(n) => Builder::DeclareVariable(self::DeclareVariable::from_node(n)),
16555                Node::DeclareEnum(n) => Builder::DeclareEnum(self::DeclareEnum::from_node(n)),
16556                Node::DeclareExportDeclaration(n) => Builder::DeclareExportDeclaration(self::DeclareExportDeclaration::from_node(n)),
16557                Node::DeclareExportAllDeclaration(n) => Builder::DeclareExportAllDeclaration(self::DeclareExportAllDeclaration::from_node(n)),
16558                Node::DeclareModule(n) => Builder::DeclareModule(self::DeclareModule::from_node(n)),
16559                Node::DeclareNamespace(n) => Builder::DeclareNamespace(self::DeclareNamespace::from_node(n)),
16560                Node::DeclareModuleExports(n) => Builder::DeclareModuleExports(self::DeclareModuleExports::from_node(n)),
16561                Node::InterfaceExtends(n) => Builder::InterfaceExtends(self::InterfaceExtends::from_node(n)),
16562                Node::ClassImplements(n) => Builder::ClassImplements(self::ClassImplements::from_node(n)),
16563                Node::TypeAnnotation(n) => Builder::TypeAnnotation(self::TypeAnnotation::from_node(n)),
16564                Node::ObjectTypeAnnotation(n) => Builder::ObjectTypeAnnotation(self::ObjectTypeAnnotation::from_node(n)),
16565                Node::ObjectTypeProperty(n) => Builder::ObjectTypeProperty(self::ObjectTypeProperty::from_node(n)),
16566                Node::ObjectTypeSpreadProperty(n) => Builder::ObjectTypeSpreadProperty(self::ObjectTypeSpreadProperty::from_node(n)),
16567                Node::ObjectTypeInternalSlot(n) => Builder::ObjectTypeInternalSlot(self::ObjectTypeInternalSlot::from_node(n)),
16568                Node::ObjectTypeCallProperty(n) => Builder::ObjectTypeCallProperty(self::ObjectTypeCallProperty::from_node(n)),
16569                Node::ObjectTypeIndexer(n) => Builder::ObjectTypeIndexer(self::ObjectTypeIndexer::from_node(n)),
16570                Node::ObjectTypeMappedTypeProperty(n) => Builder::ObjectTypeMappedTypeProperty(self::ObjectTypeMappedTypeProperty::from_node(n)),
16571                Node::Variance(n) => Builder::Variance(self::Variance::from_node(n)),
16572                Node::TypeParameterDeclaration(n) => Builder::TypeParameterDeclaration(self::TypeParameterDeclaration::from_node(n)),
16573                Node::TypeParameter(n) => Builder::TypeParameter(self::TypeParameter::from_node(n)),
16574                Node::TypeParameterInstantiation(n) => Builder::TypeParameterInstantiation(self::TypeParameterInstantiation::from_node(n)),
16575                Node::TypeCastExpression(n) => Builder::TypeCastExpression(self::TypeCastExpression::from_node(n)),
16576                Node::AsExpression(n) => Builder::AsExpression(self::AsExpression::from_node(n)),
16577                Node::AsConstExpression(n) => Builder::AsConstExpression(self::AsConstExpression::from_node(n)),
16578                Node::InferredPredicate(n) => Builder::InferredPredicate(self::InferredPredicate::from_node(n)),
16579                Node::DeclaredPredicate(n) => Builder::DeclaredPredicate(self::DeclaredPredicate::from_node(n)),
16580                Node::EnumDeclaration(n) => Builder::EnumDeclaration(self::EnumDeclaration::from_node(n)),
16581                Node::EnumStringBody(n) => Builder::EnumStringBody(self::EnumStringBody::from_node(n)),
16582                Node::EnumNumberBody(n) => Builder::EnumNumberBody(self::EnumNumberBody::from_node(n)),
16583                Node::EnumBigIntBody(n) => Builder::EnumBigIntBody(self::EnumBigIntBody::from_node(n)),
16584                Node::EnumBooleanBody(n) => Builder::EnumBooleanBody(self::EnumBooleanBody::from_node(n)),
16585                Node::EnumSymbolBody(n) => Builder::EnumSymbolBody(self::EnumSymbolBody::from_node(n)),
16586                Node::EnumDefaultedMember(n) => Builder::EnumDefaultedMember(self::EnumDefaultedMember::from_node(n)),
16587                Node::EnumStringMember(n) => Builder::EnumStringMember(self::EnumStringMember::from_node(n)),
16588                Node::EnumNumberMember(n) => Builder::EnumNumberMember(self::EnumNumberMember::from_node(n)),
16589                Node::EnumBigIntMember(n) => Builder::EnumBigIntMember(self::EnumBigIntMember::from_node(n)),
16590                Node::EnumBooleanMember(n) => Builder::EnumBooleanMember(self::EnumBooleanMember::from_node(n)),
16591                Node::ComponentParameter(n) => Builder::ComponentParameter(self::ComponentParameter::from_node(n)),
16592                Node::RecordDeclaration(n) => Builder::RecordDeclaration(self::RecordDeclaration::from_node(n)),
16593                Node::RecordDeclarationImplements(n) => Builder::RecordDeclarationImplements(self::RecordDeclarationImplements::from_node(n)),
16594                Node::RecordDeclarationBody(n) => Builder::RecordDeclarationBody(self::RecordDeclarationBody::from_node(n)),
16595                Node::RecordDeclarationProperty(n) => Builder::RecordDeclarationProperty(self::RecordDeclarationProperty::from_node(n)),
16596                Node::RecordDeclarationStaticProperty(n) => Builder::RecordDeclarationStaticProperty(self::RecordDeclarationStaticProperty::from_node(n)),
16597                Node::RecordExpression(n) => Builder::RecordExpression(self::RecordExpression::from_node(n)),
16598                Node::RecordExpressionProperties(n) => Builder::RecordExpressionProperties(self::RecordExpressionProperties::from_node(n)),
16599                Node::TSTypeAnnotation(n) => Builder::TSTypeAnnotation(self::TSTypeAnnotation::from_node(n)),
16600                Node::TSAnyKeyword(n) => Builder::TSAnyKeyword(self::TSAnyKeyword::from_node(n)),
16601                Node::TSNumberKeyword(n) => Builder::TSNumberKeyword(self::TSNumberKeyword::from_node(n)),
16602                Node::TSBooleanKeyword(n) => Builder::TSBooleanKeyword(self::TSBooleanKeyword::from_node(n)),
16603                Node::TSStringKeyword(n) => Builder::TSStringKeyword(self::TSStringKeyword::from_node(n)),
16604                Node::TSSymbolKeyword(n) => Builder::TSSymbolKeyword(self::TSSymbolKeyword::from_node(n)),
16605                Node::TSVoidKeyword(n) => Builder::TSVoidKeyword(self::TSVoidKeyword::from_node(n)),
16606                Node::TSUndefinedKeyword(n) => Builder::TSUndefinedKeyword(self::TSUndefinedKeyword::from_node(n)),
16607                Node::TSUnknownKeyword(n) => Builder::TSUnknownKeyword(self::TSUnknownKeyword::from_node(n)),
16608                Node::TSNeverKeyword(n) => Builder::TSNeverKeyword(self::TSNeverKeyword::from_node(n)),
16609                Node::TSBigIntKeyword(n) => Builder::TSBigIntKeyword(self::TSBigIntKeyword::from_node(n)),
16610                Node::TSThisType(n) => Builder::TSThisType(self::TSThisType::from_node(n)),
16611                Node::TSLiteralType(n) => Builder::TSLiteralType(self::TSLiteralType::from_node(n)),
16612                Node::TSIndexedAccessType(n) => Builder::TSIndexedAccessType(self::TSIndexedAccessType::from_node(n)),
16613                Node::TSArrayType(n) => Builder::TSArrayType(self::TSArrayType::from_node(n)),
16614                Node::TSTypeReference(n) => Builder::TSTypeReference(self::TSTypeReference::from_node(n)),
16615                Node::TSQualifiedName(n) => Builder::TSQualifiedName(self::TSQualifiedName::from_node(n)),
16616                Node::TSFunctionType(n) => Builder::TSFunctionType(self::TSFunctionType::from_node(n)),
16617                Node::TSConstructorType(n) => Builder::TSConstructorType(self::TSConstructorType::from_node(n)),
16618                Node::TSTypePredicate(n) => Builder::TSTypePredicate(self::TSTypePredicate::from_node(n)),
16619                Node::TSTupleType(n) => Builder::TSTupleType(self::TSTupleType::from_node(n)),
16620                Node::TSTypeAssertion(n) => Builder::TSTypeAssertion(self::TSTypeAssertion::from_node(n)),
16621                Node::TSAsExpression(n) => Builder::TSAsExpression(self::TSAsExpression::from_node(n)),
16622                Node::TSParameterProperty(n) => Builder::TSParameterProperty(self::TSParameterProperty::from_node(n)),
16623                Node::TSTypeAliasDeclaration(n) => Builder::TSTypeAliasDeclaration(self::TSTypeAliasDeclaration::from_node(n)),
16624                Node::TSInterfaceDeclaration(n) => Builder::TSInterfaceDeclaration(self::TSInterfaceDeclaration::from_node(n)),
16625                Node::TSInterfaceHeritage(n) => Builder::TSInterfaceHeritage(self::TSInterfaceHeritage::from_node(n)),
16626                Node::TSInterfaceBody(n) => Builder::TSInterfaceBody(self::TSInterfaceBody::from_node(n)),
16627                Node::TSEnumDeclaration(n) => Builder::TSEnumDeclaration(self::TSEnumDeclaration::from_node(n)),
16628                Node::TSEnumMember(n) => Builder::TSEnumMember(self::TSEnumMember::from_node(n)),
16629                Node::TSModuleDeclaration(n) => Builder::TSModuleDeclaration(self::TSModuleDeclaration::from_node(n)),
16630                Node::TSModuleBlock(n) => Builder::TSModuleBlock(self::TSModuleBlock::from_node(n)),
16631                Node::TSModuleMember(n) => Builder::TSModuleMember(self::TSModuleMember::from_node(n)),
16632                Node::TSTypeParameterDeclaration(n) => Builder::TSTypeParameterDeclaration(self::TSTypeParameterDeclaration::from_node(n)),
16633                Node::TSTypeParameter(n) => Builder::TSTypeParameter(self::TSTypeParameter::from_node(n)),
16634                Node::TSTypeParameterInstantiation(n) => Builder::TSTypeParameterInstantiation(self::TSTypeParameterInstantiation::from_node(n)),
16635                Node::TSUnionType(n) => Builder::TSUnionType(self::TSUnionType::from_node(n)),
16636                Node::TSIntersectionType(n) => Builder::TSIntersectionType(self::TSIntersectionType::from_node(n)),
16637                Node::TSTypeQuery(n) => Builder::TSTypeQuery(self::TSTypeQuery::from_node(n)),
16638                Node::TSConditionalType(n) => Builder::TSConditionalType(self::TSConditionalType::from_node(n)),
16639                Node::TSTypeLiteral(n) => Builder::TSTypeLiteral(self::TSTypeLiteral::from_node(n)),
16640                Node::TSPropertySignature(n) => Builder::TSPropertySignature(self::TSPropertySignature::from_node(n)),
16641                Node::TSMethodSignature(n) => Builder::TSMethodSignature(self::TSMethodSignature::from_node(n)),
16642                Node::TSIndexSignature(n) => Builder::TSIndexSignature(self::TSIndexSignature::from_node(n)),
16643                Node::TSCallSignatureDeclaration(n) => Builder::TSCallSignatureDeclaration(self::TSCallSignatureDeclaration::from_node(n)),
16644                Node::TSModifiers(n) => Builder::TSModifiers(self::TSModifiers::from_node(n)),
16645                Node::CoverEmptyArgs(n) => Builder::CoverEmptyArgs(self::CoverEmptyArgs::from_node(n)),
16646                Node::CoverTrailingComma(n) => Builder::CoverTrailingComma(self::CoverTrailingComma::from_node(n)),
16647                Node::CoverInitializer(n) => Builder::CoverInitializer(self::CoverInitializer::from_node(n)),
16648                Node::CoverRestElement(n) => Builder::CoverRestElement(self::CoverRestElement::from_node(n)),
16649                Node::CoverTypedIdentifier(n) => Builder::CoverTypedIdentifier(self::CoverTypedIdentifier::from_node(n)),
16650                Node::SHBuiltin(n) => Builder::SHBuiltin(self::SHBuiltin::from_node(n)),
16651                Node::ImplicitCheckedCast(n) => Builder::ImplicitCheckedCast(self::ImplicitCheckedCast::from_node(n)),
16652            }
16653        }
16654    }
16655
16656    /// Clone-with-changes builder for [`super::Empty`].
16657    #[derive(Debug)]
16658    pub struct Empty<'gc> {
16659        is_changed: bool,
16660        pub(super) inner: super::Empty<'gc>,
16661    }
16662    impl<'gc> Empty<'gc> {
16663        /// Start from a copy of `node`, with no field changed yet.
16664        pub fn from_node(node: &'gc super::Empty<'gc>) -> Self {
16665            Self {
16666                is_changed: false,
16667                inner: super::Empty {
16668                    metadata: node.metadata.duplicate(),
16669                },
16670            }
16671        }
16672        /// Allocate the rebuilt node if a setter ran, else
16673        /// `TransformResult::Unchanged`.
16674        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
16675            if self.is_changed {
16676                TransformResult::Changed(self.build_forced(gc))
16677            } else {
16678                TransformResult::Unchanged
16679            }
16680        }
16681        /// Allocate the node unconditionally, changed or not.
16682        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
16683            gc.alloc(Node::Empty(self.inner))
16684        }
16685    }
16686    /// Clone-with-changes builder for [`super::Metadata`].
16687    #[derive(Debug)]
16688    pub struct Metadata<'gc> {
16689        is_changed: bool,
16690        pub(super) inner: super::Metadata<'gc>,
16691    }
16692    impl<'gc> Metadata<'gc> {
16693        /// Start from a copy of `node`, with no field changed yet.
16694        pub fn from_node(node: &'gc super::Metadata<'gc>) -> Self {
16695            Self {
16696                is_changed: false,
16697                inner: super::Metadata {
16698                    metadata: node.metadata.duplicate(),
16699                },
16700            }
16701        }
16702        /// Allocate the rebuilt node if a setter ran, else
16703        /// `TransformResult::Unchanged`.
16704        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
16705            if self.is_changed {
16706                TransformResult::Changed(self.build_forced(gc))
16707            } else {
16708                TransformResult::Unchanged
16709            }
16710        }
16711        /// Allocate the node unconditionally, changed or not.
16712        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
16713            gc.alloc(Node::Metadata(self.inner))
16714        }
16715    }
16716    /// Clone-with-changes builder for [`super::Program`].
16717    #[derive(Debug)]
16718    pub struct Program<'gc> {
16719        is_changed: bool,
16720        pub(super) inner: super::Program<'gc>,
16721    }
16722    impl<'gc> Program<'gc> {
16723        /// Start from a copy of `node`, with no field changed yet.
16724        pub fn from_node(node: &'gc super::Program<'gc>) -> Self {
16725            Self {
16726                is_changed: false,
16727                inner: super::Program {
16728                    metadata: node.metadata.duplicate(),
16729                    body: node.body.duplicate(),
16730                    scope: Cell::new(node.scope.get()),
16731                    sem_info: Cell::new(node.sem_info.get()),
16732                    strictness: Cell::new(node.strictness.get()),
16733                    is_method_definition: Cell::new(node.is_method_definition.get()),
16734                    decorations: Cell::new(node.decorations.get()),
16735                    dummy_param_list: Cell::new(node.dummy_param_list.get()),
16736                },
16737            }
16738        }
16739        /// Allocate the rebuilt node if a setter ran, else
16740        /// `TransformResult::Unchanged`.
16741        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
16742            if self.is_changed {
16743                TransformResult::Changed(self.build_forced(gc))
16744            } else {
16745                TransformResult::Unchanged
16746            }
16747        }
16748        /// Allocate the node unconditionally, changed or not.
16749        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
16750            gc.alloc(Node::Program(self.inner))
16751        }
16752        /// Set the `body` field and mark the builder changed.
16753        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
16754    }
16755    /// Clone-with-changes builder for [`super::FunctionExpression`].
16756    #[derive(Debug)]
16757    pub struct FunctionExpression<'gc> {
16758        is_changed: bool,
16759        pub(super) inner: super::FunctionExpression<'gc>,
16760    }
16761    impl<'gc> FunctionExpression<'gc> {
16762        /// Start from a copy of `node`, with no field changed yet.
16763        pub fn from_node(node: &'gc super::FunctionExpression<'gc>) -> Self {
16764            Self {
16765                is_changed: false,
16766                inner: super::FunctionExpression {
16767                    metadata: node.metadata.duplicate(),
16768                    id: node.id.duplicate(),
16769                    params: node.params.duplicate(),
16770                    body: node.body.duplicate(),
16771                    type_parameters: node.type_parameters.duplicate(),
16772                    return_type: node.return_type.duplicate(),
16773                    predicate: node.predicate.duplicate(),
16774                    generator: Cell::new(node.generator.get()),
16775                    r#async: Cell::new(node.r#async.get()),
16776                    scope: Cell::new(node.scope.get()),
16777                    sem_info: Cell::new(node.sem_info.get()),
16778                    strictness: Cell::new(node.strictness.get()),
16779                    is_method_definition: Cell::new(node.is_method_definition.get()),
16780                    decorations: Cell::new(node.decorations.get()),
16781                },
16782            }
16783        }
16784        /// Allocate the rebuilt node if a setter ran, else
16785        /// `TransformResult::Unchanged`.
16786        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
16787            if self.is_changed {
16788                TransformResult::Changed(self.build_forced(gc))
16789            } else {
16790                TransformResult::Unchanged
16791            }
16792        }
16793        /// Allocate the node unconditionally, changed or not.
16794        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
16795            gc.alloc(Node::FunctionExpression(self.inner))
16796        }
16797        /// Set the `id` field and mark the builder changed.
16798        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
16799        /// Set the `params` field and mark the builder changed.
16800        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
16801        /// Set the `body` field and mark the builder changed.
16802        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
16803        /// Set the `type_parameters` field and mark the builder changed.
16804        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
16805        /// Set the `return_type` field and mark the builder changed.
16806        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
16807        /// Set the `predicate` field and mark the builder changed.
16808        pub fn predicate(&mut self, predicate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.predicate = predicate; }
16809    }
16810    /// Clone-with-changes builder for [`super::ArrowFunctionExpression`].
16811    #[derive(Debug)]
16812    pub struct ArrowFunctionExpression<'gc> {
16813        is_changed: bool,
16814        pub(super) inner: super::ArrowFunctionExpression<'gc>,
16815    }
16816    impl<'gc> ArrowFunctionExpression<'gc> {
16817        /// Start from a copy of `node`, with no field changed yet.
16818        pub fn from_node(node: &'gc super::ArrowFunctionExpression<'gc>) -> Self {
16819            Self {
16820                is_changed: false,
16821                inner: super::ArrowFunctionExpression {
16822                    metadata: node.metadata.duplicate(),
16823                    params: node.params.duplicate(),
16824                    body: node.body.duplicate(),
16825                    type_parameters: node.type_parameters.duplicate(),
16826                    return_type: node.return_type.duplicate(),
16827                    predicate: node.predicate.duplicate(),
16828                    expression: Cell::new(node.expression.get()),
16829                    r#async: Cell::new(node.r#async.get()),
16830                    scope: Cell::new(node.scope.get()),
16831                    sem_info: Cell::new(node.sem_info.get()),
16832                    strictness: Cell::new(node.strictness.get()),
16833                    is_method_definition: Cell::new(node.is_method_definition.get()),
16834                    decorations: Cell::new(node.decorations.get()),
16835                },
16836            }
16837        }
16838        /// Allocate the rebuilt node if a setter ran, else
16839        /// `TransformResult::Unchanged`.
16840        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
16841            if self.is_changed {
16842                TransformResult::Changed(self.build_forced(gc))
16843            } else {
16844                TransformResult::Unchanged
16845            }
16846        }
16847        /// Allocate the node unconditionally, changed or not.
16848        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
16849            gc.alloc(Node::ArrowFunctionExpression(self.inner))
16850        }
16851        /// Set the `params` field and mark the builder changed.
16852        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
16853        /// Set the `body` field and mark the builder changed.
16854        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
16855        /// Set the `type_parameters` field and mark the builder changed.
16856        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
16857        /// Set the `return_type` field and mark the builder changed.
16858        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
16859        /// Set the `predicate` field and mark the builder changed.
16860        pub fn predicate(&mut self, predicate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.predicate = predicate; }
16861    }
16862    /// Clone-with-changes builder for [`super::FunctionDeclaration`].
16863    #[derive(Debug)]
16864    pub struct FunctionDeclaration<'gc> {
16865        is_changed: bool,
16866        pub(super) inner: super::FunctionDeclaration<'gc>,
16867    }
16868    impl<'gc> FunctionDeclaration<'gc> {
16869        /// Start from a copy of `node`, with no field changed yet.
16870        pub fn from_node(node: &'gc super::FunctionDeclaration<'gc>) -> Self {
16871            Self {
16872                is_changed: false,
16873                inner: super::FunctionDeclaration {
16874                    metadata: node.metadata.duplicate(),
16875                    id: node.id.duplicate(),
16876                    params: node.params.duplicate(),
16877                    body: node.body.duplicate(),
16878                    type_parameters: node.type_parameters.duplicate(),
16879                    return_type: node.return_type.duplicate(),
16880                    predicate: node.predicate.duplicate(),
16881                    generator: Cell::new(node.generator.get()),
16882                    r#async: Cell::new(node.r#async.get()),
16883                    scope: Cell::new(node.scope.get()),
16884                    sem_info: Cell::new(node.sem_info.get()),
16885                    strictness: Cell::new(node.strictness.get()),
16886                    is_method_definition: Cell::new(node.is_method_definition.get()),
16887                    decorations: Cell::new(node.decorations.get()),
16888                },
16889            }
16890        }
16891        /// Allocate the rebuilt node if a setter ran, else
16892        /// `TransformResult::Unchanged`.
16893        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
16894            if self.is_changed {
16895                TransformResult::Changed(self.build_forced(gc))
16896            } else {
16897                TransformResult::Unchanged
16898            }
16899        }
16900        /// Allocate the node unconditionally, changed or not.
16901        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
16902            gc.alloc(Node::FunctionDeclaration(self.inner))
16903        }
16904        /// Set the `id` field and mark the builder changed.
16905        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
16906        /// Set the `params` field and mark the builder changed.
16907        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
16908        /// Set the `body` field and mark the builder changed.
16909        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
16910        /// Set the `type_parameters` field and mark the builder changed.
16911        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
16912        /// Set the `return_type` field and mark the builder changed.
16913        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
16914        /// Set the `predicate` field and mark the builder changed.
16915        pub fn predicate(&mut self, predicate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.predicate = predicate; }
16916    }
16917    /// Clone-with-changes builder for [`super::ComponentDeclaration`].
16918    #[derive(Debug)]
16919    pub struct ComponentDeclaration<'gc> {
16920        is_changed: bool,
16921        pub(super) inner: super::ComponentDeclaration<'gc>,
16922    }
16923    impl<'gc> ComponentDeclaration<'gc> {
16924        /// Start from a copy of `node`, with no field changed yet.
16925        pub fn from_node(node: &'gc super::ComponentDeclaration<'gc>) -> Self {
16926            Self {
16927                is_changed: false,
16928                inner: super::ComponentDeclaration {
16929                    metadata: node.metadata.duplicate(),
16930                    id: node.id.duplicate(),
16931                    params: node.params.duplicate(),
16932                    body: node.body.duplicate(),
16933                    type_parameters: node.type_parameters.duplicate(),
16934                    renders_type: node.renders_type.duplicate(),
16935                    r#async: Cell::new(node.r#async.get()),
16936                    scope: Cell::new(node.scope.get()),
16937                    sem_info: Cell::new(node.sem_info.get()),
16938                    strictness: Cell::new(node.strictness.get()),
16939                    is_method_definition: Cell::new(node.is_method_definition.get()),
16940                    decorations: Cell::new(node.decorations.get()),
16941                },
16942            }
16943        }
16944        /// Allocate the rebuilt node if a setter ran, else
16945        /// `TransformResult::Unchanged`.
16946        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
16947            if self.is_changed {
16948                TransformResult::Changed(self.build_forced(gc))
16949            } else {
16950                TransformResult::Unchanged
16951            }
16952        }
16953        /// Allocate the node unconditionally, changed or not.
16954        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
16955            gc.alloc(Node::ComponentDeclaration(self.inner))
16956        }
16957        /// Set the `id` field and mark the builder changed.
16958        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
16959        /// Set the `params` field and mark the builder changed.
16960        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
16961        /// Set the `body` field and mark the builder changed.
16962        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
16963        /// Set the `type_parameters` field and mark the builder changed.
16964        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
16965        /// Set the `renders_type` field and mark the builder changed.
16966        pub fn renders_type(&mut self, renders_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.renders_type = renders_type; }
16967    }
16968    /// Clone-with-changes builder for [`super::HookDeclaration`].
16969    #[derive(Debug)]
16970    pub struct HookDeclaration<'gc> {
16971        is_changed: bool,
16972        pub(super) inner: super::HookDeclaration<'gc>,
16973    }
16974    impl<'gc> HookDeclaration<'gc> {
16975        /// Start from a copy of `node`, with no field changed yet.
16976        pub fn from_node(node: &'gc super::HookDeclaration<'gc>) -> Self {
16977            Self {
16978                is_changed: false,
16979                inner: super::HookDeclaration {
16980                    metadata: node.metadata.duplicate(),
16981                    id: node.id.duplicate(),
16982                    params: node.params.duplicate(),
16983                    body: node.body.duplicate(),
16984                    type_parameters: node.type_parameters.duplicate(),
16985                    return_type: node.return_type.duplicate(),
16986                    r#async: Cell::new(node.r#async.get()),
16987                    scope: Cell::new(node.scope.get()),
16988                    sem_info: Cell::new(node.sem_info.get()),
16989                    strictness: Cell::new(node.strictness.get()),
16990                    is_method_definition: Cell::new(node.is_method_definition.get()),
16991                    decorations: Cell::new(node.decorations.get()),
16992                },
16993            }
16994        }
16995        /// Allocate the rebuilt node if a setter ran, else
16996        /// `TransformResult::Unchanged`.
16997        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
16998            if self.is_changed {
16999                TransformResult::Changed(self.build_forced(gc))
17000            } else {
17001                TransformResult::Unchanged
17002            }
17003        }
17004        /// Allocate the node unconditionally, changed or not.
17005        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17006            gc.alloc(Node::HookDeclaration(self.inner))
17007        }
17008        /// Set the `id` field and mark the builder changed.
17009        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
17010        /// Set the `params` field and mark the builder changed.
17011        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
17012        /// Set the `body` field and mark the builder changed.
17013        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
17014        /// Set the `type_parameters` field and mark the builder changed.
17015        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
17016        /// Set the `return_type` field and mark the builder changed.
17017        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
17018    }
17019    /// Clone-with-changes builder for [`super::MatchStatement`].
17020    #[derive(Debug)]
17021    pub struct MatchStatement<'gc> {
17022        is_changed: bool,
17023        pub(super) inner: super::MatchStatement<'gc>,
17024    }
17025    impl<'gc> MatchStatement<'gc> {
17026        /// Start from a copy of `node`, with no field changed yet.
17027        pub fn from_node(node: &'gc super::MatchStatement<'gc>) -> Self {
17028            Self {
17029                is_changed: false,
17030                inner: super::MatchStatement {
17031                    metadata: node.metadata.duplicate(),
17032                    argument: node.argument.duplicate(),
17033                    cases: node.cases.duplicate(),
17034                },
17035            }
17036        }
17037        /// Allocate the rebuilt node if a setter ran, else
17038        /// `TransformResult::Unchanged`.
17039        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17040            if self.is_changed {
17041                TransformResult::Changed(self.build_forced(gc))
17042            } else {
17043                TransformResult::Unchanged
17044            }
17045        }
17046        /// Allocate the node unconditionally, changed or not.
17047        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17048            gc.alloc(Node::MatchStatement(self.inner))
17049        }
17050        /// Set the `argument` field and mark the builder changed.
17051        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
17052        /// Set the `cases` field and mark the builder changed.
17053        pub fn cases(&mut self, cases: NodeList<'gc>) { self.is_changed = true; self.inner.cases = cases; }
17054    }
17055    /// Clone-with-changes builder for [`super::WhileStatement`].
17056    #[derive(Debug)]
17057    pub struct WhileStatement<'gc> {
17058        is_changed: bool,
17059        pub(super) inner: super::WhileStatement<'gc>,
17060    }
17061    impl<'gc> WhileStatement<'gc> {
17062        /// Start from a copy of `node`, with no field changed yet.
17063        pub fn from_node(node: &'gc super::WhileStatement<'gc>) -> Self {
17064            Self {
17065                is_changed: false,
17066                inner: super::WhileStatement {
17067                    metadata: node.metadata.duplicate(),
17068                    body: node.body.duplicate(),
17069                    test: node.test.duplicate(),
17070                    label_index: Cell::new(node.label_index.get()),
17071                },
17072            }
17073        }
17074        /// Allocate the rebuilt node if a setter ran, else
17075        /// `TransformResult::Unchanged`.
17076        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17077            if self.is_changed {
17078                TransformResult::Changed(self.build_forced(gc))
17079            } else {
17080                TransformResult::Unchanged
17081            }
17082        }
17083        /// Allocate the node unconditionally, changed or not.
17084        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17085            gc.alloc(Node::WhileStatement(self.inner))
17086        }
17087        /// Set the `body` field and mark the builder changed.
17088        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
17089        /// Set the `test` field and mark the builder changed.
17090        pub fn test(&mut self, test: &'gc Node<'gc>) { self.is_changed = true; self.inner.test = test; }
17091    }
17092    /// Clone-with-changes builder for [`super::DoWhileStatement`].
17093    #[derive(Debug)]
17094    pub struct DoWhileStatement<'gc> {
17095        is_changed: bool,
17096        pub(super) inner: super::DoWhileStatement<'gc>,
17097    }
17098    impl<'gc> DoWhileStatement<'gc> {
17099        /// Start from a copy of `node`, with no field changed yet.
17100        pub fn from_node(node: &'gc super::DoWhileStatement<'gc>) -> Self {
17101            Self {
17102                is_changed: false,
17103                inner: super::DoWhileStatement {
17104                    metadata: node.metadata.duplicate(),
17105                    body: node.body.duplicate(),
17106                    test: node.test.duplicate(),
17107                    label_index: Cell::new(node.label_index.get()),
17108                },
17109            }
17110        }
17111        /// Allocate the rebuilt node if a setter ran, else
17112        /// `TransformResult::Unchanged`.
17113        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17114            if self.is_changed {
17115                TransformResult::Changed(self.build_forced(gc))
17116            } else {
17117                TransformResult::Unchanged
17118            }
17119        }
17120        /// Allocate the node unconditionally, changed or not.
17121        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17122            gc.alloc(Node::DoWhileStatement(self.inner))
17123        }
17124        /// Set the `body` field and mark the builder changed.
17125        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
17126        /// Set the `test` field and mark the builder changed.
17127        pub fn test(&mut self, test: &'gc Node<'gc>) { self.is_changed = true; self.inner.test = test; }
17128    }
17129    /// Clone-with-changes builder for [`super::ForInStatement`].
17130    #[derive(Debug)]
17131    pub struct ForInStatement<'gc> {
17132        is_changed: bool,
17133        pub(super) inner: super::ForInStatement<'gc>,
17134    }
17135    impl<'gc> ForInStatement<'gc> {
17136        /// Start from a copy of `node`, with no field changed yet.
17137        pub fn from_node(node: &'gc super::ForInStatement<'gc>) -> Self {
17138            Self {
17139                is_changed: false,
17140                inner: super::ForInStatement {
17141                    metadata: node.metadata.duplicate(),
17142                    left: node.left.duplicate(),
17143                    right: node.right.duplicate(),
17144                    body: node.body.duplicate(),
17145                    label_index: Cell::new(node.label_index.get()),
17146                    scope: Cell::new(node.scope.get()),
17147                },
17148            }
17149        }
17150        /// Allocate the rebuilt node if a setter ran, else
17151        /// `TransformResult::Unchanged`.
17152        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17153            if self.is_changed {
17154                TransformResult::Changed(self.build_forced(gc))
17155            } else {
17156                TransformResult::Unchanged
17157            }
17158        }
17159        /// Allocate the node unconditionally, changed or not.
17160        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17161            gc.alloc(Node::ForInStatement(self.inner))
17162        }
17163        /// Set the `left` field and mark the builder changed.
17164        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
17165        /// Set the `right` field and mark the builder changed.
17166        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
17167        /// Set the `body` field and mark the builder changed.
17168        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
17169    }
17170    /// Clone-with-changes builder for [`super::ForOfStatement`].
17171    #[derive(Debug)]
17172    pub struct ForOfStatement<'gc> {
17173        is_changed: bool,
17174        pub(super) inner: super::ForOfStatement<'gc>,
17175    }
17176    impl<'gc> ForOfStatement<'gc> {
17177        /// Start from a copy of `node`, with no field changed yet.
17178        pub fn from_node(node: &'gc super::ForOfStatement<'gc>) -> Self {
17179            Self {
17180                is_changed: false,
17181                inner: super::ForOfStatement {
17182                    metadata: node.metadata.duplicate(),
17183                    left: node.left.duplicate(),
17184                    right: node.right.duplicate(),
17185                    body: node.body.duplicate(),
17186                    r#await: Cell::new(node.r#await.get()),
17187                    label_index: Cell::new(node.label_index.get()),
17188                    scope: Cell::new(node.scope.get()),
17189                },
17190            }
17191        }
17192        /// Allocate the rebuilt node if a setter ran, else
17193        /// `TransformResult::Unchanged`.
17194        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17195            if self.is_changed {
17196                TransformResult::Changed(self.build_forced(gc))
17197            } else {
17198                TransformResult::Unchanged
17199            }
17200        }
17201        /// Allocate the node unconditionally, changed or not.
17202        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17203            gc.alloc(Node::ForOfStatement(self.inner))
17204        }
17205        /// Set the `left` field and mark the builder changed.
17206        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
17207        /// Set the `right` field and mark the builder changed.
17208        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
17209        /// Set the `body` field and mark the builder changed.
17210        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
17211    }
17212    /// Clone-with-changes builder for [`super::ForStatement`].
17213    #[derive(Debug)]
17214    pub struct ForStatement<'gc> {
17215        is_changed: bool,
17216        pub(super) inner: super::ForStatement<'gc>,
17217    }
17218    impl<'gc> ForStatement<'gc> {
17219        /// Start from a copy of `node`, with no field changed yet.
17220        pub fn from_node(node: &'gc super::ForStatement<'gc>) -> Self {
17221            Self {
17222                is_changed: false,
17223                inner: super::ForStatement {
17224                    metadata: node.metadata.duplicate(),
17225                    init: node.init.duplicate(),
17226                    test: node.test.duplicate(),
17227                    update: node.update.duplicate(),
17228                    body: node.body.duplicate(),
17229                    label_index: Cell::new(node.label_index.get()),
17230                    scope: Cell::new(node.scope.get()),
17231                },
17232            }
17233        }
17234        /// Allocate the rebuilt node if a setter ran, else
17235        /// `TransformResult::Unchanged`.
17236        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17237            if self.is_changed {
17238                TransformResult::Changed(self.build_forced(gc))
17239            } else {
17240                TransformResult::Unchanged
17241            }
17242        }
17243        /// Allocate the node unconditionally, changed or not.
17244        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17245            gc.alloc(Node::ForStatement(self.inner))
17246        }
17247        /// Set the `init` field and mark the builder changed.
17248        pub fn init(&mut self, init: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.init = init; }
17249        /// Set the `test` field and mark the builder changed.
17250        pub fn test(&mut self, test: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.test = test; }
17251        /// Set the `update` field and mark the builder changed.
17252        pub fn update(&mut self, update: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.update = update; }
17253        /// Set the `body` field and mark the builder changed.
17254        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
17255    }
17256    /// Clone-with-changes builder for [`super::DebuggerStatement`].
17257    #[derive(Debug)]
17258    pub struct DebuggerStatement<'gc> {
17259        is_changed: bool,
17260        pub(super) inner: super::DebuggerStatement<'gc>,
17261    }
17262    impl<'gc> DebuggerStatement<'gc> {
17263        /// Start from a copy of `node`, with no field changed yet.
17264        pub fn from_node(node: &'gc super::DebuggerStatement<'gc>) -> Self {
17265            Self {
17266                is_changed: false,
17267                inner: super::DebuggerStatement {
17268                    metadata: node.metadata.duplicate(),
17269                },
17270            }
17271        }
17272        /// Allocate the rebuilt node if a setter ran, else
17273        /// `TransformResult::Unchanged`.
17274        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17275            if self.is_changed {
17276                TransformResult::Changed(self.build_forced(gc))
17277            } else {
17278                TransformResult::Unchanged
17279            }
17280        }
17281        /// Allocate the node unconditionally, changed or not.
17282        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17283            gc.alloc(Node::DebuggerStatement(self.inner))
17284        }
17285    }
17286    /// Clone-with-changes builder for [`super::EmptyStatement`].
17287    #[derive(Debug)]
17288    pub struct EmptyStatement<'gc> {
17289        is_changed: bool,
17290        pub(super) inner: super::EmptyStatement<'gc>,
17291    }
17292    impl<'gc> EmptyStatement<'gc> {
17293        /// Start from a copy of `node`, with no field changed yet.
17294        pub fn from_node(node: &'gc super::EmptyStatement<'gc>) -> Self {
17295            Self {
17296                is_changed: false,
17297                inner: super::EmptyStatement {
17298                    metadata: node.metadata.duplicate(),
17299                },
17300            }
17301        }
17302        /// Allocate the rebuilt node if a setter ran, else
17303        /// `TransformResult::Unchanged`.
17304        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17305            if self.is_changed {
17306                TransformResult::Changed(self.build_forced(gc))
17307            } else {
17308                TransformResult::Unchanged
17309            }
17310        }
17311        /// Allocate the node unconditionally, changed or not.
17312        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17313            gc.alloc(Node::EmptyStatement(self.inner))
17314        }
17315    }
17316    /// Clone-with-changes builder for [`super::BlockStatement`].
17317    #[derive(Debug)]
17318    pub struct BlockStatement<'gc> {
17319        is_changed: bool,
17320        pub(super) inner: super::BlockStatement<'gc>,
17321    }
17322    impl<'gc> BlockStatement<'gc> {
17323        /// Start from a copy of `node`, with no field changed yet.
17324        pub fn from_node(node: &'gc super::BlockStatement<'gc>) -> Self {
17325            Self {
17326                is_changed: false,
17327                inner: super::BlockStatement {
17328                    metadata: node.metadata.duplicate(),
17329                    body: node.body.duplicate(),
17330                    implicit: Cell::new(node.implicit.get()),
17331                    scope: Cell::new(node.scope.get()),
17332                    buffer_id: Cell::new(node.buffer_id.get()),
17333                    is_lazy_function_body: Cell::new(node.is_lazy_function_body.get()),
17334                    param_yield: Cell::new(node.param_yield.get()),
17335                    param_await: Cell::new(node.param_await.get()),
17336                    contains_arrow_functions: Cell::new(node.contains_arrow_functions.get()),
17337                    may_contain_arrow_functions_using_arguments: Cell::new(node.may_contain_arrow_functions_using_arguments.get()),
17338                },
17339            }
17340        }
17341        /// Allocate the rebuilt node if a setter ran, else
17342        /// `TransformResult::Unchanged`.
17343        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17344            if self.is_changed {
17345                TransformResult::Changed(self.build_forced(gc))
17346            } else {
17347                TransformResult::Unchanged
17348            }
17349        }
17350        /// Allocate the node unconditionally, changed or not.
17351        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17352            gc.alloc(Node::BlockStatement(self.inner))
17353        }
17354        /// Set the `body` field and mark the builder changed.
17355        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
17356    }
17357    /// Clone-with-changes builder for [`super::StaticBlock`].
17358    #[derive(Debug)]
17359    pub struct StaticBlock<'gc> {
17360        is_changed: bool,
17361        pub(super) inner: super::StaticBlock<'gc>,
17362    }
17363    impl<'gc> StaticBlock<'gc> {
17364        /// Start from a copy of `node`, with no field changed yet.
17365        pub fn from_node(node: &'gc super::StaticBlock<'gc>) -> Self {
17366            Self {
17367                is_changed: false,
17368                inner: super::StaticBlock {
17369                    metadata: node.metadata.duplicate(),
17370                    body: node.body.duplicate(),
17371                    scope: Cell::new(node.scope.get()),
17372                    function_info: Cell::new(node.function_info.get()),
17373                },
17374            }
17375        }
17376        /// Allocate the rebuilt node if a setter ran, else
17377        /// `TransformResult::Unchanged`.
17378        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17379            if self.is_changed {
17380                TransformResult::Changed(self.build_forced(gc))
17381            } else {
17382                TransformResult::Unchanged
17383            }
17384        }
17385        /// Allocate the node unconditionally, changed or not.
17386        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17387            gc.alloc(Node::StaticBlock(self.inner))
17388        }
17389        /// Set the `body` field and mark the builder changed.
17390        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
17391    }
17392    /// Clone-with-changes builder for [`super::BreakStatement`].
17393    #[derive(Debug)]
17394    pub struct BreakStatement<'gc> {
17395        is_changed: bool,
17396        pub(super) inner: super::BreakStatement<'gc>,
17397    }
17398    impl<'gc> BreakStatement<'gc> {
17399        /// Start from a copy of `node`, with no field changed yet.
17400        pub fn from_node(node: &'gc super::BreakStatement<'gc>) -> Self {
17401            Self {
17402                is_changed: false,
17403                inner: super::BreakStatement {
17404                    metadata: node.metadata.duplicate(),
17405                    label: node.label.duplicate(),
17406                    label_index: Cell::new(node.label_index.get()),
17407                },
17408            }
17409        }
17410        /// Allocate the rebuilt node if a setter ran, else
17411        /// `TransformResult::Unchanged`.
17412        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17413            if self.is_changed {
17414                TransformResult::Changed(self.build_forced(gc))
17415            } else {
17416                TransformResult::Unchanged
17417            }
17418        }
17419        /// Allocate the node unconditionally, changed or not.
17420        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17421            gc.alloc(Node::BreakStatement(self.inner))
17422        }
17423        /// Set the `label` field and mark the builder changed.
17424        pub fn label(&mut self, label: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.label = label; }
17425    }
17426    /// Clone-with-changes builder for [`super::ContinueStatement`].
17427    #[derive(Debug)]
17428    pub struct ContinueStatement<'gc> {
17429        is_changed: bool,
17430        pub(super) inner: super::ContinueStatement<'gc>,
17431    }
17432    impl<'gc> ContinueStatement<'gc> {
17433        /// Start from a copy of `node`, with no field changed yet.
17434        pub fn from_node(node: &'gc super::ContinueStatement<'gc>) -> Self {
17435            Self {
17436                is_changed: false,
17437                inner: super::ContinueStatement {
17438                    metadata: node.metadata.duplicate(),
17439                    label: node.label.duplicate(),
17440                    label_index: Cell::new(node.label_index.get()),
17441                },
17442            }
17443        }
17444        /// Allocate the rebuilt node if a setter ran, else
17445        /// `TransformResult::Unchanged`.
17446        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17447            if self.is_changed {
17448                TransformResult::Changed(self.build_forced(gc))
17449            } else {
17450                TransformResult::Unchanged
17451            }
17452        }
17453        /// Allocate the node unconditionally, changed or not.
17454        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17455            gc.alloc(Node::ContinueStatement(self.inner))
17456        }
17457        /// Set the `label` field and mark the builder changed.
17458        pub fn label(&mut self, label: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.label = label; }
17459    }
17460    /// Clone-with-changes builder for [`super::ThrowStatement`].
17461    #[derive(Debug)]
17462    pub struct ThrowStatement<'gc> {
17463        is_changed: bool,
17464        pub(super) inner: super::ThrowStatement<'gc>,
17465    }
17466    impl<'gc> ThrowStatement<'gc> {
17467        /// Start from a copy of `node`, with no field changed yet.
17468        pub fn from_node(node: &'gc super::ThrowStatement<'gc>) -> Self {
17469            Self {
17470                is_changed: false,
17471                inner: super::ThrowStatement {
17472                    metadata: node.metadata.duplicate(),
17473                    argument: node.argument.duplicate(),
17474                },
17475            }
17476        }
17477        /// Allocate the rebuilt node if a setter ran, else
17478        /// `TransformResult::Unchanged`.
17479        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17480            if self.is_changed {
17481                TransformResult::Changed(self.build_forced(gc))
17482            } else {
17483                TransformResult::Unchanged
17484            }
17485        }
17486        /// Allocate the node unconditionally, changed or not.
17487        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17488            gc.alloc(Node::ThrowStatement(self.inner))
17489        }
17490        /// Set the `argument` field and mark the builder changed.
17491        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
17492    }
17493    /// Clone-with-changes builder for [`super::ReturnStatement`].
17494    #[derive(Debug)]
17495    pub struct ReturnStatement<'gc> {
17496        is_changed: bool,
17497        pub(super) inner: super::ReturnStatement<'gc>,
17498    }
17499    impl<'gc> ReturnStatement<'gc> {
17500        /// Start from a copy of `node`, with no field changed yet.
17501        pub fn from_node(node: &'gc super::ReturnStatement<'gc>) -> Self {
17502            Self {
17503                is_changed: false,
17504                inner: super::ReturnStatement {
17505                    metadata: node.metadata.duplicate(),
17506                    argument: node.argument.duplicate(),
17507                },
17508            }
17509        }
17510        /// Allocate the rebuilt node if a setter ran, else
17511        /// `TransformResult::Unchanged`.
17512        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17513            if self.is_changed {
17514                TransformResult::Changed(self.build_forced(gc))
17515            } else {
17516                TransformResult::Unchanged
17517            }
17518        }
17519        /// Allocate the node unconditionally, changed or not.
17520        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17521            gc.alloc(Node::ReturnStatement(self.inner))
17522        }
17523        /// Set the `argument` field and mark the builder changed.
17524        pub fn argument(&mut self, argument: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.argument = argument; }
17525    }
17526    /// Clone-with-changes builder for [`super::WithStatement`].
17527    #[derive(Debug)]
17528    pub struct WithStatement<'gc> {
17529        is_changed: bool,
17530        pub(super) inner: super::WithStatement<'gc>,
17531    }
17532    impl<'gc> WithStatement<'gc> {
17533        /// Start from a copy of `node`, with no field changed yet.
17534        pub fn from_node(node: &'gc super::WithStatement<'gc>) -> Self {
17535            Self {
17536                is_changed: false,
17537                inner: super::WithStatement {
17538                    metadata: node.metadata.duplicate(),
17539                    object: node.object.duplicate(),
17540                    body: node.body.duplicate(),
17541                },
17542            }
17543        }
17544        /// Allocate the rebuilt node if a setter ran, else
17545        /// `TransformResult::Unchanged`.
17546        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17547            if self.is_changed {
17548                TransformResult::Changed(self.build_forced(gc))
17549            } else {
17550                TransformResult::Unchanged
17551            }
17552        }
17553        /// Allocate the node unconditionally, changed or not.
17554        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17555            gc.alloc(Node::WithStatement(self.inner))
17556        }
17557        /// Set the `object` field and mark the builder changed.
17558        pub fn object(&mut self, object: &'gc Node<'gc>) { self.is_changed = true; self.inner.object = object; }
17559        /// Set the `body` field and mark the builder changed.
17560        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
17561    }
17562    /// Clone-with-changes builder for [`super::SwitchStatement`].
17563    #[derive(Debug)]
17564    pub struct SwitchStatement<'gc> {
17565        is_changed: bool,
17566        pub(super) inner: super::SwitchStatement<'gc>,
17567    }
17568    impl<'gc> SwitchStatement<'gc> {
17569        /// Start from a copy of `node`, with no field changed yet.
17570        pub fn from_node(node: &'gc super::SwitchStatement<'gc>) -> Self {
17571            Self {
17572                is_changed: false,
17573                inner: super::SwitchStatement {
17574                    metadata: node.metadata.duplicate(),
17575                    discriminant: node.discriminant.duplicate(),
17576                    cases: node.cases.duplicate(),
17577                    label_index: Cell::new(node.label_index.get()),
17578                    scope: Cell::new(node.scope.get()),
17579                },
17580            }
17581        }
17582        /// Allocate the rebuilt node if a setter ran, else
17583        /// `TransformResult::Unchanged`.
17584        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17585            if self.is_changed {
17586                TransformResult::Changed(self.build_forced(gc))
17587            } else {
17588                TransformResult::Unchanged
17589            }
17590        }
17591        /// Allocate the node unconditionally, changed or not.
17592        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17593            gc.alloc(Node::SwitchStatement(self.inner))
17594        }
17595        /// Set the `discriminant` field and mark the builder changed.
17596        pub fn discriminant(&mut self, discriminant: &'gc Node<'gc>) { self.is_changed = true; self.inner.discriminant = discriminant; }
17597        /// Set the `cases` field and mark the builder changed.
17598        pub fn cases(&mut self, cases: NodeList<'gc>) { self.is_changed = true; self.inner.cases = cases; }
17599    }
17600    /// Clone-with-changes builder for [`super::LabeledStatement`].
17601    #[derive(Debug)]
17602    pub struct LabeledStatement<'gc> {
17603        is_changed: bool,
17604        pub(super) inner: super::LabeledStatement<'gc>,
17605    }
17606    impl<'gc> LabeledStatement<'gc> {
17607        /// Start from a copy of `node`, with no field changed yet.
17608        pub fn from_node(node: &'gc super::LabeledStatement<'gc>) -> Self {
17609            Self {
17610                is_changed: false,
17611                inner: super::LabeledStatement {
17612                    metadata: node.metadata.duplicate(),
17613                    label: node.label.duplicate(),
17614                    body: node.body.duplicate(),
17615                    label_index: Cell::new(node.label_index.get()),
17616                },
17617            }
17618        }
17619        /// Allocate the rebuilt node if a setter ran, else
17620        /// `TransformResult::Unchanged`.
17621        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17622            if self.is_changed {
17623                TransformResult::Changed(self.build_forced(gc))
17624            } else {
17625                TransformResult::Unchanged
17626            }
17627        }
17628        /// Allocate the node unconditionally, changed or not.
17629        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17630            gc.alloc(Node::LabeledStatement(self.inner))
17631        }
17632        /// Set the `label` field and mark the builder changed.
17633        pub fn label(&mut self, label: &'gc Node<'gc>) { self.is_changed = true; self.inner.label = label; }
17634        /// Set the `body` field and mark the builder changed.
17635        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
17636    }
17637    /// Clone-with-changes builder for [`super::ExpressionStatement`].
17638    #[derive(Debug)]
17639    pub struct ExpressionStatement<'gc> {
17640        is_changed: bool,
17641        pub(super) inner: super::ExpressionStatement<'gc>,
17642    }
17643    impl<'gc> ExpressionStatement<'gc> {
17644        /// Start from a copy of `node`, with no field changed yet.
17645        pub fn from_node(node: &'gc super::ExpressionStatement<'gc>) -> Self {
17646            Self {
17647                is_changed: false,
17648                inner: super::ExpressionStatement {
17649                    metadata: node.metadata.duplicate(),
17650                    expression: node.expression.duplicate(),
17651                    directive: Cell::new(node.directive.get()),
17652                },
17653            }
17654        }
17655        /// Allocate the rebuilt node if a setter ran, else
17656        /// `TransformResult::Unchanged`.
17657        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17658            if self.is_changed {
17659                TransformResult::Changed(self.build_forced(gc))
17660            } else {
17661                TransformResult::Unchanged
17662            }
17663        }
17664        /// Allocate the node unconditionally, changed or not.
17665        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17666            gc.alloc(Node::ExpressionStatement(self.inner))
17667        }
17668        /// Set the `expression` field and mark the builder changed.
17669        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
17670    }
17671    /// Clone-with-changes builder for [`super::TryStatement`].
17672    #[derive(Debug)]
17673    pub struct TryStatement<'gc> {
17674        is_changed: bool,
17675        pub(super) inner: super::TryStatement<'gc>,
17676    }
17677    impl<'gc> TryStatement<'gc> {
17678        /// Start from a copy of `node`, with no field changed yet.
17679        pub fn from_node(node: &'gc super::TryStatement<'gc>) -> Self {
17680            Self {
17681                is_changed: false,
17682                inner: super::TryStatement {
17683                    metadata: node.metadata.duplicate(),
17684                    block: node.block.duplicate(),
17685                    handler: node.handler.duplicate(),
17686                    finalizer: node.finalizer.duplicate(),
17687                },
17688            }
17689        }
17690        /// Allocate the rebuilt node if a setter ran, else
17691        /// `TransformResult::Unchanged`.
17692        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17693            if self.is_changed {
17694                TransformResult::Changed(self.build_forced(gc))
17695            } else {
17696                TransformResult::Unchanged
17697            }
17698        }
17699        /// Allocate the node unconditionally, changed or not.
17700        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17701            gc.alloc(Node::TryStatement(self.inner))
17702        }
17703        /// Set the `block` field and mark the builder changed.
17704        pub fn block(&mut self, block: &'gc Node<'gc>) { self.is_changed = true; self.inner.block = block; }
17705        /// Set the `handler` field and mark the builder changed.
17706        pub fn handler(&mut self, handler: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.handler = handler; }
17707        /// Set the `finalizer` field and mark the builder changed.
17708        pub fn finalizer(&mut self, finalizer: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.finalizer = finalizer; }
17709    }
17710    /// Clone-with-changes builder for [`super::IfStatement`].
17711    #[derive(Debug)]
17712    pub struct IfStatement<'gc> {
17713        is_changed: bool,
17714        pub(super) inner: super::IfStatement<'gc>,
17715    }
17716    impl<'gc> IfStatement<'gc> {
17717        /// Start from a copy of `node`, with no field changed yet.
17718        pub fn from_node(node: &'gc super::IfStatement<'gc>) -> Self {
17719            Self {
17720                is_changed: false,
17721                inner: super::IfStatement {
17722                    metadata: node.metadata.duplicate(),
17723                    test: node.test.duplicate(),
17724                    consequent: node.consequent.duplicate(),
17725                    alternate: node.alternate.duplicate(),
17726                },
17727            }
17728        }
17729        /// Allocate the rebuilt node if a setter ran, else
17730        /// `TransformResult::Unchanged`.
17731        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17732            if self.is_changed {
17733                TransformResult::Changed(self.build_forced(gc))
17734            } else {
17735                TransformResult::Unchanged
17736            }
17737        }
17738        /// Allocate the node unconditionally, changed or not.
17739        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17740            gc.alloc(Node::IfStatement(self.inner))
17741        }
17742        /// Set the `test` field and mark the builder changed.
17743        pub fn test(&mut self, test: &'gc Node<'gc>) { self.is_changed = true; self.inner.test = test; }
17744        /// Set the `consequent` field and mark the builder changed.
17745        pub fn consequent(&mut self, consequent: &'gc Node<'gc>) { self.is_changed = true; self.inner.consequent = consequent; }
17746        /// Set the `alternate` field and mark the builder changed.
17747        pub fn alternate(&mut self, alternate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.alternate = alternate; }
17748    }
17749    /// Clone-with-changes builder for [`super::NullLiteral`].
17750    #[derive(Debug)]
17751    pub struct NullLiteral<'gc> {
17752        is_changed: bool,
17753        pub(super) inner: super::NullLiteral<'gc>,
17754    }
17755    impl<'gc> NullLiteral<'gc> {
17756        /// Start from a copy of `node`, with no field changed yet.
17757        pub fn from_node(node: &'gc super::NullLiteral<'gc>) -> Self {
17758            Self {
17759                is_changed: false,
17760                inner: super::NullLiteral {
17761                    metadata: node.metadata.duplicate(),
17762                },
17763            }
17764        }
17765        /// Allocate the rebuilt node if a setter ran, else
17766        /// `TransformResult::Unchanged`.
17767        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17768            if self.is_changed {
17769                TransformResult::Changed(self.build_forced(gc))
17770            } else {
17771                TransformResult::Unchanged
17772            }
17773        }
17774        /// Allocate the node unconditionally, changed or not.
17775        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17776            gc.alloc(Node::NullLiteral(self.inner))
17777        }
17778    }
17779    /// Clone-with-changes builder for [`super::BooleanLiteral`].
17780    #[derive(Debug)]
17781    pub struct BooleanLiteral<'gc> {
17782        is_changed: bool,
17783        pub(super) inner: super::BooleanLiteral<'gc>,
17784    }
17785    impl<'gc> BooleanLiteral<'gc> {
17786        /// Start from a copy of `node`, with no field changed yet.
17787        pub fn from_node(node: &'gc super::BooleanLiteral<'gc>) -> Self {
17788            Self {
17789                is_changed: false,
17790                inner: super::BooleanLiteral {
17791                    metadata: node.metadata.duplicate(),
17792                    value: Cell::new(node.value.get()),
17793                },
17794            }
17795        }
17796        /// Allocate the rebuilt node if a setter ran, else
17797        /// `TransformResult::Unchanged`.
17798        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17799            if self.is_changed {
17800                TransformResult::Changed(self.build_forced(gc))
17801            } else {
17802                TransformResult::Unchanged
17803            }
17804        }
17805        /// Allocate the node unconditionally, changed or not.
17806        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17807            gc.alloc(Node::BooleanLiteral(self.inner))
17808        }
17809    }
17810    /// Clone-with-changes builder for [`super::StringLiteral`].
17811    #[derive(Debug)]
17812    pub struct StringLiteral<'gc> {
17813        is_changed: bool,
17814        pub(super) inner: super::StringLiteral<'gc>,
17815    }
17816    impl<'gc> StringLiteral<'gc> {
17817        /// Start from a copy of `node`, with no field changed yet.
17818        pub fn from_node(node: &'gc super::StringLiteral<'gc>) -> Self {
17819            Self {
17820                is_changed: false,
17821                inner: super::StringLiteral {
17822                    metadata: node.metadata.duplicate(),
17823                    value: Cell::new(node.value.get()),
17824                },
17825            }
17826        }
17827        /// Allocate the rebuilt node if a setter ran, else
17828        /// `TransformResult::Unchanged`.
17829        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17830            if self.is_changed {
17831                TransformResult::Changed(self.build_forced(gc))
17832            } else {
17833                TransformResult::Unchanged
17834            }
17835        }
17836        /// Allocate the node unconditionally, changed or not.
17837        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17838            gc.alloc(Node::StringLiteral(self.inner))
17839        }
17840    }
17841    /// Clone-with-changes builder for [`super::NumericLiteral`].
17842    #[derive(Debug)]
17843    pub struct NumericLiteral<'gc> {
17844        is_changed: bool,
17845        pub(super) inner: super::NumericLiteral<'gc>,
17846    }
17847    impl<'gc> NumericLiteral<'gc> {
17848        /// Start from a copy of `node`, with no field changed yet.
17849        pub fn from_node(node: &'gc super::NumericLiteral<'gc>) -> Self {
17850            Self {
17851                is_changed: false,
17852                inner: super::NumericLiteral {
17853                    metadata: node.metadata.duplicate(),
17854                    value: Cell::new(node.value.get()),
17855                },
17856            }
17857        }
17858        /// Allocate the rebuilt node if a setter ran, else
17859        /// `TransformResult::Unchanged`.
17860        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17861            if self.is_changed {
17862                TransformResult::Changed(self.build_forced(gc))
17863            } else {
17864                TransformResult::Unchanged
17865            }
17866        }
17867        /// Allocate the node unconditionally, changed or not.
17868        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17869            gc.alloc(Node::NumericLiteral(self.inner))
17870        }
17871    }
17872    /// Clone-with-changes builder for [`super::RegExpLiteral`].
17873    #[derive(Debug)]
17874    pub struct RegExpLiteral<'gc> {
17875        is_changed: bool,
17876        pub(super) inner: super::RegExpLiteral<'gc>,
17877    }
17878    impl<'gc> RegExpLiteral<'gc> {
17879        /// Start from a copy of `node`, with no field changed yet.
17880        pub fn from_node(node: &'gc super::RegExpLiteral<'gc>) -> Self {
17881            Self {
17882                is_changed: false,
17883                inner: super::RegExpLiteral {
17884                    metadata: node.metadata.duplicate(),
17885                    pattern: Cell::new(node.pattern.get()),
17886                    flags: Cell::new(node.flags.get()),
17887                },
17888            }
17889        }
17890        /// Allocate the rebuilt node if a setter ran, else
17891        /// `TransformResult::Unchanged`.
17892        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17893            if self.is_changed {
17894                TransformResult::Changed(self.build_forced(gc))
17895            } else {
17896                TransformResult::Unchanged
17897            }
17898        }
17899        /// Allocate the node unconditionally, changed or not.
17900        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17901            gc.alloc(Node::RegExpLiteral(self.inner))
17902        }
17903    }
17904    /// Clone-with-changes builder for [`super::BigIntLiteral`].
17905    #[derive(Debug)]
17906    pub struct BigIntLiteral<'gc> {
17907        is_changed: bool,
17908        pub(super) inner: super::BigIntLiteral<'gc>,
17909    }
17910    impl<'gc> BigIntLiteral<'gc> {
17911        /// Start from a copy of `node`, with no field changed yet.
17912        pub fn from_node(node: &'gc super::BigIntLiteral<'gc>) -> Self {
17913            Self {
17914                is_changed: false,
17915                inner: super::BigIntLiteral {
17916                    metadata: node.metadata.duplicate(),
17917                    bigint: Cell::new(node.bigint.get()),
17918                },
17919            }
17920        }
17921        /// Allocate the rebuilt node if a setter ran, else
17922        /// `TransformResult::Unchanged`.
17923        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17924            if self.is_changed {
17925                TransformResult::Changed(self.build_forced(gc))
17926            } else {
17927                TransformResult::Unchanged
17928            }
17929        }
17930        /// Allocate the node unconditionally, changed or not.
17931        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17932            gc.alloc(Node::BigIntLiteral(self.inner))
17933        }
17934    }
17935    /// Clone-with-changes builder for [`super::ThisExpression`].
17936    #[derive(Debug)]
17937    pub struct ThisExpression<'gc> {
17938        is_changed: bool,
17939        pub(super) inner: super::ThisExpression<'gc>,
17940    }
17941    impl<'gc> ThisExpression<'gc> {
17942        /// Start from a copy of `node`, with no field changed yet.
17943        pub fn from_node(node: &'gc super::ThisExpression<'gc>) -> Self {
17944            Self {
17945                is_changed: false,
17946                inner: super::ThisExpression {
17947                    metadata: node.metadata.duplicate(),
17948                },
17949            }
17950        }
17951        /// Allocate the rebuilt node if a setter ran, else
17952        /// `TransformResult::Unchanged`.
17953        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17954            if self.is_changed {
17955                TransformResult::Changed(self.build_forced(gc))
17956            } else {
17957                TransformResult::Unchanged
17958            }
17959        }
17960        /// Allocate the node unconditionally, changed or not.
17961        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17962            gc.alloc(Node::ThisExpression(self.inner))
17963        }
17964    }
17965    /// Clone-with-changes builder for [`super::Super`].
17966    #[derive(Debug)]
17967    pub struct Super<'gc> {
17968        is_changed: bool,
17969        pub(super) inner: super::Super<'gc>,
17970    }
17971    impl<'gc> Super<'gc> {
17972        /// Start from a copy of `node`, with no field changed yet.
17973        pub fn from_node(node: &'gc super::Super<'gc>) -> Self {
17974            Self {
17975                is_changed: false,
17976                inner: super::Super {
17977                    metadata: node.metadata.duplicate(),
17978                },
17979            }
17980        }
17981        /// Allocate the rebuilt node if a setter ran, else
17982        /// `TransformResult::Unchanged`.
17983        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17984            if self.is_changed {
17985                TransformResult::Changed(self.build_forced(gc))
17986            } else {
17987                TransformResult::Unchanged
17988            }
17989        }
17990        /// Allocate the node unconditionally, changed or not.
17991        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17992            gc.alloc(Node::Super(self.inner))
17993        }
17994    }
17995    /// Clone-with-changes builder for [`super::SequenceExpression`].
17996    #[derive(Debug)]
17997    pub struct SequenceExpression<'gc> {
17998        is_changed: bool,
17999        pub(super) inner: super::SequenceExpression<'gc>,
18000    }
18001    impl<'gc> SequenceExpression<'gc> {
18002        /// Start from a copy of `node`, with no field changed yet.
18003        pub fn from_node(node: &'gc super::SequenceExpression<'gc>) -> Self {
18004            Self {
18005                is_changed: false,
18006                inner: super::SequenceExpression {
18007                    metadata: node.metadata.duplicate(),
18008                    expressions: node.expressions.duplicate(),
18009                },
18010            }
18011        }
18012        /// Allocate the rebuilt node if a setter ran, else
18013        /// `TransformResult::Unchanged`.
18014        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18015            if self.is_changed {
18016                TransformResult::Changed(self.build_forced(gc))
18017            } else {
18018                TransformResult::Unchanged
18019            }
18020        }
18021        /// Allocate the node unconditionally, changed or not.
18022        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18023            gc.alloc(Node::SequenceExpression(self.inner))
18024        }
18025        /// Set the `expressions` field and mark the builder changed.
18026        pub fn expressions(&mut self, expressions: NodeList<'gc>) { self.is_changed = true; self.inner.expressions = expressions; }
18027    }
18028    /// Clone-with-changes builder for [`super::ObjectExpression`].
18029    #[derive(Debug)]
18030    pub struct ObjectExpression<'gc> {
18031        is_changed: bool,
18032        pub(super) inner: super::ObjectExpression<'gc>,
18033    }
18034    impl<'gc> ObjectExpression<'gc> {
18035        /// Start from a copy of `node`, with no field changed yet.
18036        pub fn from_node(node: &'gc super::ObjectExpression<'gc>) -> Self {
18037            Self {
18038                is_changed: false,
18039                inner: super::ObjectExpression {
18040                    metadata: node.metadata.duplicate(),
18041                    properties: node.properties.duplicate(),
18042                },
18043            }
18044        }
18045        /// Allocate the rebuilt node if a setter ran, else
18046        /// `TransformResult::Unchanged`.
18047        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18048            if self.is_changed {
18049                TransformResult::Changed(self.build_forced(gc))
18050            } else {
18051                TransformResult::Unchanged
18052            }
18053        }
18054        /// Allocate the node unconditionally, changed or not.
18055        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18056            gc.alloc(Node::ObjectExpression(self.inner))
18057        }
18058        /// Set the `properties` field and mark the builder changed.
18059        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
18060    }
18061    /// Clone-with-changes builder for [`super::ArrayExpression`].
18062    #[derive(Debug)]
18063    pub struct ArrayExpression<'gc> {
18064        is_changed: bool,
18065        pub(super) inner: super::ArrayExpression<'gc>,
18066    }
18067    impl<'gc> ArrayExpression<'gc> {
18068        /// Start from a copy of `node`, with no field changed yet.
18069        pub fn from_node(node: &'gc super::ArrayExpression<'gc>) -> Self {
18070            Self {
18071                is_changed: false,
18072                inner: super::ArrayExpression {
18073                    metadata: node.metadata.duplicate(),
18074                    elements: node.elements.duplicate(),
18075                    trailing_comma: Cell::new(node.trailing_comma.get()),
18076                },
18077            }
18078        }
18079        /// Allocate the rebuilt node if a setter ran, else
18080        /// `TransformResult::Unchanged`.
18081        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18082            if self.is_changed {
18083                TransformResult::Changed(self.build_forced(gc))
18084            } else {
18085                TransformResult::Unchanged
18086            }
18087        }
18088        /// Allocate the node unconditionally, changed or not.
18089        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18090            gc.alloc(Node::ArrayExpression(self.inner))
18091        }
18092        /// Set the `elements` field and mark the builder changed.
18093        pub fn elements(&mut self, elements: NodeList<'gc>) { self.is_changed = true; self.inner.elements = elements; }
18094    }
18095    /// Clone-with-changes builder for [`super::SpreadElement`].
18096    #[derive(Debug)]
18097    pub struct SpreadElement<'gc> {
18098        is_changed: bool,
18099        pub(super) inner: super::SpreadElement<'gc>,
18100    }
18101    impl<'gc> SpreadElement<'gc> {
18102        /// Start from a copy of `node`, with no field changed yet.
18103        pub fn from_node(node: &'gc super::SpreadElement<'gc>) -> Self {
18104            Self {
18105                is_changed: false,
18106                inner: super::SpreadElement {
18107                    metadata: node.metadata.duplicate(),
18108                    argument: node.argument.duplicate(),
18109                },
18110            }
18111        }
18112        /// Allocate the rebuilt node if a setter ran, else
18113        /// `TransformResult::Unchanged`.
18114        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18115            if self.is_changed {
18116                TransformResult::Changed(self.build_forced(gc))
18117            } else {
18118                TransformResult::Unchanged
18119            }
18120        }
18121        /// Allocate the node unconditionally, changed or not.
18122        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18123            gc.alloc(Node::SpreadElement(self.inner))
18124        }
18125        /// Set the `argument` field and mark the builder changed.
18126        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
18127    }
18128    /// Clone-with-changes builder for [`super::NewExpression`].
18129    #[derive(Debug)]
18130    pub struct NewExpression<'gc> {
18131        is_changed: bool,
18132        pub(super) inner: super::NewExpression<'gc>,
18133    }
18134    impl<'gc> NewExpression<'gc> {
18135        /// Start from a copy of `node`, with no field changed yet.
18136        pub fn from_node(node: &'gc super::NewExpression<'gc>) -> Self {
18137            Self {
18138                is_changed: false,
18139                inner: super::NewExpression {
18140                    metadata: node.metadata.duplicate(),
18141                    callee: node.callee.duplicate(),
18142                    type_arguments: node.type_arguments.duplicate(),
18143                    arguments: node.arguments.duplicate(),
18144                },
18145            }
18146        }
18147        /// Allocate the rebuilt node if a setter ran, else
18148        /// `TransformResult::Unchanged`.
18149        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18150            if self.is_changed {
18151                TransformResult::Changed(self.build_forced(gc))
18152            } else {
18153                TransformResult::Unchanged
18154            }
18155        }
18156        /// Allocate the node unconditionally, changed or not.
18157        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18158            gc.alloc(Node::NewExpression(self.inner))
18159        }
18160        /// Set the `callee` field and mark the builder changed.
18161        pub fn callee(&mut self, callee: &'gc Node<'gc>) { self.is_changed = true; self.inner.callee = callee; }
18162        /// Set the `type_arguments` field and mark the builder changed.
18163        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
18164        /// Set the `arguments` field and mark the builder changed.
18165        pub fn arguments(&mut self, arguments: NodeList<'gc>) { self.is_changed = true; self.inner.arguments = arguments; }
18166    }
18167    /// Clone-with-changes builder for [`super::YieldExpression`].
18168    #[derive(Debug)]
18169    pub struct YieldExpression<'gc> {
18170        is_changed: bool,
18171        pub(super) inner: super::YieldExpression<'gc>,
18172    }
18173    impl<'gc> YieldExpression<'gc> {
18174        /// Start from a copy of `node`, with no field changed yet.
18175        pub fn from_node(node: &'gc super::YieldExpression<'gc>) -> Self {
18176            Self {
18177                is_changed: false,
18178                inner: super::YieldExpression {
18179                    metadata: node.metadata.duplicate(),
18180                    argument: node.argument.duplicate(),
18181                    delegate: Cell::new(node.delegate.get()),
18182                },
18183            }
18184        }
18185        /// Allocate the rebuilt node if a setter ran, else
18186        /// `TransformResult::Unchanged`.
18187        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18188            if self.is_changed {
18189                TransformResult::Changed(self.build_forced(gc))
18190            } else {
18191                TransformResult::Unchanged
18192            }
18193        }
18194        /// Allocate the node unconditionally, changed or not.
18195        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18196            gc.alloc(Node::YieldExpression(self.inner))
18197        }
18198        /// Set the `argument` field and mark the builder changed.
18199        pub fn argument(&mut self, argument: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.argument = argument; }
18200    }
18201    /// Clone-with-changes builder for [`super::AwaitExpression`].
18202    #[derive(Debug)]
18203    pub struct AwaitExpression<'gc> {
18204        is_changed: bool,
18205        pub(super) inner: super::AwaitExpression<'gc>,
18206    }
18207    impl<'gc> AwaitExpression<'gc> {
18208        /// Start from a copy of `node`, with no field changed yet.
18209        pub fn from_node(node: &'gc super::AwaitExpression<'gc>) -> Self {
18210            Self {
18211                is_changed: false,
18212                inner: super::AwaitExpression {
18213                    metadata: node.metadata.duplicate(),
18214                    argument: node.argument.duplicate(),
18215                },
18216            }
18217        }
18218        /// Allocate the rebuilt node if a setter ran, else
18219        /// `TransformResult::Unchanged`.
18220        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18221            if self.is_changed {
18222                TransformResult::Changed(self.build_forced(gc))
18223            } else {
18224                TransformResult::Unchanged
18225            }
18226        }
18227        /// Allocate the node unconditionally, changed or not.
18228        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18229            gc.alloc(Node::AwaitExpression(self.inner))
18230        }
18231        /// Set the `argument` field and mark the builder changed.
18232        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
18233    }
18234    /// Clone-with-changes builder for [`super::ImportExpression`].
18235    #[derive(Debug)]
18236    pub struct ImportExpression<'gc> {
18237        is_changed: bool,
18238        pub(super) inner: super::ImportExpression<'gc>,
18239    }
18240    impl<'gc> ImportExpression<'gc> {
18241        /// Start from a copy of `node`, with no field changed yet.
18242        pub fn from_node(node: &'gc super::ImportExpression<'gc>) -> Self {
18243            Self {
18244                is_changed: false,
18245                inner: super::ImportExpression {
18246                    metadata: node.metadata.duplicate(),
18247                    source: node.source.duplicate(),
18248                    options: node.options.duplicate(),
18249                },
18250            }
18251        }
18252        /// Allocate the rebuilt node if a setter ran, else
18253        /// `TransformResult::Unchanged`.
18254        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18255            if self.is_changed {
18256                TransformResult::Changed(self.build_forced(gc))
18257            } else {
18258                TransformResult::Unchanged
18259            }
18260        }
18261        /// Allocate the node unconditionally, changed or not.
18262        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18263            gc.alloc(Node::ImportExpression(self.inner))
18264        }
18265        /// Set the `source` field and mark the builder changed.
18266        pub fn source(&mut self, source: &'gc Node<'gc>) { self.is_changed = true; self.inner.source = source; }
18267        /// Set the `options` field and mark the builder changed.
18268        pub fn options(&mut self, options: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.options = options; }
18269    }
18270    /// Clone-with-changes builder for [`super::CallExpression`].
18271    #[derive(Debug)]
18272    pub struct CallExpression<'gc> {
18273        is_changed: bool,
18274        pub(super) inner: super::CallExpression<'gc>,
18275    }
18276    impl<'gc> CallExpression<'gc> {
18277        /// Start from a copy of `node`, with no field changed yet.
18278        pub fn from_node(node: &'gc super::CallExpression<'gc>) -> Self {
18279            Self {
18280                is_changed: false,
18281                inner: super::CallExpression {
18282                    metadata: node.metadata.duplicate(),
18283                    callee: node.callee.duplicate(),
18284                    type_arguments: node.type_arguments.duplicate(),
18285                    arguments: node.arguments.duplicate(),
18286                },
18287            }
18288        }
18289        /// Allocate the rebuilt node if a setter ran, else
18290        /// `TransformResult::Unchanged`.
18291        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18292            if self.is_changed {
18293                TransformResult::Changed(self.build_forced(gc))
18294            } else {
18295                TransformResult::Unchanged
18296            }
18297        }
18298        /// Allocate the node unconditionally, changed or not.
18299        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18300            gc.alloc(Node::CallExpression(self.inner))
18301        }
18302        /// Set the `callee` field and mark the builder changed.
18303        pub fn callee(&mut self, callee: &'gc Node<'gc>) { self.is_changed = true; self.inner.callee = callee; }
18304        /// Set the `type_arguments` field and mark the builder changed.
18305        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
18306        /// Set the `arguments` field and mark the builder changed.
18307        pub fn arguments(&mut self, arguments: NodeList<'gc>) { self.is_changed = true; self.inner.arguments = arguments; }
18308    }
18309    /// Clone-with-changes builder for [`super::OptionalCallExpression`].
18310    #[derive(Debug)]
18311    pub struct OptionalCallExpression<'gc> {
18312        is_changed: bool,
18313        pub(super) inner: super::OptionalCallExpression<'gc>,
18314    }
18315    impl<'gc> OptionalCallExpression<'gc> {
18316        /// Start from a copy of `node`, with no field changed yet.
18317        pub fn from_node(node: &'gc super::OptionalCallExpression<'gc>) -> Self {
18318            Self {
18319                is_changed: false,
18320                inner: super::OptionalCallExpression {
18321                    metadata: node.metadata.duplicate(),
18322                    callee: node.callee.duplicate(),
18323                    type_arguments: node.type_arguments.duplicate(),
18324                    arguments: node.arguments.duplicate(),
18325                    optional: Cell::new(node.optional.get()),
18326                },
18327            }
18328        }
18329        /// Allocate the rebuilt node if a setter ran, else
18330        /// `TransformResult::Unchanged`.
18331        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18332            if self.is_changed {
18333                TransformResult::Changed(self.build_forced(gc))
18334            } else {
18335                TransformResult::Unchanged
18336            }
18337        }
18338        /// Allocate the node unconditionally, changed or not.
18339        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18340            gc.alloc(Node::OptionalCallExpression(self.inner))
18341        }
18342        /// Set the `callee` field and mark the builder changed.
18343        pub fn callee(&mut self, callee: &'gc Node<'gc>) { self.is_changed = true; self.inner.callee = callee; }
18344        /// Set the `type_arguments` field and mark the builder changed.
18345        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
18346        /// Set the `arguments` field and mark the builder changed.
18347        pub fn arguments(&mut self, arguments: NodeList<'gc>) { self.is_changed = true; self.inner.arguments = arguments; }
18348    }
18349    /// Clone-with-changes builder for [`super::AssignmentExpression`].
18350    #[derive(Debug)]
18351    pub struct AssignmentExpression<'gc> {
18352        is_changed: bool,
18353        pub(super) inner: super::AssignmentExpression<'gc>,
18354    }
18355    impl<'gc> AssignmentExpression<'gc> {
18356        /// Start from a copy of `node`, with no field changed yet.
18357        pub fn from_node(node: &'gc super::AssignmentExpression<'gc>) -> Self {
18358            Self {
18359                is_changed: false,
18360                inner: super::AssignmentExpression {
18361                    metadata: node.metadata.duplicate(),
18362                    operator: Cell::new(node.operator.get()),
18363                    left: node.left.duplicate(),
18364                    right: node.right.duplicate(),
18365                },
18366            }
18367        }
18368        /// Allocate the rebuilt node if a setter ran, else
18369        /// `TransformResult::Unchanged`.
18370        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18371            if self.is_changed {
18372                TransformResult::Changed(self.build_forced(gc))
18373            } else {
18374                TransformResult::Unchanged
18375            }
18376        }
18377        /// Allocate the node unconditionally, changed or not.
18378        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18379            gc.alloc(Node::AssignmentExpression(self.inner))
18380        }
18381        /// Set the `left` field and mark the builder changed.
18382        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
18383        /// Set the `right` field and mark the builder changed.
18384        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
18385    }
18386    /// Clone-with-changes builder for [`super::UnaryExpression`].
18387    #[derive(Debug)]
18388    pub struct UnaryExpression<'gc> {
18389        is_changed: bool,
18390        pub(super) inner: super::UnaryExpression<'gc>,
18391    }
18392    impl<'gc> UnaryExpression<'gc> {
18393        /// Start from a copy of `node`, with no field changed yet.
18394        pub fn from_node(node: &'gc super::UnaryExpression<'gc>) -> Self {
18395            Self {
18396                is_changed: false,
18397                inner: super::UnaryExpression {
18398                    metadata: node.metadata.duplicate(),
18399                    operator: Cell::new(node.operator.get()),
18400                    argument: node.argument.duplicate(),
18401                    prefix: Cell::new(node.prefix.get()),
18402                },
18403            }
18404        }
18405        /// Allocate the rebuilt node if a setter ran, else
18406        /// `TransformResult::Unchanged`.
18407        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18408            if self.is_changed {
18409                TransformResult::Changed(self.build_forced(gc))
18410            } else {
18411                TransformResult::Unchanged
18412            }
18413        }
18414        /// Allocate the node unconditionally, changed or not.
18415        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18416            gc.alloc(Node::UnaryExpression(self.inner))
18417        }
18418        /// Set the `argument` field and mark the builder changed.
18419        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
18420    }
18421    /// Clone-with-changes builder for [`super::UpdateExpression`].
18422    #[derive(Debug)]
18423    pub struct UpdateExpression<'gc> {
18424        is_changed: bool,
18425        pub(super) inner: super::UpdateExpression<'gc>,
18426    }
18427    impl<'gc> UpdateExpression<'gc> {
18428        /// Start from a copy of `node`, with no field changed yet.
18429        pub fn from_node(node: &'gc super::UpdateExpression<'gc>) -> Self {
18430            Self {
18431                is_changed: false,
18432                inner: super::UpdateExpression {
18433                    metadata: node.metadata.duplicate(),
18434                    operator: Cell::new(node.operator.get()),
18435                    argument: node.argument.duplicate(),
18436                    prefix: Cell::new(node.prefix.get()),
18437                },
18438            }
18439        }
18440        /// Allocate the rebuilt node if a setter ran, else
18441        /// `TransformResult::Unchanged`.
18442        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18443            if self.is_changed {
18444                TransformResult::Changed(self.build_forced(gc))
18445            } else {
18446                TransformResult::Unchanged
18447            }
18448        }
18449        /// Allocate the node unconditionally, changed or not.
18450        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18451            gc.alloc(Node::UpdateExpression(self.inner))
18452        }
18453        /// Set the `argument` field and mark the builder changed.
18454        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
18455    }
18456    /// Clone-with-changes builder for [`super::MemberExpression`].
18457    #[derive(Debug)]
18458    pub struct MemberExpression<'gc> {
18459        is_changed: bool,
18460        pub(super) inner: super::MemberExpression<'gc>,
18461    }
18462    impl<'gc> MemberExpression<'gc> {
18463        /// Start from a copy of `node`, with no field changed yet.
18464        pub fn from_node(node: &'gc super::MemberExpression<'gc>) -> Self {
18465            Self {
18466                is_changed: false,
18467                inner: super::MemberExpression {
18468                    metadata: node.metadata.duplicate(),
18469                    object: node.object.duplicate(),
18470                    property: node.property.duplicate(),
18471                    computed: Cell::new(node.computed.get()),
18472                },
18473            }
18474        }
18475        /// Allocate the rebuilt node if a setter ran, else
18476        /// `TransformResult::Unchanged`.
18477        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18478            if self.is_changed {
18479                TransformResult::Changed(self.build_forced(gc))
18480            } else {
18481                TransformResult::Unchanged
18482            }
18483        }
18484        /// Allocate the node unconditionally, changed or not.
18485        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18486            gc.alloc(Node::MemberExpression(self.inner))
18487        }
18488        /// Set the `object` field and mark the builder changed.
18489        pub fn object(&mut self, object: &'gc Node<'gc>) { self.is_changed = true; self.inner.object = object; }
18490        /// Set the `property` field and mark the builder changed.
18491        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
18492    }
18493    /// Clone-with-changes builder for [`super::OptionalMemberExpression`].
18494    #[derive(Debug)]
18495    pub struct OptionalMemberExpression<'gc> {
18496        is_changed: bool,
18497        pub(super) inner: super::OptionalMemberExpression<'gc>,
18498    }
18499    impl<'gc> OptionalMemberExpression<'gc> {
18500        /// Start from a copy of `node`, with no field changed yet.
18501        pub fn from_node(node: &'gc super::OptionalMemberExpression<'gc>) -> Self {
18502            Self {
18503                is_changed: false,
18504                inner: super::OptionalMemberExpression {
18505                    metadata: node.metadata.duplicate(),
18506                    object: node.object.duplicate(),
18507                    property: node.property.duplicate(),
18508                    computed: Cell::new(node.computed.get()),
18509                    optional: Cell::new(node.optional.get()),
18510                },
18511            }
18512        }
18513        /// Allocate the rebuilt node if a setter ran, else
18514        /// `TransformResult::Unchanged`.
18515        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18516            if self.is_changed {
18517                TransformResult::Changed(self.build_forced(gc))
18518            } else {
18519                TransformResult::Unchanged
18520            }
18521        }
18522        /// Allocate the node unconditionally, changed or not.
18523        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18524            gc.alloc(Node::OptionalMemberExpression(self.inner))
18525        }
18526        /// Set the `object` field and mark the builder changed.
18527        pub fn object(&mut self, object: &'gc Node<'gc>) { self.is_changed = true; self.inner.object = object; }
18528        /// Set the `property` field and mark the builder changed.
18529        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
18530    }
18531    /// Clone-with-changes builder for [`super::LogicalExpression`].
18532    #[derive(Debug)]
18533    pub struct LogicalExpression<'gc> {
18534        is_changed: bool,
18535        pub(super) inner: super::LogicalExpression<'gc>,
18536    }
18537    impl<'gc> LogicalExpression<'gc> {
18538        /// Start from a copy of `node`, with no field changed yet.
18539        pub fn from_node(node: &'gc super::LogicalExpression<'gc>) -> Self {
18540            Self {
18541                is_changed: false,
18542                inner: super::LogicalExpression {
18543                    metadata: node.metadata.duplicate(),
18544                    left: node.left.duplicate(),
18545                    right: node.right.duplicate(),
18546                    operator: Cell::new(node.operator.get()),
18547                },
18548            }
18549        }
18550        /// Allocate the rebuilt node if a setter ran, else
18551        /// `TransformResult::Unchanged`.
18552        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18553            if self.is_changed {
18554                TransformResult::Changed(self.build_forced(gc))
18555            } else {
18556                TransformResult::Unchanged
18557            }
18558        }
18559        /// Allocate the node unconditionally, changed or not.
18560        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18561            gc.alloc(Node::LogicalExpression(self.inner))
18562        }
18563        /// Set the `left` field and mark the builder changed.
18564        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
18565        /// Set the `right` field and mark the builder changed.
18566        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
18567    }
18568    /// Clone-with-changes builder for [`super::ConditionalExpression`].
18569    #[derive(Debug)]
18570    pub struct ConditionalExpression<'gc> {
18571        is_changed: bool,
18572        pub(super) inner: super::ConditionalExpression<'gc>,
18573    }
18574    impl<'gc> ConditionalExpression<'gc> {
18575        /// Start from a copy of `node`, with no field changed yet.
18576        pub fn from_node(node: &'gc super::ConditionalExpression<'gc>) -> Self {
18577            Self {
18578                is_changed: false,
18579                inner: super::ConditionalExpression {
18580                    metadata: node.metadata.duplicate(),
18581                    test: node.test.duplicate(),
18582                    alternate: node.alternate.duplicate(),
18583                    consequent: node.consequent.duplicate(),
18584                },
18585            }
18586        }
18587        /// Allocate the rebuilt node if a setter ran, else
18588        /// `TransformResult::Unchanged`.
18589        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18590            if self.is_changed {
18591                TransformResult::Changed(self.build_forced(gc))
18592            } else {
18593                TransformResult::Unchanged
18594            }
18595        }
18596        /// Allocate the node unconditionally, changed or not.
18597        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18598            gc.alloc(Node::ConditionalExpression(self.inner))
18599        }
18600        /// Set the `test` field and mark the builder changed.
18601        pub fn test(&mut self, test: &'gc Node<'gc>) { self.is_changed = true; self.inner.test = test; }
18602        /// Set the `alternate` field and mark the builder changed.
18603        pub fn alternate(&mut self, alternate: &'gc Node<'gc>) { self.is_changed = true; self.inner.alternate = alternate; }
18604        /// Set the `consequent` field and mark the builder changed.
18605        pub fn consequent(&mut self, consequent: &'gc Node<'gc>) { self.is_changed = true; self.inner.consequent = consequent; }
18606    }
18607    /// Clone-with-changes builder for [`super::BinaryExpression`].
18608    #[derive(Debug)]
18609    pub struct BinaryExpression<'gc> {
18610        is_changed: bool,
18611        pub(super) inner: super::BinaryExpression<'gc>,
18612    }
18613    impl<'gc> BinaryExpression<'gc> {
18614        /// Start from a copy of `node`, with no field changed yet.
18615        pub fn from_node(node: &'gc super::BinaryExpression<'gc>) -> Self {
18616            Self {
18617                is_changed: false,
18618                inner: super::BinaryExpression {
18619                    metadata: node.metadata.duplicate(),
18620                    left: node.left.duplicate(),
18621                    right: node.right.duplicate(),
18622                    operator: Cell::new(node.operator.get()),
18623                },
18624            }
18625        }
18626        /// Allocate the rebuilt node if a setter ran, else
18627        /// `TransformResult::Unchanged`.
18628        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18629            if self.is_changed {
18630                TransformResult::Changed(self.build_forced(gc))
18631            } else {
18632                TransformResult::Unchanged
18633            }
18634        }
18635        /// Allocate the node unconditionally, changed or not.
18636        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18637            gc.alloc(Node::BinaryExpression(self.inner))
18638        }
18639        /// Set the `left` field and mark the builder changed.
18640        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
18641        /// Set the `right` field and mark the builder changed.
18642        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
18643    }
18644    /// Clone-with-changes builder for [`super::Directive`].
18645    #[derive(Debug)]
18646    pub struct Directive<'gc> {
18647        is_changed: bool,
18648        pub(super) inner: super::Directive<'gc>,
18649    }
18650    impl<'gc> Directive<'gc> {
18651        /// Start from a copy of `node`, with no field changed yet.
18652        pub fn from_node(node: &'gc super::Directive<'gc>) -> Self {
18653            Self {
18654                is_changed: false,
18655                inner: super::Directive {
18656                    metadata: node.metadata.duplicate(),
18657                    value: node.value.duplicate(),
18658                },
18659            }
18660        }
18661        /// Allocate the rebuilt node if a setter ran, else
18662        /// `TransformResult::Unchanged`.
18663        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18664            if self.is_changed {
18665                TransformResult::Changed(self.build_forced(gc))
18666            } else {
18667                TransformResult::Unchanged
18668            }
18669        }
18670        /// Allocate the node unconditionally, changed or not.
18671        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18672            gc.alloc(Node::Directive(self.inner))
18673        }
18674        /// Set the `value` field and mark the builder changed.
18675        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
18676    }
18677    /// Clone-with-changes builder for [`super::DirectiveLiteral`].
18678    #[derive(Debug)]
18679    pub struct DirectiveLiteral<'gc> {
18680        is_changed: bool,
18681        pub(super) inner: super::DirectiveLiteral<'gc>,
18682    }
18683    impl<'gc> DirectiveLiteral<'gc> {
18684        /// Start from a copy of `node`, with no field changed yet.
18685        pub fn from_node(node: &'gc super::DirectiveLiteral<'gc>) -> Self {
18686            Self {
18687                is_changed: false,
18688                inner: super::DirectiveLiteral {
18689                    metadata: node.metadata.duplicate(),
18690                    value: Cell::new(node.value.get()),
18691                },
18692            }
18693        }
18694        /// Allocate the rebuilt node if a setter ran, else
18695        /// `TransformResult::Unchanged`.
18696        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18697            if self.is_changed {
18698                TransformResult::Changed(self.build_forced(gc))
18699            } else {
18700                TransformResult::Unchanged
18701            }
18702        }
18703        /// Allocate the node unconditionally, changed or not.
18704        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18705            gc.alloc(Node::DirectiveLiteral(self.inner))
18706        }
18707    }
18708    /// Clone-with-changes builder for [`super::Identifier`].
18709    #[derive(Debug)]
18710    pub struct Identifier<'gc> {
18711        is_changed: bool,
18712        pub(super) inner: super::Identifier<'gc>,
18713    }
18714    impl<'gc> Identifier<'gc> {
18715        /// Start from a copy of `node`, with no field changed yet.
18716        pub fn from_node(node: &'gc super::Identifier<'gc>) -> Self {
18717            Self {
18718                is_changed: false,
18719                inner: super::Identifier {
18720                    metadata: node.metadata.duplicate(),
18721                    name: Cell::new(node.name.get()),
18722                    type_annotation: node.type_annotation.duplicate(),
18723                    optional: Cell::new(node.optional.get()),
18724                    unresolvable: Cell::new(node.unresolvable.get()),
18725                    decl_state: Cell::new(node.decl_state.get()),
18726                    decl: Cell::new(node.decl.get()),
18727                },
18728            }
18729        }
18730        /// Allocate the rebuilt node if a setter ran, else
18731        /// `TransformResult::Unchanged`.
18732        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18733            if self.is_changed {
18734                TransformResult::Changed(self.build_forced(gc))
18735            } else {
18736                TransformResult::Unchanged
18737            }
18738        }
18739        /// Allocate the node unconditionally, changed or not.
18740        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18741            gc.alloc(Node::Identifier(self.inner))
18742        }
18743        /// Set the `type_annotation` field and mark the builder changed.
18744        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
18745    }
18746    /// Clone-with-changes builder for [`super::PrivateName`].
18747    #[derive(Debug)]
18748    pub struct PrivateName<'gc> {
18749        is_changed: bool,
18750        pub(super) inner: super::PrivateName<'gc>,
18751    }
18752    impl<'gc> PrivateName<'gc> {
18753        /// Start from a copy of `node`, with no field changed yet.
18754        pub fn from_node(node: &'gc super::PrivateName<'gc>) -> Self {
18755            Self {
18756                is_changed: false,
18757                inner: super::PrivateName {
18758                    metadata: node.metadata.duplicate(),
18759                    id: node.id.duplicate(),
18760                },
18761            }
18762        }
18763        /// Allocate the rebuilt node if a setter ran, else
18764        /// `TransformResult::Unchanged`.
18765        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18766            if self.is_changed {
18767                TransformResult::Changed(self.build_forced(gc))
18768            } else {
18769                TransformResult::Unchanged
18770            }
18771        }
18772        /// Allocate the node unconditionally, changed or not.
18773        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18774            gc.alloc(Node::PrivateName(self.inner))
18775        }
18776        /// Set the `id` field and mark the builder changed.
18777        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
18778    }
18779    /// Clone-with-changes builder for [`super::MetaProperty`].
18780    #[derive(Debug)]
18781    pub struct MetaProperty<'gc> {
18782        is_changed: bool,
18783        pub(super) inner: super::MetaProperty<'gc>,
18784    }
18785    impl<'gc> MetaProperty<'gc> {
18786        /// Start from a copy of `node`, with no field changed yet.
18787        pub fn from_node(node: &'gc super::MetaProperty<'gc>) -> Self {
18788            Self {
18789                is_changed: false,
18790                inner: super::MetaProperty {
18791                    metadata: node.metadata.duplicate(),
18792                    meta: node.meta.duplicate(),
18793                    property: node.property.duplicate(),
18794                },
18795            }
18796        }
18797        /// Allocate the rebuilt node if a setter ran, else
18798        /// `TransformResult::Unchanged`.
18799        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18800            if self.is_changed {
18801                TransformResult::Changed(self.build_forced(gc))
18802            } else {
18803                TransformResult::Unchanged
18804            }
18805        }
18806        /// Allocate the node unconditionally, changed or not.
18807        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18808            gc.alloc(Node::MetaProperty(self.inner))
18809        }
18810        /// Set the `meta` field and mark the builder changed.
18811        pub fn meta(&mut self, meta: &'gc Node<'gc>) { self.is_changed = true; self.inner.meta = meta; }
18812        /// Set the `property` field and mark the builder changed.
18813        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
18814    }
18815    /// Clone-with-changes builder for [`super::SwitchCase`].
18816    #[derive(Debug)]
18817    pub struct SwitchCase<'gc> {
18818        is_changed: bool,
18819        pub(super) inner: super::SwitchCase<'gc>,
18820    }
18821    impl<'gc> SwitchCase<'gc> {
18822        /// Start from a copy of `node`, with no field changed yet.
18823        pub fn from_node(node: &'gc super::SwitchCase<'gc>) -> Self {
18824            Self {
18825                is_changed: false,
18826                inner: super::SwitchCase {
18827                    metadata: node.metadata.duplicate(),
18828                    test: node.test.duplicate(),
18829                    consequent: node.consequent.duplicate(),
18830                },
18831            }
18832        }
18833        /// Allocate the rebuilt node if a setter ran, else
18834        /// `TransformResult::Unchanged`.
18835        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18836            if self.is_changed {
18837                TransformResult::Changed(self.build_forced(gc))
18838            } else {
18839                TransformResult::Unchanged
18840            }
18841        }
18842        /// Allocate the node unconditionally, changed or not.
18843        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18844            gc.alloc(Node::SwitchCase(self.inner))
18845        }
18846        /// Set the `test` field and mark the builder changed.
18847        pub fn test(&mut self, test: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.test = test; }
18848        /// Set the `consequent` field and mark the builder changed.
18849        pub fn consequent(&mut self, consequent: NodeList<'gc>) { self.is_changed = true; self.inner.consequent = consequent; }
18850    }
18851    /// Clone-with-changes builder for [`super::CatchClause`].
18852    #[derive(Debug)]
18853    pub struct CatchClause<'gc> {
18854        is_changed: bool,
18855        pub(super) inner: super::CatchClause<'gc>,
18856    }
18857    impl<'gc> CatchClause<'gc> {
18858        /// Start from a copy of `node`, with no field changed yet.
18859        pub fn from_node(node: &'gc super::CatchClause<'gc>) -> Self {
18860            Self {
18861                is_changed: false,
18862                inner: super::CatchClause {
18863                    metadata: node.metadata.duplicate(),
18864                    param: node.param.duplicate(),
18865                    body: node.body.duplicate(),
18866                    scope: Cell::new(node.scope.get()),
18867                },
18868            }
18869        }
18870        /// Allocate the rebuilt node if a setter ran, else
18871        /// `TransformResult::Unchanged`.
18872        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18873            if self.is_changed {
18874                TransformResult::Changed(self.build_forced(gc))
18875            } else {
18876                TransformResult::Unchanged
18877            }
18878        }
18879        /// Allocate the node unconditionally, changed or not.
18880        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18881            gc.alloc(Node::CatchClause(self.inner))
18882        }
18883        /// Set the `param` field and mark the builder changed.
18884        pub fn param(&mut self, param: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.param = param; }
18885        /// Set the `body` field and mark the builder changed.
18886        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18887    }
18888    /// Clone-with-changes builder for [`super::VariableDeclarator`].
18889    #[derive(Debug)]
18890    pub struct VariableDeclarator<'gc> {
18891        is_changed: bool,
18892        pub(super) inner: super::VariableDeclarator<'gc>,
18893    }
18894    impl<'gc> VariableDeclarator<'gc> {
18895        /// Start from a copy of `node`, with no field changed yet.
18896        pub fn from_node(node: &'gc super::VariableDeclarator<'gc>) -> Self {
18897            Self {
18898                is_changed: false,
18899                inner: super::VariableDeclarator {
18900                    metadata: node.metadata.duplicate(),
18901                    init: node.init.duplicate(),
18902                    id: node.id.duplicate(),
18903                },
18904            }
18905        }
18906        /// Allocate the rebuilt node if a setter ran, else
18907        /// `TransformResult::Unchanged`.
18908        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18909            if self.is_changed {
18910                TransformResult::Changed(self.build_forced(gc))
18911            } else {
18912                TransformResult::Unchanged
18913            }
18914        }
18915        /// Allocate the node unconditionally, changed or not.
18916        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18917            gc.alloc(Node::VariableDeclarator(self.inner))
18918        }
18919        /// Set the `init` field and mark the builder changed.
18920        pub fn init(&mut self, init: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.init = init; }
18921        /// Set the `id` field and mark the builder changed.
18922        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
18923    }
18924    /// Clone-with-changes builder for [`super::VariableDeclaration`].
18925    #[derive(Debug)]
18926    pub struct VariableDeclaration<'gc> {
18927        is_changed: bool,
18928        pub(super) inner: super::VariableDeclaration<'gc>,
18929    }
18930    impl<'gc> VariableDeclaration<'gc> {
18931        /// Start from a copy of `node`, with no field changed yet.
18932        pub fn from_node(node: &'gc super::VariableDeclaration<'gc>) -> Self {
18933            Self {
18934                is_changed: false,
18935                inner: super::VariableDeclaration {
18936                    metadata: node.metadata.duplicate(),
18937                    kind: Cell::new(node.kind.get()),
18938                    declarations: node.declarations.duplicate(),
18939                },
18940            }
18941        }
18942        /// Allocate the rebuilt node if a setter ran, else
18943        /// `TransformResult::Unchanged`.
18944        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18945            if self.is_changed {
18946                TransformResult::Changed(self.build_forced(gc))
18947            } else {
18948                TransformResult::Unchanged
18949            }
18950        }
18951        /// Allocate the node unconditionally, changed or not.
18952        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18953            gc.alloc(Node::VariableDeclaration(self.inner))
18954        }
18955        /// Set the `declarations` field and mark the builder changed.
18956        pub fn declarations(&mut self, declarations: NodeList<'gc>) { self.is_changed = true; self.inner.declarations = declarations; }
18957    }
18958    /// Clone-with-changes builder for [`super::TemplateLiteral`].
18959    #[derive(Debug)]
18960    pub struct TemplateLiteral<'gc> {
18961        is_changed: bool,
18962        pub(super) inner: super::TemplateLiteral<'gc>,
18963    }
18964    impl<'gc> TemplateLiteral<'gc> {
18965        /// Start from a copy of `node`, with no field changed yet.
18966        pub fn from_node(node: &'gc super::TemplateLiteral<'gc>) -> Self {
18967            Self {
18968                is_changed: false,
18969                inner: super::TemplateLiteral {
18970                    metadata: node.metadata.duplicate(),
18971                    quasis: node.quasis.duplicate(),
18972                    expressions: node.expressions.duplicate(),
18973                },
18974            }
18975        }
18976        /// Allocate the rebuilt node if a setter ran, else
18977        /// `TransformResult::Unchanged`.
18978        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18979            if self.is_changed {
18980                TransformResult::Changed(self.build_forced(gc))
18981            } else {
18982                TransformResult::Unchanged
18983            }
18984        }
18985        /// Allocate the node unconditionally, changed or not.
18986        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18987            gc.alloc(Node::TemplateLiteral(self.inner))
18988        }
18989        /// Set the `quasis` field and mark the builder changed.
18990        pub fn quasis(&mut self, quasis: NodeList<'gc>) { self.is_changed = true; self.inner.quasis = quasis; }
18991        /// Set the `expressions` field and mark the builder changed.
18992        pub fn expressions(&mut self, expressions: NodeList<'gc>) { self.is_changed = true; self.inner.expressions = expressions; }
18993    }
18994    /// Clone-with-changes builder for [`super::TaggedTemplateExpression`].
18995    #[derive(Debug)]
18996    pub struct TaggedTemplateExpression<'gc> {
18997        is_changed: bool,
18998        pub(super) inner: super::TaggedTemplateExpression<'gc>,
18999    }
19000    impl<'gc> TaggedTemplateExpression<'gc> {
19001        /// Start from a copy of `node`, with no field changed yet.
19002        pub fn from_node(node: &'gc super::TaggedTemplateExpression<'gc>) -> Self {
19003            Self {
19004                is_changed: false,
19005                inner: super::TaggedTemplateExpression {
19006                    metadata: node.metadata.duplicate(),
19007                    tag: node.tag.duplicate(),
19008                    quasi: node.quasi.duplicate(),
19009                },
19010            }
19011        }
19012        /// Allocate the rebuilt node if a setter ran, else
19013        /// `TransformResult::Unchanged`.
19014        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19015            if self.is_changed {
19016                TransformResult::Changed(self.build_forced(gc))
19017            } else {
19018                TransformResult::Unchanged
19019            }
19020        }
19021        /// Allocate the node unconditionally, changed or not.
19022        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19023            gc.alloc(Node::TaggedTemplateExpression(self.inner))
19024        }
19025        /// Set the `tag` field and mark the builder changed.
19026        pub fn tag(&mut self, tag: &'gc Node<'gc>) { self.is_changed = true; self.inner.tag = tag; }
19027        /// Set the `quasi` field and mark the builder changed.
19028        pub fn quasi(&mut self, quasi: &'gc Node<'gc>) { self.is_changed = true; self.inner.quasi = quasi; }
19029    }
19030    /// Clone-with-changes builder for [`super::TemplateElement`].
19031    #[derive(Debug)]
19032    pub struct TemplateElement<'gc> {
19033        is_changed: bool,
19034        pub(super) inner: super::TemplateElement<'gc>,
19035    }
19036    impl<'gc> TemplateElement<'gc> {
19037        /// Start from a copy of `node`, with no field changed yet.
19038        pub fn from_node(node: &'gc super::TemplateElement<'gc>) -> Self {
19039            Self {
19040                is_changed: false,
19041                inner: super::TemplateElement {
19042                    metadata: node.metadata.duplicate(),
19043                    tail: Cell::new(node.tail.get()),
19044                    cooked: Cell::new(node.cooked.get()),
19045                    raw: Cell::new(node.raw.get()),
19046                },
19047            }
19048        }
19049        /// Allocate the rebuilt node if a setter ran, else
19050        /// `TransformResult::Unchanged`.
19051        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19052            if self.is_changed {
19053                TransformResult::Changed(self.build_forced(gc))
19054            } else {
19055                TransformResult::Unchanged
19056            }
19057        }
19058        /// Allocate the node unconditionally, changed or not.
19059        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19060            gc.alloc(Node::TemplateElement(self.inner))
19061        }
19062    }
19063    /// Clone-with-changes builder for [`super::Property`].
19064    #[derive(Debug)]
19065    pub struct Property<'gc> {
19066        is_changed: bool,
19067        pub(super) inner: super::Property<'gc>,
19068    }
19069    impl<'gc> Property<'gc> {
19070        /// Start from a copy of `node`, with no field changed yet.
19071        pub fn from_node(node: &'gc super::Property<'gc>) -> Self {
19072            Self {
19073                is_changed: false,
19074                inner: super::Property {
19075                    metadata: node.metadata.duplicate(),
19076                    key: node.key.duplicate(),
19077                    value: node.value.duplicate(),
19078                    kind: Cell::new(node.kind.get()),
19079                    computed: Cell::new(node.computed.get()),
19080                    method: Cell::new(node.method.get()),
19081                    shorthand: Cell::new(node.shorthand.get()),
19082                },
19083            }
19084        }
19085        /// Allocate the rebuilt node if a setter ran, else
19086        /// `TransformResult::Unchanged`.
19087        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19088            if self.is_changed {
19089                TransformResult::Changed(self.build_forced(gc))
19090            } else {
19091                TransformResult::Unchanged
19092            }
19093        }
19094        /// Allocate the node unconditionally, changed or not.
19095        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19096            gc.alloc(Node::Property(self.inner))
19097        }
19098        /// Set the `key` field and mark the builder changed.
19099        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
19100        /// Set the `value` field and mark the builder changed.
19101        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
19102    }
19103    /// Clone-with-changes builder for [`super::Decorator`].
19104    #[derive(Debug)]
19105    pub struct Decorator<'gc> {
19106        is_changed: bool,
19107        pub(super) inner: super::Decorator<'gc>,
19108    }
19109    impl<'gc> Decorator<'gc> {
19110        /// Start from a copy of `node`, with no field changed yet.
19111        pub fn from_node(node: &'gc super::Decorator<'gc>) -> Self {
19112            Self {
19113                is_changed: false,
19114                inner: super::Decorator {
19115                    metadata: node.metadata.duplicate(),
19116                    expression: node.expression.duplicate(),
19117                },
19118            }
19119        }
19120        /// Allocate the rebuilt node if a setter ran, else
19121        /// `TransformResult::Unchanged`.
19122        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19123            if self.is_changed {
19124                TransformResult::Changed(self.build_forced(gc))
19125            } else {
19126                TransformResult::Unchanged
19127            }
19128        }
19129        /// Allocate the node unconditionally, changed or not.
19130        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19131            gc.alloc(Node::Decorator(self.inner))
19132        }
19133        /// Set the `expression` field and mark the builder changed.
19134        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
19135    }
19136    /// Clone-with-changes builder for [`super::ClassDeclaration`].
19137    #[derive(Debug)]
19138    pub struct ClassDeclaration<'gc> {
19139        is_changed: bool,
19140        pub(super) inner: super::ClassDeclaration<'gc>,
19141    }
19142    impl<'gc> ClassDeclaration<'gc> {
19143        /// Start from a copy of `node`, with no field changed yet.
19144        pub fn from_node(node: &'gc super::ClassDeclaration<'gc>) -> Self {
19145            Self {
19146                is_changed: false,
19147                inner: super::ClassDeclaration {
19148                    metadata: node.metadata.duplicate(),
19149                    id: node.id.duplicate(),
19150                    type_parameters: node.type_parameters.duplicate(),
19151                    super_class: node.super_class.duplicate(),
19152                    super_type_arguments: node.super_type_arguments.duplicate(),
19153                    implements: node.implements.duplicate(),
19154                    decorators: node.decorators.duplicate(),
19155                    body: node.body.duplicate(),
19156                    scope: Cell::new(node.scope.get()),
19157                    implicit_ctor_function_info: Cell::new(node.implicit_ctor_function_info.get()),
19158                    instance_elements_init_function_info: Cell::new(node.instance_elements_init_function_info.get()),
19159                    static_elements_init_function_info: Cell::new(node.static_elements_init_function_info.get()),
19160                },
19161            }
19162        }
19163        /// Allocate the rebuilt node if a setter ran, else
19164        /// `TransformResult::Unchanged`.
19165        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19166            if self.is_changed {
19167                TransformResult::Changed(self.build_forced(gc))
19168            } else {
19169                TransformResult::Unchanged
19170            }
19171        }
19172        /// Allocate the node unconditionally, changed or not.
19173        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19174            gc.alloc(Node::ClassDeclaration(self.inner))
19175        }
19176        /// Set the `id` field and mark the builder changed.
19177        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
19178        /// Set the `type_parameters` field and mark the builder changed.
19179        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
19180        /// Set the `super_class` field and mark the builder changed.
19181        pub fn super_class(&mut self, super_class: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.super_class = super_class; }
19182        /// Set the `super_type_arguments` field and mark the builder changed.
19183        pub fn super_type_arguments(&mut self, super_type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.super_type_arguments = super_type_arguments; }
19184        /// Set the `implements` field and mark the builder changed.
19185        pub fn implements(&mut self, implements: NodeList<'gc>) { self.is_changed = true; self.inner.implements = implements; }
19186        /// Set the `decorators` field and mark the builder changed.
19187        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
19188        /// Set the `body` field and mark the builder changed.
19189        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
19190    }
19191    /// Clone-with-changes builder for [`super::ClassExpression`].
19192    #[derive(Debug)]
19193    pub struct ClassExpression<'gc> {
19194        is_changed: bool,
19195        pub(super) inner: super::ClassExpression<'gc>,
19196    }
19197    impl<'gc> ClassExpression<'gc> {
19198        /// Start from a copy of `node`, with no field changed yet.
19199        pub fn from_node(node: &'gc super::ClassExpression<'gc>) -> Self {
19200            Self {
19201                is_changed: false,
19202                inner: super::ClassExpression {
19203                    metadata: node.metadata.duplicate(),
19204                    id: node.id.duplicate(),
19205                    type_parameters: node.type_parameters.duplicate(),
19206                    super_class: node.super_class.duplicate(),
19207                    super_type_arguments: node.super_type_arguments.duplicate(),
19208                    implements: node.implements.duplicate(),
19209                    decorators: node.decorators.duplicate(),
19210                    body: node.body.duplicate(),
19211                    scope: Cell::new(node.scope.get()),
19212                    implicit_ctor_function_info: Cell::new(node.implicit_ctor_function_info.get()),
19213                    instance_elements_init_function_info: Cell::new(node.instance_elements_init_function_info.get()),
19214                    static_elements_init_function_info: Cell::new(node.static_elements_init_function_info.get()),
19215                },
19216            }
19217        }
19218        /// Allocate the rebuilt node if a setter ran, else
19219        /// `TransformResult::Unchanged`.
19220        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19221            if self.is_changed {
19222                TransformResult::Changed(self.build_forced(gc))
19223            } else {
19224                TransformResult::Unchanged
19225            }
19226        }
19227        /// Allocate the node unconditionally, changed or not.
19228        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19229            gc.alloc(Node::ClassExpression(self.inner))
19230        }
19231        /// Set the `id` field and mark the builder changed.
19232        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
19233        /// Set the `type_parameters` field and mark the builder changed.
19234        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
19235        /// Set the `super_class` field and mark the builder changed.
19236        pub fn super_class(&mut self, super_class: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.super_class = super_class; }
19237        /// Set the `super_type_arguments` field and mark the builder changed.
19238        pub fn super_type_arguments(&mut self, super_type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.super_type_arguments = super_type_arguments; }
19239        /// Set the `implements` field and mark the builder changed.
19240        pub fn implements(&mut self, implements: NodeList<'gc>) { self.is_changed = true; self.inner.implements = implements; }
19241        /// Set the `decorators` field and mark the builder changed.
19242        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
19243        /// Set the `body` field and mark the builder changed.
19244        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
19245    }
19246    /// Clone-with-changes builder for [`super::ClassBody`].
19247    #[derive(Debug)]
19248    pub struct ClassBody<'gc> {
19249        is_changed: bool,
19250        pub(super) inner: super::ClassBody<'gc>,
19251    }
19252    impl<'gc> ClassBody<'gc> {
19253        /// Start from a copy of `node`, with no field changed yet.
19254        pub fn from_node(node: &'gc super::ClassBody<'gc>) -> Self {
19255            Self {
19256                is_changed: false,
19257                inner: super::ClassBody {
19258                    metadata: node.metadata.duplicate(),
19259                    body: node.body.duplicate(),
19260                },
19261            }
19262        }
19263        /// Allocate the rebuilt node if a setter ran, else
19264        /// `TransformResult::Unchanged`.
19265        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19266            if self.is_changed {
19267                TransformResult::Changed(self.build_forced(gc))
19268            } else {
19269                TransformResult::Unchanged
19270            }
19271        }
19272        /// Allocate the node unconditionally, changed or not.
19273        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19274            gc.alloc(Node::ClassBody(self.inner))
19275        }
19276        /// Set the `body` field and mark the builder changed.
19277        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
19278    }
19279    /// Clone-with-changes builder for [`super::ClassProperty`].
19280    #[derive(Debug)]
19281    pub struct ClassProperty<'gc> {
19282        is_changed: bool,
19283        pub(super) inner: super::ClassProperty<'gc>,
19284    }
19285    impl<'gc> ClassProperty<'gc> {
19286        /// Start from a copy of `node`, with no field changed yet.
19287        pub fn from_node(node: &'gc super::ClassProperty<'gc>) -> Self {
19288            Self {
19289                is_changed: false,
19290                inner: super::ClassProperty {
19291                    metadata: node.metadata.duplicate(),
19292                    key: node.key.duplicate(),
19293                    value: node.value.duplicate(),
19294                    computed: Cell::new(node.computed.get()),
19295                    r#static: Cell::new(node.r#static.get()),
19296                    decorators: node.decorators.duplicate(),
19297                    declare: Cell::new(node.declare.get()),
19298                    optional: Cell::new(node.optional.get()),
19299                    variance: node.variance.duplicate(),
19300                    type_annotation: node.type_annotation.duplicate(),
19301                    ts_modifiers: node.ts_modifiers.duplicate(),
19302                },
19303            }
19304        }
19305        /// Allocate the rebuilt node if a setter ran, else
19306        /// `TransformResult::Unchanged`.
19307        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19308            if self.is_changed {
19309                TransformResult::Changed(self.build_forced(gc))
19310            } else {
19311                TransformResult::Unchanged
19312            }
19313        }
19314        /// Allocate the node unconditionally, changed or not.
19315        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19316            gc.alloc(Node::ClassProperty(self.inner))
19317        }
19318        /// Set the `key` field and mark the builder changed.
19319        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
19320        /// Set the `value` field and mark the builder changed.
19321        pub fn value(&mut self, value: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.value = value; }
19322        /// Set the `decorators` field and mark the builder changed.
19323        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
19324        /// Set the `variance` field and mark the builder changed.
19325        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
19326        /// Set the `type_annotation` field and mark the builder changed.
19327        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
19328        /// Set the `ts_modifiers` field and mark the builder changed.
19329        pub fn ts_modifiers(&mut self, ts_modifiers: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.ts_modifiers = ts_modifiers; }
19330    }
19331    /// Clone-with-changes builder for [`super::ClassPrivateProperty`].
19332    #[derive(Debug)]
19333    pub struct ClassPrivateProperty<'gc> {
19334        is_changed: bool,
19335        pub(super) inner: super::ClassPrivateProperty<'gc>,
19336    }
19337    impl<'gc> ClassPrivateProperty<'gc> {
19338        /// Start from a copy of `node`, with no field changed yet.
19339        pub fn from_node(node: &'gc super::ClassPrivateProperty<'gc>) -> Self {
19340            Self {
19341                is_changed: false,
19342                inner: super::ClassPrivateProperty {
19343                    metadata: node.metadata.duplicate(),
19344                    key: node.key.duplicate(),
19345                    value: node.value.duplicate(),
19346                    r#static: Cell::new(node.r#static.get()),
19347                    decorators: node.decorators.duplicate(),
19348                    declare: Cell::new(node.declare.get()),
19349                    optional: Cell::new(node.optional.get()),
19350                    variance: node.variance.duplicate(),
19351                    type_annotation: node.type_annotation.duplicate(),
19352                    ts_modifiers: node.ts_modifiers.duplicate(),
19353                },
19354            }
19355        }
19356        /// Allocate the rebuilt node if a setter ran, else
19357        /// `TransformResult::Unchanged`.
19358        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19359            if self.is_changed {
19360                TransformResult::Changed(self.build_forced(gc))
19361            } else {
19362                TransformResult::Unchanged
19363            }
19364        }
19365        /// Allocate the node unconditionally, changed or not.
19366        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19367            gc.alloc(Node::ClassPrivateProperty(self.inner))
19368        }
19369        /// Set the `key` field and mark the builder changed.
19370        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
19371        /// Set the `value` field and mark the builder changed.
19372        pub fn value(&mut self, value: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.value = value; }
19373        /// Set the `decorators` field and mark the builder changed.
19374        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
19375        /// Set the `variance` field and mark the builder changed.
19376        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
19377        /// Set the `type_annotation` field and mark the builder changed.
19378        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
19379        /// Set the `ts_modifiers` field and mark the builder changed.
19380        pub fn ts_modifiers(&mut self, ts_modifiers: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.ts_modifiers = ts_modifiers; }
19381    }
19382    /// Clone-with-changes builder for [`super::MethodDefinition`].
19383    #[derive(Debug)]
19384    pub struct MethodDefinition<'gc> {
19385        is_changed: bool,
19386        pub(super) inner: super::MethodDefinition<'gc>,
19387    }
19388    impl<'gc> MethodDefinition<'gc> {
19389        /// Start from a copy of `node`, with no field changed yet.
19390        pub fn from_node(node: &'gc super::MethodDefinition<'gc>) -> Self {
19391            Self {
19392                is_changed: false,
19393                inner: super::MethodDefinition {
19394                    metadata: node.metadata.duplicate(),
19395                    key: node.key.duplicate(),
19396                    value: node.value.duplicate(),
19397                    kind: Cell::new(node.kind.get()),
19398                    computed: Cell::new(node.computed.get()),
19399                    r#static: Cell::new(node.r#static.get()),
19400                    decorators: node.decorators.duplicate(),
19401                },
19402            }
19403        }
19404        /// Allocate the rebuilt node if a setter ran, else
19405        /// `TransformResult::Unchanged`.
19406        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19407            if self.is_changed {
19408                TransformResult::Changed(self.build_forced(gc))
19409            } else {
19410                TransformResult::Unchanged
19411            }
19412        }
19413        /// Allocate the node unconditionally, changed or not.
19414        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19415            gc.alloc(Node::MethodDefinition(self.inner))
19416        }
19417        /// Set the `key` field and mark the builder changed.
19418        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
19419        /// Set the `value` field and mark the builder changed.
19420        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
19421        /// Set the `decorators` field and mark the builder changed.
19422        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
19423    }
19424    /// Clone-with-changes builder for [`super::ImportDeclaration`].
19425    #[derive(Debug)]
19426    pub struct ImportDeclaration<'gc> {
19427        is_changed: bool,
19428        pub(super) inner: super::ImportDeclaration<'gc>,
19429    }
19430    impl<'gc> ImportDeclaration<'gc> {
19431        /// Start from a copy of `node`, with no field changed yet.
19432        pub fn from_node(node: &'gc super::ImportDeclaration<'gc>) -> Self {
19433            Self {
19434                is_changed: false,
19435                inner: super::ImportDeclaration {
19436                    metadata: node.metadata.duplicate(),
19437                    specifiers: node.specifiers.duplicate(),
19438                    source: node.source.duplicate(),
19439                    attributes: node.attributes.duplicate(),
19440                    import_kind: Cell::new(node.import_kind.get()),
19441                },
19442            }
19443        }
19444        /// Allocate the rebuilt node if a setter ran, else
19445        /// `TransformResult::Unchanged`.
19446        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19447            if self.is_changed {
19448                TransformResult::Changed(self.build_forced(gc))
19449            } else {
19450                TransformResult::Unchanged
19451            }
19452        }
19453        /// Allocate the node unconditionally, changed or not.
19454        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19455            gc.alloc(Node::ImportDeclaration(self.inner))
19456        }
19457        /// Set the `specifiers` field and mark the builder changed.
19458        pub fn specifiers(&mut self, specifiers: NodeList<'gc>) { self.is_changed = true; self.inner.specifiers = specifiers; }
19459        /// Set the `source` field and mark the builder changed.
19460        pub fn source(&mut self, source: &'gc Node<'gc>) { self.is_changed = true; self.inner.source = source; }
19461        /// Set the `attributes` field and mark the builder changed.
19462        pub fn attributes(&mut self, attributes: NodeList<'gc>) { self.is_changed = true; self.inner.attributes = attributes; }
19463    }
19464    /// Clone-with-changes builder for [`super::ImportSpecifier`].
19465    #[derive(Debug)]
19466    pub struct ImportSpecifier<'gc> {
19467        is_changed: bool,
19468        pub(super) inner: super::ImportSpecifier<'gc>,
19469    }
19470    impl<'gc> ImportSpecifier<'gc> {
19471        /// Start from a copy of `node`, with no field changed yet.
19472        pub fn from_node(node: &'gc super::ImportSpecifier<'gc>) -> Self {
19473            Self {
19474                is_changed: false,
19475                inner: super::ImportSpecifier {
19476                    metadata: node.metadata.duplicate(),
19477                    imported: node.imported.duplicate(),
19478                    local: node.local.duplicate(),
19479                    import_kind: Cell::new(node.import_kind.get()),
19480                },
19481            }
19482        }
19483        /// Allocate the rebuilt node if a setter ran, else
19484        /// `TransformResult::Unchanged`.
19485        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19486            if self.is_changed {
19487                TransformResult::Changed(self.build_forced(gc))
19488            } else {
19489                TransformResult::Unchanged
19490            }
19491        }
19492        /// Allocate the node unconditionally, changed or not.
19493        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19494            gc.alloc(Node::ImportSpecifier(self.inner))
19495        }
19496        /// Set the `imported` field and mark the builder changed.
19497        pub fn imported(&mut self, imported: &'gc Node<'gc>) { self.is_changed = true; self.inner.imported = imported; }
19498        /// Set the `local` field and mark the builder changed.
19499        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
19500    }
19501    /// Clone-with-changes builder for [`super::ImportDefaultSpecifier`].
19502    #[derive(Debug)]
19503    pub struct ImportDefaultSpecifier<'gc> {
19504        is_changed: bool,
19505        pub(super) inner: super::ImportDefaultSpecifier<'gc>,
19506    }
19507    impl<'gc> ImportDefaultSpecifier<'gc> {
19508        /// Start from a copy of `node`, with no field changed yet.
19509        pub fn from_node(node: &'gc super::ImportDefaultSpecifier<'gc>) -> Self {
19510            Self {
19511                is_changed: false,
19512                inner: super::ImportDefaultSpecifier {
19513                    metadata: node.metadata.duplicate(),
19514                    local: node.local.duplicate(),
19515                },
19516            }
19517        }
19518        /// Allocate the rebuilt node if a setter ran, else
19519        /// `TransformResult::Unchanged`.
19520        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19521            if self.is_changed {
19522                TransformResult::Changed(self.build_forced(gc))
19523            } else {
19524                TransformResult::Unchanged
19525            }
19526        }
19527        /// Allocate the node unconditionally, changed or not.
19528        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19529            gc.alloc(Node::ImportDefaultSpecifier(self.inner))
19530        }
19531        /// Set the `local` field and mark the builder changed.
19532        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
19533    }
19534    /// Clone-with-changes builder for [`super::ImportNamespaceSpecifier`].
19535    #[derive(Debug)]
19536    pub struct ImportNamespaceSpecifier<'gc> {
19537        is_changed: bool,
19538        pub(super) inner: super::ImportNamespaceSpecifier<'gc>,
19539    }
19540    impl<'gc> ImportNamespaceSpecifier<'gc> {
19541        /// Start from a copy of `node`, with no field changed yet.
19542        pub fn from_node(node: &'gc super::ImportNamespaceSpecifier<'gc>) -> Self {
19543            Self {
19544                is_changed: false,
19545                inner: super::ImportNamespaceSpecifier {
19546                    metadata: node.metadata.duplicate(),
19547                    local: node.local.duplicate(),
19548                },
19549            }
19550        }
19551        /// Allocate the rebuilt node if a setter ran, else
19552        /// `TransformResult::Unchanged`.
19553        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19554            if self.is_changed {
19555                TransformResult::Changed(self.build_forced(gc))
19556            } else {
19557                TransformResult::Unchanged
19558            }
19559        }
19560        /// Allocate the node unconditionally, changed or not.
19561        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19562            gc.alloc(Node::ImportNamespaceSpecifier(self.inner))
19563        }
19564        /// Set the `local` field and mark the builder changed.
19565        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
19566    }
19567    /// Clone-with-changes builder for [`super::ImportAttribute`].
19568    #[derive(Debug)]
19569    pub struct ImportAttribute<'gc> {
19570        is_changed: bool,
19571        pub(super) inner: super::ImportAttribute<'gc>,
19572    }
19573    impl<'gc> ImportAttribute<'gc> {
19574        /// Start from a copy of `node`, with no field changed yet.
19575        pub fn from_node(node: &'gc super::ImportAttribute<'gc>) -> Self {
19576            Self {
19577                is_changed: false,
19578                inner: super::ImportAttribute {
19579                    metadata: node.metadata.duplicate(),
19580                    key: node.key.duplicate(),
19581                    value: node.value.duplicate(),
19582                },
19583            }
19584        }
19585        /// Allocate the rebuilt node if a setter ran, else
19586        /// `TransformResult::Unchanged`.
19587        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19588            if self.is_changed {
19589                TransformResult::Changed(self.build_forced(gc))
19590            } else {
19591                TransformResult::Unchanged
19592            }
19593        }
19594        /// Allocate the node unconditionally, changed or not.
19595        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19596            gc.alloc(Node::ImportAttribute(self.inner))
19597        }
19598        /// Set the `key` field and mark the builder changed.
19599        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
19600        /// Set the `value` field and mark the builder changed.
19601        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
19602    }
19603    /// Clone-with-changes builder for [`super::ExportNamedDeclaration`].
19604    #[derive(Debug)]
19605    pub struct ExportNamedDeclaration<'gc> {
19606        is_changed: bool,
19607        pub(super) inner: super::ExportNamedDeclaration<'gc>,
19608    }
19609    impl<'gc> ExportNamedDeclaration<'gc> {
19610        /// Start from a copy of `node`, with no field changed yet.
19611        pub fn from_node(node: &'gc super::ExportNamedDeclaration<'gc>) -> Self {
19612            Self {
19613                is_changed: false,
19614                inner: super::ExportNamedDeclaration {
19615                    metadata: node.metadata.duplicate(),
19616                    declaration: node.declaration.duplicate(),
19617                    specifiers: node.specifiers.duplicate(),
19618                    source: node.source.duplicate(),
19619                    export_kind: Cell::new(node.export_kind.get()),
19620                },
19621            }
19622        }
19623        /// Allocate the rebuilt node if a setter ran, else
19624        /// `TransformResult::Unchanged`.
19625        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19626            if self.is_changed {
19627                TransformResult::Changed(self.build_forced(gc))
19628            } else {
19629                TransformResult::Unchanged
19630            }
19631        }
19632        /// Allocate the node unconditionally, changed or not.
19633        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19634            gc.alloc(Node::ExportNamedDeclaration(self.inner))
19635        }
19636        /// Set the `declaration` field and mark the builder changed.
19637        pub fn declaration(&mut self, declaration: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.declaration = declaration; }
19638        /// Set the `specifiers` field and mark the builder changed.
19639        pub fn specifiers(&mut self, specifiers: NodeList<'gc>) { self.is_changed = true; self.inner.specifiers = specifiers; }
19640        /// Set the `source` field and mark the builder changed.
19641        pub fn source(&mut self, source: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.source = source; }
19642    }
19643    /// Clone-with-changes builder for [`super::ExportSpecifier`].
19644    #[derive(Debug)]
19645    pub struct ExportSpecifier<'gc> {
19646        is_changed: bool,
19647        pub(super) inner: super::ExportSpecifier<'gc>,
19648    }
19649    impl<'gc> ExportSpecifier<'gc> {
19650        /// Start from a copy of `node`, with no field changed yet.
19651        pub fn from_node(node: &'gc super::ExportSpecifier<'gc>) -> Self {
19652            Self {
19653                is_changed: false,
19654                inner: super::ExportSpecifier {
19655                    metadata: node.metadata.duplicate(),
19656                    exported: node.exported.duplicate(),
19657                    local: node.local.duplicate(),
19658                },
19659            }
19660        }
19661        /// Allocate the rebuilt node if a setter ran, else
19662        /// `TransformResult::Unchanged`.
19663        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19664            if self.is_changed {
19665                TransformResult::Changed(self.build_forced(gc))
19666            } else {
19667                TransformResult::Unchanged
19668            }
19669        }
19670        /// Allocate the node unconditionally, changed or not.
19671        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19672            gc.alloc(Node::ExportSpecifier(self.inner))
19673        }
19674        /// Set the `exported` field and mark the builder changed.
19675        pub fn exported(&mut self, exported: &'gc Node<'gc>) { self.is_changed = true; self.inner.exported = exported; }
19676        /// Set the `local` field and mark the builder changed.
19677        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
19678    }
19679    /// Clone-with-changes builder for [`super::ExportNamespaceSpecifier`].
19680    #[derive(Debug)]
19681    pub struct ExportNamespaceSpecifier<'gc> {
19682        is_changed: bool,
19683        pub(super) inner: super::ExportNamespaceSpecifier<'gc>,
19684    }
19685    impl<'gc> ExportNamespaceSpecifier<'gc> {
19686        /// Start from a copy of `node`, with no field changed yet.
19687        pub fn from_node(node: &'gc super::ExportNamespaceSpecifier<'gc>) -> Self {
19688            Self {
19689                is_changed: false,
19690                inner: super::ExportNamespaceSpecifier {
19691                    metadata: node.metadata.duplicate(),
19692                    exported: node.exported.duplicate(),
19693                },
19694            }
19695        }
19696        /// Allocate the rebuilt node if a setter ran, else
19697        /// `TransformResult::Unchanged`.
19698        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19699            if self.is_changed {
19700                TransformResult::Changed(self.build_forced(gc))
19701            } else {
19702                TransformResult::Unchanged
19703            }
19704        }
19705        /// Allocate the node unconditionally, changed or not.
19706        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19707            gc.alloc(Node::ExportNamespaceSpecifier(self.inner))
19708        }
19709        /// Set the `exported` field and mark the builder changed.
19710        pub fn exported(&mut self, exported: &'gc Node<'gc>) { self.is_changed = true; self.inner.exported = exported; }
19711    }
19712    /// Clone-with-changes builder for [`super::ExportDefaultDeclaration`].
19713    #[derive(Debug)]
19714    pub struct ExportDefaultDeclaration<'gc> {
19715        is_changed: bool,
19716        pub(super) inner: super::ExportDefaultDeclaration<'gc>,
19717    }
19718    impl<'gc> ExportDefaultDeclaration<'gc> {
19719        /// Start from a copy of `node`, with no field changed yet.
19720        pub fn from_node(node: &'gc super::ExportDefaultDeclaration<'gc>) -> Self {
19721            Self {
19722                is_changed: false,
19723                inner: super::ExportDefaultDeclaration {
19724                    metadata: node.metadata.duplicate(),
19725                    declaration: node.declaration.duplicate(),
19726                },
19727            }
19728        }
19729        /// Allocate the rebuilt node if a setter ran, else
19730        /// `TransformResult::Unchanged`.
19731        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19732            if self.is_changed {
19733                TransformResult::Changed(self.build_forced(gc))
19734            } else {
19735                TransformResult::Unchanged
19736            }
19737        }
19738        /// Allocate the node unconditionally, changed or not.
19739        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19740            gc.alloc(Node::ExportDefaultDeclaration(self.inner))
19741        }
19742        /// Set the `declaration` field and mark the builder changed.
19743        pub fn declaration(&mut self, declaration: &'gc Node<'gc>) { self.is_changed = true; self.inner.declaration = declaration; }
19744    }
19745    /// Clone-with-changes builder for [`super::ExportAllDeclaration`].
19746    #[derive(Debug)]
19747    pub struct ExportAllDeclaration<'gc> {
19748        is_changed: bool,
19749        pub(super) inner: super::ExportAllDeclaration<'gc>,
19750    }
19751    impl<'gc> ExportAllDeclaration<'gc> {
19752        /// Start from a copy of `node`, with no field changed yet.
19753        pub fn from_node(node: &'gc super::ExportAllDeclaration<'gc>) -> Self {
19754            Self {
19755                is_changed: false,
19756                inner: super::ExportAllDeclaration {
19757                    metadata: node.metadata.duplicate(),
19758                    source: node.source.duplicate(),
19759                    export_kind: Cell::new(node.export_kind.get()),
19760                },
19761            }
19762        }
19763        /// Allocate the rebuilt node if a setter ran, else
19764        /// `TransformResult::Unchanged`.
19765        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19766            if self.is_changed {
19767                TransformResult::Changed(self.build_forced(gc))
19768            } else {
19769                TransformResult::Unchanged
19770            }
19771        }
19772        /// Allocate the node unconditionally, changed or not.
19773        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19774            gc.alloc(Node::ExportAllDeclaration(self.inner))
19775        }
19776        /// Set the `source` field and mark the builder changed.
19777        pub fn source(&mut self, source: &'gc Node<'gc>) { self.is_changed = true; self.inner.source = source; }
19778    }
19779    /// Clone-with-changes builder for [`super::ObjectPattern`].
19780    #[derive(Debug)]
19781    pub struct ObjectPattern<'gc> {
19782        is_changed: bool,
19783        pub(super) inner: super::ObjectPattern<'gc>,
19784    }
19785    impl<'gc> ObjectPattern<'gc> {
19786        /// Start from a copy of `node`, with no field changed yet.
19787        pub fn from_node(node: &'gc super::ObjectPattern<'gc>) -> Self {
19788            Self {
19789                is_changed: false,
19790                inner: super::ObjectPattern {
19791                    metadata: node.metadata.duplicate(),
19792                    properties: node.properties.duplicate(),
19793                    type_annotation: node.type_annotation.duplicate(),
19794                },
19795            }
19796        }
19797        /// Allocate the rebuilt node if a setter ran, else
19798        /// `TransformResult::Unchanged`.
19799        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19800            if self.is_changed {
19801                TransformResult::Changed(self.build_forced(gc))
19802            } else {
19803                TransformResult::Unchanged
19804            }
19805        }
19806        /// Allocate the node unconditionally, changed or not.
19807        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19808            gc.alloc(Node::ObjectPattern(self.inner))
19809        }
19810        /// Set the `properties` field and mark the builder changed.
19811        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
19812        /// Set the `type_annotation` field and mark the builder changed.
19813        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
19814    }
19815    /// Clone-with-changes builder for [`super::ArrayPattern`].
19816    #[derive(Debug)]
19817    pub struct ArrayPattern<'gc> {
19818        is_changed: bool,
19819        pub(super) inner: super::ArrayPattern<'gc>,
19820    }
19821    impl<'gc> ArrayPattern<'gc> {
19822        /// Start from a copy of `node`, with no field changed yet.
19823        pub fn from_node(node: &'gc super::ArrayPattern<'gc>) -> Self {
19824            Self {
19825                is_changed: false,
19826                inner: super::ArrayPattern {
19827                    metadata: node.metadata.duplicate(),
19828                    elements: node.elements.duplicate(),
19829                    type_annotation: node.type_annotation.duplicate(),
19830                },
19831            }
19832        }
19833        /// Allocate the rebuilt node if a setter ran, else
19834        /// `TransformResult::Unchanged`.
19835        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19836            if self.is_changed {
19837                TransformResult::Changed(self.build_forced(gc))
19838            } else {
19839                TransformResult::Unchanged
19840            }
19841        }
19842        /// Allocate the node unconditionally, changed or not.
19843        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19844            gc.alloc(Node::ArrayPattern(self.inner))
19845        }
19846        /// Set the `elements` field and mark the builder changed.
19847        pub fn elements(&mut self, elements: NodeList<'gc>) { self.is_changed = true; self.inner.elements = elements; }
19848        /// Set the `type_annotation` field and mark the builder changed.
19849        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
19850    }
19851    /// Clone-with-changes builder for [`super::RestElement`].
19852    #[derive(Debug)]
19853    pub struct RestElement<'gc> {
19854        is_changed: bool,
19855        pub(super) inner: super::RestElement<'gc>,
19856    }
19857    impl<'gc> RestElement<'gc> {
19858        /// Start from a copy of `node`, with no field changed yet.
19859        pub fn from_node(node: &'gc super::RestElement<'gc>) -> Self {
19860            Self {
19861                is_changed: false,
19862                inner: super::RestElement {
19863                    metadata: node.metadata.duplicate(),
19864                    argument: node.argument.duplicate(),
19865                },
19866            }
19867        }
19868        /// Allocate the rebuilt node if a setter ran, else
19869        /// `TransformResult::Unchanged`.
19870        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19871            if self.is_changed {
19872                TransformResult::Changed(self.build_forced(gc))
19873            } else {
19874                TransformResult::Unchanged
19875            }
19876        }
19877        /// Allocate the node unconditionally, changed or not.
19878        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19879            gc.alloc(Node::RestElement(self.inner))
19880        }
19881        /// Set the `argument` field and mark the builder changed.
19882        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
19883    }
19884    /// Clone-with-changes builder for [`super::AssignmentPattern`].
19885    #[derive(Debug)]
19886    pub struct AssignmentPattern<'gc> {
19887        is_changed: bool,
19888        pub(super) inner: super::AssignmentPattern<'gc>,
19889    }
19890    impl<'gc> AssignmentPattern<'gc> {
19891        /// Start from a copy of `node`, with no field changed yet.
19892        pub fn from_node(node: &'gc super::AssignmentPattern<'gc>) -> Self {
19893            Self {
19894                is_changed: false,
19895                inner: super::AssignmentPattern {
19896                    metadata: node.metadata.duplicate(),
19897                    left: node.left.duplicate(),
19898                    right: node.right.duplicate(),
19899                },
19900            }
19901        }
19902        /// Allocate the rebuilt node if a setter ran, else
19903        /// `TransformResult::Unchanged`.
19904        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19905            if self.is_changed {
19906                TransformResult::Changed(self.build_forced(gc))
19907            } else {
19908                TransformResult::Unchanged
19909            }
19910        }
19911        /// Allocate the node unconditionally, changed or not.
19912        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19913            gc.alloc(Node::AssignmentPattern(self.inner))
19914        }
19915        /// Set the `left` field and mark the builder changed.
19916        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
19917        /// Set the `right` field and mark the builder changed.
19918        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
19919    }
19920    /// Clone-with-changes builder for [`super::MatchStatementCase`].
19921    #[derive(Debug)]
19922    pub struct MatchStatementCase<'gc> {
19923        is_changed: bool,
19924        pub(super) inner: super::MatchStatementCase<'gc>,
19925    }
19926    impl<'gc> MatchStatementCase<'gc> {
19927        /// Start from a copy of `node`, with no field changed yet.
19928        pub fn from_node(node: &'gc super::MatchStatementCase<'gc>) -> Self {
19929            Self {
19930                is_changed: false,
19931                inner: super::MatchStatementCase {
19932                    metadata: node.metadata.duplicate(),
19933                    pattern: node.pattern.duplicate(),
19934                    body: node.body.duplicate(),
19935                    guard: node.guard.duplicate(),
19936                },
19937            }
19938        }
19939        /// Allocate the rebuilt node if a setter ran, else
19940        /// `TransformResult::Unchanged`.
19941        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19942            if self.is_changed {
19943                TransformResult::Changed(self.build_forced(gc))
19944            } else {
19945                TransformResult::Unchanged
19946            }
19947        }
19948        /// Allocate the node unconditionally, changed or not.
19949        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19950            gc.alloc(Node::MatchStatementCase(self.inner))
19951        }
19952        /// Set the `pattern` field and mark the builder changed.
19953        pub fn pattern(&mut self, pattern: &'gc Node<'gc>) { self.is_changed = true; self.inner.pattern = pattern; }
19954        /// Set the `body` field and mark the builder changed.
19955        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
19956        /// Set the `guard` field and mark the builder changed.
19957        pub fn guard(&mut self, guard: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.guard = guard; }
19958    }
19959    /// Clone-with-changes builder for [`super::MatchExpression`].
19960    #[derive(Debug)]
19961    pub struct MatchExpression<'gc> {
19962        is_changed: bool,
19963        pub(super) inner: super::MatchExpression<'gc>,
19964    }
19965    impl<'gc> MatchExpression<'gc> {
19966        /// Start from a copy of `node`, with no field changed yet.
19967        pub fn from_node(node: &'gc super::MatchExpression<'gc>) -> Self {
19968            Self {
19969                is_changed: false,
19970                inner: super::MatchExpression {
19971                    metadata: node.metadata.duplicate(),
19972                    argument: node.argument.duplicate(),
19973                    cases: node.cases.duplicate(),
19974                },
19975            }
19976        }
19977        /// Allocate the rebuilt node if a setter ran, else
19978        /// `TransformResult::Unchanged`.
19979        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19980            if self.is_changed {
19981                TransformResult::Changed(self.build_forced(gc))
19982            } else {
19983                TransformResult::Unchanged
19984            }
19985        }
19986        /// Allocate the node unconditionally, changed or not.
19987        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19988            gc.alloc(Node::MatchExpression(self.inner))
19989        }
19990        /// Set the `argument` field and mark the builder changed.
19991        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
19992        /// Set the `cases` field and mark the builder changed.
19993        pub fn cases(&mut self, cases: NodeList<'gc>) { self.is_changed = true; self.inner.cases = cases; }
19994    }
19995    /// Clone-with-changes builder for [`super::MatchExpressionCase`].
19996    #[derive(Debug)]
19997    pub struct MatchExpressionCase<'gc> {
19998        is_changed: bool,
19999        pub(super) inner: super::MatchExpressionCase<'gc>,
20000    }
20001    impl<'gc> MatchExpressionCase<'gc> {
20002        /// Start from a copy of `node`, with no field changed yet.
20003        pub fn from_node(node: &'gc super::MatchExpressionCase<'gc>) -> Self {
20004            Self {
20005                is_changed: false,
20006                inner: super::MatchExpressionCase {
20007                    metadata: node.metadata.duplicate(),
20008                    pattern: node.pattern.duplicate(),
20009                    body: node.body.duplicate(),
20010                    guard: node.guard.duplicate(),
20011                },
20012            }
20013        }
20014        /// Allocate the rebuilt node if a setter ran, else
20015        /// `TransformResult::Unchanged`.
20016        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20017            if self.is_changed {
20018                TransformResult::Changed(self.build_forced(gc))
20019            } else {
20020                TransformResult::Unchanged
20021            }
20022        }
20023        /// Allocate the node unconditionally, changed or not.
20024        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20025            gc.alloc(Node::MatchExpressionCase(self.inner))
20026        }
20027        /// Set the `pattern` field and mark the builder changed.
20028        pub fn pattern(&mut self, pattern: &'gc Node<'gc>) { self.is_changed = true; self.inner.pattern = pattern; }
20029        /// Set the `body` field and mark the builder changed.
20030        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
20031        /// Set the `guard` field and mark the builder changed.
20032        pub fn guard(&mut self, guard: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.guard = guard; }
20033    }
20034    /// Clone-with-changes builder for [`super::MatchWildcardPattern`].
20035    #[derive(Debug)]
20036    pub struct MatchWildcardPattern<'gc> {
20037        is_changed: bool,
20038        pub(super) inner: super::MatchWildcardPattern<'gc>,
20039    }
20040    impl<'gc> MatchWildcardPattern<'gc> {
20041        /// Start from a copy of `node`, with no field changed yet.
20042        pub fn from_node(node: &'gc super::MatchWildcardPattern<'gc>) -> Self {
20043            Self {
20044                is_changed: false,
20045                inner: super::MatchWildcardPattern {
20046                    metadata: node.metadata.duplicate(),
20047                },
20048            }
20049        }
20050        /// Allocate the rebuilt node if a setter ran, else
20051        /// `TransformResult::Unchanged`.
20052        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20053            if self.is_changed {
20054                TransformResult::Changed(self.build_forced(gc))
20055            } else {
20056                TransformResult::Unchanged
20057            }
20058        }
20059        /// Allocate the node unconditionally, changed or not.
20060        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20061            gc.alloc(Node::MatchWildcardPattern(self.inner))
20062        }
20063    }
20064    /// Clone-with-changes builder for [`super::MatchLiteralPattern`].
20065    #[derive(Debug)]
20066    pub struct MatchLiteralPattern<'gc> {
20067        is_changed: bool,
20068        pub(super) inner: super::MatchLiteralPattern<'gc>,
20069    }
20070    impl<'gc> MatchLiteralPattern<'gc> {
20071        /// Start from a copy of `node`, with no field changed yet.
20072        pub fn from_node(node: &'gc super::MatchLiteralPattern<'gc>) -> Self {
20073            Self {
20074                is_changed: false,
20075                inner: super::MatchLiteralPattern {
20076                    metadata: node.metadata.duplicate(),
20077                    literal: node.literal.duplicate(),
20078                },
20079            }
20080        }
20081        /// Allocate the rebuilt node if a setter ran, else
20082        /// `TransformResult::Unchanged`.
20083        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20084            if self.is_changed {
20085                TransformResult::Changed(self.build_forced(gc))
20086            } else {
20087                TransformResult::Unchanged
20088            }
20089        }
20090        /// Allocate the node unconditionally, changed or not.
20091        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20092            gc.alloc(Node::MatchLiteralPattern(self.inner))
20093        }
20094        /// Set the `literal` field and mark the builder changed.
20095        pub fn literal(&mut self, literal: &'gc Node<'gc>) { self.is_changed = true; self.inner.literal = literal; }
20096    }
20097    /// Clone-with-changes builder for [`super::MatchUnaryPattern`].
20098    #[derive(Debug)]
20099    pub struct MatchUnaryPattern<'gc> {
20100        is_changed: bool,
20101        pub(super) inner: super::MatchUnaryPattern<'gc>,
20102    }
20103    impl<'gc> MatchUnaryPattern<'gc> {
20104        /// Start from a copy of `node`, with no field changed yet.
20105        pub fn from_node(node: &'gc super::MatchUnaryPattern<'gc>) -> Self {
20106            Self {
20107                is_changed: false,
20108                inner: super::MatchUnaryPattern {
20109                    metadata: node.metadata.duplicate(),
20110                    argument: node.argument.duplicate(),
20111                    operator: Cell::new(node.operator.get()),
20112                },
20113            }
20114        }
20115        /// Allocate the rebuilt node if a setter ran, else
20116        /// `TransformResult::Unchanged`.
20117        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20118            if self.is_changed {
20119                TransformResult::Changed(self.build_forced(gc))
20120            } else {
20121                TransformResult::Unchanged
20122            }
20123        }
20124        /// Allocate the node unconditionally, changed or not.
20125        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20126            gc.alloc(Node::MatchUnaryPattern(self.inner))
20127        }
20128        /// Set the `argument` field and mark the builder changed.
20129        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
20130    }
20131    /// Clone-with-changes builder for [`super::MatchIdentifierPattern`].
20132    #[derive(Debug)]
20133    pub struct MatchIdentifierPattern<'gc> {
20134        is_changed: bool,
20135        pub(super) inner: super::MatchIdentifierPattern<'gc>,
20136    }
20137    impl<'gc> MatchIdentifierPattern<'gc> {
20138        /// Start from a copy of `node`, with no field changed yet.
20139        pub fn from_node(node: &'gc super::MatchIdentifierPattern<'gc>) -> Self {
20140            Self {
20141                is_changed: false,
20142                inner: super::MatchIdentifierPattern {
20143                    metadata: node.metadata.duplicate(),
20144                    id: node.id.duplicate(),
20145                },
20146            }
20147        }
20148        /// Allocate the rebuilt node if a setter ran, else
20149        /// `TransformResult::Unchanged`.
20150        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20151            if self.is_changed {
20152                TransformResult::Changed(self.build_forced(gc))
20153            } else {
20154                TransformResult::Unchanged
20155            }
20156        }
20157        /// Allocate the node unconditionally, changed or not.
20158        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20159            gc.alloc(Node::MatchIdentifierPattern(self.inner))
20160        }
20161        /// Set the `id` field and mark the builder changed.
20162        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
20163    }
20164    /// Clone-with-changes builder for [`super::MatchBindingPattern`].
20165    #[derive(Debug)]
20166    pub struct MatchBindingPattern<'gc> {
20167        is_changed: bool,
20168        pub(super) inner: super::MatchBindingPattern<'gc>,
20169    }
20170    impl<'gc> MatchBindingPattern<'gc> {
20171        /// Start from a copy of `node`, with no field changed yet.
20172        pub fn from_node(node: &'gc super::MatchBindingPattern<'gc>) -> Self {
20173            Self {
20174                is_changed: false,
20175                inner: super::MatchBindingPattern {
20176                    metadata: node.metadata.duplicate(),
20177                    id: node.id.duplicate(),
20178                    kind: Cell::new(node.kind.get()),
20179                },
20180            }
20181        }
20182        /// Allocate the rebuilt node if a setter ran, else
20183        /// `TransformResult::Unchanged`.
20184        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20185            if self.is_changed {
20186                TransformResult::Changed(self.build_forced(gc))
20187            } else {
20188                TransformResult::Unchanged
20189            }
20190        }
20191        /// Allocate the node unconditionally, changed or not.
20192        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20193            gc.alloc(Node::MatchBindingPattern(self.inner))
20194        }
20195        /// Set the `id` field and mark the builder changed.
20196        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
20197    }
20198    /// Clone-with-changes builder for [`super::MatchObjectPattern`].
20199    #[derive(Debug)]
20200    pub struct MatchObjectPattern<'gc> {
20201        is_changed: bool,
20202        pub(super) inner: super::MatchObjectPattern<'gc>,
20203    }
20204    impl<'gc> MatchObjectPattern<'gc> {
20205        /// Start from a copy of `node`, with no field changed yet.
20206        pub fn from_node(node: &'gc super::MatchObjectPattern<'gc>) -> Self {
20207            Self {
20208                is_changed: false,
20209                inner: super::MatchObjectPattern {
20210                    metadata: node.metadata.duplicate(),
20211                    properties: node.properties.duplicate(),
20212                    rest: node.rest.duplicate(),
20213                },
20214            }
20215        }
20216        /// Allocate the rebuilt node if a setter ran, else
20217        /// `TransformResult::Unchanged`.
20218        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20219            if self.is_changed {
20220                TransformResult::Changed(self.build_forced(gc))
20221            } else {
20222                TransformResult::Unchanged
20223            }
20224        }
20225        /// Allocate the node unconditionally, changed or not.
20226        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20227            gc.alloc(Node::MatchObjectPattern(self.inner))
20228        }
20229        /// Set the `properties` field and mark the builder changed.
20230        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
20231        /// Set the `rest` field and mark the builder changed.
20232        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
20233    }
20234    /// Clone-with-changes builder for [`super::MatchArrayPattern`].
20235    #[derive(Debug)]
20236    pub struct MatchArrayPattern<'gc> {
20237        is_changed: bool,
20238        pub(super) inner: super::MatchArrayPattern<'gc>,
20239    }
20240    impl<'gc> MatchArrayPattern<'gc> {
20241        /// Start from a copy of `node`, with no field changed yet.
20242        pub fn from_node(node: &'gc super::MatchArrayPattern<'gc>) -> Self {
20243            Self {
20244                is_changed: false,
20245                inner: super::MatchArrayPattern {
20246                    metadata: node.metadata.duplicate(),
20247                    elements: node.elements.duplicate(),
20248                    rest: node.rest.duplicate(),
20249                },
20250            }
20251        }
20252        /// Allocate the rebuilt node if a setter ran, else
20253        /// `TransformResult::Unchanged`.
20254        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20255            if self.is_changed {
20256                TransformResult::Changed(self.build_forced(gc))
20257            } else {
20258                TransformResult::Unchanged
20259            }
20260        }
20261        /// Allocate the node unconditionally, changed or not.
20262        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20263            gc.alloc(Node::MatchArrayPattern(self.inner))
20264        }
20265        /// Set the `elements` field and mark the builder changed.
20266        pub fn elements(&mut self, elements: NodeList<'gc>) { self.is_changed = true; self.inner.elements = elements; }
20267        /// Set the `rest` field and mark the builder changed.
20268        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
20269    }
20270    /// Clone-with-changes builder for [`super::MatchOrPattern`].
20271    #[derive(Debug)]
20272    pub struct MatchOrPattern<'gc> {
20273        is_changed: bool,
20274        pub(super) inner: super::MatchOrPattern<'gc>,
20275    }
20276    impl<'gc> MatchOrPattern<'gc> {
20277        /// Start from a copy of `node`, with no field changed yet.
20278        pub fn from_node(node: &'gc super::MatchOrPattern<'gc>) -> Self {
20279            Self {
20280                is_changed: false,
20281                inner: super::MatchOrPattern {
20282                    metadata: node.metadata.duplicate(),
20283                    patterns: node.patterns.duplicate(),
20284                },
20285            }
20286        }
20287        /// Allocate the rebuilt node if a setter ran, else
20288        /// `TransformResult::Unchanged`.
20289        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20290            if self.is_changed {
20291                TransformResult::Changed(self.build_forced(gc))
20292            } else {
20293                TransformResult::Unchanged
20294            }
20295        }
20296        /// Allocate the node unconditionally, changed or not.
20297        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20298            gc.alloc(Node::MatchOrPattern(self.inner))
20299        }
20300        /// Set the `patterns` field and mark the builder changed.
20301        pub fn patterns(&mut self, patterns: NodeList<'gc>) { self.is_changed = true; self.inner.patterns = patterns; }
20302    }
20303    /// Clone-with-changes builder for [`super::MatchAsPattern`].
20304    #[derive(Debug)]
20305    pub struct MatchAsPattern<'gc> {
20306        is_changed: bool,
20307        pub(super) inner: super::MatchAsPattern<'gc>,
20308    }
20309    impl<'gc> MatchAsPattern<'gc> {
20310        /// Start from a copy of `node`, with no field changed yet.
20311        pub fn from_node(node: &'gc super::MatchAsPattern<'gc>) -> Self {
20312            Self {
20313                is_changed: false,
20314                inner: super::MatchAsPattern {
20315                    metadata: node.metadata.duplicate(),
20316                    pattern: node.pattern.duplicate(),
20317                    target: node.target.duplicate(),
20318                },
20319            }
20320        }
20321        /// Allocate the rebuilt node if a setter ran, else
20322        /// `TransformResult::Unchanged`.
20323        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20324            if self.is_changed {
20325                TransformResult::Changed(self.build_forced(gc))
20326            } else {
20327                TransformResult::Unchanged
20328            }
20329        }
20330        /// Allocate the node unconditionally, changed or not.
20331        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20332            gc.alloc(Node::MatchAsPattern(self.inner))
20333        }
20334        /// Set the `pattern` field and mark the builder changed.
20335        pub fn pattern(&mut self, pattern: &'gc Node<'gc>) { self.is_changed = true; self.inner.pattern = pattern; }
20336        /// Set the `target` field and mark the builder changed.
20337        pub fn target(&mut self, target: &'gc Node<'gc>) { self.is_changed = true; self.inner.target = target; }
20338    }
20339    /// Clone-with-changes builder for [`super::MatchMemberPattern`].
20340    #[derive(Debug)]
20341    pub struct MatchMemberPattern<'gc> {
20342        is_changed: bool,
20343        pub(super) inner: super::MatchMemberPattern<'gc>,
20344    }
20345    impl<'gc> MatchMemberPattern<'gc> {
20346        /// Start from a copy of `node`, with no field changed yet.
20347        pub fn from_node(node: &'gc super::MatchMemberPattern<'gc>) -> Self {
20348            Self {
20349                is_changed: false,
20350                inner: super::MatchMemberPattern {
20351                    metadata: node.metadata.duplicate(),
20352                    base: node.base.duplicate(),
20353                    property: node.property.duplicate(),
20354                },
20355            }
20356        }
20357        /// Allocate the rebuilt node if a setter ran, else
20358        /// `TransformResult::Unchanged`.
20359        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20360            if self.is_changed {
20361                TransformResult::Changed(self.build_forced(gc))
20362            } else {
20363                TransformResult::Unchanged
20364            }
20365        }
20366        /// Allocate the node unconditionally, changed or not.
20367        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20368            gc.alloc(Node::MatchMemberPattern(self.inner))
20369        }
20370        /// Set the `base` field and mark the builder changed.
20371        pub fn base(&mut self, base: &'gc Node<'gc>) { self.is_changed = true; self.inner.base = base; }
20372        /// Set the `property` field and mark the builder changed.
20373        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
20374    }
20375    /// Clone-with-changes builder for [`super::MatchInstancePattern`].
20376    #[derive(Debug)]
20377    pub struct MatchInstancePattern<'gc> {
20378        is_changed: bool,
20379        pub(super) inner: super::MatchInstancePattern<'gc>,
20380    }
20381    impl<'gc> MatchInstancePattern<'gc> {
20382        /// Start from a copy of `node`, with no field changed yet.
20383        pub fn from_node(node: &'gc super::MatchInstancePattern<'gc>) -> Self {
20384            Self {
20385                is_changed: false,
20386                inner: super::MatchInstancePattern {
20387                    metadata: node.metadata.duplicate(),
20388                    target_constructor: node.target_constructor.duplicate(),
20389                    properties: node.properties.duplicate(),
20390                },
20391            }
20392        }
20393        /// Allocate the rebuilt node if a setter ran, else
20394        /// `TransformResult::Unchanged`.
20395        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20396            if self.is_changed {
20397                TransformResult::Changed(self.build_forced(gc))
20398            } else {
20399                TransformResult::Unchanged
20400            }
20401        }
20402        /// Allocate the node unconditionally, changed or not.
20403        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20404            gc.alloc(Node::MatchInstancePattern(self.inner))
20405        }
20406        /// Set the `target_constructor` field and mark the builder changed.
20407        pub fn target_constructor(&mut self, target_constructor: &'gc Node<'gc>) { self.is_changed = true; self.inner.target_constructor = target_constructor; }
20408        /// Set the `properties` field and mark the builder changed.
20409        pub fn properties(&mut self, properties: &'gc Node<'gc>) { self.is_changed = true; self.inner.properties = properties; }
20410    }
20411    /// Clone-with-changes builder for [`super::MatchObjectPatternProperty`].
20412    #[derive(Debug)]
20413    pub struct MatchObjectPatternProperty<'gc> {
20414        is_changed: bool,
20415        pub(super) inner: super::MatchObjectPatternProperty<'gc>,
20416    }
20417    impl<'gc> MatchObjectPatternProperty<'gc> {
20418        /// Start from a copy of `node`, with no field changed yet.
20419        pub fn from_node(node: &'gc super::MatchObjectPatternProperty<'gc>) -> Self {
20420            Self {
20421                is_changed: false,
20422                inner: super::MatchObjectPatternProperty {
20423                    metadata: node.metadata.duplicate(),
20424                    key: node.key.duplicate(),
20425                    pattern: node.pattern.duplicate(),
20426                    shorthand: Cell::new(node.shorthand.get()),
20427                },
20428            }
20429        }
20430        /// Allocate the rebuilt node if a setter ran, else
20431        /// `TransformResult::Unchanged`.
20432        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20433            if self.is_changed {
20434                TransformResult::Changed(self.build_forced(gc))
20435            } else {
20436                TransformResult::Unchanged
20437            }
20438        }
20439        /// Allocate the node unconditionally, changed or not.
20440        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20441            gc.alloc(Node::MatchObjectPatternProperty(self.inner))
20442        }
20443        /// Set the `key` field and mark the builder changed.
20444        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
20445        /// Set the `pattern` field and mark the builder changed.
20446        pub fn pattern(&mut self, pattern: &'gc Node<'gc>) { self.is_changed = true; self.inner.pattern = pattern; }
20447    }
20448    /// Clone-with-changes builder for [`super::MatchInstanceObjectPattern`].
20449    #[derive(Debug)]
20450    pub struct MatchInstanceObjectPattern<'gc> {
20451        is_changed: bool,
20452        pub(super) inner: super::MatchInstanceObjectPattern<'gc>,
20453    }
20454    impl<'gc> MatchInstanceObjectPattern<'gc> {
20455        /// Start from a copy of `node`, with no field changed yet.
20456        pub fn from_node(node: &'gc super::MatchInstanceObjectPattern<'gc>) -> Self {
20457            Self {
20458                is_changed: false,
20459                inner: super::MatchInstanceObjectPattern {
20460                    metadata: node.metadata.duplicate(),
20461                    properties: node.properties.duplicate(),
20462                    rest: node.rest.duplicate(),
20463                },
20464            }
20465        }
20466        /// Allocate the rebuilt node if a setter ran, else
20467        /// `TransformResult::Unchanged`.
20468        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20469            if self.is_changed {
20470                TransformResult::Changed(self.build_forced(gc))
20471            } else {
20472                TransformResult::Unchanged
20473            }
20474        }
20475        /// Allocate the node unconditionally, changed or not.
20476        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20477            gc.alloc(Node::MatchInstanceObjectPattern(self.inner))
20478        }
20479        /// Set the `properties` field and mark the builder changed.
20480        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
20481        /// Set the `rest` field and mark the builder changed.
20482        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
20483    }
20484    /// Clone-with-changes builder for [`super::MatchRestPattern`].
20485    #[derive(Debug)]
20486    pub struct MatchRestPattern<'gc> {
20487        is_changed: bool,
20488        pub(super) inner: super::MatchRestPattern<'gc>,
20489    }
20490    impl<'gc> MatchRestPattern<'gc> {
20491        /// Start from a copy of `node`, with no field changed yet.
20492        pub fn from_node(node: &'gc super::MatchRestPattern<'gc>) -> Self {
20493            Self {
20494                is_changed: false,
20495                inner: super::MatchRestPattern {
20496                    metadata: node.metadata.duplicate(),
20497                    argument: node.argument.duplicate(),
20498                },
20499            }
20500        }
20501        /// Allocate the rebuilt node if a setter ran, else
20502        /// `TransformResult::Unchanged`.
20503        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20504            if self.is_changed {
20505                TransformResult::Changed(self.build_forced(gc))
20506            } else {
20507                TransformResult::Unchanged
20508            }
20509        }
20510        /// Allocate the node unconditionally, changed or not.
20511        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20512            gc.alloc(Node::MatchRestPattern(self.inner))
20513        }
20514        /// Set the `argument` field and mark the builder changed.
20515        pub fn argument(&mut self, argument: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.argument = argument; }
20516    }
20517    /// Clone-with-changes builder for [`super::JSXIdentifier`].
20518    #[derive(Debug)]
20519    pub struct JSXIdentifier<'gc> {
20520        is_changed: bool,
20521        pub(super) inner: super::JSXIdentifier<'gc>,
20522    }
20523    impl<'gc> JSXIdentifier<'gc> {
20524        /// Start from a copy of `node`, with no field changed yet.
20525        pub fn from_node(node: &'gc super::JSXIdentifier<'gc>) -> Self {
20526            Self {
20527                is_changed: false,
20528                inner: super::JSXIdentifier {
20529                    metadata: node.metadata.duplicate(),
20530                    name: Cell::new(node.name.get()),
20531                },
20532            }
20533        }
20534        /// Allocate the rebuilt node if a setter ran, else
20535        /// `TransformResult::Unchanged`.
20536        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20537            if self.is_changed {
20538                TransformResult::Changed(self.build_forced(gc))
20539            } else {
20540                TransformResult::Unchanged
20541            }
20542        }
20543        /// Allocate the node unconditionally, changed or not.
20544        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20545            gc.alloc(Node::JSXIdentifier(self.inner))
20546        }
20547    }
20548    /// Clone-with-changes builder for [`super::JSXMemberExpression`].
20549    #[derive(Debug)]
20550    pub struct JSXMemberExpression<'gc> {
20551        is_changed: bool,
20552        pub(super) inner: super::JSXMemberExpression<'gc>,
20553    }
20554    impl<'gc> JSXMemberExpression<'gc> {
20555        /// Start from a copy of `node`, with no field changed yet.
20556        pub fn from_node(node: &'gc super::JSXMemberExpression<'gc>) -> Self {
20557            Self {
20558                is_changed: false,
20559                inner: super::JSXMemberExpression {
20560                    metadata: node.metadata.duplicate(),
20561                    object: node.object.duplicate(),
20562                    property: node.property.duplicate(),
20563                },
20564            }
20565        }
20566        /// Allocate the rebuilt node if a setter ran, else
20567        /// `TransformResult::Unchanged`.
20568        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20569            if self.is_changed {
20570                TransformResult::Changed(self.build_forced(gc))
20571            } else {
20572                TransformResult::Unchanged
20573            }
20574        }
20575        /// Allocate the node unconditionally, changed or not.
20576        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20577            gc.alloc(Node::JSXMemberExpression(self.inner))
20578        }
20579        /// Set the `object` field and mark the builder changed.
20580        pub fn object(&mut self, object: &'gc Node<'gc>) { self.is_changed = true; self.inner.object = object; }
20581        /// Set the `property` field and mark the builder changed.
20582        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
20583    }
20584    /// Clone-with-changes builder for [`super::JSXNamespacedName`].
20585    #[derive(Debug)]
20586    pub struct JSXNamespacedName<'gc> {
20587        is_changed: bool,
20588        pub(super) inner: super::JSXNamespacedName<'gc>,
20589    }
20590    impl<'gc> JSXNamespacedName<'gc> {
20591        /// Start from a copy of `node`, with no field changed yet.
20592        pub fn from_node(node: &'gc super::JSXNamespacedName<'gc>) -> Self {
20593            Self {
20594                is_changed: false,
20595                inner: super::JSXNamespacedName {
20596                    metadata: node.metadata.duplicate(),
20597                    namespace: node.namespace.duplicate(),
20598                    name: node.name.duplicate(),
20599                },
20600            }
20601        }
20602        /// Allocate the rebuilt node if a setter ran, else
20603        /// `TransformResult::Unchanged`.
20604        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20605            if self.is_changed {
20606                TransformResult::Changed(self.build_forced(gc))
20607            } else {
20608                TransformResult::Unchanged
20609            }
20610        }
20611        /// Allocate the node unconditionally, changed or not.
20612        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20613            gc.alloc(Node::JSXNamespacedName(self.inner))
20614        }
20615        /// Set the `namespace` field and mark the builder changed.
20616        pub fn namespace(&mut self, namespace: &'gc Node<'gc>) { self.is_changed = true; self.inner.namespace = namespace; }
20617        /// Set the `name` field and mark the builder changed.
20618        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
20619    }
20620    /// Clone-with-changes builder for [`super::JSXEmptyExpression`].
20621    #[derive(Debug)]
20622    pub struct JSXEmptyExpression<'gc> {
20623        is_changed: bool,
20624        pub(super) inner: super::JSXEmptyExpression<'gc>,
20625    }
20626    impl<'gc> JSXEmptyExpression<'gc> {
20627        /// Start from a copy of `node`, with no field changed yet.
20628        pub fn from_node(node: &'gc super::JSXEmptyExpression<'gc>) -> Self {
20629            Self {
20630                is_changed: false,
20631                inner: super::JSXEmptyExpression {
20632                    metadata: node.metadata.duplicate(),
20633                },
20634            }
20635        }
20636        /// Allocate the rebuilt node if a setter ran, else
20637        /// `TransformResult::Unchanged`.
20638        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20639            if self.is_changed {
20640                TransformResult::Changed(self.build_forced(gc))
20641            } else {
20642                TransformResult::Unchanged
20643            }
20644        }
20645        /// Allocate the node unconditionally, changed or not.
20646        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20647            gc.alloc(Node::JSXEmptyExpression(self.inner))
20648        }
20649    }
20650    /// Clone-with-changes builder for [`super::JSXExpressionContainer`].
20651    #[derive(Debug)]
20652    pub struct JSXExpressionContainer<'gc> {
20653        is_changed: bool,
20654        pub(super) inner: super::JSXExpressionContainer<'gc>,
20655    }
20656    impl<'gc> JSXExpressionContainer<'gc> {
20657        /// Start from a copy of `node`, with no field changed yet.
20658        pub fn from_node(node: &'gc super::JSXExpressionContainer<'gc>) -> Self {
20659            Self {
20660                is_changed: false,
20661                inner: super::JSXExpressionContainer {
20662                    metadata: node.metadata.duplicate(),
20663                    expression: node.expression.duplicate(),
20664                },
20665            }
20666        }
20667        /// Allocate the rebuilt node if a setter ran, else
20668        /// `TransformResult::Unchanged`.
20669        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20670            if self.is_changed {
20671                TransformResult::Changed(self.build_forced(gc))
20672            } else {
20673                TransformResult::Unchanged
20674            }
20675        }
20676        /// Allocate the node unconditionally, changed or not.
20677        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20678            gc.alloc(Node::JSXExpressionContainer(self.inner))
20679        }
20680        /// Set the `expression` field and mark the builder changed.
20681        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
20682    }
20683    /// Clone-with-changes builder for [`super::JSXSpreadChild`].
20684    #[derive(Debug)]
20685    pub struct JSXSpreadChild<'gc> {
20686        is_changed: bool,
20687        pub(super) inner: super::JSXSpreadChild<'gc>,
20688    }
20689    impl<'gc> JSXSpreadChild<'gc> {
20690        /// Start from a copy of `node`, with no field changed yet.
20691        pub fn from_node(node: &'gc super::JSXSpreadChild<'gc>) -> Self {
20692            Self {
20693                is_changed: false,
20694                inner: super::JSXSpreadChild {
20695                    metadata: node.metadata.duplicate(),
20696                    expression: node.expression.duplicate(),
20697                },
20698            }
20699        }
20700        /// Allocate the rebuilt node if a setter ran, else
20701        /// `TransformResult::Unchanged`.
20702        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20703            if self.is_changed {
20704                TransformResult::Changed(self.build_forced(gc))
20705            } else {
20706                TransformResult::Unchanged
20707            }
20708        }
20709        /// Allocate the node unconditionally, changed or not.
20710        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20711            gc.alloc(Node::JSXSpreadChild(self.inner))
20712        }
20713        /// Set the `expression` field and mark the builder changed.
20714        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
20715    }
20716    /// Clone-with-changes builder for [`super::JSXOpeningElement`].
20717    #[derive(Debug)]
20718    pub struct JSXOpeningElement<'gc> {
20719        is_changed: bool,
20720        pub(super) inner: super::JSXOpeningElement<'gc>,
20721    }
20722    impl<'gc> JSXOpeningElement<'gc> {
20723        /// Start from a copy of `node`, with no field changed yet.
20724        pub fn from_node(node: &'gc super::JSXOpeningElement<'gc>) -> Self {
20725            Self {
20726                is_changed: false,
20727                inner: super::JSXOpeningElement {
20728                    metadata: node.metadata.duplicate(),
20729                    name: node.name.duplicate(),
20730                    attributes: node.attributes.duplicate(),
20731                    self_closing: Cell::new(node.self_closing.get()),
20732                    type_arguments: node.type_arguments.duplicate(),
20733                },
20734            }
20735        }
20736        /// Allocate the rebuilt node if a setter ran, else
20737        /// `TransformResult::Unchanged`.
20738        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20739            if self.is_changed {
20740                TransformResult::Changed(self.build_forced(gc))
20741            } else {
20742                TransformResult::Unchanged
20743            }
20744        }
20745        /// Allocate the node unconditionally, changed or not.
20746        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20747            gc.alloc(Node::JSXOpeningElement(self.inner))
20748        }
20749        /// Set the `name` field and mark the builder changed.
20750        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
20751        /// Set the `attributes` field and mark the builder changed.
20752        pub fn attributes(&mut self, attributes: NodeList<'gc>) { self.is_changed = true; self.inner.attributes = attributes; }
20753        /// Set the `type_arguments` field and mark the builder changed.
20754        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
20755    }
20756    /// Clone-with-changes builder for [`super::JSXClosingElement`].
20757    #[derive(Debug)]
20758    pub struct JSXClosingElement<'gc> {
20759        is_changed: bool,
20760        pub(super) inner: super::JSXClosingElement<'gc>,
20761    }
20762    impl<'gc> JSXClosingElement<'gc> {
20763        /// Start from a copy of `node`, with no field changed yet.
20764        pub fn from_node(node: &'gc super::JSXClosingElement<'gc>) -> Self {
20765            Self {
20766                is_changed: false,
20767                inner: super::JSXClosingElement {
20768                    metadata: node.metadata.duplicate(),
20769                    name: node.name.duplicate(),
20770                },
20771            }
20772        }
20773        /// Allocate the rebuilt node if a setter ran, else
20774        /// `TransformResult::Unchanged`.
20775        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20776            if self.is_changed {
20777                TransformResult::Changed(self.build_forced(gc))
20778            } else {
20779                TransformResult::Unchanged
20780            }
20781        }
20782        /// Allocate the node unconditionally, changed or not.
20783        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20784            gc.alloc(Node::JSXClosingElement(self.inner))
20785        }
20786        /// Set the `name` field and mark the builder changed.
20787        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
20788    }
20789    /// Clone-with-changes builder for [`super::JSXAttribute`].
20790    #[derive(Debug)]
20791    pub struct JSXAttribute<'gc> {
20792        is_changed: bool,
20793        pub(super) inner: super::JSXAttribute<'gc>,
20794    }
20795    impl<'gc> JSXAttribute<'gc> {
20796        /// Start from a copy of `node`, with no field changed yet.
20797        pub fn from_node(node: &'gc super::JSXAttribute<'gc>) -> Self {
20798            Self {
20799                is_changed: false,
20800                inner: super::JSXAttribute {
20801                    metadata: node.metadata.duplicate(),
20802                    name: node.name.duplicate(),
20803                    value: node.value.duplicate(),
20804                },
20805            }
20806        }
20807        /// Allocate the rebuilt node if a setter ran, else
20808        /// `TransformResult::Unchanged`.
20809        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20810            if self.is_changed {
20811                TransformResult::Changed(self.build_forced(gc))
20812            } else {
20813                TransformResult::Unchanged
20814            }
20815        }
20816        /// Allocate the node unconditionally, changed or not.
20817        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20818            gc.alloc(Node::JSXAttribute(self.inner))
20819        }
20820        /// Set the `name` field and mark the builder changed.
20821        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
20822        /// Set the `value` field and mark the builder changed.
20823        pub fn value(&mut self, value: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.value = value; }
20824    }
20825    /// Clone-with-changes builder for [`super::JSXSpreadAttribute`].
20826    #[derive(Debug)]
20827    pub struct JSXSpreadAttribute<'gc> {
20828        is_changed: bool,
20829        pub(super) inner: super::JSXSpreadAttribute<'gc>,
20830    }
20831    impl<'gc> JSXSpreadAttribute<'gc> {
20832        /// Start from a copy of `node`, with no field changed yet.
20833        pub fn from_node(node: &'gc super::JSXSpreadAttribute<'gc>) -> Self {
20834            Self {
20835                is_changed: false,
20836                inner: super::JSXSpreadAttribute {
20837                    metadata: node.metadata.duplicate(),
20838                    argument: node.argument.duplicate(),
20839                },
20840            }
20841        }
20842        /// Allocate the rebuilt node if a setter ran, else
20843        /// `TransformResult::Unchanged`.
20844        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20845            if self.is_changed {
20846                TransformResult::Changed(self.build_forced(gc))
20847            } else {
20848                TransformResult::Unchanged
20849            }
20850        }
20851        /// Allocate the node unconditionally, changed or not.
20852        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20853            gc.alloc(Node::JSXSpreadAttribute(self.inner))
20854        }
20855        /// Set the `argument` field and mark the builder changed.
20856        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
20857    }
20858    /// Clone-with-changes builder for [`super::JSXStringLiteral`].
20859    #[derive(Debug)]
20860    pub struct JSXStringLiteral<'gc> {
20861        is_changed: bool,
20862        pub(super) inner: super::JSXStringLiteral<'gc>,
20863    }
20864    impl<'gc> JSXStringLiteral<'gc> {
20865        /// Start from a copy of `node`, with no field changed yet.
20866        pub fn from_node(node: &'gc super::JSXStringLiteral<'gc>) -> Self {
20867            Self {
20868                is_changed: false,
20869                inner: super::JSXStringLiteral {
20870                    metadata: node.metadata.duplicate(),
20871                    value: Cell::new(node.value.get()),
20872                    raw: Cell::new(node.raw.get()),
20873                },
20874            }
20875        }
20876        /// Allocate the rebuilt node if a setter ran, else
20877        /// `TransformResult::Unchanged`.
20878        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20879            if self.is_changed {
20880                TransformResult::Changed(self.build_forced(gc))
20881            } else {
20882                TransformResult::Unchanged
20883            }
20884        }
20885        /// Allocate the node unconditionally, changed or not.
20886        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20887            gc.alloc(Node::JSXStringLiteral(self.inner))
20888        }
20889    }
20890    /// Clone-with-changes builder for [`super::JSXText`].
20891    #[derive(Debug)]
20892    pub struct JSXText<'gc> {
20893        is_changed: bool,
20894        pub(super) inner: super::JSXText<'gc>,
20895    }
20896    impl<'gc> JSXText<'gc> {
20897        /// Start from a copy of `node`, with no field changed yet.
20898        pub fn from_node(node: &'gc super::JSXText<'gc>) -> Self {
20899            Self {
20900                is_changed: false,
20901                inner: super::JSXText {
20902                    metadata: node.metadata.duplicate(),
20903                    value: Cell::new(node.value.get()),
20904                    raw: Cell::new(node.raw.get()),
20905                },
20906            }
20907        }
20908        /// Allocate the rebuilt node if a setter ran, else
20909        /// `TransformResult::Unchanged`.
20910        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20911            if self.is_changed {
20912                TransformResult::Changed(self.build_forced(gc))
20913            } else {
20914                TransformResult::Unchanged
20915            }
20916        }
20917        /// Allocate the node unconditionally, changed or not.
20918        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20919            gc.alloc(Node::JSXText(self.inner))
20920        }
20921    }
20922    /// Clone-with-changes builder for [`super::JSXElement`].
20923    #[derive(Debug)]
20924    pub struct JSXElement<'gc> {
20925        is_changed: bool,
20926        pub(super) inner: super::JSXElement<'gc>,
20927    }
20928    impl<'gc> JSXElement<'gc> {
20929        /// Start from a copy of `node`, with no field changed yet.
20930        pub fn from_node(node: &'gc super::JSXElement<'gc>) -> Self {
20931            Self {
20932                is_changed: false,
20933                inner: super::JSXElement {
20934                    metadata: node.metadata.duplicate(),
20935                    opening_element: node.opening_element.duplicate(),
20936                    children: node.children.duplicate(),
20937                    closing_element: node.closing_element.duplicate(),
20938                },
20939            }
20940        }
20941        /// Allocate the rebuilt node if a setter ran, else
20942        /// `TransformResult::Unchanged`.
20943        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20944            if self.is_changed {
20945                TransformResult::Changed(self.build_forced(gc))
20946            } else {
20947                TransformResult::Unchanged
20948            }
20949        }
20950        /// Allocate the node unconditionally, changed or not.
20951        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20952            gc.alloc(Node::JSXElement(self.inner))
20953        }
20954        /// Set the `opening_element` field and mark the builder changed.
20955        pub fn opening_element(&mut self, opening_element: &'gc Node<'gc>) { self.is_changed = true; self.inner.opening_element = opening_element; }
20956        /// Set the `children` field and mark the builder changed.
20957        pub fn children(&mut self, children: NodeList<'gc>) { self.is_changed = true; self.inner.children = children; }
20958        /// Set the `closing_element` field and mark the builder changed.
20959        pub fn closing_element(&mut self, closing_element: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.closing_element = closing_element; }
20960    }
20961    /// Clone-with-changes builder for [`super::JSXFragment`].
20962    #[derive(Debug)]
20963    pub struct JSXFragment<'gc> {
20964        is_changed: bool,
20965        pub(super) inner: super::JSXFragment<'gc>,
20966    }
20967    impl<'gc> JSXFragment<'gc> {
20968        /// Start from a copy of `node`, with no field changed yet.
20969        pub fn from_node(node: &'gc super::JSXFragment<'gc>) -> Self {
20970            Self {
20971                is_changed: false,
20972                inner: super::JSXFragment {
20973                    metadata: node.metadata.duplicate(),
20974                    opening_fragment: node.opening_fragment.duplicate(),
20975                    children: node.children.duplicate(),
20976                    closing_fragment: node.closing_fragment.duplicate(),
20977                },
20978            }
20979        }
20980        /// Allocate the rebuilt node if a setter ran, else
20981        /// `TransformResult::Unchanged`.
20982        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20983            if self.is_changed {
20984                TransformResult::Changed(self.build_forced(gc))
20985            } else {
20986                TransformResult::Unchanged
20987            }
20988        }
20989        /// Allocate the node unconditionally, changed or not.
20990        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20991            gc.alloc(Node::JSXFragment(self.inner))
20992        }
20993        /// Set the `opening_fragment` field and mark the builder changed.
20994        pub fn opening_fragment(&mut self, opening_fragment: &'gc Node<'gc>) { self.is_changed = true; self.inner.opening_fragment = opening_fragment; }
20995        /// Set the `children` field and mark the builder changed.
20996        pub fn children(&mut self, children: NodeList<'gc>) { self.is_changed = true; self.inner.children = children; }
20997        /// Set the `closing_fragment` field and mark the builder changed.
20998        pub fn closing_fragment(&mut self, closing_fragment: &'gc Node<'gc>) { self.is_changed = true; self.inner.closing_fragment = closing_fragment; }
20999    }
21000    /// Clone-with-changes builder for [`super::JSXOpeningFragment`].
21001    #[derive(Debug)]
21002    pub struct JSXOpeningFragment<'gc> {
21003        is_changed: bool,
21004        pub(super) inner: super::JSXOpeningFragment<'gc>,
21005    }
21006    impl<'gc> JSXOpeningFragment<'gc> {
21007        /// Start from a copy of `node`, with no field changed yet.
21008        pub fn from_node(node: &'gc super::JSXOpeningFragment<'gc>) -> Self {
21009            Self {
21010                is_changed: false,
21011                inner: super::JSXOpeningFragment {
21012                    metadata: node.metadata.duplicate(),
21013                },
21014            }
21015        }
21016        /// Allocate the rebuilt node if a setter ran, else
21017        /// `TransformResult::Unchanged`.
21018        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21019            if self.is_changed {
21020                TransformResult::Changed(self.build_forced(gc))
21021            } else {
21022                TransformResult::Unchanged
21023            }
21024        }
21025        /// Allocate the node unconditionally, changed or not.
21026        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21027            gc.alloc(Node::JSXOpeningFragment(self.inner))
21028        }
21029    }
21030    /// Clone-with-changes builder for [`super::JSXClosingFragment`].
21031    #[derive(Debug)]
21032    pub struct JSXClosingFragment<'gc> {
21033        is_changed: bool,
21034        pub(super) inner: super::JSXClosingFragment<'gc>,
21035    }
21036    impl<'gc> JSXClosingFragment<'gc> {
21037        /// Start from a copy of `node`, with no field changed yet.
21038        pub fn from_node(node: &'gc super::JSXClosingFragment<'gc>) -> Self {
21039            Self {
21040                is_changed: false,
21041                inner: super::JSXClosingFragment {
21042                    metadata: node.metadata.duplicate(),
21043                },
21044            }
21045        }
21046        /// Allocate the rebuilt node if a setter ran, else
21047        /// `TransformResult::Unchanged`.
21048        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21049            if self.is_changed {
21050                TransformResult::Changed(self.build_forced(gc))
21051            } else {
21052                TransformResult::Unchanged
21053            }
21054        }
21055        /// Allocate the node unconditionally, changed or not.
21056        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21057            gc.alloc(Node::JSXClosingFragment(self.inner))
21058        }
21059    }
21060    /// Clone-with-changes builder for [`super::ExistsTypeAnnotation`].
21061    #[derive(Debug)]
21062    pub struct ExistsTypeAnnotation<'gc> {
21063        is_changed: bool,
21064        pub(super) inner: super::ExistsTypeAnnotation<'gc>,
21065    }
21066    impl<'gc> ExistsTypeAnnotation<'gc> {
21067        /// Start from a copy of `node`, with no field changed yet.
21068        pub fn from_node(node: &'gc super::ExistsTypeAnnotation<'gc>) -> Self {
21069            Self {
21070                is_changed: false,
21071                inner: super::ExistsTypeAnnotation {
21072                    metadata: node.metadata.duplicate(),
21073                },
21074            }
21075        }
21076        /// Allocate the rebuilt node if a setter ran, else
21077        /// `TransformResult::Unchanged`.
21078        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21079            if self.is_changed {
21080                TransformResult::Changed(self.build_forced(gc))
21081            } else {
21082                TransformResult::Unchanged
21083            }
21084        }
21085        /// Allocate the node unconditionally, changed or not.
21086        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21087            gc.alloc(Node::ExistsTypeAnnotation(self.inner))
21088        }
21089    }
21090    /// Clone-with-changes builder for [`super::EmptyTypeAnnotation`].
21091    #[derive(Debug)]
21092    pub struct EmptyTypeAnnotation<'gc> {
21093        is_changed: bool,
21094        pub(super) inner: super::EmptyTypeAnnotation<'gc>,
21095    }
21096    impl<'gc> EmptyTypeAnnotation<'gc> {
21097        /// Start from a copy of `node`, with no field changed yet.
21098        pub fn from_node(node: &'gc super::EmptyTypeAnnotation<'gc>) -> Self {
21099            Self {
21100                is_changed: false,
21101                inner: super::EmptyTypeAnnotation {
21102                    metadata: node.metadata.duplicate(),
21103                },
21104            }
21105        }
21106        /// Allocate the rebuilt node if a setter ran, else
21107        /// `TransformResult::Unchanged`.
21108        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21109            if self.is_changed {
21110                TransformResult::Changed(self.build_forced(gc))
21111            } else {
21112                TransformResult::Unchanged
21113            }
21114        }
21115        /// Allocate the node unconditionally, changed or not.
21116        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21117            gc.alloc(Node::EmptyTypeAnnotation(self.inner))
21118        }
21119    }
21120    /// Clone-with-changes builder for [`super::StringTypeAnnotation`].
21121    #[derive(Debug)]
21122    pub struct StringTypeAnnotation<'gc> {
21123        is_changed: bool,
21124        pub(super) inner: super::StringTypeAnnotation<'gc>,
21125    }
21126    impl<'gc> StringTypeAnnotation<'gc> {
21127        /// Start from a copy of `node`, with no field changed yet.
21128        pub fn from_node(node: &'gc super::StringTypeAnnotation<'gc>) -> Self {
21129            Self {
21130                is_changed: false,
21131                inner: super::StringTypeAnnotation {
21132                    metadata: node.metadata.duplicate(),
21133                },
21134            }
21135        }
21136        /// Allocate the rebuilt node if a setter ran, else
21137        /// `TransformResult::Unchanged`.
21138        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21139            if self.is_changed {
21140                TransformResult::Changed(self.build_forced(gc))
21141            } else {
21142                TransformResult::Unchanged
21143            }
21144        }
21145        /// Allocate the node unconditionally, changed or not.
21146        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21147            gc.alloc(Node::StringTypeAnnotation(self.inner))
21148        }
21149    }
21150    /// Clone-with-changes builder for [`super::NumberTypeAnnotation`].
21151    #[derive(Debug)]
21152    pub struct NumberTypeAnnotation<'gc> {
21153        is_changed: bool,
21154        pub(super) inner: super::NumberTypeAnnotation<'gc>,
21155    }
21156    impl<'gc> NumberTypeAnnotation<'gc> {
21157        /// Start from a copy of `node`, with no field changed yet.
21158        pub fn from_node(node: &'gc super::NumberTypeAnnotation<'gc>) -> Self {
21159            Self {
21160                is_changed: false,
21161                inner: super::NumberTypeAnnotation {
21162                    metadata: node.metadata.duplicate(),
21163                },
21164            }
21165        }
21166        /// Allocate the rebuilt node if a setter ran, else
21167        /// `TransformResult::Unchanged`.
21168        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21169            if self.is_changed {
21170                TransformResult::Changed(self.build_forced(gc))
21171            } else {
21172                TransformResult::Unchanged
21173            }
21174        }
21175        /// Allocate the node unconditionally, changed or not.
21176        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21177            gc.alloc(Node::NumberTypeAnnotation(self.inner))
21178        }
21179    }
21180    /// Clone-with-changes builder for [`super::StringLiteralTypeAnnotation`].
21181    #[derive(Debug)]
21182    pub struct StringLiteralTypeAnnotation<'gc> {
21183        is_changed: bool,
21184        pub(super) inner: super::StringLiteralTypeAnnotation<'gc>,
21185    }
21186    impl<'gc> StringLiteralTypeAnnotation<'gc> {
21187        /// Start from a copy of `node`, with no field changed yet.
21188        pub fn from_node(node: &'gc super::StringLiteralTypeAnnotation<'gc>) -> Self {
21189            Self {
21190                is_changed: false,
21191                inner: super::StringLiteralTypeAnnotation {
21192                    metadata: node.metadata.duplicate(),
21193                    value: Cell::new(node.value.get()),
21194                    raw: Cell::new(node.raw.get()),
21195                },
21196            }
21197        }
21198        /// Allocate the rebuilt node if a setter ran, else
21199        /// `TransformResult::Unchanged`.
21200        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21201            if self.is_changed {
21202                TransformResult::Changed(self.build_forced(gc))
21203            } else {
21204                TransformResult::Unchanged
21205            }
21206        }
21207        /// Allocate the node unconditionally, changed or not.
21208        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21209            gc.alloc(Node::StringLiteralTypeAnnotation(self.inner))
21210        }
21211    }
21212    /// Clone-with-changes builder for [`super::NumberLiteralTypeAnnotation`].
21213    #[derive(Debug)]
21214    pub struct NumberLiteralTypeAnnotation<'gc> {
21215        is_changed: bool,
21216        pub(super) inner: super::NumberLiteralTypeAnnotation<'gc>,
21217    }
21218    impl<'gc> NumberLiteralTypeAnnotation<'gc> {
21219        /// Start from a copy of `node`, with no field changed yet.
21220        pub fn from_node(node: &'gc super::NumberLiteralTypeAnnotation<'gc>) -> Self {
21221            Self {
21222                is_changed: false,
21223                inner: super::NumberLiteralTypeAnnotation {
21224                    metadata: node.metadata.duplicate(),
21225                    value: Cell::new(node.value.get()),
21226                    raw: Cell::new(node.raw.get()),
21227                },
21228            }
21229        }
21230        /// Allocate the rebuilt node if a setter ran, else
21231        /// `TransformResult::Unchanged`.
21232        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21233            if self.is_changed {
21234                TransformResult::Changed(self.build_forced(gc))
21235            } else {
21236                TransformResult::Unchanged
21237            }
21238        }
21239        /// Allocate the node unconditionally, changed or not.
21240        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21241            gc.alloc(Node::NumberLiteralTypeAnnotation(self.inner))
21242        }
21243    }
21244    /// Clone-with-changes builder for [`super::BigIntLiteralTypeAnnotation`].
21245    #[derive(Debug)]
21246    pub struct BigIntLiteralTypeAnnotation<'gc> {
21247        is_changed: bool,
21248        pub(super) inner: super::BigIntLiteralTypeAnnotation<'gc>,
21249    }
21250    impl<'gc> BigIntLiteralTypeAnnotation<'gc> {
21251        /// Start from a copy of `node`, with no field changed yet.
21252        pub fn from_node(node: &'gc super::BigIntLiteralTypeAnnotation<'gc>) -> Self {
21253            Self {
21254                is_changed: false,
21255                inner: super::BigIntLiteralTypeAnnotation {
21256                    metadata: node.metadata.duplicate(),
21257                    raw: Cell::new(node.raw.get()),
21258                },
21259            }
21260        }
21261        /// Allocate the rebuilt node if a setter ran, else
21262        /// `TransformResult::Unchanged`.
21263        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21264            if self.is_changed {
21265                TransformResult::Changed(self.build_forced(gc))
21266            } else {
21267                TransformResult::Unchanged
21268            }
21269        }
21270        /// Allocate the node unconditionally, changed or not.
21271        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21272            gc.alloc(Node::BigIntLiteralTypeAnnotation(self.inner))
21273        }
21274    }
21275    /// Clone-with-changes builder for [`super::BooleanTypeAnnotation`].
21276    #[derive(Debug)]
21277    pub struct BooleanTypeAnnotation<'gc> {
21278        is_changed: bool,
21279        pub(super) inner: super::BooleanTypeAnnotation<'gc>,
21280    }
21281    impl<'gc> BooleanTypeAnnotation<'gc> {
21282        /// Start from a copy of `node`, with no field changed yet.
21283        pub fn from_node(node: &'gc super::BooleanTypeAnnotation<'gc>) -> Self {
21284            Self {
21285                is_changed: false,
21286                inner: super::BooleanTypeAnnotation {
21287                    metadata: node.metadata.duplicate(),
21288                },
21289            }
21290        }
21291        /// Allocate the rebuilt node if a setter ran, else
21292        /// `TransformResult::Unchanged`.
21293        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21294            if self.is_changed {
21295                TransformResult::Changed(self.build_forced(gc))
21296            } else {
21297                TransformResult::Unchanged
21298            }
21299        }
21300        /// Allocate the node unconditionally, changed or not.
21301        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21302            gc.alloc(Node::BooleanTypeAnnotation(self.inner))
21303        }
21304    }
21305    /// Clone-with-changes builder for [`super::BooleanLiteralTypeAnnotation`].
21306    #[derive(Debug)]
21307    pub struct BooleanLiteralTypeAnnotation<'gc> {
21308        is_changed: bool,
21309        pub(super) inner: super::BooleanLiteralTypeAnnotation<'gc>,
21310    }
21311    impl<'gc> BooleanLiteralTypeAnnotation<'gc> {
21312        /// Start from a copy of `node`, with no field changed yet.
21313        pub fn from_node(node: &'gc super::BooleanLiteralTypeAnnotation<'gc>) -> Self {
21314            Self {
21315                is_changed: false,
21316                inner: super::BooleanLiteralTypeAnnotation {
21317                    metadata: node.metadata.duplicate(),
21318                    value: Cell::new(node.value.get()),
21319                    raw: Cell::new(node.raw.get()),
21320                },
21321            }
21322        }
21323        /// Allocate the rebuilt node if a setter ran, else
21324        /// `TransformResult::Unchanged`.
21325        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21326            if self.is_changed {
21327                TransformResult::Changed(self.build_forced(gc))
21328            } else {
21329                TransformResult::Unchanged
21330            }
21331        }
21332        /// Allocate the node unconditionally, changed or not.
21333        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21334            gc.alloc(Node::BooleanLiteralTypeAnnotation(self.inner))
21335        }
21336    }
21337    /// Clone-with-changes builder for [`super::NullLiteralTypeAnnotation`].
21338    #[derive(Debug)]
21339    pub struct NullLiteralTypeAnnotation<'gc> {
21340        is_changed: bool,
21341        pub(super) inner: super::NullLiteralTypeAnnotation<'gc>,
21342    }
21343    impl<'gc> NullLiteralTypeAnnotation<'gc> {
21344        /// Start from a copy of `node`, with no field changed yet.
21345        pub fn from_node(node: &'gc super::NullLiteralTypeAnnotation<'gc>) -> Self {
21346            Self {
21347                is_changed: false,
21348                inner: super::NullLiteralTypeAnnotation {
21349                    metadata: node.metadata.duplicate(),
21350                },
21351            }
21352        }
21353        /// Allocate the rebuilt node if a setter ran, else
21354        /// `TransformResult::Unchanged`.
21355        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21356            if self.is_changed {
21357                TransformResult::Changed(self.build_forced(gc))
21358            } else {
21359                TransformResult::Unchanged
21360            }
21361        }
21362        /// Allocate the node unconditionally, changed or not.
21363        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21364            gc.alloc(Node::NullLiteralTypeAnnotation(self.inner))
21365        }
21366    }
21367    /// Clone-with-changes builder for [`super::SymbolTypeAnnotation`].
21368    #[derive(Debug)]
21369    pub struct SymbolTypeAnnotation<'gc> {
21370        is_changed: bool,
21371        pub(super) inner: super::SymbolTypeAnnotation<'gc>,
21372    }
21373    impl<'gc> SymbolTypeAnnotation<'gc> {
21374        /// Start from a copy of `node`, with no field changed yet.
21375        pub fn from_node(node: &'gc super::SymbolTypeAnnotation<'gc>) -> Self {
21376            Self {
21377                is_changed: false,
21378                inner: super::SymbolTypeAnnotation {
21379                    metadata: node.metadata.duplicate(),
21380                },
21381            }
21382        }
21383        /// Allocate the rebuilt node if a setter ran, else
21384        /// `TransformResult::Unchanged`.
21385        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21386            if self.is_changed {
21387                TransformResult::Changed(self.build_forced(gc))
21388            } else {
21389                TransformResult::Unchanged
21390            }
21391        }
21392        /// Allocate the node unconditionally, changed or not.
21393        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21394            gc.alloc(Node::SymbolTypeAnnotation(self.inner))
21395        }
21396    }
21397    /// Clone-with-changes builder for [`super::AnyTypeAnnotation`].
21398    #[derive(Debug)]
21399    pub struct AnyTypeAnnotation<'gc> {
21400        is_changed: bool,
21401        pub(super) inner: super::AnyTypeAnnotation<'gc>,
21402    }
21403    impl<'gc> AnyTypeAnnotation<'gc> {
21404        /// Start from a copy of `node`, with no field changed yet.
21405        pub fn from_node(node: &'gc super::AnyTypeAnnotation<'gc>) -> Self {
21406            Self {
21407                is_changed: false,
21408                inner: super::AnyTypeAnnotation {
21409                    metadata: node.metadata.duplicate(),
21410                },
21411            }
21412        }
21413        /// Allocate the rebuilt node if a setter ran, else
21414        /// `TransformResult::Unchanged`.
21415        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21416            if self.is_changed {
21417                TransformResult::Changed(self.build_forced(gc))
21418            } else {
21419                TransformResult::Unchanged
21420            }
21421        }
21422        /// Allocate the node unconditionally, changed or not.
21423        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21424            gc.alloc(Node::AnyTypeAnnotation(self.inner))
21425        }
21426    }
21427    /// Clone-with-changes builder for [`super::MixedTypeAnnotation`].
21428    #[derive(Debug)]
21429    pub struct MixedTypeAnnotation<'gc> {
21430        is_changed: bool,
21431        pub(super) inner: super::MixedTypeAnnotation<'gc>,
21432    }
21433    impl<'gc> MixedTypeAnnotation<'gc> {
21434        /// Start from a copy of `node`, with no field changed yet.
21435        pub fn from_node(node: &'gc super::MixedTypeAnnotation<'gc>) -> Self {
21436            Self {
21437                is_changed: false,
21438                inner: super::MixedTypeAnnotation {
21439                    metadata: node.metadata.duplicate(),
21440                },
21441            }
21442        }
21443        /// Allocate the rebuilt node if a setter ran, else
21444        /// `TransformResult::Unchanged`.
21445        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21446            if self.is_changed {
21447                TransformResult::Changed(self.build_forced(gc))
21448            } else {
21449                TransformResult::Unchanged
21450            }
21451        }
21452        /// Allocate the node unconditionally, changed or not.
21453        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21454            gc.alloc(Node::MixedTypeAnnotation(self.inner))
21455        }
21456    }
21457    /// Clone-with-changes builder for [`super::BigIntTypeAnnotation`].
21458    #[derive(Debug)]
21459    pub struct BigIntTypeAnnotation<'gc> {
21460        is_changed: bool,
21461        pub(super) inner: super::BigIntTypeAnnotation<'gc>,
21462    }
21463    impl<'gc> BigIntTypeAnnotation<'gc> {
21464        /// Start from a copy of `node`, with no field changed yet.
21465        pub fn from_node(node: &'gc super::BigIntTypeAnnotation<'gc>) -> Self {
21466            Self {
21467                is_changed: false,
21468                inner: super::BigIntTypeAnnotation {
21469                    metadata: node.metadata.duplicate(),
21470                },
21471            }
21472        }
21473        /// Allocate the rebuilt node if a setter ran, else
21474        /// `TransformResult::Unchanged`.
21475        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21476            if self.is_changed {
21477                TransformResult::Changed(self.build_forced(gc))
21478            } else {
21479                TransformResult::Unchanged
21480            }
21481        }
21482        /// Allocate the node unconditionally, changed or not.
21483        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21484            gc.alloc(Node::BigIntTypeAnnotation(self.inner))
21485        }
21486    }
21487    /// Clone-with-changes builder for [`super::VoidTypeAnnotation`].
21488    #[derive(Debug)]
21489    pub struct VoidTypeAnnotation<'gc> {
21490        is_changed: bool,
21491        pub(super) inner: super::VoidTypeAnnotation<'gc>,
21492    }
21493    impl<'gc> VoidTypeAnnotation<'gc> {
21494        /// Start from a copy of `node`, with no field changed yet.
21495        pub fn from_node(node: &'gc super::VoidTypeAnnotation<'gc>) -> Self {
21496            Self {
21497                is_changed: false,
21498                inner: super::VoidTypeAnnotation {
21499                    metadata: node.metadata.duplicate(),
21500                },
21501            }
21502        }
21503        /// Allocate the rebuilt node if a setter ran, else
21504        /// `TransformResult::Unchanged`.
21505        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21506            if self.is_changed {
21507                TransformResult::Changed(self.build_forced(gc))
21508            } else {
21509                TransformResult::Unchanged
21510            }
21511        }
21512        /// Allocate the node unconditionally, changed or not.
21513        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21514            gc.alloc(Node::VoidTypeAnnotation(self.inner))
21515        }
21516    }
21517    /// Clone-with-changes builder for [`super::NeverTypeAnnotation`].
21518    #[derive(Debug)]
21519    pub struct NeverTypeAnnotation<'gc> {
21520        is_changed: bool,
21521        pub(super) inner: super::NeverTypeAnnotation<'gc>,
21522    }
21523    impl<'gc> NeverTypeAnnotation<'gc> {
21524        /// Start from a copy of `node`, with no field changed yet.
21525        pub fn from_node(node: &'gc super::NeverTypeAnnotation<'gc>) -> Self {
21526            Self {
21527                is_changed: false,
21528                inner: super::NeverTypeAnnotation {
21529                    metadata: node.metadata.duplicate(),
21530                },
21531            }
21532        }
21533        /// Allocate the rebuilt node if a setter ran, else
21534        /// `TransformResult::Unchanged`.
21535        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21536            if self.is_changed {
21537                TransformResult::Changed(self.build_forced(gc))
21538            } else {
21539                TransformResult::Unchanged
21540            }
21541        }
21542        /// Allocate the node unconditionally, changed or not.
21543        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21544            gc.alloc(Node::NeverTypeAnnotation(self.inner))
21545        }
21546    }
21547    /// Clone-with-changes builder for [`super::UnknownTypeAnnotation`].
21548    #[derive(Debug)]
21549    pub struct UnknownTypeAnnotation<'gc> {
21550        is_changed: bool,
21551        pub(super) inner: super::UnknownTypeAnnotation<'gc>,
21552    }
21553    impl<'gc> UnknownTypeAnnotation<'gc> {
21554        /// Start from a copy of `node`, with no field changed yet.
21555        pub fn from_node(node: &'gc super::UnknownTypeAnnotation<'gc>) -> Self {
21556            Self {
21557                is_changed: false,
21558                inner: super::UnknownTypeAnnotation {
21559                    metadata: node.metadata.duplicate(),
21560                },
21561            }
21562        }
21563        /// Allocate the rebuilt node if a setter ran, else
21564        /// `TransformResult::Unchanged`.
21565        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21566            if self.is_changed {
21567                TransformResult::Changed(self.build_forced(gc))
21568            } else {
21569                TransformResult::Unchanged
21570            }
21571        }
21572        /// Allocate the node unconditionally, changed or not.
21573        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21574            gc.alloc(Node::UnknownTypeAnnotation(self.inner))
21575        }
21576    }
21577    /// Clone-with-changes builder for [`super::UndefinedTypeAnnotation`].
21578    #[derive(Debug)]
21579    pub struct UndefinedTypeAnnotation<'gc> {
21580        is_changed: bool,
21581        pub(super) inner: super::UndefinedTypeAnnotation<'gc>,
21582    }
21583    impl<'gc> UndefinedTypeAnnotation<'gc> {
21584        /// Start from a copy of `node`, with no field changed yet.
21585        pub fn from_node(node: &'gc super::UndefinedTypeAnnotation<'gc>) -> Self {
21586            Self {
21587                is_changed: false,
21588                inner: super::UndefinedTypeAnnotation {
21589                    metadata: node.metadata.duplicate(),
21590                },
21591            }
21592        }
21593        /// Allocate the rebuilt node if a setter ran, else
21594        /// `TransformResult::Unchanged`.
21595        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21596            if self.is_changed {
21597                TransformResult::Changed(self.build_forced(gc))
21598            } else {
21599                TransformResult::Unchanged
21600            }
21601        }
21602        /// Allocate the node unconditionally, changed or not.
21603        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21604            gc.alloc(Node::UndefinedTypeAnnotation(self.inner))
21605        }
21606    }
21607    /// Clone-with-changes builder for [`super::FunctionTypeAnnotation`].
21608    #[derive(Debug)]
21609    pub struct FunctionTypeAnnotation<'gc> {
21610        is_changed: bool,
21611        pub(super) inner: super::FunctionTypeAnnotation<'gc>,
21612    }
21613    impl<'gc> FunctionTypeAnnotation<'gc> {
21614        /// Start from a copy of `node`, with no field changed yet.
21615        pub fn from_node(node: &'gc super::FunctionTypeAnnotation<'gc>) -> Self {
21616            Self {
21617                is_changed: false,
21618                inner: super::FunctionTypeAnnotation {
21619                    metadata: node.metadata.duplicate(),
21620                    params: node.params.duplicate(),
21621                    this: node.this.duplicate(),
21622                    return_type: node.return_type.duplicate(),
21623                    rest: node.rest.duplicate(),
21624                    type_parameters: node.type_parameters.duplicate(),
21625                },
21626            }
21627        }
21628        /// Allocate the rebuilt node if a setter ran, else
21629        /// `TransformResult::Unchanged`.
21630        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21631            if self.is_changed {
21632                TransformResult::Changed(self.build_forced(gc))
21633            } else {
21634                TransformResult::Unchanged
21635            }
21636        }
21637        /// Allocate the node unconditionally, changed or not.
21638        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21639            gc.alloc(Node::FunctionTypeAnnotation(self.inner))
21640        }
21641        /// Set the `params` field and mark the builder changed.
21642        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
21643        /// Set the `this` field and mark the builder changed.
21644        pub fn this(&mut self, this: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.this = this; }
21645        /// Set the `return_type` field and mark the builder changed.
21646        pub fn return_type(&mut self, return_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.return_type = return_type; }
21647        /// Set the `rest` field and mark the builder changed.
21648        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
21649        /// Set the `type_parameters` field and mark the builder changed.
21650        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
21651    }
21652    /// Clone-with-changes builder for [`super::HookTypeAnnotation`].
21653    #[derive(Debug)]
21654    pub struct HookTypeAnnotation<'gc> {
21655        is_changed: bool,
21656        pub(super) inner: super::HookTypeAnnotation<'gc>,
21657    }
21658    impl<'gc> HookTypeAnnotation<'gc> {
21659        /// Start from a copy of `node`, with no field changed yet.
21660        pub fn from_node(node: &'gc super::HookTypeAnnotation<'gc>) -> Self {
21661            Self {
21662                is_changed: false,
21663                inner: super::HookTypeAnnotation {
21664                    metadata: node.metadata.duplicate(),
21665                    params: node.params.duplicate(),
21666                    return_type: node.return_type.duplicate(),
21667                    rest: node.rest.duplicate(),
21668                    type_parameters: node.type_parameters.duplicate(),
21669                },
21670            }
21671        }
21672        /// Allocate the rebuilt node if a setter ran, else
21673        /// `TransformResult::Unchanged`.
21674        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21675            if self.is_changed {
21676                TransformResult::Changed(self.build_forced(gc))
21677            } else {
21678                TransformResult::Unchanged
21679            }
21680        }
21681        /// Allocate the node unconditionally, changed or not.
21682        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21683            gc.alloc(Node::HookTypeAnnotation(self.inner))
21684        }
21685        /// Set the `params` field and mark the builder changed.
21686        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
21687        /// Set the `return_type` field and mark the builder changed.
21688        pub fn return_type(&mut self, return_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.return_type = return_type; }
21689        /// Set the `rest` field and mark the builder changed.
21690        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
21691        /// Set the `type_parameters` field and mark the builder changed.
21692        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
21693    }
21694    /// Clone-with-changes builder for [`super::FunctionTypeParam`].
21695    #[derive(Debug)]
21696    pub struct FunctionTypeParam<'gc> {
21697        is_changed: bool,
21698        pub(super) inner: super::FunctionTypeParam<'gc>,
21699    }
21700    impl<'gc> FunctionTypeParam<'gc> {
21701        /// Start from a copy of `node`, with no field changed yet.
21702        pub fn from_node(node: &'gc super::FunctionTypeParam<'gc>) -> Self {
21703            Self {
21704                is_changed: false,
21705                inner: super::FunctionTypeParam {
21706                    metadata: node.metadata.duplicate(),
21707                    name: node.name.duplicate(),
21708                    type_annotation: node.type_annotation.duplicate(),
21709                    optional: Cell::new(node.optional.get()),
21710                },
21711            }
21712        }
21713        /// Allocate the rebuilt node if a setter ran, else
21714        /// `TransformResult::Unchanged`.
21715        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21716            if self.is_changed {
21717                TransformResult::Changed(self.build_forced(gc))
21718            } else {
21719                TransformResult::Unchanged
21720            }
21721        }
21722        /// Allocate the node unconditionally, changed or not.
21723        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21724            gc.alloc(Node::FunctionTypeParam(self.inner))
21725        }
21726        /// Set the `name` field and mark the builder changed.
21727        pub fn name(&mut self, name: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.name = name; }
21728        /// Set the `type_annotation` field and mark the builder changed.
21729        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
21730    }
21731    /// Clone-with-changes builder for [`super::ComponentTypeAnnotation`].
21732    #[derive(Debug)]
21733    pub struct ComponentTypeAnnotation<'gc> {
21734        is_changed: bool,
21735        pub(super) inner: super::ComponentTypeAnnotation<'gc>,
21736    }
21737    impl<'gc> ComponentTypeAnnotation<'gc> {
21738        /// Start from a copy of `node`, with no field changed yet.
21739        pub fn from_node(node: &'gc super::ComponentTypeAnnotation<'gc>) -> Self {
21740            Self {
21741                is_changed: false,
21742                inner: super::ComponentTypeAnnotation {
21743                    metadata: node.metadata.duplicate(),
21744                    params: node.params.duplicate(),
21745                    rest: node.rest.duplicate(),
21746                    type_parameters: node.type_parameters.duplicate(),
21747                    renders_type: node.renders_type.duplicate(),
21748                },
21749            }
21750        }
21751        /// Allocate the rebuilt node if a setter ran, else
21752        /// `TransformResult::Unchanged`.
21753        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21754            if self.is_changed {
21755                TransformResult::Changed(self.build_forced(gc))
21756            } else {
21757                TransformResult::Unchanged
21758            }
21759        }
21760        /// Allocate the node unconditionally, changed or not.
21761        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21762            gc.alloc(Node::ComponentTypeAnnotation(self.inner))
21763        }
21764        /// Set the `params` field and mark the builder changed.
21765        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
21766        /// Set the `rest` field and mark the builder changed.
21767        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
21768        /// Set the `type_parameters` field and mark the builder changed.
21769        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
21770        /// Set the `renders_type` field and mark the builder changed.
21771        pub fn renders_type(&mut self, renders_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.renders_type = renders_type; }
21772    }
21773    /// Clone-with-changes builder for [`super::ComponentTypeParameter`].
21774    #[derive(Debug)]
21775    pub struct ComponentTypeParameter<'gc> {
21776        is_changed: bool,
21777        pub(super) inner: super::ComponentTypeParameter<'gc>,
21778    }
21779    impl<'gc> ComponentTypeParameter<'gc> {
21780        /// Start from a copy of `node`, with no field changed yet.
21781        pub fn from_node(node: &'gc super::ComponentTypeParameter<'gc>) -> Self {
21782            Self {
21783                is_changed: false,
21784                inner: super::ComponentTypeParameter {
21785                    metadata: node.metadata.duplicate(),
21786                    name: node.name.duplicate(),
21787                    type_annotation: node.type_annotation.duplicate(),
21788                    optional: Cell::new(node.optional.get()),
21789                },
21790            }
21791        }
21792        /// Allocate the rebuilt node if a setter ran, else
21793        /// `TransformResult::Unchanged`.
21794        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21795            if self.is_changed {
21796                TransformResult::Changed(self.build_forced(gc))
21797            } else {
21798                TransformResult::Unchanged
21799            }
21800        }
21801        /// Allocate the node unconditionally, changed or not.
21802        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21803            gc.alloc(Node::ComponentTypeParameter(self.inner))
21804        }
21805        /// Set the `name` field and mark the builder changed.
21806        pub fn name(&mut self, name: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.name = name; }
21807        /// Set the `type_annotation` field and mark the builder changed.
21808        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
21809    }
21810    /// Clone-with-changes builder for [`super::NullableTypeAnnotation`].
21811    #[derive(Debug)]
21812    pub struct NullableTypeAnnotation<'gc> {
21813        is_changed: bool,
21814        pub(super) inner: super::NullableTypeAnnotation<'gc>,
21815    }
21816    impl<'gc> NullableTypeAnnotation<'gc> {
21817        /// Start from a copy of `node`, with no field changed yet.
21818        pub fn from_node(node: &'gc super::NullableTypeAnnotation<'gc>) -> Self {
21819            Self {
21820                is_changed: false,
21821                inner: super::NullableTypeAnnotation {
21822                    metadata: node.metadata.duplicate(),
21823                    type_annotation: node.type_annotation.duplicate(),
21824                },
21825            }
21826        }
21827        /// Allocate the rebuilt node if a setter ran, else
21828        /// `TransformResult::Unchanged`.
21829        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21830            if self.is_changed {
21831                TransformResult::Changed(self.build_forced(gc))
21832            } else {
21833                TransformResult::Unchanged
21834            }
21835        }
21836        /// Allocate the node unconditionally, changed or not.
21837        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21838            gc.alloc(Node::NullableTypeAnnotation(self.inner))
21839        }
21840        /// Set the `type_annotation` field and mark the builder changed.
21841        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
21842    }
21843    /// Clone-with-changes builder for [`super::QualifiedTypeIdentifier`].
21844    #[derive(Debug)]
21845    pub struct QualifiedTypeIdentifier<'gc> {
21846        is_changed: bool,
21847        pub(super) inner: super::QualifiedTypeIdentifier<'gc>,
21848    }
21849    impl<'gc> QualifiedTypeIdentifier<'gc> {
21850        /// Start from a copy of `node`, with no field changed yet.
21851        pub fn from_node(node: &'gc super::QualifiedTypeIdentifier<'gc>) -> Self {
21852            Self {
21853                is_changed: false,
21854                inner: super::QualifiedTypeIdentifier {
21855                    metadata: node.metadata.duplicate(),
21856                    qualification: node.qualification.duplicate(),
21857                    id: node.id.duplicate(),
21858                },
21859            }
21860        }
21861        /// Allocate the rebuilt node if a setter ran, else
21862        /// `TransformResult::Unchanged`.
21863        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21864            if self.is_changed {
21865                TransformResult::Changed(self.build_forced(gc))
21866            } else {
21867                TransformResult::Unchanged
21868            }
21869        }
21870        /// Allocate the node unconditionally, changed or not.
21871        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21872            gc.alloc(Node::QualifiedTypeIdentifier(self.inner))
21873        }
21874        /// Set the `qualification` field and mark the builder changed.
21875        pub fn qualification(&mut self, qualification: &'gc Node<'gc>) { self.is_changed = true; self.inner.qualification = qualification; }
21876        /// Set the `id` field and mark the builder changed.
21877        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
21878    }
21879    /// Clone-with-changes builder for [`super::TypeofTypeAnnotation`].
21880    #[derive(Debug)]
21881    pub struct TypeofTypeAnnotation<'gc> {
21882        is_changed: bool,
21883        pub(super) inner: super::TypeofTypeAnnotation<'gc>,
21884    }
21885    impl<'gc> TypeofTypeAnnotation<'gc> {
21886        /// Start from a copy of `node`, with no field changed yet.
21887        pub fn from_node(node: &'gc super::TypeofTypeAnnotation<'gc>) -> Self {
21888            Self {
21889                is_changed: false,
21890                inner: super::TypeofTypeAnnotation {
21891                    metadata: node.metadata.duplicate(),
21892                    argument: node.argument.duplicate(),
21893                    type_arguments: node.type_arguments.duplicate(),
21894                },
21895            }
21896        }
21897        /// Allocate the rebuilt node if a setter ran, else
21898        /// `TransformResult::Unchanged`.
21899        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21900            if self.is_changed {
21901                TransformResult::Changed(self.build_forced(gc))
21902            } else {
21903                TransformResult::Unchanged
21904            }
21905        }
21906        /// Allocate the node unconditionally, changed or not.
21907        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21908            gc.alloc(Node::TypeofTypeAnnotation(self.inner))
21909        }
21910        /// Set the `argument` field and mark the builder changed.
21911        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
21912        /// Set the `type_arguments` field and mark the builder changed.
21913        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
21914    }
21915    /// Clone-with-changes builder for [`super::KeyofTypeAnnotation`].
21916    #[derive(Debug)]
21917    pub struct KeyofTypeAnnotation<'gc> {
21918        is_changed: bool,
21919        pub(super) inner: super::KeyofTypeAnnotation<'gc>,
21920    }
21921    impl<'gc> KeyofTypeAnnotation<'gc> {
21922        /// Start from a copy of `node`, with no field changed yet.
21923        pub fn from_node(node: &'gc super::KeyofTypeAnnotation<'gc>) -> Self {
21924            Self {
21925                is_changed: false,
21926                inner: super::KeyofTypeAnnotation {
21927                    metadata: node.metadata.duplicate(),
21928                    argument: node.argument.duplicate(),
21929                },
21930            }
21931        }
21932        /// Allocate the rebuilt node if a setter ran, else
21933        /// `TransformResult::Unchanged`.
21934        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21935            if self.is_changed {
21936                TransformResult::Changed(self.build_forced(gc))
21937            } else {
21938                TransformResult::Unchanged
21939            }
21940        }
21941        /// Allocate the node unconditionally, changed or not.
21942        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21943            gc.alloc(Node::KeyofTypeAnnotation(self.inner))
21944        }
21945        /// Set the `argument` field and mark the builder changed.
21946        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
21947    }
21948    /// Clone-with-changes builder for [`super::TypeOperator`].
21949    #[derive(Debug)]
21950    pub struct TypeOperator<'gc> {
21951        is_changed: bool,
21952        pub(super) inner: super::TypeOperator<'gc>,
21953    }
21954    impl<'gc> TypeOperator<'gc> {
21955        /// Start from a copy of `node`, with no field changed yet.
21956        pub fn from_node(node: &'gc super::TypeOperator<'gc>) -> Self {
21957            Self {
21958                is_changed: false,
21959                inner: super::TypeOperator {
21960                    metadata: node.metadata.duplicate(),
21961                    operator: Cell::new(node.operator.get()),
21962                    type_annotation: node.type_annotation.duplicate(),
21963                },
21964            }
21965        }
21966        /// Allocate the rebuilt node if a setter ran, else
21967        /// `TransformResult::Unchanged`.
21968        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21969            if self.is_changed {
21970                TransformResult::Changed(self.build_forced(gc))
21971            } else {
21972                TransformResult::Unchanged
21973            }
21974        }
21975        /// Allocate the node unconditionally, changed or not.
21976        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21977            gc.alloc(Node::TypeOperator(self.inner))
21978        }
21979        /// Set the `type_annotation` field and mark the builder changed.
21980        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
21981    }
21982    /// Clone-with-changes builder for [`super::QualifiedTypeofIdentifier`].
21983    #[derive(Debug)]
21984    pub struct QualifiedTypeofIdentifier<'gc> {
21985        is_changed: bool,
21986        pub(super) inner: super::QualifiedTypeofIdentifier<'gc>,
21987    }
21988    impl<'gc> QualifiedTypeofIdentifier<'gc> {
21989        /// Start from a copy of `node`, with no field changed yet.
21990        pub fn from_node(node: &'gc super::QualifiedTypeofIdentifier<'gc>) -> Self {
21991            Self {
21992                is_changed: false,
21993                inner: super::QualifiedTypeofIdentifier {
21994                    metadata: node.metadata.duplicate(),
21995                    qualification: node.qualification.duplicate(),
21996                    id: node.id.duplicate(),
21997                },
21998            }
21999        }
22000        /// Allocate the rebuilt node if a setter ran, else
22001        /// `TransformResult::Unchanged`.
22002        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22003            if self.is_changed {
22004                TransformResult::Changed(self.build_forced(gc))
22005            } else {
22006                TransformResult::Unchanged
22007            }
22008        }
22009        /// Allocate the node unconditionally, changed or not.
22010        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22011            gc.alloc(Node::QualifiedTypeofIdentifier(self.inner))
22012        }
22013        /// Set the `qualification` field and mark the builder changed.
22014        pub fn qualification(&mut self, qualification: &'gc Node<'gc>) { self.is_changed = true; self.inner.qualification = qualification; }
22015        /// Set the `id` field and mark the builder changed.
22016        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22017    }
22018    /// Clone-with-changes builder for [`super::TupleTypeAnnotation`].
22019    #[derive(Debug)]
22020    pub struct TupleTypeAnnotation<'gc> {
22021        is_changed: bool,
22022        pub(super) inner: super::TupleTypeAnnotation<'gc>,
22023    }
22024    impl<'gc> TupleTypeAnnotation<'gc> {
22025        /// Start from a copy of `node`, with no field changed yet.
22026        pub fn from_node(node: &'gc super::TupleTypeAnnotation<'gc>) -> Self {
22027            Self {
22028                is_changed: false,
22029                inner: super::TupleTypeAnnotation {
22030                    metadata: node.metadata.duplicate(),
22031                    element_types: node.element_types.duplicate(),
22032                    inexact: Cell::new(node.inexact.get()),
22033                },
22034            }
22035        }
22036        /// Allocate the rebuilt node if a setter ran, else
22037        /// `TransformResult::Unchanged`.
22038        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22039            if self.is_changed {
22040                TransformResult::Changed(self.build_forced(gc))
22041            } else {
22042                TransformResult::Unchanged
22043            }
22044        }
22045        /// Allocate the node unconditionally, changed or not.
22046        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22047            gc.alloc(Node::TupleTypeAnnotation(self.inner))
22048        }
22049        /// Set the `element_types` field and mark the builder changed.
22050        pub fn element_types(&mut self, element_types: NodeList<'gc>) { self.is_changed = true; self.inner.element_types = element_types; }
22051    }
22052    /// Clone-with-changes builder for [`super::TupleTypeSpreadElement`].
22053    #[derive(Debug)]
22054    pub struct TupleTypeSpreadElement<'gc> {
22055        is_changed: bool,
22056        pub(super) inner: super::TupleTypeSpreadElement<'gc>,
22057    }
22058    impl<'gc> TupleTypeSpreadElement<'gc> {
22059        /// Start from a copy of `node`, with no field changed yet.
22060        pub fn from_node(node: &'gc super::TupleTypeSpreadElement<'gc>) -> Self {
22061            Self {
22062                is_changed: false,
22063                inner: super::TupleTypeSpreadElement {
22064                    metadata: node.metadata.duplicate(),
22065                    label: node.label.duplicate(),
22066                    type_annotation: node.type_annotation.duplicate(),
22067                },
22068            }
22069        }
22070        /// Allocate the rebuilt node if a setter ran, else
22071        /// `TransformResult::Unchanged`.
22072        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22073            if self.is_changed {
22074                TransformResult::Changed(self.build_forced(gc))
22075            } else {
22076                TransformResult::Unchanged
22077            }
22078        }
22079        /// Allocate the node unconditionally, changed or not.
22080        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22081            gc.alloc(Node::TupleTypeSpreadElement(self.inner))
22082        }
22083        /// Set the `label` field and mark the builder changed.
22084        pub fn label(&mut self, label: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.label = label; }
22085        /// Set the `type_annotation` field and mark the builder changed.
22086        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
22087    }
22088    /// Clone-with-changes builder for [`super::TupleTypeLabeledElement`].
22089    #[derive(Debug)]
22090    pub struct TupleTypeLabeledElement<'gc> {
22091        is_changed: bool,
22092        pub(super) inner: super::TupleTypeLabeledElement<'gc>,
22093    }
22094    impl<'gc> TupleTypeLabeledElement<'gc> {
22095        /// Start from a copy of `node`, with no field changed yet.
22096        pub fn from_node(node: &'gc super::TupleTypeLabeledElement<'gc>) -> Self {
22097            Self {
22098                is_changed: false,
22099                inner: super::TupleTypeLabeledElement {
22100                    metadata: node.metadata.duplicate(),
22101                    label: node.label.duplicate(),
22102                    element_type: node.element_type.duplicate(),
22103                    optional: Cell::new(node.optional.get()),
22104                    variance: node.variance.duplicate(),
22105                },
22106            }
22107        }
22108        /// Allocate the rebuilt node if a setter ran, else
22109        /// `TransformResult::Unchanged`.
22110        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22111            if self.is_changed {
22112                TransformResult::Changed(self.build_forced(gc))
22113            } else {
22114                TransformResult::Unchanged
22115            }
22116        }
22117        /// Allocate the node unconditionally, changed or not.
22118        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22119            gc.alloc(Node::TupleTypeLabeledElement(self.inner))
22120        }
22121        /// Set the `label` field and mark the builder changed.
22122        pub fn label(&mut self, label: &'gc Node<'gc>) { self.is_changed = true; self.inner.label = label; }
22123        /// Set the `element_type` field and mark the builder changed.
22124        pub fn element_type(&mut self, element_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.element_type = element_type; }
22125        /// Set the `variance` field and mark the builder changed.
22126        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
22127    }
22128    /// Clone-with-changes builder for [`super::ArrayTypeAnnotation`].
22129    #[derive(Debug)]
22130    pub struct ArrayTypeAnnotation<'gc> {
22131        is_changed: bool,
22132        pub(super) inner: super::ArrayTypeAnnotation<'gc>,
22133    }
22134    impl<'gc> ArrayTypeAnnotation<'gc> {
22135        /// Start from a copy of `node`, with no field changed yet.
22136        pub fn from_node(node: &'gc super::ArrayTypeAnnotation<'gc>) -> Self {
22137            Self {
22138                is_changed: false,
22139                inner: super::ArrayTypeAnnotation {
22140                    metadata: node.metadata.duplicate(),
22141                    element_type: node.element_type.duplicate(),
22142                },
22143            }
22144        }
22145        /// Allocate the rebuilt node if a setter ran, else
22146        /// `TransformResult::Unchanged`.
22147        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22148            if self.is_changed {
22149                TransformResult::Changed(self.build_forced(gc))
22150            } else {
22151                TransformResult::Unchanged
22152            }
22153        }
22154        /// Allocate the node unconditionally, changed or not.
22155        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22156            gc.alloc(Node::ArrayTypeAnnotation(self.inner))
22157        }
22158        /// Set the `element_type` field and mark the builder changed.
22159        pub fn element_type(&mut self, element_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.element_type = element_type; }
22160    }
22161    /// Clone-with-changes builder for [`super::InferTypeAnnotation`].
22162    #[derive(Debug)]
22163    pub struct InferTypeAnnotation<'gc> {
22164        is_changed: bool,
22165        pub(super) inner: super::InferTypeAnnotation<'gc>,
22166    }
22167    impl<'gc> InferTypeAnnotation<'gc> {
22168        /// Start from a copy of `node`, with no field changed yet.
22169        pub fn from_node(node: &'gc super::InferTypeAnnotation<'gc>) -> Self {
22170            Self {
22171                is_changed: false,
22172                inner: super::InferTypeAnnotation {
22173                    metadata: node.metadata.duplicate(),
22174                    type_parameter: node.type_parameter.duplicate(),
22175                },
22176            }
22177        }
22178        /// Allocate the rebuilt node if a setter ran, else
22179        /// `TransformResult::Unchanged`.
22180        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22181            if self.is_changed {
22182                TransformResult::Changed(self.build_forced(gc))
22183            } else {
22184                TransformResult::Unchanged
22185            }
22186        }
22187        /// Allocate the node unconditionally, changed or not.
22188        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22189            gc.alloc(Node::InferTypeAnnotation(self.inner))
22190        }
22191        /// Set the `type_parameter` field and mark the builder changed.
22192        pub fn type_parameter(&mut self, type_parameter: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_parameter = type_parameter; }
22193    }
22194    /// Clone-with-changes builder for [`super::UnionTypeAnnotation`].
22195    #[derive(Debug)]
22196    pub struct UnionTypeAnnotation<'gc> {
22197        is_changed: bool,
22198        pub(super) inner: super::UnionTypeAnnotation<'gc>,
22199    }
22200    impl<'gc> UnionTypeAnnotation<'gc> {
22201        /// Start from a copy of `node`, with no field changed yet.
22202        pub fn from_node(node: &'gc super::UnionTypeAnnotation<'gc>) -> Self {
22203            Self {
22204                is_changed: false,
22205                inner: super::UnionTypeAnnotation {
22206                    metadata: node.metadata.duplicate(),
22207                    types: node.types.duplicate(),
22208                },
22209            }
22210        }
22211        /// Allocate the rebuilt node if a setter ran, else
22212        /// `TransformResult::Unchanged`.
22213        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22214            if self.is_changed {
22215                TransformResult::Changed(self.build_forced(gc))
22216            } else {
22217                TransformResult::Unchanged
22218            }
22219        }
22220        /// Allocate the node unconditionally, changed or not.
22221        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22222            gc.alloc(Node::UnionTypeAnnotation(self.inner))
22223        }
22224        /// Set the `types` field and mark the builder changed.
22225        pub fn types(&mut self, types: NodeList<'gc>) { self.is_changed = true; self.inner.types = types; }
22226    }
22227    /// Clone-with-changes builder for [`super::IntersectionTypeAnnotation`].
22228    #[derive(Debug)]
22229    pub struct IntersectionTypeAnnotation<'gc> {
22230        is_changed: bool,
22231        pub(super) inner: super::IntersectionTypeAnnotation<'gc>,
22232    }
22233    impl<'gc> IntersectionTypeAnnotation<'gc> {
22234        /// Start from a copy of `node`, with no field changed yet.
22235        pub fn from_node(node: &'gc super::IntersectionTypeAnnotation<'gc>) -> Self {
22236            Self {
22237                is_changed: false,
22238                inner: super::IntersectionTypeAnnotation {
22239                    metadata: node.metadata.duplicate(),
22240                    types: node.types.duplicate(),
22241                },
22242            }
22243        }
22244        /// Allocate the rebuilt node if a setter ran, else
22245        /// `TransformResult::Unchanged`.
22246        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22247            if self.is_changed {
22248                TransformResult::Changed(self.build_forced(gc))
22249            } else {
22250                TransformResult::Unchanged
22251            }
22252        }
22253        /// Allocate the node unconditionally, changed or not.
22254        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22255            gc.alloc(Node::IntersectionTypeAnnotation(self.inner))
22256        }
22257        /// Set the `types` field and mark the builder changed.
22258        pub fn types(&mut self, types: NodeList<'gc>) { self.is_changed = true; self.inner.types = types; }
22259    }
22260    /// Clone-with-changes builder for [`super::GenericTypeAnnotation`].
22261    #[derive(Debug)]
22262    pub struct GenericTypeAnnotation<'gc> {
22263        is_changed: bool,
22264        pub(super) inner: super::GenericTypeAnnotation<'gc>,
22265    }
22266    impl<'gc> GenericTypeAnnotation<'gc> {
22267        /// Start from a copy of `node`, with no field changed yet.
22268        pub fn from_node(node: &'gc super::GenericTypeAnnotation<'gc>) -> Self {
22269            Self {
22270                is_changed: false,
22271                inner: super::GenericTypeAnnotation {
22272                    metadata: node.metadata.duplicate(),
22273                    id: node.id.duplicate(),
22274                    type_parameters: node.type_parameters.duplicate(),
22275                },
22276            }
22277        }
22278        /// Allocate the rebuilt node if a setter ran, else
22279        /// `TransformResult::Unchanged`.
22280        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22281            if self.is_changed {
22282                TransformResult::Changed(self.build_forced(gc))
22283            } else {
22284                TransformResult::Unchanged
22285            }
22286        }
22287        /// Allocate the node unconditionally, changed or not.
22288        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22289            gc.alloc(Node::GenericTypeAnnotation(self.inner))
22290        }
22291        /// Set the `id` field and mark the builder changed.
22292        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22293        /// Set the `type_parameters` field and mark the builder changed.
22294        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22295    }
22296    /// Clone-with-changes builder for [`super::IndexedAccessType`].
22297    #[derive(Debug)]
22298    pub struct IndexedAccessType<'gc> {
22299        is_changed: bool,
22300        pub(super) inner: super::IndexedAccessType<'gc>,
22301    }
22302    impl<'gc> IndexedAccessType<'gc> {
22303        /// Start from a copy of `node`, with no field changed yet.
22304        pub fn from_node(node: &'gc super::IndexedAccessType<'gc>) -> Self {
22305            Self {
22306                is_changed: false,
22307                inner: super::IndexedAccessType {
22308                    metadata: node.metadata.duplicate(),
22309                    object_type: node.object_type.duplicate(),
22310                    index_type: node.index_type.duplicate(),
22311                },
22312            }
22313        }
22314        /// Allocate the rebuilt node if a setter ran, else
22315        /// `TransformResult::Unchanged`.
22316        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22317            if self.is_changed {
22318                TransformResult::Changed(self.build_forced(gc))
22319            } else {
22320                TransformResult::Unchanged
22321            }
22322        }
22323        /// Allocate the node unconditionally, changed or not.
22324        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22325            gc.alloc(Node::IndexedAccessType(self.inner))
22326        }
22327        /// Set the `object_type` field and mark the builder changed.
22328        pub fn object_type(&mut self, object_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.object_type = object_type; }
22329        /// Set the `index_type` field and mark the builder changed.
22330        pub fn index_type(&mut self, index_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.index_type = index_type; }
22331    }
22332    /// Clone-with-changes builder for [`super::OptionalIndexedAccessType`].
22333    #[derive(Debug)]
22334    pub struct OptionalIndexedAccessType<'gc> {
22335        is_changed: bool,
22336        pub(super) inner: super::OptionalIndexedAccessType<'gc>,
22337    }
22338    impl<'gc> OptionalIndexedAccessType<'gc> {
22339        /// Start from a copy of `node`, with no field changed yet.
22340        pub fn from_node(node: &'gc super::OptionalIndexedAccessType<'gc>) -> Self {
22341            Self {
22342                is_changed: false,
22343                inner: super::OptionalIndexedAccessType {
22344                    metadata: node.metadata.duplicate(),
22345                    object_type: node.object_type.duplicate(),
22346                    index_type: node.index_type.duplicate(),
22347                    optional: Cell::new(node.optional.get()),
22348                },
22349            }
22350        }
22351        /// Allocate the rebuilt node if a setter ran, else
22352        /// `TransformResult::Unchanged`.
22353        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22354            if self.is_changed {
22355                TransformResult::Changed(self.build_forced(gc))
22356            } else {
22357                TransformResult::Unchanged
22358            }
22359        }
22360        /// Allocate the node unconditionally, changed or not.
22361        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22362            gc.alloc(Node::OptionalIndexedAccessType(self.inner))
22363        }
22364        /// Set the `object_type` field and mark the builder changed.
22365        pub fn object_type(&mut self, object_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.object_type = object_type; }
22366        /// Set the `index_type` field and mark the builder changed.
22367        pub fn index_type(&mut self, index_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.index_type = index_type; }
22368    }
22369    /// Clone-with-changes builder for [`super::ConditionalTypeAnnotation`].
22370    #[derive(Debug)]
22371    pub struct ConditionalTypeAnnotation<'gc> {
22372        is_changed: bool,
22373        pub(super) inner: super::ConditionalTypeAnnotation<'gc>,
22374    }
22375    impl<'gc> ConditionalTypeAnnotation<'gc> {
22376        /// Start from a copy of `node`, with no field changed yet.
22377        pub fn from_node(node: &'gc super::ConditionalTypeAnnotation<'gc>) -> Self {
22378            Self {
22379                is_changed: false,
22380                inner: super::ConditionalTypeAnnotation {
22381                    metadata: node.metadata.duplicate(),
22382                    check_type: node.check_type.duplicate(),
22383                    extends_type: node.extends_type.duplicate(),
22384                    true_type: node.true_type.duplicate(),
22385                    false_type: node.false_type.duplicate(),
22386                },
22387            }
22388        }
22389        /// Allocate the rebuilt node if a setter ran, else
22390        /// `TransformResult::Unchanged`.
22391        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22392            if self.is_changed {
22393                TransformResult::Changed(self.build_forced(gc))
22394            } else {
22395                TransformResult::Unchanged
22396            }
22397        }
22398        /// Allocate the node unconditionally, changed or not.
22399        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22400            gc.alloc(Node::ConditionalTypeAnnotation(self.inner))
22401        }
22402        /// Set the `check_type` field and mark the builder changed.
22403        pub fn check_type(&mut self, check_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.check_type = check_type; }
22404        /// Set the `extends_type` field and mark the builder changed.
22405        pub fn extends_type(&mut self, extends_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.extends_type = extends_type; }
22406        /// Set the `true_type` field and mark the builder changed.
22407        pub fn true_type(&mut self, true_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.true_type = true_type; }
22408        /// Set the `false_type` field and mark the builder changed.
22409        pub fn false_type(&mut self, false_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.false_type = false_type; }
22410    }
22411    /// Clone-with-changes builder for [`super::TypePredicate`].
22412    #[derive(Debug)]
22413    pub struct TypePredicate<'gc> {
22414        is_changed: bool,
22415        pub(super) inner: super::TypePredicate<'gc>,
22416    }
22417    impl<'gc> TypePredicate<'gc> {
22418        /// Start from a copy of `node`, with no field changed yet.
22419        pub fn from_node(node: &'gc super::TypePredicate<'gc>) -> Self {
22420            Self {
22421                is_changed: false,
22422                inner: super::TypePredicate {
22423                    metadata: node.metadata.duplicate(),
22424                    parameter_name: node.parameter_name.duplicate(),
22425                    type_annotation: node.type_annotation.duplicate(),
22426                    kind: Cell::new(node.kind.get()),
22427                },
22428            }
22429        }
22430        /// Allocate the rebuilt node if a setter ran, else
22431        /// `TransformResult::Unchanged`.
22432        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22433            if self.is_changed {
22434                TransformResult::Changed(self.build_forced(gc))
22435            } else {
22436                TransformResult::Unchanged
22437            }
22438        }
22439        /// Allocate the node unconditionally, changed or not.
22440        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22441            gc.alloc(Node::TypePredicate(self.inner))
22442        }
22443        /// Set the `parameter_name` field and mark the builder changed.
22444        pub fn parameter_name(&mut self, parameter_name: &'gc Node<'gc>) { self.is_changed = true; self.inner.parameter_name = parameter_name; }
22445        /// Set the `type_annotation` field and mark the builder changed.
22446        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
22447    }
22448    /// Clone-with-changes builder for [`super::InterfaceTypeAnnotation`].
22449    #[derive(Debug)]
22450    pub struct InterfaceTypeAnnotation<'gc> {
22451        is_changed: bool,
22452        pub(super) inner: super::InterfaceTypeAnnotation<'gc>,
22453    }
22454    impl<'gc> InterfaceTypeAnnotation<'gc> {
22455        /// Start from a copy of `node`, with no field changed yet.
22456        pub fn from_node(node: &'gc super::InterfaceTypeAnnotation<'gc>) -> Self {
22457            Self {
22458                is_changed: false,
22459                inner: super::InterfaceTypeAnnotation {
22460                    metadata: node.metadata.duplicate(),
22461                    extends: node.extends.duplicate(),
22462                    body: node.body.duplicate(),
22463                },
22464            }
22465        }
22466        /// Allocate the rebuilt node if a setter ran, else
22467        /// `TransformResult::Unchanged`.
22468        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22469            if self.is_changed {
22470                TransformResult::Changed(self.build_forced(gc))
22471            } else {
22472                TransformResult::Unchanged
22473            }
22474        }
22475        /// Allocate the node unconditionally, changed or not.
22476        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22477            gc.alloc(Node::InterfaceTypeAnnotation(self.inner))
22478        }
22479        /// Set the `extends` field and mark the builder changed.
22480        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
22481        /// Set the `body` field and mark the builder changed.
22482        pub fn body(&mut self, body: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.body = body; }
22483    }
22484    /// Clone-with-changes builder for [`super::TypeAlias`].
22485    #[derive(Debug)]
22486    pub struct TypeAlias<'gc> {
22487        is_changed: bool,
22488        pub(super) inner: super::TypeAlias<'gc>,
22489    }
22490    impl<'gc> TypeAlias<'gc> {
22491        /// Start from a copy of `node`, with no field changed yet.
22492        pub fn from_node(node: &'gc super::TypeAlias<'gc>) -> Self {
22493            Self {
22494                is_changed: false,
22495                inner: super::TypeAlias {
22496                    metadata: node.metadata.duplicate(),
22497                    id: node.id.duplicate(),
22498                    type_parameters: node.type_parameters.duplicate(),
22499                    right: node.right.duplicate(),
22500                },
22501            }
22502        }
22503        /// Allocate the rebuilt node if a setter ran, else
22504        /// `TransformResult::Unchanged`.
22505        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22506            if self.is_changed {
22507                TransformResult::Changed(self.build_forced(gc))
22508            } else {
22509                TransformResult::Unchanged
22510            }
22511        }
22512        /// Allocate the node unconditionally, changed or not.
22513        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22514            gc.alloc(Node::TypeAlias(self.inner))
22515        }
22516        /// Set the `id` field and mark the builder changed.
22517        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22518        /// Set the `type_parameters` field and mark the builder changed.
22519        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22520        /// Set the `right` field and mark the builder changed.
22521        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
22522    }
22523    /// Clone-with-changes builder for [`super::OpaqueType`].
22524    #[derive(Debug)]
22525    pub struct OpaqueType<'gc> {
22526        is_changed: bool,
22527        pub(super) inner: super::OpaqueType<'gc>,
22528    }
22529    impl<'gc> OpaqueType<'gc> {
22530        /// Start from a copy of `node`, with no field changed yet.
22531        pub fn from_node(node: &'gc super::OpaqueType<'gc>) -> Self {
22532            Self {
22533                is_changed: false,
22534                inner: super::OpaqueType {
22535                    metadata: node.metadata.duplicate(),
22536                    id: node.id.duplicate(),
22537                    type_parameters: node.type_parameters.duplicate(),
22538                    impltype: node.impltype.duplicate(),
22539                    lower_bound: node.lower_bound.duplicate(),
22540                    upper_bound: node.upper_bound.duplicate(),
22541                    supertype: node.supertype.duplicate(),
22542                },
22543            }
22544        }
22545        /// Allocate the rebuilt node if a setter ran, else
22546        /// `TransformResult::Unchanged`.
22547        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22548            if self.is_changed {
22549                TransformResult::Changed(self.build_forced(gc))
22550            } else {
22551                TransformResult::Unchanged
22552            }
22553        }
22554        /// Allocate the node unconditionally, changed or not.
22555        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22556            gc.alloc(Node::OpaqueType(self.inner))
22557        }
22558        /// Set the `id` field and mark the builder changed.
22559        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22560        /// Set the `type_parameters` field and mark the builder changed.
22561        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22562        /// Set the `impltype` field and mark the builder changed.
22563        pub fn impltype(&mut self, impltype: &'gc Node<'gc>) { self.is_changed = true; self.inner.impltype = impltype; }
22564        /// Set the `lower_bound` field and mark the builder changed.
22565        pub fn lower_bound(&mut self, lower_bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.lower_bound = lower_bound; }
22566        /// Set the `upper_bound` field and mark the builder changed.
22567        pub fn upper_bound(&mut self, upper_bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.upper_bound = upper_bound; }
22568        /// Set the `supertype` field and mark the builder changed.
22569        pub fn supertype(&mut self, supertype: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.supertype = supertype; }
22570    }
22571    /// Clone-with-changes builder for [`super::InterfaceDeclaration`].
22572    #[derive(Debug)]
22573    pub struct InterfaceDeclaration<'gc> {
22574        is_changed: bool,
22575        pub(super) inner: super::InterfaceDeclaration<'gc>,
22576    }
22577    impl<'gc> InterfaceDeclaration<'gc> {
22578        /// Start from a copy of `node`, with no field changed yet.
22579        pub fn from_node(node: &'gc super::InterfaceDeclaration<'gc>) -> Self {
22580            Self {
22581                is_changed: false,
22582                inner: super::InterfaceDeclaration {
22583                    metadata: node.metadata.duplicate(),
22584                    id: node.id.duplicate(),
22585                    type_parameters: node.type_parameters.duplicate(),
22586                    extends: node.extends.duplicate(),
22587                    body: node.body.duplicate(),
22588                },
22589            }
22590        }
22591        /// Allocate the rebuilt node if a setter ran, else
22592        /// `TransformResult::Unchanged`.
22593        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22594            if self.is_changed {
22595                TransformResult::Changed(self.build_forced(gc))
22596            } else {
22597                TransformResult::Unchanged
22598            }
22599        }
22600        /// Allocate the node unconditionally, changed or not.
22601        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22602            gc.alloc(Node::InterfaceDeclaration(self.inner))
22603        }
22604        /// Set the `id` field and mark the builder changed.
22605        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22606        /// Set the `type_parameters` field and mark the builder changed.
22607        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22608        /// Set the `extends` field and mark the builder changed.
22609        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
22610        /// Set the `body` field and mark the builder changed.
22611        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
22612    }
22613    /// Clone-with-changes builder for [`super::DeclareTypeAlias`].
22614    #[derive(Debug)]
22615    pub struct DeclareTypeAlias<'gc> {
22616        is_changed: bool,
22617        pub(super) inner: super::DeclareTypeAlias<'gc>,
22618    }
22619    impl<'gc> DeclareTypeAlias<'gc> {
22620        /// Start from a copy of `node`, with no field changed yet.
22621        pub fn from_node(node: &'gc super::DeclareTypeAlias<'gc>) -> Self {
22622            Self {
22623                is_changed: false,
22624                inner: super::DeclareTypeAlias {
22625                    metadata: node.metadata.duplicate(),
22626                    id: node.id.duplicate(),
22627                    type_parameters: node.type_parameters.duplicate(),
22628                    right: node.right.duplicate(),
22629                },
22630            }
22631        }
22632        /// Allocate the rebuilt node if a setter ran, else
22633        /// `TransformResult::Unchanged`.
22634        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22635            if self.is_changed {
22636                TransformResult::Changed(self.build_forced(gc))
22637            } else {
22638                TransformResult::Unchanged
22639            }
22640        }
22641        /// Allocate the node unconditionally, changed or not.
22642        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22643            gc.alloc(Node::DeclareTypeAlias(self.inner))
22644        }
22645        /// Set the `id` field and mark the builder changed.
22646        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22647        /// Set the `type_parameters` field and mark the builder changed.
22648        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22649        /// Set the `right` field and mark the builder changed.
22650        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
22651    }
22652    /// Clone-with-changes builder for [`super::DeclareOpaqueType`].
22653    #[derive(Debug)]
22654    pub struct DeclareOpaqueType<'gc> {
22655        is_changed: bool,
22656        pub(super) inner: super::DeclareOpaqueType<'gc>,
22657    }
22658    impl<'gc> DeclareOpaqueType<'gc> {
22659        /// Start from a copy of `node`, with no field changed yet.
22660        pub fn from_node(node: &'gc super::DeclareOpaqueType<'gc>) -> Self {
22661            Self {
22662                is_changed: false,
22663                inner: super::DeclareOpaqueType {
22664                    metadata: node.metadata.duplicate(),
22665                    id: node.id.duplicate(),
22666                    type_parameters: node.type_parameters.duplicate(),
22667                    impltype: node.impltype.duplicate(),
22668                    lower_bound: node.lower_bound.duplicate(),
22669                    upper_bound: node.upper_bound.duplicate(),
22670                    supertype: node.supertype.duplicate(),
22671                },
22672            }
22673        }
22674        /// Allocate the rebuilt node if a setter ran, else
22675        /// `TransformResult::Unchanged`.
22676        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22677            if self.is_changed {
22678                TransformResult::Changed(self.build_forced(gc))
22679            } else {
22680                TransformResult::Unchanged
22681            }
22682        }
22683        /// Allocate the node unconditionally, changed or not.
22684        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22685            gc.alloc(Node::DeclareOpaqueType(self.inner))
22686        }
22687        /// Set the `id` field and mark the builder changed.
22688        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22689        /// Set the `type_parameters` field and mark the builder changed.
22690        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22691        /// Set the `impltype` field and mark the builder changed.
22692        pub fn impltype(&mut self, impltype: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.impltype = impltype; }
22693        /// Set the `lower_bound` field and mark the builder changed.
22694        pub fn lower_bound(&mut self, lower_bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.lower_bound = lower_bound; }
22695        /// Set the `upper_bound` field and mark the builder changed.
22696        pub fn upper_bound(&mut self, upper_bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.upper_bound = upper_bound; }
22697        /// Set the `supertype` field and mark the builder changed.
22698        pub fn supertype(&mut self, supertype: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.supertype = supertype; }
22699    }
22700    /// Clone-with-changes builder for [`super::DeclareInterface`].
22701    #[derive(Debug)]
22702    pub struct DeclareInterface<'gc> {
22703        is_changed: bool,
22704        pub(super) inner: super::DeclareInterface<'gc>,
22705    }
22706    impl<'gc> DeclareInterface<'gc> {
22707        /// Start from a copy of `node`, with no field changed yet.
22708        pub fn from_node(node: &'gc super::DeclareInterface<'gc>) -> Self {
22709            Self {
22710                is_changed: false,
22711                inner: super::DeclareInterface {
22712                    metadata: node.metadata.duplicate(),
22713                    id: node.id.duplicate(),
22714                    type_parameters: node.type_parameters.duplicate(),
22715                    extends: node.extends.duplicate(),
22716                    body: node.body.duplicate(),
22717                },
22718            }
22719        }
22720        /// Allocate the rebuilt node if a setter ran, else
22721        /// `TransformResult::Unchanged`.
22722        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22723            if self.is_changed {
22724                TransformResult::Changed(self.build_forced(gc))
22725            } else {
22726                TransformResult::Unchanged
22727            }
22728        }
22729        /// Allocate the node unconditionally, changed or not.
22730        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22731            gc.alloc(Node::DeclareInterface(self.inner))
22732        }
22733        /// Set the `id` field and mark the builder changed.
22734        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22735        /// Set the `type_parameters` field and mark the builder changed.
22736        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22737        /// Set the `extends` field and mark the builder changed.
22738        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
22739        /// Set the `body` field and mark the builder changed.
22740        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
22741    }
22742    /// Clone-with-changes builder for [`super::DeclareClass`].
22743    #[derive(Debug)]
22744    pub struct DeclareClass<'gc> {
22745        is_changed: bool,
22746        pub(super) inner: super::DeclareClass<'gc>,
22747    }
22748    impl<'gc> DeclareClass<'gc> {
22749        /// Start from a copy of `node`, with no field changed yet.
22750        pub fn from_node(node: &'gc super::DeclareClass<'gc>) -> Self {
22751            Self {
22752                is_changed: false,
22753                inner: super::DeclareClass {
22754                    metadata: node.metadata.duplicate(),
22755                    id: node.id.duplicate(),
22756                    type_parameters: node.type_parameters.duplicate(),
22757                    extends: node.extends.duplicate(),
22758                    implements: node.implements.duplicate(),
22759                    mixins: node.mixins.duplicate(),
22760                    body: node.body.duplicate(),
22761                },
22762            }
22763        }
22764        /// Allocate the rebuilt node if a setter ran, else
22765        /// `TransformResult::Unchanged`.
22766        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22767            if self.is_changed {
22768                TransformResult::Changed(self.build_forced(gc))
22769            } else {
22770                TransformResult::Unchanged
22771            }
22772        }
22773        /// Allocate the node unconditionally, changed or not.
22774        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22775            gc.alloc(Node::DeclareClass(self.inner))
22776        }
22777        /// Set the `id` field and mark the builder changed.
22778        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22779        /// Set the `type_parameters` field and mark the builder changed.
22780        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22781        /// Set the `extends` field and mark the builder changed.
22782        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
22783        /// Set the `implements` field and mark the builder changed.
22784        pub fn implements(&mut self, implements: NodeList<'gc>) { self.is_changed = true; self.inner.implements = implements; }
22785        /// Set the `mixins` field and mark the builder changed.
22786        pub fn mixins(&mut self, mixins: NodeList<'gc>) { self.is_changed = true; self.inner.mixins = mixins; }
22787        /// Set the `body` field and mark the builder changed.
22788        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
22789    }
22790    /// Clone-with-changes builder for [`super::DeclareFunction`].
22791    #[derive(Debug)]
22792    pub struct DeclareFunction<'gc> {
22793        is_changed: bool,
22794        pub(super) inner: super::DeclareFunction<'gc>,
22795    }
22796    impl<'gc> DeclareFunction<'gc> {
22797        /// Start from a copy of `node`, with no field changed yet.
22798        pub fn from_node(node: &'gc super::DeclareFunction<'gc>) -> Self {
22799            Self {
22800                is_changed: false,
22801                inner: super::DeclareFunction {
22802                    metadata: node.metadata.duplicate(),
22803                    id: node.id.duplicate(),
22804                    predicate: node.predicate.duplicate(),
22805                },
22806            }
22807        }
22808        /// Allocate the rebuilt node if a setter ran, else
22809        /// `TransformResult::Unchanged`.
22810        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22811            if self.is_changed {
22812                TransformResult::Changed(self.build_forced(gc))
22813            } else {
22814                TransformResult::Unchanged
22815            }
22816        }
22817        /// Allocate the node unconditionally, changed or not.
22818        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22819            gc.alloc(Node::DeclareFunction(self.inner))
22820        }
22821        /// Set the `id` field and mark the builder changed.
22822        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22823        /// Set the `predicate` field and mark the builder changed.
22824        pub fn predicate(&mut self, predicate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.predicate = predicate; }
22825    }
22826    /// Clone-with-changes builder for [`super::DeclareHook`].
22827    #[derive(Debug)]
22828    pub struct DeclareHook<'gc> {
22829        is_changed: bool,
22830        pub(super) inner: super::DeclareHook<'gc>,
22831    }
22832    impl<'gc> DeclareHook<'gc> {
22833        /// Start from a copy of `node`, with no field changed yet.
22834        pub fn from_node(node: &'gc super::DeclareHook<'gc>) -> Self {
22835            Self {
22836                is_changed: false,
22837                inner: super::DeclareHook {
22838                    metadata: node.metadata.duplicate(),
22839                    id: node.id.duplicate(),
22840                },
22841            }
22842        }
22843        /// Allocate the rebuilt node if a setter ran, else
22844        /// `TransformResult::Unchanged`.
22845        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22846            if self.is_changed {
22847                TransformResult::Changed(self.build_forced(gc))
22848            } else {
22849                TransformResult::Unchanged
22850            }
22851        }
22852        /// Allocate the node unconditionally, changed or not.
22853        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22854            gc.alloc(Node::DeclareHook(self.inner))
22855        }
22856        /// Set the `id` field and mark the builder changed.
22857        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22858    }
22859    /// Clone-with-changes builder for [`super::DeclareComponent`].
22860    #[derive(Debug)]
22861    pub struct DeclareComponent<'gc> {
22862        is_changed: bool,
22863        pub(super) inner: super::DeclareComponent<'gc>,
22864    }
22865    impl<'gc> DeclareComponent<'gc> {
22866        /// Start from a copy of `node`, with no field changed yet.
22867        pub fn from_node(node: &'gc super::DeclareComponent<'gc>) -> Self {
22868            Self {
22869                is_changed: false,
22870                inner: super::DeclareComponent {
22871                    metadata: node.metadata.duplicate(),
22872                    id: node.id.duplicate(),
22873                    params: node.params.duplicate(),
22874                    rest: node.rest.duplicate(),
22875                    type_parameters: node.type_parameters.duplicate(),
22876                    renders_type: node.renders_type.duplicate(),
22877                },
22878            }
22879        }
22880        /// Allocate the rebuilt node if a setter ran, else
22881        /// `TransformResult::Unchanged`.
22882        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22883            if self.is_changed {
22884                TransformResult::Changed(self.build_forced(gc))
22885            } else {
22886                TransformResult::Unchanged
22887            }
22888        }
22889        /// Allocate the node unconditionally, changed or not.
22890        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22891            gc.alloc(Node::DeclareComponent(self.inner))
22892        }
22893        /// Set the `id` field and mark the builder changed.
22894        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22895        /// Set the `params` field and mark the builder changed.
22896        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
22897        /// Set the `rest` field and mark the builder changed.
22898        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
22899        /// Set the `type_parameters` field and mark the builder changed.
22900        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22901        /// Set the `renders_type` field and mark the builder changed.
22902        pub fn renders_type(&mut self, renders_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.renders_type = renders_type; }
22903    }
22904    /// Clone-with-changes builder for [`super::DeclareVariable`].
22905    #[derive(Debug)]
22906    pub struct DeclareVariable<'gc> {
22907        is_changed: bool,
22908        pub(super) inner: super::DeclareVariable<'gc>,
22909    }
22910    impl<'gc> DeclareVariable<'gc> {
22911        /// Start from a copy of `node`, with no field changed yet.
22912        pub fn from_node(node: &'gc super::DeclareVariable<'gc>) -> Self {
22913            Self {
22914                is_changed: false,
22915                inner: super::DeclareVariable {
22916                    metadata: node.metadata.duplicate(),
22917                    id: node.id.duplicate(),
22918                    kind: Cell::new(node.kind.get()),
22919                },
22920            }
22921        }
22922        /// Allocate the rebuilt node if a setter ran, else
22923        /// `TransformResult::Unchanged`.
22924        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22925            if self.is_changed {
22926                TransformResult::Changed(self.build_forced(gc))
22927            } else {
22928                TransformResult::Unchanged
22929            }
22930        }
22931        /// Allocate the node unconditionally, changed or not.
22932        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22933            gc.alloc(Node::DeclareVariable(self.inner))
22934        }
22935        /// Set the `id` field and mark the builder changed.
22936        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22937    }
22938    /// Clone-with-changes builder for [`super::DeclareEnum`].
22939    #[derive(Debug)]
22940    pub struct DeclareEnum<'gc> {
22941        is_changed: bool,
22942        pub(super) inner: super::DeclareEnum<'gc>,
22943    }
22944    impl<'gc> DeclareEnum<'gc> {
22945        /// Start from a copy of `node`, with no field changed yet.
22946        pub fn from_node(node: &'gc super::DeclareEnum<'gc>) -> Self {
22947            Self {
22948                is_changed: false,
22949                inner: super::DeclareEnum {
22950                    metadata: node.metadata.duplicate(),
22951                    id: node.id.duplicate(),
22952                    body: node.body.duplicate(),
22953                },
22954            }
22955        }
22956        /// Allocate the rebuilt node if a setter ran, else
22957        /// `TransformResult::Unchanged`.
22958        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22959            if self.is_changed {
22960                TransformResult::Changed(self.build_forced(gc))
22961            } else {
22962                TransformResult::Unchanged
22963            }
22964        }
22965        /// Allocate the node unconditionally, changed or not.
22966        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22967            gc.alloc(Node::DeclareEnum(self.inner))
22968        }
22969        /// Set the `id` field and mark the builder changed.
22970        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
22971        /// Set the `body` field and mark the builder changed.
22972        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
22973    }
22974    /// Clone-with-changes builder for [`super::DeclareExportDeclaration`].
22975    #[derive(Debug)]
22976    pub struct DeclareExportDeclaration<'gc> {
22977        is_changed: bool,
22978        pub(super) inner: super::DeclareExportDeclaration<'gc>,
22979    }
22980    impl<'gc> DeclareExportDeclaration<'gc> {
22981        /// Start from a copy of `node`, with no field changed yet.
22982        pub fn from_node(node: &'gc super::DeclareExportDeclaration<'gc>) -> Self {
22983            Self {
22984                is_changed: false,
22985                inner: super::DeclareExportDeclaration {
22986                    metadata: node.metadata.duplicate(),
22987                    declaration: node.declaration.duplicate(),
22988                    specifiers: node.specifiers.duplicate(),
22989                    source: node.source.duplicate(),
22990                    default: Cell::new(node.default.get()),
22991                },
22992            }
22993        }
22994        /// Allocate the rebuilt node if a setter ran, else
22995        /// `TransformResult::Unchanged`.
22996        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22997            if self.is_changed {
22998                TransformResult::Changed(self.build_forced(gc))
22999            } else {
23000                TransformResult::Unchanged
23001            }
23002        }
23003        /// Allocate the node unconditionally, changed or not.
23004        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23005            gc.alloc(Node::DeclareExportDeclaration(self.inner))
23006        }
23007        /// Set the `declaration` field and mark the builder changed.
23008        pub fn declaration(&mut self, declaration: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.declaration = declaration; }
23009        /// Set the `specifiers` field and mark the builder changed.
23010        pub fn specifiers(&mut self, specifiers: NodeList<'gc>) { self.is_changed = true; self.inner.specifiers = specifiers; }
23011        /// Set the `source` field and mark the builder changed.
23012        pub fn source(&mut self, source: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.source = source; }
23013    }
23014    /// Clone-with-changes builder for [`super::DeclareExportAllDeclaration`].
23015    #[derive(Debug)]
23016    pub struct DeclareExportAllDeclaration<'gc> {
23017        is_changed: bool,
23018        pub(super) inner: super::DeclareExportAllDeclaration<'gc>,
23019    }
23020    impl<'gc> DeclareExportAllDeclaration<'gc> {
23021        /// Start from a copy of `node`, with no field changed yet.
23022        pub fn from_node(node: &'gc super::DeclareExportAllDeclaration<'gc>) -> Self {
23023            Self {
23024                is_changed: false,
23025                inner: super::DeclareExportAllDeclaration {
23026                    metadata: node.metadata.duplicate(),
23027                    source: node.source.duplicate(),
23028                },
23029            }
23030        }
23031        /// Allocate the rebuilt node if a setter ran, else
23032        /// `TransformResult::Unchanged`.
23033        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23034            if self.is_changed {
23035                TransformResult::Changed(self.build_forced(gc))
23036            } else {
23037                TransformResult::Unchanged
23038            }
23039        }
23040        /// Allocate the node unconditionally, changed or not.
23041        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23042            gc.alloc(Node::DeclareExportAllDeclaration(self.inner))
23043        }
23044        /// Set the `source` field and mark the builder changed.
23045        pub fn source(&mut self, source: &'gc Node<'gc>) { self.is_changed = true; self.inner.source = source; }
23046    }
23047    /// Clone-with-changes builder for [`super::DeclareModule`].
23048    #[derive(Debug)]
23049    pub struct DeclareModule<'gc> {
23050        is_changed: bool,
23051        pub(super) inner: super::DeclareModule<'gc>,
23052    }
23053    impl<'gc> DeclareModule<'gc> {
23054        /// Start from a copy of `node`, with no field changed yet.
23055        pub fn from_node(node: &'gc super::DeclareModule<'gc>) -> Self {
23056            Self {
23057                is_changed: false,
23058                inner: super::DeclareModule {
23059                    metadata: node.metadata.duplicate(),
23060                    id: node.id.duplicate(),
23061                    body: node.body.duplicate(),
23062                },
23063            }
23064        }
23065        /// Allocate the rebuilt node if a setter ran, else
23066        /// `TransformResult::Unchanged`.
23067        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23068            if self.is_changed {
23069                TransformResult::Changed(self.build_forced(gc))
23070            } else {
23071                TransformResult::Unchanged
23072            }
23073        }
23074        /// Allocate the node unconditionally, changed or not.
23075        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23076            gc.alloc(Node::DeclareModule(self.inner))
23077        }
23078        /// Set the `id` field and mark the builder changed.
23079        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23080        /// Set the `body` field and mark the builder changed.
23081        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
23082    }
23083    /// Clone-with-changes builder for [`super::DeclareNamespace`].
23084    #[derive(Debug)]
23085    pub struct DeclareNamespace<'gc> {
23086        is_changed: bool,
23087        pub(super) inner: super::DeclareNamespace<'gc>,
23088    }
23089    impl<'gc> DeclareNamespace<'gc> {
23090        /// Start from a copy of `node`, with no field changed yet.
23091        pub fn from_node(node: &'gc super::DeclareNamespace<'gc>) -> Self {
23092            Self {
23093                is_changed: false,
23094                inner: super::DeclareNamespace {
23095                    metadata: node.metadata.duplicate(),
23096                    id: node.id.duplicate(),
23097                    body: node.body.duplicate(),
23098                },
23099            }
23100        }
23101        /// Allocate the rebuilt node if a setter ran, else
23102        /// `TransformResult::Unchanged`.
23103        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23104            if self.is_changed {
23105                TransformResult::Changed(self.build_forced(gc))
23106            } else {
23107                TransformResult::Unchanged
23108            }
23109        }
23110        /// Allocate the node unconditionally, changed or not.
23111        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23112            gc.alloc(Node::DeclareNamespace(self.inner))
23113        }
23114        /// Set the `id` field and mark the builder changed.
23115        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23116        /// Set the `body` field and mark the builder changed.
23117        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
23118    }
23119    /// Clone-with-changes builder for [`super::DeclareModuleExports`].
23120    #[derive(Debug)]
23121    pub struct DeclareModuleExports<'gc> {
23122        is_changed: bool,
23123        pub(super) inner: super::DeclareModuleExports<'gc>,
23124    }
23125    impl<'gc> DeclareModuleExports<'gc> {
23126        /// Start from a copy of `node`, with no field changed yet.
23127        pub fn from_node(node: &'gc super::DeclareModuleExports<'gc>) -> Self {
23128            Self {
23129                is_changed: false,
23130                inner: super::DeclareModuleExports {
23131                    metadata: node.metadata.duplicate(),
23132                    type_annotation: node.type_annotation.duplicate(),
23133                },
23134            }
23135        }
23136        /// Allocate the rebuilt node if a setter ran, else
23137        /// `TransformResult::Unchanged`.
23138        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23139            if self.is_changed {
23140                TransformResult::Changed(self.build_forced(gc))
23141            } else {
23142                TransformResult::Unchanged
23143            }
23144        }
23145        /// Allocate the node unconditionally, changed or not.
23146        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23147            gc.alloc(Node::DeclareModuleExports(self.inner))
23148        }
23149        /// Set the `type_annotation` field and mark the builder changed.
23150        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23151    }
23152    /// Clone-with-changes builder for [`super::InterfaceExtends`].
23153    #[derive(Debug)]
23154    pub struct InterfaceExtends<'gc> {
23155        is_changed: bool,
23156        pub(super) inner: super::InterfaceExtends<'gc>,
23157    }
23158    impl<'gc> InterfaceExtends<'gc> {
23159        /// Start from a copy of `node`, with no field changed yet.
23160        pub fn from_node(node: &'gc super::InterfaceExtends<'gc>) -> Self {
23161            Self {
23162                is_changed: false,
23163                inner: super::InterfaceExtends {
23164                    metadata: node.metadata.duplicate(),
23165                    id: node.id.duplicate(),
23166                    type_parameters: node.type_parameters.duplicate(),
23167                },
23168            }
23169        }
23170        /// Allocate the rebuilt node if a setter ran, else
23171        /// `TransformResult::Unchanged`.
23172        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23173            if self.is_changed {
23174                TransformResult::Changed(self.build_forced(gc))
23175            } else {
23176                TransformResult::Unchanged
23177            }
23178        }
23179        /// Allocate the node unconditionally, changed or not.
23180        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23181            gc.alloc(Node::InterfaceExtends(self.inner))
23182        }
23183        /// Set the `id` field and mark the builder changed.
23184        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23185        /// Set the `type_parameters` field and mark the builder changed.
23186        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
23187    }
23188    /// Clone-with-changes builder for [`super::ClassImplements`].
23189    #[derive(Debug)]
23190    pub struct ClassImplements<'gc> {
23191        is_changed: bool,
23192        pub(super) inner: super::ClassImplements<'gc>,
23193    }
23194    impl<'gc> ClassImplements<'gc> {
23195        /// Start from a copy of `node`, with no field changed yet.
23196        pub fn from_node(node: &'gc super::ClassImplements<'gc>) -> Self {
23197            Self {
23198                is_changed: false,
23199                inner: super::ClassImplements {
23200                    metadata: node.metadata.duplicate(),
23201                    id: node.id.duplicate(),
23202                    type_parameters: node.type_parameters.duplicate(),
23203                },
23204            }
23205        }
23206        /// Allocate the rebuilt node if a setter ran, else
23207        /// `TransformResult::Unchanged`.
23208        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23209            if self.is_changed {
23210                TransformResult::Changed(self.build_forced(gc))
23211            } else {
23212                TransformResult::Unchanged
23213            }
23214        }
23215        /// Allocate the node unconditionally, changed or not.
23216        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23217            gc.alloc(Node::ClassImplements(self.inner))
23218        }
23219        /// Set the `id` field and mark the builder changed.
23220        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23221        /// Set the `type_parameters` field and mark the builder changed.
23222        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
23223    }
23224    /// Clone-with-changes builder for [`super::TypeAnnotation`].
23225    #[derive(Debug)]
23226    pub struct TypeAnnotation<'gc> {
23227        is_changed: bool,
23228        pub(super) inner: super::TypeAnnotation<'gc>,
23229    }
23230    impl<'gc> TypeAnnotation<'gc> {
23231        /// Start from a copy of `node`, with no field changed yet.
23232        pub fn from_node(node: &'gc super::TypeAnnotation<'gc>) -> Self {
23233            Self {
23234                is_changed: false,
23235                inner: super::TypeAnnotation {
23236                    metadata: node.metadata.duplicate(),
23237                    type_annotation: node.type_annotation.duplicate(),
23238                },
23239            }
23240        }
23241        /// Allocate the rebuilt node if a setter ran, else
23242        /// `TransformResult::Unchanged`.
23243        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23244            if self.is_changed {
23245                TransformResult::Changed(self.build_forced(gc))
23246            } else {
23247                TransformResult::Unchanged
23248            }
23249        }
23250        /// Allocate the node unconditionally, changed or not.
23251        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23252            gc.alloc(Node::TypeAnnotation(self.inner))
23253        }
23254        /// Set the `type_annotation` field and mark the builder changed.
23255        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23256    }
23257    /// Clone-with-changes builder for [`super::ObjectTypeAnnotation`].
23258    #[derive(Debug)]
23259    pub struct ObjectTypeAnnotation<'gc> {
23260        is_changed: bool,
23261        pub(super) inner: super::ObjectTypeAnnotation<'gc>,
23262    }
23263    impl<'gc> ObjectTypeAnnotation<'gc> {
23264        /// Start from a copy of `node`, with no field changed yet.
23265        pub fn from_node(node: &'gc super::ObjectTypeAnnotation<'gc>) -> Self {
23266            Self {
23267                is_changed: false,
23268                inner: super::ObjectTypeAnnotation {
23269                    metadata: node.metadata.duplicate(),
23270                    properties: node.properties.duplicate(),
23271                    indexers: node.indexers.duplicate(),
23272                    call_properties: node.call_properties.duplicate(),
23273                    internal_slots: node.internal_slots.duplicate(),
23274                    inexact: Cell::new(node.inexact.get()),
23275                    exact: Cell::new(node.exact.get()),
23276                },
23277            }
23278        }
23279        /// Allocate the rebuilt node if a setter ran, else
23280        /// `TransformResult::Unchanged`.
23281        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23282            if self.is_changed {
23283                TransformResult::Changed(self.build_forced(gc))
23284            } else {
23285                TransformResult::Unchanged
23286            }
23287        }
23288        /// Allocate the node unconditionally, changed or not.
23289        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23290            gc.alloc(Node::ObjectTypeAnnotation(self.inner))
23291        }
23292        /// Set the `properties` field and mark the builder changed.
23293        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
23294        /// Set the `indexers` field and mark the builder changed.
23295        pub fn indexers(&mut self, indexers: NodeList<'gc>) { self.is_changed = true; self.inner.indexers = indexers; }
23296        /// Set the `call_properties` field and mark the builder changed.
23297        pub fn call_properties(&mut self, call_properties: NodeList<'gc>) { self.is_changed = true; self.inner.call_properties = call_properties; }
23298        /// Set the `internal_slots` field and mark the builder changed.
23299        pub fn internal_slots(&mut self, internal_slots: NodeList<'gc>) { self.is_changed = true; self.inner.internal_slots = internal_slots; }
23300    }
23301    /// Clone-with-changes builder for [`super::ObjectTypeProperty`].
23302    #[derive(Debug)]
23303    pub struct ObjectTypeProperty<'gc> {
23304        is_changed: bool,
23305        pub(super) inner: super::ObjectTypeProperty<'gc>,
23306    }
23307    impl<'gc> ObjectTypeProperty<'gc> {
23308        /// Start from a copy of `node`, with no field changed yet.
23309        pub fn from_node(node: &'gc super::ObjectTypeProperty<'gc>) -> Self {
23310            Self {
23311                is_changed: false,
23312                inner: super::ObjectTypeProperty {
23313                    metadata: node.metadata.duplicate(),
23314                    key: node.key.duplicate(),
23315                    value: node.value.duplicate(),
23316                    method: Cell::new(node.method.get()),
23317                    optional: Cell::new(node.optional.get()),
23318                    r#static: Cell::new(node.r#static.get()),
23319                    proto: Cell::new(node.proto.get()),
23320                    variance: node.variance.duplicate(),
23321                    kind: Cell::new(node.kind.get()),
23322                },
23323            }
23324        }
23325        /// Allocate the rebuilt node if a setter ran, else
23326        /// `TransformResult::Unchanged`.
23327        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23328            if self.is_changed {
23329                TransformResult::Changed(self.build_forced(gc))
23330            } else {
23331                TransformResult::Unchanged
23332            }
23333        }
23334        /// Allocate the node unconditionally, changed or not.
23335        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23336            gc.alloc(Node::ObjectTypeProperty(self.inner))
23337        }
23338        /// Set the `key` field and mark the builder changed.
23339        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
23340        /// Set the `value` field and mark the builder changed.
23341        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
23342        /// Set the `variance` field and mark the builder changed.
23343        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
23344    }
23345    /// Clone-with-changes builder for [`super::ObjectTypeSpreadProperty`].
23346    #[derive(Debug)]
23347    pub struct ObjectTypeSpreadProperty<'gc> {
23348        is_changed: bool,
23349        pub(super) inner: super::ObjectTypeSpreadProperty<'gc>,
23350    }
23351    impl<'gc> ObjectTypeSpreadProperty<'gc> {
23352        /// Start from a copy of `node`, with no field changed yet.
23353        pub fn from_node(node: &'gc super::ObjectTypeSpreadProperty<'gc>) -> Self {
23354            Self {
23355                is_changed: false,
23356                inner: super::ObjectTypeSpreadProperty {
23357                    metadata: node.metadata.duplicate(),
23358                    argument: node.argument.duplicate(),
23359                },
23360            }
23361        }
23362        /// Allocate the rebuilt node if a setter ran, else
23363        /// `TransformResult::Unchanged`.
23364        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23365            if self.is_changed {
23366                TransformResult::Changed(self.build_forced(gc))
23367            } else {
23368                TransformResult::Unchanged
23369            }
23370        }
23371        /// Allocate the node unconditionally, changed or not.
23372        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23373            gc.alloc(Node::ObjectTypeSpreadProperty(self.inner))
23374        }
23375        /// Set the `argument` field and mark the builder changed.
23376        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
23377    }
23378    /// Clone-with-changes builder for [`super::ObjectTypeInternalSlot`].
23379    #[derive(Debug)]
23380    pub struct ObjectTypeInternalSlot<'gc> {
23381        is_changed: bool,
23382        pub(super) inner: super::ObjectTypeInternalSlot<'gc>,
23383    }
23384    impl<'gc> ObjectTypeInternalSlot<'gc> {
23385        /// Start from a copy of `node`, with no field changed yet.
23386        pub fn from_node(node: &'gc super::ObjectTypeInternalSlot<'gc>) -> Self {
23387            Self {
23388                is_changed: false,
23389                inner: super::ObjectTypeInternalSlot {
23390                    metadata: node.metadata.duplicate(),
23391                    id: node.id.duplicate(),
23392                    value: node.value.duplicate(),
23393                    optional: Cell::new(node.optional.get()),
23394                    r#static: Cell::new(node.r#static.get()),
23395                    method: Cell::new(node.method.get()),
23396                },
23397            }
23398        }
23399        /// Allocate the rebuilt node if a setter ran, else
23400        /// `TransformResult::Unchanged`.
23401        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23402            if self.is_changed {
23403                TransformResult::Changed(self.build_forced(gc))
23404            } else {
23405                TransformResult::Unchanged
23406            }
23407        }
23408        /// Allocate the node unconditionally, changed or not.
23409        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23410            gc.alloc(Node::ObjectTypeInternalSlot(self.inner))
23411        }
23412        /// Set the `id` field and mark the builder changed.
23413        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23414        /// Set the `value` field and mark the builder changed.
23415        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
23416    }
23417    /// Clone-with-changes builder for [`super::ObjectTypeCallProperty`].
23418    #[derive(Debug)]
23419    pub struct ObjectTypeCallProperty<'gc> {
23420        is_changed: bool,
23421        pub(super) inner: super::ObjectTypeCallProperty<'gc>,
23422    }
23423    impl<'gc> ObjectTypeCallProperty<'gc> {
23424        /// Start from a copy of `node`, with no field changed yet.
23425        pub fn from_node(node: &'gc super::ObjectTypeCallProperty<'gc>) -> Self {
23426            Self {
23427                is_changed: false,
23428                inner: super::ObjectTypeCallProperty {
23429                    metadata: node.metadata.duplicate(),
23430                    value: node.value.duplicate(),
23431                    r#static: Cell::new(node.r#static.get()),
23432                },
23433            }
23434        }
23435        /// Allocate the rebuilt node if a setter ran, else
23436        /// `TransformResult::Unchanged`.
23437        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23438            if self.is_changed {
23439                TransformResult::Changed(self.build_forced(gc))
23440            } else {
23441                TransformResult::Unchanged
23442            }
23443        }
23444        /// Allocate the node unconditionally, changed or not.
23445        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23446            gc.alloc(Node::ObjectTypeCallProperty(self.inner))
23447        }
23448        /// Set the `value` field and mark the builder changed.
23449        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
23450    }
23451    /// Clone-with-changes builder for [`super::ObjectTypeIndexer`].
23452    #[derive(Debug)]
23453    pub struct ObjectTypeIndexer<'gc> {
23454        is_changed: bool,
23455        pub(super) inner: super::ObjectTypeIndexer<'gc>,
23456    }
23457    impl<'gc> ObjectTypeIndexer<'gc> {
23458        /// Start from a copy of `node`, with no field changed yet.
23459        pub fn from_node(node: &'gc super::ObjectTypeIndexer<'gc>) -> Self {
23460            Self {
23461                is_changed: false,
23462                inner: super::ObjectTypeIndexer {
23463                    metadata: node.metadata.duplicate(),
23464                    id: node.id.duplicate(),
23465                    key: node.key.duplicate(),
23466                    value: node.value.duplicate(),
23467                    r#static: Cell::new(node.r#static.get()),
23468                    variance: node.variance.duplicate(),
23469                },
23470            }
23471        }
23472        /// Allocate the rebuilt node if a setter ran, else
23473        /// `TransformResult::Unchanged`.
23474        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23475            if self.is_changed {
23476                TransformResult::Changed(self.build_forced(gc))
23477            } else {
23478                TransformResult::Unchanged
23479            }
23480        }
23481        /// Allocate the node unconditionally, changed or not.
23482        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23483            gc.alloc(Node::ObjectTypeIndexer(self.inner))
23484        }
23485        /// Set the `id` field and mark the builder changed.
23486        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
23487        /// Set the `key` field and mark the builder changed.
23488        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
23489        /// Set the `value` field and mark the builder changed.
23490        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
23491        /// Set the `variance` field and mark the builder changed.
23492        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
23493    }
23494    /// Clone-with-changes builder for [`super::ObjectTypeMappedTypeProperty`].
23495    #[derive(Debug)]
23496    pub struct ObjectTypeMappedTypeProperty<'gc> {
23497        is_changed: bool,
23498        pub(super) inner: super::ObjectTypeMappedTypeProperty<'gc>,
23499    }
23500    impl<'gc> ObjectTypeMappedTypeProperty<'gc> {
23501        /// Start from a copy of `node`, with no field changed yet.
23502        pub fn from_node(node: &'gc super::ObjectTypeMappedTypeProperty<'gc>) -> Self {
23503            Self {
23504                is_changed: false,
23505                inner: super::ObjectTypeMappedTypeProperty {
23506                    metadata: node.metadata.duplicate(),
23507                    key_tparam: node.key_tparam.duplicate(),
23508                    prop_type: node.prop_type.duplicate(),
23509                    source_type: node.source_type.duplicate(),
23510                    variance: node.variance.duplicate(),
23511                    optional: Cell::new(node.optional.get()),
23512                },
23513            }
23514        }
23515        /// Allocate the rebuilt node if a setter ran, else
23516        /// `TransformResult::Unchanged`.
23517        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23518            if self.is_changed {
23519                TransformResult::Changed(self.build_forced(gc))
23520            } else {
23521                TransformResult::Unchanged
23522            }
23523        }
23524        /// Allocate the node unconditionally, changed or not.
23525        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23526            gc.alloc(Node::ObjectTypeMappedTypeProperty(self.inner))
23527        }
23528        /// Set the `key_tparam` field and mark the builder changed.
23529        pub fn key_tparam(&mut self, key_tparam: &'gc Node<'gc>) { self.is_changed = true; self.inner.key_tparam = key_tparam; }
23530        /// Set the `prop_type` field and mark the builder changed.
23531        pub fn prop_type(&mut self, prop_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.prop_type = prop_type; }
23532        /// Set the `source_type` field and mark the builder changed.
23533        pub fn source_type(&mut self, source_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.source_type = source_type; }
23534        /// Set the `variance` field and mark the builder changed.
23535        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
23536    }
23537    /// Clone-with-changes builder for [`super::Variance`].
23538    #[derive(Debug)]
23539    pub struct Variance<'gc> {
23540        is_changed: bool,
23541        pub(super) inner: super::Variance<'gc>,
23542    }
23543    impl<'gc> Variance<'gc> {
23544        /// Start from a copy of `node`, with no field changed yet.
23545        pub fn from_node(node: &'gc super::Variance<'gc>) -> Self {
23546            Self {
23547                is_changed: false,
23548                inner: super::Variance {
23549                    metadata: node.metadata.duplicate(),
23550                    kind: Cell::new(node.kind.get()),
23551                },
23552            }
23553        }
23554        /// Allocate the rebuilt node if a setter ran, else
23555        /// `TransformResult::Unchanged`.
23556        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23557            if self.is_changed {
23558                TransformResult::Changed(self.build_forced(gc))
23559            } else {
23560                TransformResult::Unchanged
23561            }
23562        }
23563        /// Allocate the node unconditionally, changed or not.
23564        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23565            gc.alloc(Node::Variance(self.inner))
23566        }
23567    }
23568    /// Clone-with-changes builder for [`super::TypeParameterDeclaration`].
23569    #[derive(Debug)]
23570    pub struct TypeParameterDeclaration<'gc> {
23571        is_changed: bool,
23572        pub(super) inner: super::TypeParameterDeclaration<'gc>,
23573    }
23574    impl<'gc> TypeParameterDeclaration<'gc> {
23575        /// Start from a copy of `node`, with no field changed yet.
23576        pub fn from_node(node: &'gc super::TypeParameterDeclaration<'gc>) -> Self {
23577            Self {
23578                is_changed: false,
23579                inner: super::TypeParameterDeclaration {
23580                    metadata: node.metadata.duplicate(),
23581                    params: node.params.duplicate(),
23582                },
23583            }
23584        }
23585        /// Allocate the rebuilt node if a setter ran, else
23586        /// `TransformResult::Unchanged`.
23587        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23588            if self.is_changed {
23589                TransformResult::Changed(self.build_forced(gc))
23590            } else {
23591                TransformResult::Unchanged
23592            }
23593        }
23594        /// Allocate the node unconditionally, changed or not.
23595        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23596            gc.alloc(Node::TypeParameterDeclaration(self.inner))
23597        }
23598        /// Set the `params` field and mark the builder changed.
23599        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
23600    }
23601    /// Clone-with-changes builder for [`super::TypeParameter`].
23602    #[derive(Debug)]
23603    pub struct TypeParameter<'gc> {
23604        is_changed: bool,
23605        pub(super) inner: super::TypeParameter<'gc>,
23606    }
23607    impl<'gc> TypeParameter<'gc> {
23608        /// Start from a copy of `node`, with no field changed yet.
23609        pub fn from_node(node: &'gc super::TypeParameter<'gc>) -> Self {
23610            Self {
23611                is_changed: false,
23612                inner: super::TypeParameter {
23613                    metadata: node.metadata.duplicate(),
23614                    name: Cell::new(node.name.get()),
23615                    r#const: Cell::new(node.r#const.get()),
23616                    bound: node.bound.duplicate(),
23617                    variance: node.variance.duplicate(),
23618                    default: node.default.duplicate(),
23619                    uses_extends_bound: Cell::new(node.uses_extends_bound.get()),
23620                },
23621            }
23622        }
23623        /// Allocate the rebuilt node if a setter ran, else
23624        /// `TransformResult::Unchanged`.
23625        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23626            if self.is_changed {
23627                TransformResult::Changed(self.build_forced(gc))
23628            } else {
23629                TransformResult::Unchanged
23630            }
23631        }
23632        /// Allocate the node unconditionally, changed or not.
23633        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23634            gc.alloc(Node::TypeParameter(self.inner))
23635        }
23636        /// Set the `bound` field and mark the builder changed.
23637        pub fn bound(&mut self, bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.bound = bound; }
23638        /// Set the `variance` field and mark the builder changed.
23639        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
23640        /// Set the `default` field and mark the builder changed.
23641        pub fn default(&mut self, default: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.default = default; }
23642    }
23643    /// Clone-with-changes builder for [`super::TypeParameterInstantiation`].
23644    #[derive(Debug)]
23645    pub struct TypeParameterInstantiation<'gc> {
23646        is_changed: bool,
23647        pub(super) inner: super::TypeParameterInstantiation<'gc>,
23648    }
23649    impl<'gc> TypeParameterInstantiation<'gc> {
23650        /// Start from a copy of `node`, with no field changed yet.
23651        pub fn from_node(node: &'gc super::TypeParameterInstantiation<'gc>) -> Self {
23652            Self {
23653                is_changed: false,
23654                inner: super::TypeParameterInstantiation {
23655                    metadata: node.metadata.duplicate(),
23656                    params: node.params.duplicate(),
23657                },
23658            }
23659        }
23660        /// Allocate the rebuilt node if a setter ran, else
23661        /// `TransformResult::Unchanged`.
23662        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23663            if self.is_changed {
23664                TransformResult::Changed(self.build_forced(gc))
23665            } else {
23666                TransformResult::Unchanged
23667            }
23668        }
23669        /// Allocate the node unconditionally, changed or not.
23670        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23671            gc.alloc(Node::TypeParameterInstantiation(self.inner))
23672        }
23673        /// Set the `params` field and mark the builder changed.
23674        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
23675    }
23676    /// Clone-with-changes builder for [`super::TypeCastExpression`].
23677    #[derive(Debug)]
23678    pub struct TypeCastExpression<'gc> {
23679        is_changed: bool,
23680        pub(super) inner: super::TypeCastExpression<'gc>,
23681    }
23682    impl<'gc> TypeCastExpression<'gc> {
23683        /// Start from a copy of `node`, with no field changed yet.
23684        pub fn from_node(node: &'gc super::TypeCastExpression<'gc>) -> Self {
23685            Self {
23686                is_changed: false,
23687                inner: super::TypeCastExpression {
23688                    metadata: node.metadata.duplicate(),
23689                    expression: node.expression.duplicate(),
23690                    type_annotation: node.type_annotation.duplicate(),
23691                },
23692            }
23693        }
23694        /// Allocate the rebuilt node if a setter ran, else
23695        /// `TransformResult::Unchanged`.
23696        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23697            if self.is_changed {
23698                TransformResult::Changed(self.build_forced(gc))
23699            } else {
23700                TransformResult::Unchanged
23701            }
23702        }
23703        /// Allocate the node unconditionally, changed or not.
23704        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23705            gc.alloc(Node::TypeCastExpression(self.inner))
23706        }
23707        /// Set the `expression` field and mark the builder changed.
23708        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
23709        /// Set the `type_annotation` field and mark the builder changed.
23710        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23711    }
23712    /// Clone-with-changes builder for [`super::AsExpression`].
23713    #[derive(Debug)]
23714    pub struct AsExpression<'gc> {
23715        is_changed: bool,
23716        pub(super) inner: super::AsExpression<'gc>,
23717    }
23718    impl<'gc> AsExpression<'gc> {
23719        /// Start from a copy of `node`, with no field changed yet.
23720        pub fn from_node(node: &'gc super::AsExpression<'gc>) -> Self {
23721            Self {
23722                is_changed: false,
23723                inner: super::AsExpression {
23724                    metadata: node.metadata.duplicate(),
23725                    expression: node.expression.duplicate(),
23726                    type_annotation: node.type_annotation.duplicate(),
23727                },
23728            }
23729        }
23730        /// Allocate the rebuilt node if a setter ran, else
23731        /// `TransformResult::Unchanged`.
23732        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23733            if self.is_changed {
23734                TransformResult::Changed(self.build_forced(gc))
23735            } else {
23736                TransformResult::Unchanged
23737            }
23738        }
23739        /// Allocate the node unconditionally, changed or not.
23740        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23741            gc.alloc(Node::AsExpression(self.inner))
23742        }
23743        /// Set the `expression` field and mark the builder changed.
23744        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
23745        /// Set the `type_annotation` field and mark the builder changed.
23746        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23747    }
23748    /// Clone-with-changes builder for [`super::AsConstExpression`].
23749    #[derive(Debug)]
23750    pub struct AsConstExpression<'gc> {
23751        is_changed: bool,
23752        pub(super) inner: super::AsConstExpression<'gc>,
23753    }
23754    impl<'gc> AsConstExpression<'gc> {
23755        /// Start from a copy of `node`, with no field changed yet.
23756        pub fn from_node(node: &'gc super::AsConstExpression<'gc>) -> Self {
23757            Self {
23758                is_changed: false,
23759                inner: super::AsConstExpression {
23760                    metadata: node.metadata.duplicate(),
23761                    expression: node.expression.duplicate(),
23762                },
23763            }
23764        }
23765        /// Allocate the rebuilt node if a setter ran, else
23766        /// `TransformResult::Unchanged`.
23767        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23768            if self.is_changed {
23769                TransformResult::Changed(self.build_forced(gc))
23770            } else {
23771                TransformResult::Unchanged
23772            }
23773        }
23774        /// Allocate the node unconditionally, changed or not.
23775        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23776            gc.alloc(Node::AsConstExpression(self.inner))
23777        }
23778        /// Set the `expression` field and mark the builder changed.
23779        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
23780    }
23781    /// Clone-with-changes builder for [`super::InferredPredicate`].
23782    #[derive(Debug)]
23783    pub struct InferredPredicate<'gc> {
23784        is_changed: bool,
23785        pub(super) inner: super::InferredPredicate<'gc>,
23786    }
23787    impl<'gc> InferredPredicate<'gc> {
23788        /// Start from a copy of `node`, with no field changed yet.
23789        pub fn from_node(node: &'gc super::InferredPredicate<'gc>) -> Self {
23790            Self {
23791                is_changed: false,
23792                inner: super::InferredPredicate {
23793                    metadata: node.metadata.duplicate(),
23794                },
23795            }
23796        }
23797        /// Allocate the rebuilt node if a setter ran, else
23798        /// `TransformResult::Unchanged`.
23799        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23800            if self.is_changed {
23801                TransformResult::Changed(self.build_forced(gc))
23802            } else {
23803                TransformResult::Unchanged
23804            }
23805        }
23806        /// Allocate the node unconditionally, changed or not.
23807        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23808            gc.alloc(Node::InferredPredicate(self.inner))
23809        }
23810    }
23811    /// Clone-with-changes builder for [`super::DeclaredPredicate`].
23812    #[derive(Debug)]
23813    pub struct DeclaredPredicate<'gc> {
23814        is_changed: bool,
23815        pub(super) inner: super::DeclaredPredicate<'gc>,
23816    }
23817    impl<'gc> DeclaredPredicate<'gc> {
23818        /// Start from a copy of `node`, with no field changed yet.
23819        pub fn from_node(node: &'gc super::DeclaredPredicate<'gc>) -> Self {
23820            Self {
23821                is_changed: false,
23822                inner: super::DeclaredPredicate {
23823                    metadata: node.metadata.duplicate(),
23824                    value: node.value.duplicate(),
23825                },
23826            }
23827        }
23828        /// Allocate the rebuilt node if a setter ran, else
23829        /// `TransformResult::Unchanged`.
23830        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23831            if self.is_changed {
23832                TransformResult::Changed(self.build_forced(gc))
23833            } else {
23834                TransformResult::Unchanged
23835            }
23836        }
23837        /// Allocate the node unconditionally, changed or not.
23838        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23839            gc.alloc(Node::DeclaredPredicate(self.inner))
23840        }
23841        /// Set the `value` field and mark the builder changed.
23842        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
23843    }
23844    /// Clone-with-changes builder for [`super::EnumDeclaration`].
23845    #[derive(Debug)]
23846    pub struct EnumDeclaration<'gc> {
23847        is_changed: bool,
23848        pub(super) inner: super::EnumDeclaration<'gc>,
23849    }
23850    impl<'gc> EnumDeclaration<'gc> {
23851        /// Start from a copy of `node`, with no field changed yet.
23852        pub fn from_node(node: &'gc super::EnumDeclaration<'gc>) -> Self {
23853            Self {
23854                is_changed: false,
23855                inner: super::EnumDeclaration {
23856                    metadata: node.metadata.duplicate(),
23857                    id: node.id.duplicate(),
23858                    body: node.body.duplicate(),
23859                },
23860            }
23861        }
23862        /// Allocate the rebuilt node if a setter ran, else
23863        /// `TransformResult::Unchanged`.
23864        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23865            if self.is_changed {
23866                TransformResult::Changed(self.build_forced(gc))
23867            } else {
23868                TransformResult::Unchanged
23869            }
23870        }
23871        /// Allocate the node unconditionally, changed or not.
23872        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23873            gc.alloc(Node::EnumDeclaration(self.inner))
23874        }
23875        /// Set the `id` field and mark the builder changed.
23876        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23877        /// Set the `body` field and mark the builder changed.
23878        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
23879    }
23880    /// Clone-with-changes builder for [`super::EnumStringBody`].
23881    #[derive(Debug)]
23882    pub struct EnumStringBody<'gc> {
23883        is_changed: bool,
23884        pub(super) inner: super::EnumStringBody<'gc>,
23885    }
23886    impl<'gc> EnumStringBody<'gc> {
23887        /// Start from a copy of `node`, with no field changed yet.
23888        pub fn from_node(node: &'gc super::EnumStringBody<'gc>) -> Self {
23889            Self {
23890                is_changed: false,
23891                inner: super::EnumStringBody {
23892                    metadata: node.metadata.duplicate(),
23893                    members: node.members.duplicate(),
23894                    explicit_type: Cell::new(node.explicit_type.get()),
23895                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
23896                },
23897            }
23898        }
23899        /// Allocate the rebuilt node if a setter ran, else
23900        /// `TransformResult::Unchanged`.
23901        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23902            if self.is_changed {
23903                TransformResult::Changed(self.build_forced(gc))
23904            } else {
23905                TransformResult::Unchanged
23906            }
23907        }
23908        /// Allocate the node unconditionally, changed or not.
23909        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23910            gc.alloc(Node::EnumStringBody(self.inner))
23911        }
23912        /// Set the `members` field and mark the builder changed.
23913        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
23914    }
23915    /// Clone-with-changes builder for [`super::EnumNumberBody`].
23916    #[derive(Debug)]
23917    pub struct EnumNumberBody<'gc> {
23918        is_changed: bool,
23919        pub(super) inner: super::EnumNumberBody<'gc>,
23920    }
23921    impl<'gc> EnumNumberBody<'gc> {
23922        /// Start from a copy of `node`, with no field changed yet.
23923        pub fn from_node(node: &'gc super::EnumNumberBody<'gc>) -> Self {
23924            Self {
23925                is_changed: false,
23926                inner: super::EnumNumberBody {
23927                    metadata: node.metadata.duplicate(),
23928                    members: node.members.duplicate(),
23929                    explicit_type: Cell::new(node.explicit_type.get()),
23930                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
23931                },
23932            }
23933        }
23934        /// Allocate the rebuilt node if a setter ran, else
23935        /// `TransformResult::Unchanged`.
23936        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23937            if self.is_changed {
23938                TransformResult::Changed(self.build_forced(gc))
23939            } else {
23940                TransformResult::Unchanged
23941            }
23942        }
23943        /// Allocate the node unconditionally, changed or not.
23944        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23945            gc.alloc(Node::EnumNumberBody(self.inner))
23946        }
23947        /// Set the `members` field and mark the builder changed.
23948        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
23949    }
23950    /// Clone-with-changes builder for [`super::EnumBigIntBody`].
23951    #[derive(Debug)]
23952    pub struct EnumBigIntBody<'gc> {
23953        is_changed: bool,
23954        pub(super) inner: super::EnumBigIntBody<'gc>,
23955    }
23956    impl<'gc> EnumBigIntBody<'gc> {
23957        /// Start from a copy of `node`, with no field changed yet.
23958        pub fn from_node(node: &'gc super::EnumBigIntBody<'gc>) -> Self {
23959            Self {
23960                is_changed: false,
23961                inner: super::EnumBigIntBody {
23962                    metadata: node.metadata.duplicate(),
23963                    members: node.members.duplicate(),
23964                    explicit_type: Cell::new(node.explicit_type.get()),
23965                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
23966                },
23967            }
23968        }
23969        /// Allocate the rebuilt node if a setter ran, else
23970        /// `TransformResult::Unchanged`.
23971        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23972            if self.is_changed {
23973                TransformResult::Changed(self.build_forced(gc))
23974            } else {
23975                TransformResult::Unchanged
23976            }
23977        }
23978        /// Allocate the node unconditionally, changed or not.
23979        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23980            gc.alloc(Node::EnumBigIntBody(self.inner))
23981        }
23982        /// Set the `members` field and mark the builder changed.
23983        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
23984    }
23985    /// Clone-with-changes builder for [`super::EnumBooleanBody`].
23986    #[derive(Debug)]
23987    pub struct EnumBooleanBody<'gc> {
23988        is_changed: bool,
23989        pub(super) inner: super::EnumBooleanBody<'gc>,
23990    }
23991    impl<'gc> EnumBooleanBody<'gc> {
23992        /// Start from a copy of `node`, with no field changed yet.
23993        pub fn from_node(node: &'gc super::EnumBooleanBody<'gc>) -> Self {
23994            Self {
23995                is_changed: false,
23996                inner: super::EnumBooleanBody {
23997                    metadata: node.metadata.duplicate(),
23998                    members: node.members.duplicate(),
23999                    explicit_type: Cell::new(node.explicit_type.get()),
24000                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
24001                },
24002            }
24003        }
24004        /// Allocate the rebuilt node if a setter ran, else
24005        /// `TransformResult::Unchanged`.
24006        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24007            if self.is_changed {
24008                TransformResult::Changed(self.build_forced(gc))
24009            } else {
24010                TransformResult::Unchanged
24011            }
24012        }
24013        /// Allocate the node unconditionally, changed or not.
24014        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24015            gc.alloc(Node::EnumBooleanBody(self.inner))
24016        }
24017        /// Set the `members` field and mark the builder changed.
24018        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
24019    }
24020    /// Clone-with-changes builder for [`super::EnumSymbolBody`].
24021    #[derive(Debug)]
24022    pub struct EnumSymbolBody<'gc> {
24023        is_changed: bool,
24024        pub(super) inner: super::EnumSymbolBody<'gc>,
24025    }
24026    impl<'gc> EnumSymbolBody<'gc> {
24027        /// Start from a copy of `node`, with no field changed yet.
24028        pub fn from_node(node: &'gc super::EnumSymbolBody<'gc>) -> Self {
24029            Self {
24030                is_changed: false,
24031                inner: super::EnumSymbolBody {
24032                    metadata: node.metadata.duplicate(),
24033                    members: node.members.duplicate(),
24034                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
24035                },
24036            }
24037        }
24038        /// Allocate the rebuilt node if a setter ran, else
24039        /// `TransformResult::Unchanged`.
24040        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24041            if self.is_changed {
24042                TransformResult::Changed(self.build_forced(gc))
24043            } else {
24044                TransformResult::Unchanged
24045            }
24046        }
24047        /// Allocate the node unconditionally, changed or not.
24048        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24049            gc.alloc(Node::EnumSymbolBody(self.inner))
24050        }
24051        /// Set the `members` field and mark the builder changed.
24052        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
24053    }
24054    /// Clone-with-changes builder for [`super::EnumDefaultedMember`].
24055    #[derive(Debug)]
24056    pub struct EnumDefaultedMember<'gc> {
24057        is_changed: bool,
24058        pub(super) inner: super::EnumDefaultedMember<'gc>,
24059    }
24060    impl<'gc> EnumDefaultedMember<'gc> {
24061        /// Start from a copy of `node`, with no field changed yet.
24062        pub fn from_node(node: &'gc super::EnumDefaultedMember<'gc>) -> Self {
24063            Self {
24064                is_changed: false,
24065                inner: super::EnumDefaultedMember {
24066                    metadata: node.metadata.duplicate(),
24067                    id: node.id.duplicate(),
24068                },
24069            }
24070        }
24071        /// Allocate the rebuilt node if a setter ran, else
24072        /// `TransformResult::Unchanged`.
24073        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24074            if self.is_changed {
24075                TransformResult::Changed(self.build_forced(gc))
24076            } else {
24077                TransformResult::Unchanged
24078            }
24079        }
24080        /// Allocate the node unconditionally, changed or not.
24081        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24082            gc.alloc(Node::EnumDefaultedMember(self.inner))
24083        }
24084        /// Set the `id` field and mark the builder changed.
24085        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24086    }
24087    /// Clone-with-changes builder for [`super::EnumStringMember`].
24088    #[derive(Debug)]
24089    pub struct EnumStringMember<'gc> {
24090        is_changed: bool,
24091        pub(super) inner: super::EnumStringMember<'gc>,
24092    }
24093    impl<'gc> EnumStringMember<'gc> {
24094        /// Start from a copy of `node`, with no field changed yet.
24095        pub fn from_node(node: &'gc super::EnumStringMember<'gc>) -> Self {
24096            Self {
24097                is_changed: false,
24098                inner: super::EnumStringMember {
24099                    metadata: node.metadata.duplicate(),
24100                    id: node.id.duplicate(),
24101                    init: node.init.duplicate(),
24102                },
24103            }
24104        }
24105        /// Allocate the rebuilt node if a setter ran, else
24106        /// `TransformResult::Unchanged`.
24107        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24108            if self.is_changed {
24109                TransformResult::Changed(self.build_forced(gc))
24110            } else {
24111                TransformResult::Unchanged
24112            }
24113        }
24114        /// Allocate the node unconditionally, changed or not.
24115        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24116            gc.alloc(Node::EnumStringMember(self.inner))
24117        }
24118        /// Set the `id` field and mark the builder changed.
24119        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24120        /// Set the `init` field and mark the builder changed.
24121        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
24122    }
24123    /// Clone-with-changes builder for [`super::EnumNumberMember`].
24124    #[derive(Debug)]
24125    pub struct EnumNumberMember<'gc> {
24126        is_changed: bool,
24127        pub(super) inner: super::EnumNumberMember<'gc>,
24128    }
24129    impl<'gc> EnumNumberMember<'gc> {
24130        /// Start from a copy of `node`, with no field changed yet.
24131        pub fn from_node(node: &'gc super::EnumNumberMember<'gc>) -> Self {
24132            Self {
24133                is_changed: false,
24134                inner: super::EnumNumberMember {
24135                    metadata: node.metadata.duplicate(),
24136                    id: node.id.duplicate(),
24137                    init: node.init.duplicate(),
24138                },
24139            }
24140        }
24141        /// Allocate the rebuilt node if a setter ran, else
24142        /// `TransformResult::Unchanged`.
24143        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24144            if self.is_changed {
24145                TransformResult::Changed(self.build_forced(gc))
24146            } else {
24147                TransformResult::Unchanged
24148            }
24149        }
24150        /// Allocate the node unconditionally, changed or not.
24151        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24152            gc.alloc(Node::EnumNumberMember(self.inner))
24153        }
24154        /// Set the `id` field and mark the builder changed.
24155        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24156        /// Set the `init` field and mark the builder changed.
24157        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
24158    }
24159    /// Clone-with-changes builder for [`super::EnumBigIntMember`].
24160    #[derive(Debug)]
24161    pub struct EnumBigIntMember<'gc> {
24162        is_changed: bool,
24163        pub(super) inner: super::EnumBigIntMember<'gc>,
24164    }
24165    impl<'gc> EnumBigIntMember<'gc> {
24166        /// Start from a copy of `node`, with no field changed yet.
24167        pub fn from_node(node: &'gc super::EnumBigIntMember<'gc>) -> Self {
24168            Self {
24169                is_changed: false,
24170                inner: super::EnumBigIntMember {
24171                    metadata: node.metadata.duplicate(),
24172                    id: node.id.duplicate(),
24173                    init: node.init.duplicate(),
24174                },
24175            }
24176        }
24177        /// Allocate the rebuilt node if a setter ran, else
24178        /// `TransformResult::Unchanged`.
24179        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24180            if self.is_changed {
24181                TransformResult::Changed(self.build_forced(gc))
24182            } else {
24183                TransformResult::Unchanged
24184            }
24185        }
24186        /// Allocate the node unconditionally, changed or not.
24187        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24188            gc.alloc(Node::EnumBigIntMember(self.inner))
24189        }
24190        /// Set the `id` field and mark the builder changed.
24191        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24192        /// Set the `init` field and mark the builder changed.
24193        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
24194    }
24195    /// Clone-with-changes builder for [`super::EnumBooleanMember`].
24196    #[derive(Debug)]
24197    pub struct EnumBooleanMember<'gc> {
24198        is_changed: bool,
24199        pub(super) inner: super::EnumBooleanMember<'gc>,
24200    }
24201    impl<'gc> EnumBooleanMember<'gc> {
24202        /// Start from a copy of `node`, with no field changed yet.
24203        pub fn from_node(node: &'gc super::EnumBooleanMember<'gc>) -> Self {
24204            Self {
24205                is_changed: false,
24206                inner: super::EnumBooleanMember {
24207                    metadata: node.metadata.duplicate(),
24208                    id: node.id.duplicate(),
24209                    init: node.init.duplicate(),
24210                },
24211            }
24212        }
24213        /// Allocate the rebuilt node if a setter ran, else
24214        /// `TransformResult::Unchanged`.
24215        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24216            if self.is_changed {
24217                TransformResult::Changed(self.build_forced(gc))
24218            } else {
24219                TransformResult::Unchanged
24220            }
24221        }
24222        /// Allocate the node unconditionally, changed or not.
24223        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24224            gc.alloc(Node::EnumBooleanMember(self.inner))
24225        }
24226        /// Set the `id` field and mark the builder changed.
24227        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24228        /// Set the `init` field and mark the builder changed.
24229        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
24230    }
24231    /// Clone-with-changes builder for [`super::ComponentParameter`].
24232    #[derive(Debug)]
24233    pub struct ComponentParameter<'gc> {
24234        is_changed: bool,
24235        pub(super) inner: super::ComponentParameter<'gc>,
24236    }
24237    impl<'gc> ComponentParameter<'gc> {
24238        /// Start from a copy of `node`, with no field changed yet.
24239        pub fn from_node(node: &'gc super::ComponentParameter<'gc>) -> Self {
24240            Self {
24241                is_changed: false,
24242                inner: super::ComponentParameter {
24243                    metadata: node.metadata.duplicate(),
24244                    name: node.name.duplicate(),
24245                    local: node.local.duplicate(),
24246                    shorthand: Cell::new(node.shorthand.get()),
24247                },
24248            }
24249        }
24250        /// Allocate the rebuilt node if a setter ran, else
24251        /// `TransformResult::Unchanged`.
24252        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24253            if self.is_changed {
24254                TransformResult::Changed(self.build_forced(gc))
24255            } else {
24256                TransformResult::Unchanged
24257            }
24258        }
24259        /// Allocate the node unconditionally, changed or not.
24260        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24261            gc.alloc(Node::ComponentParameter(self.inner))
24262        }
24263        /// Set the `name` field and mark the builder changed.
24264        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
24265        /// Set the `local` field and mark the builder changed.
24266        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
24267    }
24268    /// Clone-with-changes builder for [`super::RecordDeclaration`].
24269    #[derive(Debug)]
24270    pub struct RecordDeclaration<'gc> {
24271        is_changed: bool,
24272        pub(super) inner: super::RecordDeclaration<'gc>,
24273    }
24274    impl<'gc> RecordDeclaration<'gc> {
24275        /// Start from a copy of `node`, with no field changed yet.
24276        pub fn from_node(node: &'gc super::RecordDeclaration<'gc>) -> Self {
24277            Self {
24278                is_changed: false,
24279                inner: super::RecordDeclaration {
24280                    metadata: node.metadata.duplicate(),
24281                    id: node.id.duplicate(),
24282                    type_parameters: node.type_parameters.duplicate(),
24283                    implements: node.implements.duplicate(),
24284                    body: node.body.duplicate(),
24285                },
24286            }
24287        }
24288        /// Allocate the rebuilt node if a setter ran, else
24289        /// `TransformResult::Unchanged`.
24290        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24291            if self.is_changed {
24292                TransformResult::Changed(self.build_forced(gc))
24293            } else {
24294                TransformResult::Unchanged
24295            }
24296        }
24297        /// Allocate the node unconditionally, changed or not.
24298        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24299            gc.alloc(Node::RecordDeclaration(self.inner))
24300        }
24301        /// Set the `id` field and mark the builder changed.
24302        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24303        /// Set the `type_parameters` field and mark the builder changed.
24304        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
24305        /// Set the `implements` field and mark the builder changed.
24306        pub fn implements(&mut self, implements: NodeList<'gc>) { self.is_changed = true; self.inner.implements = implements; }
24307        /// Set the `body` field and mark the builder changed.
24308        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
24309    }
24310    /// Clone-with-changes builder for [`super::RecordDeclarationImplements`].
24311    #[derive(Debug)]
24312    pub struct RecordDeclarationImplements<'gc> {
24313        is_changed: bool,
24314        pub(super) inner: super::RecordDeclarationImplements<'gc>,
24315    }
24316    impl<'gc> RecordDeclarationImplements<'gc> {
24317        /// Start from a copy of `node`, with no field changed yet.
24318        pub fn from_node(node: &'gc super::RecordDeclarationImplements<'gc>) -> Self {
24319            Self {
24320                is_changed: false,
24321                inner: super::RecordDeclarationImplements {
24322                    metadata: node.metadata.duplicate(),
24323                    id: node.id.duplicate(),
24324                    type_arguments: node.type_arguments.duplicate(),
24325                },
24326            }
24327        }
24328        /// Allocate the rebuilt node if a setter ran, else
24329        /// `TransformResult::Unchanged`.
24330        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24331            if self.is_changed {
24332                TransformResult::Changed(self.build_forced(gc))
24333            } else {
24334                TransformResult::Unchanged
24335            }
24336        }
24337        /// Allocate the node unconditionally, changed or not.
24338        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24339            gc.alloc(Node::RecordDeclarationImplements(self.inner))
24340        }
24341        /// Set the `id` field and mark the builder changed.
24342        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24343        /// Set the `type_arguments` field and mark the builder changed.
24344        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
24345    }
24346    /// Clone-with-changes builder for [`super::RecordDeclarationBody`].
24347    #[derive(Debug)]
24348    pub struct RecordDeclarationBody<'gc> {
24349        is_changed: bool,
24350        pub(super) inner: super::RecordDeclarationBody<'gc>,
24351    }
24352    impl<'gc> RecordDeclarationBody<'gc> {
24353        /// Start from a copy of `node`, with no field changed yet.
24354        pub fn from_node(node: &'gc super::RecordDeclarationBody<'gc>) -> Self {
24355            Self {
24356                is_changed: false,
24357                inner: super::RecordDeclarationBody {
24358                    metadata: node.metadata.duplicate(),
24359                    elements: node.elements.duplicate(),
24360                },
24361            }
24362        }
24363        /// Allocate the rebuilt node if a setter ran, else
24364        /// `TransformResult::Unchanged`.
24365        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24366            if self.is_changed {
24367                TransformResult::Changed(self.build_forced(gc))
24368            } else {
24369                TransformResult::Unchanged
24370            }
24371        }
24372        /// Allocate the node unconditionally, changed or not.
24373        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24374            gc.alloc(Node::RecordDeclarationBody(self.inner))
24375        }
24376        /// Set the `elements` field and mark the builder changed.
24377        pub fn elements(&mut self, elements: NodeList<'gc>) { self.is_changed = true; self.inner.elements = elements; }
24378    }
24379    /// Clone-with-changes builder for [`super::RecordDeclarationProperty`].
24380    #[derive(Debug)]
24381    pub struct RecordDeclarationProperty<'gc> {
24382        is_changed: bool,
24383        pub(super) inner: super::RecordDeclarationProperty<'gc>,
24384    }
24385    impl<'gc> RecordDeclarationProperty<'gc> {
24386        /// Start from a copy of `node`, with no field changed yet.
24387        pub fn from_node(node: &'gc super::RecordDeclarationProperty<'gc>) -> Self {
24388            Self {
24389                is_changed: false,
24390                inner: super::RecordDeclarationProperty {
24391                    metadata: node.metadata.duplicate(),
24392                    key: node.key.duplicate(),
24393                    type_annotation: node.type_annotation.duplicate(),
24394                    default_value: node.default_value.duplicate(),
24395                },
24396            }
24397        }
24398        /// Allocate the rebuilt node if a setter ran, else
24399        /// `TransformResult::Unchanged`.
24400        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24401            if self.is_changed {
24402                TransformResult::Changed(self.build_forced(gc))
24403            } else {
24404                TransformResult::Unchanged
24405            }
24406        }
24407        /// Allocate the node unconditionally, changed or not.
24408        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24409            gc.alloc(Node::RecordDeclarationProperty(self.inner))
24410        }
24411        /// Set the `key` field and mark the builder changed.
24412        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
24413        /// Set the `type_annotation` field and mark the builder changed.
24414        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
24415        /// Set the `default_value` field and mark the builder changed.
24416        pub fn default_value(&mut self, default_value: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.default_value = default_value; }
24417    }
24418    /// Clone-with-changes builder for
24419    /// [`super::RecordDeclarationStaticProperty`].
24420    #[derive(Debug)]
24421    pub struct RecordDeclarationStaticProperty<'gc> {
24422        is_changed: bool,
24423        pub(super) inner: super::RecordDeclarationStaticProperty<'gc>,
24424    }
24425    impl<'gc> RecordDeclarationStaticProperty<'gc> {
24426        /// Start from a copy of `node`, with no field changed yet.
24427        pub fn from_node(node: &'gc super::RecordDeclarationStaticProperty<'gc>) -> Self {
24428            Self {
24429                is_changed: false,
24430                inner: super::RecordDeclarationStaticProperty {
24431                    metadata: node.metadata.duplicate(),
24432                    key: node.key.duplicate(),
24433                    type_annotation: node.type_annotation.duplicate(),
24434                    value: node.value.duplicate(),
24435                },
24436            }
24437        }
24438        /// Allocate the rebuilt node if a setter ran, else
24439        /// `TransformResult::Unchanged`.
24440        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24441            if self.is_changed {
24442                TransformResult::Changed(self.build_forced(gc))
24443            } else {
24444                TransformResult::Unchanged
24445            }
24446        }
24447        /// Allocate the node unconditionally, changed or not.
24448        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24449            gc.alloc(Node::RecordDeclarationStaticProperty(self.inner))
24450        }
24451        /// Set the `key` field and mark the builder changed.
24452        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
24453        /// Set the `type_annotation` field and mark the builder changed.
24454        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
24455        /// Set the `value` field and mark the builder changed.
24456        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
24457    }
24458    /// Clone-with-changes builder for [`super::RecordExpression`].
24459    #[derive(Debug)]
24460    pub struct RecordExpression<'gc> {
24461        is_changed: bool,
24462        pub(super) inner: super::RecordExpression<'gc>,
24463    }
24464    impl<'gc> RecordExpression<'gc> {
24465        /// Start from a copy of `node`, with no field changed yet.
24466        pub fn from_node(node: &'gc super::RecordExpression<'gc>) -> Self {
24467            Self {
24468                is_changed: false,
24469                inner: super::RecordExpression {
24470                    metadata: node.metadata.duplicate(),
24471                    record_constructor: node.record_constructor.duplicate(),
24472                    type_arguments: node.type_arguments.duplicate(),
24473                    properties: node.properties.duplicate(),
24474                },
24475            }
24476        }
24477        /// Allocate the rebuilt node if a setter ran, else
24478        /// `TransformResult::Unchanged`.
24479        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24480            if self.is_changed {
24481                TransformResult::Changed(self.build_forced(gc))
24482            } else {
24483                TransformResult::Unchanged
24484            }
24485        }
24486        /// Allocate the node unconditionally, changed or not.
24487        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24488            gc.alloc(Node::RecordExpression(self.inner))
24489        }
24490        /// Set the `record_constructor` field and mark the builder changed.
24491        pub fn record_constructor(&mut self, record_constructor: &'gc Node<'gc>) { self.is_changed = true; self.inner.record_constructor = record_constructor; }
24492        /// Set the `type_arguments` field and mark the builder changed.
24493        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
24494        /// Set the `properties` field and mark the builder changed.
24495        pub fn properties(&mut self, properties: &'gc Node<'gc>) { self.is_changed = true; self.inner.properties = properties; }
24496    }
24497    /// Clone-with-changes builder for [`super::RecordExpressionProperties`].
24498    #[derive(Debug)]
24499    pub struct RecordExpressionProperties<'gc> {
24500        is_changed: bool,
24501        pub(super) inner: super::RecordExpressionProperties<'gc>,
24502    }
24503    impl<'gc> RecordExpressionProperties<'gc> {
24504        /// Start from a copy of `node`, with no field changed yet.
24505        pub fn from_node(node: &'gc super::RecordExpressionProperties<'gc>) -> Self {
24506            Self {
24507                is_changed: false,
24508                inner: super::RecordExpressionProperties {
24509                    metadata: node.metadata.duplicate(),
24510                    properties: node.properties.duplicate(),
24511                },
24512            }
24513        }
24514        /// Allocate the rebuilt node if a setter ran, else
24515        /// `TransformResult::Unchanged`.
24516        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24517            if self.is_changed {
24518                TransformResult::Changed(self.build_forced(gc))
24519            } else {
24520                TransformResult::Unchanged
24521            }
24522        }
24523        /// Allocate the node unconditionally, changed or not.
24524        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24525            gc.alloc(Node::RecordExpressionProperties(self.inner))
24526        }
24527        /// Set the `properties` field and mark the builder changed.
24528        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
24529    }
24530    /// Clone-with-changes builder for [`super::TSTypeAnnotation`].
24531    #[derive(Debug)]
24532    pub struct TSTypeAnnotation<'gc> {
24533        is_changed: bool,
24534        pub(super) inner: super::TSTypeAnnotation<'gc>,
24535    }
24536    impl<'gc> TSTypeAnnotation<'gc> {
24537        /// Start from a copy of `node`, with no field changed yet.
24538        pub fn from_node(node: &'gc super::TSTypeAnnotation<'gc>) -> Self {
24539            Self {
24540                is_changed: false,
24541                inner: super::TSTypeAnnotation {
24542                    metadata: node.metadata.duplicate(),
24543                    type_annotation: node.type_annotation.duplicate(),
24544                },
24545            }
24546        }
24547        /// Allocate the rebuilt node if a setter ran, else
24548        /// `TransformResult::Unchanged`.
24549        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24550            if self.is_changed {
24551                TransformResult::Changed(self.build_forced(gc))
24552            } else {
24553                TransformResult::Unchanged
24554            }
24555        }
24556        /// Allocate the node unconditionally, changed or not.
24557        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24558            gc.alloc(Node::TSTypeAnnotation(self.inner))
24559        }
24560        /// Set the `type_annotation` field and mark the builder changed.
24561        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
24562    }
24563    /// Clone-with-changes builder for [`super::TSAnyKeyword`].
24564    #[derive(Debug)]
24565    pub struct TSAnyKeyword<'gc> {
24566        is_changed: bool,
24567        pub(super) inner: super::TSAnyKeyword<'gc>,
24568    }
24569    impl<'gc> TSAnyKeyword<'gc> {
24570        /// Start from a copy of `node`, with no field changed yet.
24571        pub fn from_node(node: &'gc super::TSAnyKeyword<'gc>) -> Self {
24572            Self {
24573                is_changed: false,
24574                inner: super::TSAnyKeyword {
24575                    metadata: node.metadata.duplicate(),
24576                },
24577            }
24578        }
24579        /// Allocate the rebuilt node if a setter ran, else
24580        /// `TransformResult::Unchanged`.
24581        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24582            if self.is_changed {
24583                TransformResult::Changed(self.build_forced(gc))
24584            } else {
24585                TransformResult::Unchanged
24586            }
24587        }
24588        /// Allocate the node unconditionally, changed or not.
24589        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24590            gc.alloc(Node::TSAnyKeyword(self.inner))
24591        }
24592    }
24593    /// Clone-with-changes builder for [`super::TSNumberKeyword`].
24594    #[derive(Debug)]
24595    pub struct TSNumberKeyword<'gc> {
24596        is_changed: bool,
24597        pub(super) inner: super::TSNumberKeyword<'gc>,
24598    }
24599    impl<'gc> TSNumberKeyword<'gc> {
24600        /// Start from a copy of `node`, with no field changed yet.
24601        pub fn from_node(node: &'gc super::TSNumberKeyword<'gc>) -> Self {
24602            Self {
24603                is_changed: false,
24604                inner: super::TSNumberKeyword {
24605                    metadata: node.metadata.duplicate(),
24606                },
24607            }
24608        }
24609        /// Allocate the rebuilt node if a setter ran, else
24610        /// `TransformResult::Unchanged`.
24611        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24612            if self.is_changed {
24613                TransformResult::Changed(self.build_forced(gc))
24614            } else {
24615                TransformResult::Unchanged
24616            }
24617        }
24618        /// Allocate the node unconditionally, changed or not.
24619        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24620            gc.alloc(Node::TSNumberKeyword(self.inner))
24621        }
24622    }
24623    /// Clone-with-changes builder for [`super::TSBooleanKeyword`].
24624    #[derive(Debug)]
24625    pub struct TSBooleanKeyword<'gc> {
24626        is_changed: bool,
24627        pub(super) inner: super::TSBooleanKeyword<'gc>,
24628    }
24629    impl<'gc> TSBooleanKeyword<'gc> {
24630        /// Start from a copy of `node`, with no field changed yet.
24631        pub fn from_node(node: &'gc super::TSBooleanKeyword<'gc>) -> Self {
24632            Self {
24633                is_changed: false,
24634                inner: super::TSBooleanKeyword {
24635                    metadata: node.metadata.duplicate(),
24636                },
24637            }
24638        }
24639        /// Allocate the rebuilt node if a setter ran, else
24640        /// `TransformResult::Unchanged`.
24641        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24642            if self.is_changed {
24643                TransformResult::Changed(self.build_forced(gc))
24644            } else {
24645                TransformResult::Unchanged
24646            }
24647        }
24648        /// Allocate the node unconditionally, changed or not.
24649        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24650            gc.alloc(Node::TSBooleanKeyword(self.inner))
24651        }
24652    }
24653    /// Clone-with-changes builder for [`super::TSStringKeyword`].
24654    #[derive(Debug)]
24655    pub struct TSStringKeyword<'gc> {
24656        is_changed: bool,
24657        pub(super) inner: super::TSStringKeyword<'gc>,
24658    }
24659    impl<'gc> TSStringKeyword<'gc> {
24660        /// Start from a copy of `node`, with no field changed yet.
24661        pub fn from_node(node: &'gc super::TSStringKeyword<'gc>) -> Self {
24662            Self {
24663                is_changed: false,
24664                inner: super::TSStringKeyword {
24665                    metadata: node.metadata.duplicate(),
24666                },
24667            }
24668        }
24669        /// Allocate the rebuilt node if a setter ran, else
24670        /// `TransformResult::Unchanged`.
24671        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24672            if self.is_changed {
24673                TransformResult::Changed(self.build_forced(gc))
24674            } else {
24675                TransformResult::Unchanged
24676            }
24677        }
24678        /// Allocate the node unconditionally, changed or not.
24679        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24680            gc.alloc(Node::TSStringKeyword(self.inner))
24681        }
24682    }
24683    /// Clone-with-changes builder for [`super::TSSymbolKeyword`].
24684    #[derive(Debug)]
24685    pub struct TSSymbolKeyword<'gc> {
24686        is_changed: bool,
24687        pub(super) inner: super::TSSymbolKeyword<'gc>,
24688    }
24689    impl<'gc> TSSymbolKeyword<'gc> {
24690        /// Start from a copy of `node`, with no field changed yet.
24691        pub fn from_node(node: &'gc super::TSSymbolKeyword<'gc>) -> Self {
24692            Self {
24693                is_changed: false,
24694                inner: super::TSSymbolKeyword {
24695                    metadata: node.metadata.duplicate(),
24696                },
24697            }
24698        }
24699        /// Allocate the rebuilt node if a setter ran, else
24700        /// `TransformResult::Unchanged`.
24701        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24702            if self.is_changed {
24703                TransformResult::Changed(self.build_forced(gc))
24704            } else {
24705                TransformResult::Unchanged
24706            }
24707        }
24708        /// Allocate the node unconditionally, changed or not.
24709        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24710            gc.alloc(Node::TSSymbolKeyword(self.inner))
24711        }
24712    }
24713    /// Clone-with-changes builder for [`super::TSVoidKeyword`].
24714    #[derive(Debug)]
24715    pub struct TSVoidKeyword<'gc> {
24716        is_changed: bool,
24717        pub(super) inner: super::TSVoidKeyword<'gc>,
24718    }
24719    impl<'gc> TSVoidKeyword<'gc> {
24720        /// Start from a copy of `node`, with no field changed yet.
24721        pub fn from_node(node: &'gc super::TSVoidKeyword<'gc>) -> Self {
24722            Self {
24723                is_changed: false,
24724                inner: super::TSVoidKeyword {
24725                    metadata: node.metadata.duplicate(),
24726                },
24727            }
24728        }
24729        /// Allocate the rebuilt node if a setter ran, else
24730        /// `TransformResult::Unchanged`.
24731        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24732            if self.is_changed {
24733                TransformResult::Changed(self.build_forced(gc))
24734            } else {
24735                TransformResult::Unchanged
24736            }
24737        }
24738        /// Allocate the node unconditionally, changed or not.
24739        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24740            gc.alloc(Node::TSVoidKeyword(self.inner))
24741        }
24742    }
24743    /// Clone-with-changes builder for [`super::TSUndefinedKeyword`].
24744    #[derive(Debug)]
24745    pub struct TSUndefinedKeyword<'gc> {
24746        is_changed: bool,
24747        pub(super) inner: super::TSUndefinedKeyword<'gc>,
24748    }
24749    impl<'gc> TSUndefinedKeyword<'gc> {
24750        /// Start from a copy of `node`, with no field changed yet.
24751        pub fn from_node(node: &'gc super::TSUndefinedKeyword<'gc>) -> Self {
24752            Self {
24753                is_changed: false,
24754                inner: super::TSUndefinedKeyword {
24755                    metadata: node.metadata.duplicate(),
24756                },
24757            }
24758        }
24759        /// Allocate the rebuilt node if a setter ran, else
24760        /// `TransformResult::Unchanged`.
24761        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24762            if self.is_changed {
24763                TransformResult::Changed(self.build_forced(gc))
24764            } else {
24765                TransformResult::Unchanged
24766            }
24767        }
24768        /// Allocate the node unconditionally, changed or not.
24769        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24770            gc.alloc(Node::TSUndefinedKeyword(self.inner))
24771        }
24772    }
24773    /// Clone-with-changes builder for [`super::TSUnknownKeyword`].
24774    #[derive(Debug)]
24775    pub struct TSUnknownKeyword<'gc> {
24776        is_changed: bool,
24777        pub(super) inner: super::TSUnknownKeyword<'gc>,
24778    }
24779    impl<'gc> TSUnknownKeyword<'gc> {
24780        /// Start from a copy of `node`, with no field changed yet.
24781        pub fn from_node(node: &'gc super::TSUnknownKeyword<'gc>) -> Self {
24782            Self {
24783                is_changed: false,
24784                inner: super::TSUnknownKeyword {
24785                    metadata: node.metadata.duplicate(),
24786                },
24787            }
24788        }
24789        /// Allocate the rebuilt node if a setter ran, else
24790        /// `TransformResult::Unchanged`.
24791        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24792            if self.is_changed {
24793                TransformResult::Changed(self.build_forced(gc))
24794            } else {
24795                TransformResult::Unchanged
24796            }
24797        }
24798        /// Allocate the node unconditionally, changed or not.
24799        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24800            gc.alloc(Node::TSUnknownKeyword(self.inner))
24801        }
24802    }
24803    /// Clone-with-changes builder for [`super::TSNeverKeyword`].
24804    #[derive(Debug)]
24805    pub struct TSNeverKeyword<'gc> {
24806        is_changed: bool,
24807        pub(super) inner: super::TSNeverKeyword<'gc>,
24808    }
24809    impl<'gc> TSNeverKeyword<'gc> {
24810        /// Start from a copy of `node`, with no field changed yet.
24811        pub fn from_node(node: &'gc super::TSNeverKeyword<'gc>) -> Self {
24812            Self {
24813                is_changed: false,
24814                inner: super::TSNeverKeyword {
24815                    metadata: node.metadata.duplicate(),
24816                },
24817            }
24818        }
24819        /// Allocate the rebuilt node if a setter ran, else
24820        /// `TransformResult::Unchanged`.
24821        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24822            if self.is_changed {
24823                TransformResult::Changed(self.build_forced(gc))
24824            } else {
24825                TransformResult::Unchanged
24826            }
24827        }
24828        /// Allocate the node unconditionally, changed or not.
24829        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24830            gc.alloc(Node::TSNeverKeyword(self.inner))
24831        }
24832    }
24833    /// Clone-with-changes builder for [`super::TSBigIntKeyword`].
24834    #[derive(Debug)]
24835    pub struct TSBigIntKeyword<'gc> {
24836        is_changed: bool,
24837        pub(super) inner: super::TSBigIntKeyword<'gc>,
24838    }
24839    impl<'gc> TSBigIntKeyword<'gc> {
24840        /// Start from a copy of `node`, with no field changed yet.
24841        pub fn from_node(node: &'gc super::TSBigIntKeyword<'gc>) -> Self {
24842            Self {
24843                is_changed: false,
24844                inner: super::TSBigIntKeyword {
24845                    metadata: node.metadata.duplicate(),
24846                },
24847            }
24848        }
24849        /// Allocate the rebuilt node if a setter ran, else
24850        /// `TransformResult::Unchanged`.
24851        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24852            if self.is_changed {
24853                TransformResult::Changed(self.build_forced(gc))
24854            } else {
24855                TransformResult::Unchanged
24856            }
24857        }
24858        /// Allocate the node unconditionally, changed or not.
24859        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24860            gc.alloc(Node::TSBigIntKeyword(self.inner))
24861        }
24862    }
24863    /// Clone-with-changes builder for [`super::TSThisType`].
24864    #[derive(Debug)]
24865    pub struct TSThisType<'gc> {
24866        is_changed: bool,
24867        pub(super) inner: super::TSThisType<'gc>,
24868    }
24869    impl<'gc> TSThisType<'gc> {
24870        /// Start from a copy of `node`, with no field changed yet.
24871        pub fn from_node(node: &'gc super::TSThisType<'gc>) -> Self {
24872            Self {
24873                is_changed: false,
24874                inner: super::TSThisType {
24875                    metadata: node.metadata.duplicate(),
24876                },
24877            }
24878        }
24879        /// Allocate the rebuilt node if a setter ran, else
24880        /// `TransformResult::Unchanged`.
24881        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24882            if self.is_changed {
24883                TransformResult::Changed(self.build_forced(gc))
24884            } else {
24885                TransformResult::Unchanged
24886            }
24887        }
24888        /// Allocate the node unconditionally, changed or not.
24889        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24890            gc.alloc(Node::TSThisType(self.inner))
24891        }
24892    }
24893    /// Clone-with-changes builder for [`super::TSLiteralType`].
24894    #[derive(Debug)]
24895    pub struct TSLiteralType<'gc> {
24896        is_changed: bool,
24897        pub(super) inner: super::TSLiteralType<'gc>,
24898    }
24899    impl<'gc> TSLiteralType<'gc> {
24900        /// Start from a copy of `node`, with no field changed yet.
24901        pub fn from_node(node: &'gc super::TSLiteralType<'gc>) -> Self {
24902            Self {
24903                is_changed: false,
24904                inner: super::TSLiteralType {
24905                    metadata: node.metadata.duplicate(),
24906                    literal: node.literal.duplicate(),
24907                },
24908            }
24909        }
24910        /// Allocate the rebuilt node if a setter ran, else
24911        /// `TransformResult::Unchanged`.
24912        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24913            if self.is_changed {
24914                TransformResult::Changed(self.build_forced(gc))
24915            } else {
24916                TransformResult::Unchanged
24917            }
24918        }
24919        /// Allocate the node unconditionally, changed or not.
24920        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24921            gc.alloc(Node::TSLiteralType(self.inner))
24922        }
24923        /// Set the `literal` field and mark the builder changed.
24924        pub fn literal(&mut self, literal: &'gc Node<'gc>) { self.is_changed = true; self.inner.literal = literal; }
24925    }
24926    /// Clone-with-changes builder for [`super::TSIndexedAccessType`].
24927    #[derive(Debug)]
24928    pub struct TSIndexedAccessType<'gc> {
24929        is_changed: bool,
24930        pub(super) inner: super::TSIndexedAccessType<'gc>,
24931    }
24932    impl<'gc> TSIndexedAccessType<'gc> {
24933        /// Start from a copy of `node`, with no field changed yet.
24934        pub fn from_node(node: &'gc super::TSIndexedAccessType<'gc>) -> Self {
24935            Self {
24936                is_changed: false,
24937                inner: super::TSIndexedAccessType {
24938                    metadata: node.metadata.duplicate(),
24939                    object_type: node.object_type.duplicate(),
24940                    index_type: node.index_type.duplicate(),
24941                },
24942            }
24943        }
24944        /// Allocate the rebuilt node if a setter ran, else
24945        /// `TransformResult::Unchanged`.
24946        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24947            if self.is_changed {
24948                TransformResult::Changed(self.build_forced(gc))
24949            } else {
24950                TransformResult::Unchanged
24951            }
24952        }
24953        /// Allocate the node unconditionally, changed or not.
24954        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24955            gc.alloc(Node::TSIndexedAccessType(self.inner))
24956        }
24957        /// Set the `object_type` field and mark the builder changed.
24958        pub fn object_type(&mut self, object_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.object_type = object_type; }
24959        /// Set the `index_type` field and mark the builder changed.
24960        pub fn index_type(&mut self, index_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.index_type = index_type; }
24961    }
24962    /// Clone-with-changes builder for [`super::TSArrayType`].
24963    #[derive(Debug)]
24964    pub struct TSArrayType<'gc> {
24965        is_changed: bool,
24966        pub(super) inner: super::TSArrayType<'gc>,
24967    }
24968    impl<'gc> TSArrayType<'gc> {
24969        /// Start from a copy of `node`, with no field changed yet.
24970        pub fn from_node(node: &'gc super::TSArrayType<'gc>) -> Self {
24971            Self {
24972                is_changed: false,
24973                inner: super::TSArrayType {
24974                    metadata: node.metadata.duplicate(),
24975                    element_type: node.element_type.duplicate(),
24976                },
24977            }
24978        }
24979        /// Allocate the rebuilt node if a setter ran, else
24980        /// `TransformResult::Unchanged`.
24981        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24982            if self.is_changed {
24983                TransformResult::Changed(self.build_forced(gc))
24984            } else {
24985                TransformResult::Unchanged
24986            }
24987        }
24988        /// Allocate the node unconditionally, changed or not.
24989        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24990            gc.alloc(Node::TSArrayType(self.inner))
24991        }
24992        /// Set the `element_type` field and mark the builder changed.
24993        pub fn element_type(&mut self, element_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.element_type = element_type; }
24994    }
24995    /// Clone-with-changes builder for [`super::TSTypeReference`].
24996    #[derive(Debug)]
24997    pub struct TSTypeReference<'gc> {
24998        is_changed: bool,
24999        pub(super) inner: super::TSTypeReference<'gc>,
25000    }
25001    impl<'gc> TSTypeReference<'gc> {
25002        /// Start from a copy of `node`, with no field changed yet.
25003        pub fn from_node(node: &'gc super::TSTypeReference<'gc>) -> Self {
25004            Self {
25005                is_changed: false,
25006                inner: super::TSTypeReference {
25007                    metadata: node.metadata.duplicate(),
25008                    type_name: node.type_name.duplicate(),
25009                    type_parameters: node.type_parameters.duplicate(),
25010                },
25011            }
25012        }
25013        /// Allocate the rebuilt node if a setter ran, else
25014        /// `TransformResult::Unchanged`.
25015        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25016            if self.is_changed {
25017                TransformResult::Changed(self.build_forced(gc))
25018            } else {
25019                TransformResult::Unchanged
25020            }
25021        }
25022        /// Allocate the node unconditionally, changed or not.
25023        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25024            gc.alloc(Node::TSTypeReference(self.inner))
25025        }
25026        /// Set the `type_name` field and mark the builder changed.
25027        pub fn type_name(&mut self, type_name: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_name = type_name; }
25028        /// Set the `type_parameters` field and mark the builder changed.
25029        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
25030    }
25031    /// Clone-with-changes builder for [`super::TSQualifiedName`].
25032    #[derive(Debug)]
25033    pub struct TSQualifiedName<'gc> {
25034        is_changed: bool,
25035        pub(super) inner: super::TSQualifiedName<'gc>,
25036    }
25037    impl<'gc> TSQualifiedName<'gc> {
25038        /// Start from a copy of `node`, with no field changed yet.
25039        pub fn from_node(node: &'gc super::TSQualifiedName<'gc>) -> Self {
25040            Self {
25041                is_changed: false,
25042                inner: super::TSQualifiedName {
25043                    metadata: node.metadata.duplicate(),
25044                    left: node.left.duplicate(),
25045                    right: node.right.duplicate(),
25046                },
25047            }
25048        }
25049        /// Allocate the rebuilt node if a setter ran, else
25050        /// `TransformResult::Unchanged`.
25051        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25052            if self.is_changed {
25053                TransformResult::Changed(self.build_forced(gc))
25054            } else {
25055                TransformResult::Unchanged
25056            }
25057        }
25058        /// Allocate the node unconditionally, changed or not.
25059        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25060            gc.alloc(Node::TSQualifiedName(self.inner))
25061        }
25062        /// Set the `left` field and mark the builder changed.
25063        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
25064        /// Set the `right` field and mark the builder changed.
25065        pub fn right(&mut self, right: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.right = right; }
25066    }
25067    /// Clone-with-changes builder for [`super::TSFunctionType`].
25068    #[derive(Debug)]
25069    pub struct TSFunctionType<'gc> {
25070        is_changed: bool,
25071        pub(super) inner: super::TSFunctionType<'gc>,
25072    }
25073    impl<'gc> TSFunctionType<'gc> {
25074        /// Start from a copy of `node`, with no field changed yet.
25075        pub fn from_node(node: &'gc super::TSFunctionType<'gc>) -> Self {
25076            Self {
25077                is_changed: false,
25078                inner: super::TSFunctionType {
25079                    metadata: node.metadata.duplicate(),
25080                    params: node.params.duplicate(),
25081                    return_type: node.return_type.duplicate(),
25082                    type_parameters: node.type_parameters.duplicate(),
25083                },
25084            }
25085        }
25086        /// Allocate the rebuilt node if a setter ran, else
25087        /// `TransformResult::Unchanged`.
25088        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25089            if self.is_changed {
25090                TransformResult::Changed(self.build_forced(gc))
25091            } else {
25092                TransformResult::Unchanged
25093            }
25094        }
25095        /// Allocate the node unconditionally, changed or not.
25096        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25097            gc.alloc(Node::TSFunctionType(self.inner))
25098        }
25099        /// Set the `params` field and mark the builder changed.
25100        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
25101        /// Set the `return_type` field and mark the builder changed.
25102        pub fn return_type(&mut self, return_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.return_type = return_type; }
25103        /// Set the `type_parameters` field and mark the builder changed.
25104        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
25105    }
25106    /// Clone-with-changes builder for [`super::TSConstructorType`].
25107    #[derive(Debug)]
25108    pub struct TSConstructorType<'gc> {
25109        is_changed: bool,
25110        pub(super) inner: super::TSConstructorType<'gc>,
25111    }
25112    impl<'gc> TSConstructorType<'gc> {
25113        /// Start from a copy of `node`, with no field changed yet.
25114        pub fn from_node(node: &'gc super::TSConstructorType<'gc>) -> Self {
25115            Self {
25116                is_changed: false,
25117                inner: super::TSConstructorType {
25118                    metadata: node.metadata.duplicate(),
25119                    params: node.params.duplicate(),
25120                    return_type: node.return_type.duplicate(),
25121                    type_parameters: node.type_parameters.duplicate(),
25122                },
25123            }
25124        }
25125        /// Allocate the rebuilt node if a setter ran, else
25126        /// `TransformResult::Unchanged`.
25127        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25128            if self.is_changed {
25129                TransformResult::Changed(self.build_forced(gc))
25130            } else {
25131                TransformResult::Unchanged
25132            }
25133        }
25134        /// Allocate the node unconditionally, changed or not.
25135        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25136            gc.alloc(Node::TSConstructorType(self.inner))
25137        }
25138        /// Set the `params` field and mark the builder changed.
25139        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
25140        /// Set the `return_type` field and mark the builder changed.
25141        pub fn return_type(&mut self, return_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.return_type = return_type; }
25142        /// Set the `type_parameters` field and mark the builder changed.
25143        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
25144    }
25145    /// Clone-with-changes builder for [`super::TSTypePredicate`].
25146    #[derive(Debug)]
25147    pub struct TSTypePredicate<'gc> {
25148        is_changed: bool,
25149        pub(super) inner: super::TSTypePredicate<'gc>,
25150    }
25151    impl<'gc> TSTypePredicate<'gc> {
25152        /// Start from a copy of `node`, with no field changed yet.
25153        pub fn from_node(node: &'gc super::TSTypePredicate<'gc>) -> Self {
25154            Self {
25155                is_changed: false,
25156                inner: super::TSTypePredicate {
25157                    metadata: node.metadata.duplicate(),
25158                    parameter_name: node.parameter_name.duplicate(),
25159                    type_annotation: node.type_annotation.duplicate(),
25160                },
25161            }
25162        }
25163        /// Allocate the rebuilt node if a setter ran, else
25164        /// `TransformResult::Unchanged`.
25165        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25166            if self.is_changed {
25167                TransformResult::Changed(self.build_forced(gc))
25168            } else {
25169                TransformResult::Unchanged
25170            }
25171        }
25172        /// Allocate the node unconditionally, changed or not.
25173        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25174            gc.alloc(Node::TSTypePredicate(self.inner))
25175        }
25176        /// Set the `parameter_name` field and mark the builder changed.
25177        pub fn parameter_name(&mut self, parameter_name: &'gc Node<'gc>) { self.is_changed = true; self.inner.parameter_name = parameter_name; }
25178        /// Set the `type_annotation` field and mark the builder changed.
25179        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25180    }
25181    /// Clone-with-changes builder for [`super::TSTupleType`].
25182    #[derive(Debug)]
25183    pub struct TSTupleType<'gc> {
25184        is_changed: bool,
25185        pub(super) inner: super::TSTupleType<'gc>,
25186    }
25187    impl<'gc> TSTupleType<'gc> {
25188        /// Start from a copy of `node`, with no field changed yet.
25189        pub fn from_node(node: &'gc super::TSTupleType<'gc>) -> Self {
25190            Self {
25191                is_changed: false,
25192                inner: super::TSTupleType {
25193                    metadata: node.metadata.duplicate(),
25194                    element_types: node.element_types.duplicate(),
25195                },
25196            }
25197        }
25198        /// Allocate the rebuilt node if a setter ran, else
25199        /// `TransformResult::Unchanged`.
25200        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25201            if self.is_changed {
25202                TransformResult::Changed(self.build_forced(gc))
25203            } else {
25204                TransformResult::Unchanged
25205            }
25206        }
25207        /// Allocate the node unconditionally, changed or not.
25208        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25209            gc.alloc(Node::TSTupleType(self.inner))
25210        }
25211        /// Set the `element_types` field and mark the builder changed.
25212        pub fn element_types(&mut self, element_types: NodeList<'gc>) { self.is_changed = true; self.inner.element_types = element_types; }
25213    }
25214    /// Clone-with-changes builder for [`super::TSTypeAssertion`].
25215    #[derive(Debug)]
25216    pub struct TSTypeAssertion<'gc> {
25217        is_changed: bool,
25218        pub(super) inner: super::TSTypeAssertion<'gc>,
25219    }
25220    impl<'gc> TSTypeAssertion<'gc> {
25221        /// Start from a copy of `node`, with no field changed yet.
25222        pub fn from_node(node: &'gc super::TSTypeAssertion<'gc>) -> Self {
25223            Self {
25224                is_changed: false,
25225                inner: super::TSTypeAssertion {
25226                    metadata: node.metadata.duplicate(),
25227                    type_annotation: node.type_annotation.duplicate(),
25228                    expression: node.expression.duplicate(),
25229                },
25230            }
25231        }
25232        /// Allocate the rebuilt node if a setter ran, else
25233        /// `TransformResult::Unchanged`.
25234        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25235            if self.is_changed {
25236                TransformResult::Changed(self.build_forced(gc))
25237            } else {
25238                TransformResult::Unchanged
25239            }
25240        }
25241        /// Allocate the node unconditionally, changed or not.
25242        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25243            gc.alloc(Node::TSTypeAssertion(self.inner))
25244        }
25245        /// Set the `type_annotation` field and mark the builder changed.
25246        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25247        /// Set the `expression` field and mark the builder changed.
25248        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
25249    }
25250    /// Clone-with-changes builder for [`super::TSAsExpression`].
25251    #[derive(Debug)]
25252    pub struct TSAsExpression<'gc> {
25253        is_changed: bool,
25254        pub(super) inner: super::TSAsExpression<'gc>,
25255    }
25256    impl<'gc> TSAsExpression<'gc> {
25257        /// Start from a copy of `node`, with no field changed yet.
25258        pub fn from_node(node: &'gc super::TSAsExpression<'gc>) -> Self {
25259            Self {
25260                is_changed: false,
25261                inner: super::TSAsExpression {
25262                    metadata: node.metadata.duplicate(),
25263                    expression: node.expression.duplicate(),
25264                    type_annotation: node.type_annotation.duplicate(),
25265                },
25266            }
25267        }
25268        /// Allocate the rebuilt node if a setter ran, else
25269        /// `TransformResult::Unchanged`.
25270        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25271            if self.is_changed {
25272                TransformResult::Changed(self.build_forced(gc))
25273            } else {
25274                TransformResult::Unchanged
25275            }
25276        }
25277        /// Allocate the node unconditionally, changed or not.
25278        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25279            gc.alloc(Node::TSAsExpression(self.inner))
25280        }
25281        /// Set the `expression` field and mark the builder changed.
25282        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
25283        /// Set the `type_annotation` field and mark the builder changed.
25284        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25285    }
25286    /// Clone-with-changes builder for [`super::TSParameterProperty`].
25287    #[derive(Debug)]
25288    pub struct TSParameterProperty<'gc> {
25289        is_changed: bool,
25290        pub(super) inner: super::TSParameterProperty<'gc>,
25291    }
25292    impl<'gc> TSParameterProperty<'gc> {
25293        /// Start from a copy of `node`, with no field changed yet.
25294        pub fn from_node(node: &'gc super::TSParameterProperty<'gc>) -> Self {
25295            Self {
25296                is_changed: false,
25297                inner: super::TSParameterProperty {
25298                    metadata: node.metadata.duplicate(),
25299                    parameter: node.parameter.duplicate(),
25300                    accessibility: Cell::new(node.accessibility.get()),
25301                    readonly: Cell::new(node.readonly.get()),
25302                    r#static: Cell::new(node.r#static.get()),
25303                    export: Cell::new(node.export.get()),
25304                },
25305            }
25306        }
25307        /// Allocate the rebuilt node if a setter ran, else
25308        /// `TransformResult::Unchanged`.
25309        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25310            if self.is_changed {
25311                TransformResult::Changed(self.build_forced(gc))
25312            } else {
25313                TransformResult::Unchanged
25314            }
25315        }
25316        /// Allocate the node unconditionally, changed or not.
25317        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25318            gc.alloc(Node::TSParameterProperty(self.inner))
25319        }
25320        /// Set the `parameter` field and mark the builder changed.
25321        pub fn parameter(&mut self, parameter: &'gc Node<'gc>) { self.is_changed = true; self.inner.parameter = parameter; }
25322    }
25323    /// Clone-with-changes builder for [`super::TSTypeAliasDeclaration`].
25324    #[derive(Debug)]
25325    pub struct TSTypeAliasDeclaration<'gc> {
25326        is_changed: bool,
25327        pub(super) inner: super::TSTypeAliasDeclaration<'gc>,
25328    }
25329    impl<'gc> TSTypeAliasDeclaration<'gc> {
25330        /// Start from a copy of `node`, with no field changed yet.
25331        pub fn from_node(node: &'gc super::TSTypeAliasDeclaration<'gc>) -> Self {
25332            Self {
25333                is_changed: false,
25334                inner: super::TSTypeAliasDeclaration {
25335                    metadata: node.metadata.duplicate(),
25336                    id: node.id.duplicate(),
25337                    type_parameters: node.type_parameters.duplicate(),
25338                    type_annotation: node.type_annotation.duplicate(),
25339                },
25340            }
25341        }
25342        /// Allocate the rebuilt node if a setter ran, else
25343        /// `TransformResult::Unchanged`.
25344        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25345            if self.is_changed {
25346                TransformResult::Changed(self.build_forced(gc))
25347            } else {
25348                TransformResult::Unchanged
25349            }
25350        }
25351        /// Allocate the node unconditionally, changed or not.
25352        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25353            gc.alloc(Node::TSTypeAliasDeclaration(self.inner))
25354        }
25355        /// Set the `id` field and mark the builder changed.
25356        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25357        /// Set the `type_parameters` field and mark the builder changed.
25358        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
25359        /// Set the `type_annotation` field and mark the builder changed.
25360        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25361    }
25362    /// Clone-with-changes builder for [`super::TSInterfaceDeclaration`].
25363    #[derive(Debug)]
25364    pub struct TSInterfaceDeclaration<'gc> {
25365        is_changed: bool,
25366        pub(super) inner: super::TSInterfaceDeclaration<'gc>,
25367    }
25368    impl<'gc> TSInterfaceDeclaration<'gc> {
25369        /// Start from a copy of `node`, with no field changed yet.
25370        pub fn from_node(node: &'gc super::TSInterfaceDeclaration<'gc>) -> Self {
25371            Self {
25372                is_changed: false,
25373                inner: super::TSInterfaceDeclaration {
25374                    metadata: node.metadata.duplicate(),
25375                    id: node.id.duplicate(),
25376                    body: node.body.duplicate(),
25377                    extends: node.extends.duplicate(),
25378                    type_parameters: node.type_parameters.duplicate(),
25379                },
25380            }
25381        }
25382        /// Allocate the rebuilt node if a setter ran, else
25383        /// `TransformResult::Unchanged`.
25384        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25385            if self.is_changed {
25386                TransformResult::Changed(self.build_forced(gc))
25387            } else {
25388                TransformResult::Unchanged
25389            }
25390        }
25391        /// Allocate the node unconditionally, changed or not.
25392        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25393            gc.alloc(Node::TSInterfaceDeclaration(self.inner))
25394        }
25395        /// Set the `id` field and mark the builder changed.
25396        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25397        /// Set the `body` field and mark the builder changed.
25398        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
25399        /// Set the `extends` field and mark the builder changed.
25400        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
25401        /// Set the `type_parameters` field and mark the builder changed.
25402        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
25403    }
25404    /// Clone-with-changes builder for [`super::TSInterfaceHeritage`].
25405    #[derive(Debug)]
25406    pub struct TSInterfaceHeritage<'gc> {
25407        is_changed: bool,
25408        pub(super) inner: super::TSInterfaceHeritage<'gc>,
25409    }
25410    impl<'gc> TSInterfaceHeritage<'gc> {
25411        /// Start from a copy of `node`, with no field changed yet.
25412        pub fn from_node(node: &'gc super::TSInterfaceHeritage<'gc>) -> Self {
25413            Self {
25414                is_changed: false,
25415                inner: super::TSInterfaceHeritage {
25416                    metadata: node.metadata.duplicate(),
25417                    expression: node.expression.duplicate(),
25418                    type_parameters: node.type_parameters.duplicate(),
25419                },
25420            }
25421        }
25422        /// Allocate the rebuilt node if a setter ran, else
25423        /// `TransformResult::Unchanged`.
25424        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25425            if self.is_changed {
25426                TransformResult::Changed(self.build_forced(gc))
25427            } else {
25428                TransformResult::Unchanged
25429            }
25430        }
25431        /// Allocate the node unconditionally, changed or not.
25432        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25433            gc.alloc(Node::TSInterfaceHeritage(self.inner))
25434        }
25435        /// Set the `expression` field and mark the builder changed.
25436        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
25437        /// Set the `type_parameters` field and mark the builder changed.
25438        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
25439    }
25440    /// Clone-with-changes builder for [`super::TSInterfaceBody`].
25441    #[derive(Debug)]
25442    pub struct TSInterfaceBody<'gc> {
25443        is_changed: bool,
25444        pub(super) inner: super::TSInterfaceBody<'gc>,
25445    }
25446    impl<'gc> TSInterfaceBody<'gc> {
25447        /// Start from a copy of `node`, with no field changed yet.
25448        pub fn from_node(node: &'gc super::TSInterfaceBody<'gc>) -> Self {
25449            Self {
25450                is_changed: false,
25451                inner: super::TSInterfaceBody {
25452                    metadata: node.metadata.duplicate(),
25453                    body: node.body.duplicate(),
25454                },
25455            }
25456        }
25457        /// Allocate the rebuilt node if a setter ran, else
25458        /// `TransformResult::Unchanged`.
25459        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25460            if self.is_changed {
25461                TransformResult::Changed(self.build_forced(gc))
25462            } else {
25463                TransformResult::Unchanged
25464            }
25465        }
25466        /// Allocate the node unconditionally, changed or not.
25467        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25468            gc.alloc(Node::TSInterfaceBody(self.inner))
25469        }
25470        /// Set the `body` field and mark the builder changed.
25471        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
25472    }
25473    /// Clone-with-changes builder for [`super::TSEnumDeclaration`].
25474    #[derive(Debug)]
25475    pub struct TSEnumDeclaration<'gc> {
25476        is_changed: bool,
25477        pub(super) inner: super::TSEnumDeclaration<'gc>,
25478    }
25479    impl<'gc> TSEnumDeclaration<'gc> {
25480        /// Start from a copy of `node`, with no field changed yet.
25481        pub fn from_node(node: &'gc super::TSEnumDeclaration<'gc>) -> Self {
25482            Self {
25483                is_changed: false,
25484                inner: super::TSEnumDeclaration {
25485                    metadata: node.metadata.duplicate(),
25486                    id: node.id.duplicate(),
25487                    members: node.members.duplicate(),
25488                },
25489            }
25490        }
25491        /// Allocate the rebuilt node if a setter ran, else
25492        /// `TransformResult::Unchanged`.
25493        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25494            if self.is_changed {
25495                TransformResult::Changed(self.build_forced(gc))
25496            } else {
25497                TransformResult::Unchanged
25498            }
25499        }
25500        /// Allocate the node unconditionally, changed or not.
25501        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25502            gc.alloc(Node::TSEnumDeclaration(self.inner))
25503        }
25504        /// Set the `id` field and mark the builder changed.
25505        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25506        /// Set the `members` field and mark the builder changed.
25507        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
25508    }
25509    /// Clone-with-changes builder for [`super::TSEnumMember`].
25510    #[derive(Debug)]
25511    pub struct TSEnumMember<'gc> {
25512        is_changed: bool,
25513        pub(super) inner: super::TSEnumMember<'gc>,
25514    }
25515    impl<'gc> TSEnumMember<'gc> {
25516        /// Start from a copy of `node`, with no field changed yet.
25517        pub fn from_node(node: &'gc super::TSEnumMember<'gc>) -> Self {
25518            Self {
25519                is_changed: false,
25520                inner: super::TSEnumMember {
25521                    metadata: node.metadata.duplicate(),
25522                    id: node.id.duplicate(),
25523                    initializer: node.initializer.duplicate(),
25524                },
25525            }
25526        }
25527        /// Allocate the rebuilt node if a setter ran, else
25528        /// `TransformResult::Unchanged`.
25529        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25530            if self.is_changed {
25531                TransformResult::Changed(self.build_forced(gc))
25532            } else {
25533                TransformResult::Unchanged
25534            }
25535        }
25536        /// Allocate the node unconditionally, changed or not.
25537        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25538            gc.alloc(Node::TSEnumMember(self.inner))
25539        }
25540        /// Set the `id` field and mark the builder changed.
25541        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25542        /// Set the `initializer` field and mark the builder changed.
25543        pub fn initializer(&mut self, initializer: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.initializer = initializer; }
25544    }
25545    /// Clone-with-changes builder for [`super::TSModuleDeclaration`].
25546    #[derive(Debug)]
25547    pub struct TSModuleDeclaration<'gc> {
25548        is_changed: bool,
25549        pub(super) inner: super::TSModuleDeclaration<'gc>,
25550    }
25551    impl<'gc> TSModuleDeclaration<'gc> {
25552        /// Start from a copy of `node`, with no field changed yet.
25553        pub fn from_node(node: &'gc super::TSModuleDeclaration<'gc>) -> Self {
25554            Self {
25555                is_changed: false,
25556                inner: super::TSModuleDeclaration {
25557                    metadata: node.metadata.duplicate(),
25558                    id: node.id.duplicate(),
25559                    body: node.body.duplicate(),
25560                },
25561            }
25562        }
25563        /// Allocate the rebuilt node if a setter ran, else
25564        /// `TransformResult::Unchanged`.
25565        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25566            if self.is_changed {
25567                TransformResult::Changed(self.build_forced(gc))
25568            } else {
25569                TransformResult::Unchanged
25570            }
25571        }
25572        /// Allocate the node unconditionally, changed or not.
25573        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25574            gc.alloc(Node::TSModuleDeclaration(self.inner))
25575        }
25576        /// Set the `id` field and mark the builder changed.
25577        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25578        /// Set the `body` field and mark the builder changed.
25579        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
25580    }
25581    /// Clone-with-changes builder for [`super::TSModuleBlock`].
25582    #[derive(Debug)]
25583    pub struct TSModuleBlock<'gc> {
25584        is_changed: bool,
25585        pub(super) inner: super::TSModuleBlock<'gc>,
25586    }
25587    impl<'gc> TSModuleBlock<'gc> {
25588        /// Start from a copy of `node`, with no field changed yet.
25589        pub fn from_node(node: &'gc super::TSModuleBlock<'gc>) -> Self {
25590            Self {
25591                is_changed: false,
25592                inner: super::TSModuleBlock {
25593                    metadata: node.metadata.duplicate(),
25594                    body: node.body.duplicate(),
25595                },
25596            }
25597        }
25598        /// Allocate the rebuilt node if a setter ran, else
25599        /// `TransformResult::Unchanged`.
25600        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25601            if self.is_changed {
25602                TransformResult::Changed(self.build_forced(gc))
25603            } else {
25604                TransformResult::Unchanged
25605            }
25606        }
25607        /// Allocate the node unconditionally, changed or not.
25608        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25609            gc.alloc(Node::TSModuleBlock(self.inner))
25610        }
25611        /// Set the `body` field and mark the builder changed.
25612        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
25613    }
25614    /// Clone-with-changes builder for [`super::TSModuleMember`].
25615    #[derive(Debug)]
25616    pub struct TSModuleMember<'gc> {
25617        is_changed: bool,
25618        pub(super) inner: super::TSModuleMember<'gc>,
25619    }
25620    impl<'gc> TSModuleMember<'gc> {
25621        /// Start from a copy of `node`, with no field changed yet.
25622        pub fn from_node(node: &'gc super::TSModuleMember<'gc>) -> Self {
25623            Self {
25624                is_changed: false,
25625                inner: super::TSModuleMember {
25626                    metadata: node.metadata.duplicate(),
25627                    id: node.id.duplicate(),
25628                    initializer: node.initializer.duplicate(),
25629                },
25630            }
25631        }
25632        /// Allocate the rebuilt node if a setter ran, else
25633        /// `TransformResult::Unchanged`.
25634        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25635            if self.is_changed {
25636                TransformResult::Changed(self.build_forced(gc))
25637            } else {
25638                TransformResult::Unchanged
25639            }
25640        }
25641        /// Allocate the node unconditionally, changed or not.
25642        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25643            gc.alloc(Node::TSModuleMember(self.inner))
25644        }
25645        /// Set the `id` field and mark the builder changed.
25646        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25647        /// Set the `initializer` field and mark the builder changed.
25648        pub fn initializer(&mut self, initializer: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.initializer = initializer; }
25649    }
25650    /// Clone-with-changes builder for [`super::TSTypeParameterDeclaration`].
25651    #[derive(Debug)]
25652    pub struct TSTypeParameterDeclaration<'gc> {
25653        is_changed: bool,
25654        pub(super) inner: super::TSTypeParameterDeclaration<'gc>,
25655    }
25656    impl<'gc> TSTypeParameterDeclaration<'gc> {
25657        /// Start from a copy of `node`, with no field changed yet.
25658        pub fn from_node(node: &'gc super::TSTypeParameterDeclaration<'gc>) -> Self {
25659            Self {
25660                is_changed: false,
25661                inner: super::TSTypeParameterDeclaration {
25662                    metadata: node.metadata.duplicate(),
25663                    params: node.params.duplicate(),
25664                },
25665            }
25666        }
25667        /// Allocate the rebuilt node if a setter ran, else
25668        /// `TransformResult::Unchanged`.
25669        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25670            if self.is_changed {
25671                TransformResult::Changed(self.build_forced(gc))
25672            } else {
25673                TransformResult::Unchanged
25674            }
25675        }
25676        /// Allocate the node unconditionally, changed or not.
25677        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25678            gc.alloc(Node::TSTypeParameterDeclaration(self.inner))
25679        }
25680        /// Set the `params` field and mark the builder changed.
25681        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
25682    }
25683    /// Clone-with-changes builder for [`super::TSTypeParameter`].
25684    #[derive(Debug)]
25685    pub struct TSTypeParameter<'gc> {
25686        is_changed: bool,
25687        pub(super) inner: super::TSTypeParameter<'gc>,
25688    }
25689    impl<'gc> TSTypeParameter<'gc> {
25690        /// Start from a copy of `node`, with no field changed yet.
25691        pub fn from_node(node: &'gc super::TSTypeParameter<'gc>) -> Self {
25692            Self {
25693                is_changed: false,
25694                inner: super::TSTypeParameter {
25695                    metadata: node.metadata.duplicate(),
25696                    name: node.name.duplicate(),
25697                    constraint: node.constraint.duplicate(),
25698                    default: node.default.duplicate(),
25699                },
25700            }
25701        }
25702        /// Allocate the rebuilt node if a setter ran, else
25703        /// `TransformResult::Unchanged`.
25704        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25705            if self.is_changed {
25706                TransformResult::Changed(self.build_forced(gc))
25707            } else {
25708                TransformResult::Unchanged
25709            }
25710        }
25711        /// Allocate the node unconditionally, changed or not.
25712        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25713            gc.alloc(Node::TSTypeParameter(self.inner))
25714        }
25715        /// Set the `name` field and mark the builder changed.
25716        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
25717        /// Set the `constraint` field and mark the builder changed.
25718        pub fn constraint(&mut self, constraint: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.constraint = constraint; }
25719        /// Set the `default` field and mark the builder changed.
25720        pub fn default(&mut self, default: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.default = default; }
25721    }
25722    /// Clone-with-changes builder for [`super::TSTypeParameterInstantiation`].
25723    #[derive(Debug)]
25724    pub struct TSTypeParameterInstantiation<'gc> {
25725        is_changed: bool,
25726        pub(super) inner: super::TSTypeParameterInstantiation<'gc>,
25727    }
25728    impl<'gc> TSTypeParameterInstantiation<'gc> {
25729        /// Start from a copy of `node`, with no field changed yet.
25730        pub fn from_node(node: &'gc super::TSTypeParameterInstantiation<'gc>) -> Self {
25731            Self {
25732                is_changed: false,
25733                inner: super::TSTypeParameterInstantiation {
25734                    metadata: node.metadata.duplicate(),
25735                    params: node.params.duplicate(),
25736                },
25737            }
25738        }
25739        /// Allocate the rebuilt node if a setter ran, else
25740        /// `TransformResult::Unchanged`.
25741        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25742            if self.is_changed {
25743                TransformResult::Changed(self.build_forced(gc))
25744            } else {
25745                TransformResult::Unchanged
25746            }
25747        }
25748        /// Allocate the node unconditionally, changed or not.
25749        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25750            gc.alloc(Node::TSTypeParameterInstantiation(self.inner))
25751        }
25752        /// Set the `params` field and mark the builder changed.
25753        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
25754    }
25755    /// Clone-with-changes builder for [`super::TSUnionType`].
25756    #[derive(Debug)]
25757    pub struct TSUnionType<'gc> {
25758        is_changed: bool,
25759        pub(super) inner: super::TSUnionType<'gc>,
25760    }
25761    impl<'gc> TSUnionType<'gc> {
25762        /// Start from a copy of `node`, with no field changed yet.
25763        pub fn from_node(node: &'gc super::TSUnionType<'gc>) -> Self {
25764            Self {
25765                is_changed: false,
25766                inner: super::TSUnionType {
25767                    metadata: node.metadata.duplicate(),
25768                    types: node.types.duplicate(),
25769                },
25770            }
25771        }
25772        /// Allocate the rebuilt node if a setter ran, else
25773        /// `TransformResult::Unchanged`.
25774        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25775            if self.is_changed {
25776                TransformResult::Changed(self.build_forced(gc))
25777            } else {
25778                TransformResult::Unchanged
25779            }
25780        }
25781        /// Allocate the node unconditionally, changed or not.
25782        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25783            gc.alloc(Node::TSUnionType(self.inner))
25784        }
25785        /// Set the `types` field and mark the builder changed.
25786        pub fn types(&mut self, types: NodeList<'gc>) { self.is_changed = true; self.inner.types = types; }
25787    }
25788    /// Clone-with-changes builder for [`super::TSIntersectionType`].
25789    #[derive(Debug)]
25790    pub struct TSIntersectionType<'gc> {
25791        is_changed: bool,
25792        pub(super) inner: super::TSIntersectionType<'gc>,
25793    }
25794    impl<'gc> TSIntersectionType<'gc> {
25795        /// Start from a copy of `node`, with no field changed yet.
25796        pub fn from_node(node: &'gc super::TSIntersectionType<'gc>) -> Self {
25797            Self {
25798                is_changed: false,
25799                inner: super::TSIntersectionType {
25800                    metadata: node.metadata.duplicate(),
25801                    types: node.types.duplicate(),
25802                },
25803            }
25804        }
25805        /// Allocate the rebuilt node if a setter ran, else
25806        /// `TransformResult::Unchanged`.
25807        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25808            if self.is_changed {
25809                TransformResult::Changed(self.build_forced(gc))
25810            } else {
25811                TransformResult::Unchanged
25812            }
25813        }
25814        /// Allocate the node unconditionally, changed or not.
25815        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25816            gc.alloc(Node::TSIntersectionType(self.inner))
25817        }
25818        /// Set the `types` field and mark the builder changed.
25819        pub fn types(&mut self, types: NodeList<'gc>) { self.is_changed = true; self.inner.types = types; }
25820    }
25821    /// Clone-with-changes builder for [`super::TSTypeQuery`].
25822    #[derive(Debug)]
25823    pub struct TSTypeQuery<'gc> {
25824        is_changed: bool,
25825        pub(super) inner: super::TSTypeQuery<'gc>,
25826    }
25827    impl<'gc> TSTypeQuery<'gc> {
25828        /// Start from a copy of `node`, with no field changed yet.
25829        pub fn from_node(node: &'gc super::TSTypeQuery<'gc>) -> Self {
25830            Self {
25831                is_changed: false,
25832                inner: super::TSTypeQuery {
25833                    metadata: node.metadata.duplicate(),
25834                    expr_name: node.expr_name.duplicate(),
25835                },
25836            }
25837        }
25838        /// Allocate the rebuilt node if a setter ran, else
25839        /// `TransformResult::Unchanged`.
25840        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25841            if self.is_changed {
25842                TransformResult::Changed(self.build_forced(gc))
25843            } else {
25844                TransformResult::Unchanged
25845            }
25846        }
25847        /// Allocate the node unconditionally, changed or not.
25848        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25849            gc.alloc(Node::TSTypeQuery(self.inner))
25850        }
25851        /// Set the `expr_name` field and mark the builder changed.
25852        pub fn expr_name(&mut self, expr_name: &'gc Node<'gc>) { self.is_changed = true; self.inner.expr_name = expr_name; }
25853    }
25854    /// Clone-with-changes builder for [`super::TSConditionalType`].
25855    #[derive(Debug)]
25856    pub struct TSConditionalType<'gc> {
25857        is_changed: bool,
25858        pub(super) inner: super::TSConditionalType<'gc>,
25859    }
25860    impl<'gc> TSConditionalType<'gc> {
25861        /// Start from a copy of `node`, with no field changed yet.
25862        pub fn from_node(node: &'gc super::TSConditionalType<'gc>) -> Self {
25863            Self {
25864                is_changed: false,
25865                inner: super::TSConditionalType {
25866                    metadata: node.metadata.duplicate(),
25867                    check_type: node.check_type.duplicate(),
25868                    extends_type: node.extends_type.duplicate(),
25869                    true_type: node.true_type.duplicate(),
25870                    false_type: node.false_type.duplicate(),
25871                },
25872            }
25873        }
25874        /// Allocate the rebuilt node if a setter ran, else
25875        /// `TransformResult::Unchanged`.
25876        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25877            if self.is_changed {
25878                TransformResult::Changed(self.build_forced(gc))
25879            } else {
25880                TransformResult::Unchanged
25881            }
25882        }
25883        /// Allocate the node unconditionally, changed or not.
25884        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25885            gc.alloc(Node::TSConditionalType(self.inner))
25886        }
25887        /// Set the `check_type` field and mark the builder changed.
25888        pub fn check_type(&mut self, check_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.check_type = check_type; }
25889        /// Set the `extends_type` field and mark the builder changed.
25890        pub fn extends_type(&mut self, extends_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.extends_type = extends_type; }
25891        /// Set the `true_type` field and mark the builder changed.
25892        pub fn true_type(&mut self, true_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.true_type = true_type; }
25893        /// Set the `false_type` field and mark the builder changed.
25894        pub fn false_type(&mut self, false_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.false_type = false_type; }
25895    }
25896    /// Clone-with-changes builder for [`super::TSTypeLiteral`].
25897    #[derive(Debug)]
25898    pub struct TSTypeLiteral<'gc> {
25899        is_changed: bool,
25900        pub(super) inner: super::TSTypeLiteral<'gc>,
25901    }
25902    impl<'gc> TSTypeLiteral<'gc> {
25903        /// Start from a copy of `node`, with no field changed yet.
25904        pub fn from_node(node: &'gc super::TSTypeLiteral<'gc>) -> Self {
25905            Self {
25906                is_changed: false,
25907                inner: super::TSTypeLiteral {
25908                    metadata: node.metadata.duplicate(),
25909                    members: node.members.duplicate(),
25910                },
25911            }
25912        }
25913        /// Allocate the rebuilt node if a setter ran, else
25914        /// `TransformResult::Unchanged`.
25915        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25916            if self.is_changed {
25917                TransformResult::Changed(self.build_forced(gc))
25918            } else {
25919                TransformResult::Unchanged
25920            }
25921        }
25922        /// Allocate the node unconditionally, changed or not.
25923        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25924            gc.alloc(Node::TSTypeLiteral(self.inner))
25925        }
25926        /// Set the `members` field and mark the builder changed.
25927        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
25928    }
25929    /// Clone-with-changes builder for [`super::TSPropertySignature`].
25930    #[derive(Debug)]
25931    pub struct TSPropertySignature<'gc> {
25932        is_changed: bool,
25933        pub(super) inner: super::TSPropertySignature<'gc>,
25934    }
25935    impl<'gc> TSPropertySignature<'gc> {
25936        /// Start from a copy of `node`, with no field changed yet.
25937        pub fn from_node(node: &'gc super::TSPropertySignature<'gc>) -> Self {
25938            Self {
25939                is_changed: false,
25940                inner: super::TSPropertySignature {
25941                    metadata: node.metadata.duplicate(),
25942                    key: node.key.duplicate(),
25943                    type_annotation: node.type_annotation.duplicate(),
25944                    initializer: node.initializer.duplicate(),
25945                    optional: Cell::new(node.optional.get()),
25946                    computed: Cell::new(node.computed.get()),
25947                    readonly: Cell::new(node.readonly.get()),
25948                    r#static: Cell::new(node.r#static.get()),
25949                    export: Cell::new(node.export.get()),
25950                },
25951            }
25952        }
25953        /// Allocate the rebuilt node if a setter ran, else
25954        /// `TransformResult::Unchanged`.
25955        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25956            if self.is_changed {
25957                TransformResult::Changed(self.build_forced(gc))
25958            } else {
25959                TransformResult::Unchanged
25960            }
25961        }
25962        /// Allocate the node unconditionally, changed or not.
25963        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25964            gc.alloc(Node::TSPropertySignature(self.inner))
25965        }
25966        /// Set the `key` field and mark the builder changed.
25967        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
25968        /// Set the `type_annotation` field and mark the builder changed.
25969        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25970        /// Set the `initializer` field and mark the builder changed.
25971        pub fn initializer(&mut self, initializer: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.initializer = initializer; }
25972    }
25973    /// Clone-with-changes builder for [`super::TSMethodSignature`].
25974    #[derive(Debug)]
25975    pub struct TSMethodSignature<'gc> {
25976        is_changed: bool,
25977        pub(super) inner: super::TSMethodSignature<'gc>,
25978    }
25979    impl<'gc> TSMethodSignature<'gc> {
25980        /// Start from a copy of `node`, with no field changed yet.
25981        pub fn from_node(node: &'gc super::TSMethodSignature<'gc>) -> Self {
25982            Self {
25983                is_changed: false,
25984                inner: super::TSMethodSignature {
25985                    metadata: node.metadata.duplicate(),
25986                    key: node.key.duplicate(),
25987                    params: node.params.duplicate(),
25988                    return_type: node.return_type.duplicate(),
25989                    computed: Cell::new(node.computed.get()),
25990                },
25991            }
25992        }
25993        /// Allocate the rebuilt node if a setter ran, else
25994        /// `TransformResult::Unchanged`.
25995        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25996            if self.is_changed {
25997                TransformResult::Changed(self.build_forced(gc))
25998            } else {
25999                TransformResult::Unchanged
26000            }
26001        }
26002        /// Allocate the node unconditionally, changed or not.
26003        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26004            gc.alloc(Node::TSMethodSignature(self.inner))
26005        }
26006        /// Set the `key` field and mark the builder changed.
26007        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
26008        /// Set the `params` field and mark the builder changed.
26009        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
26010        /// Set the `return_type` field and mark the builder changed.
26011        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
26012    }
26013    /// Clone-with-changes builder for [`super::TSIndexSignature`].
26014    #[derive(Debug)]
26015    pub struct TSIndexSignature<'gc> {
26016        is_changed: bool,
26017        pub(super) inner: super::TSIndexSignature<'gc>,
26018    }
26019    impl<'gc> TSIndexSignature<'gc> {
26020        /// Start from a copy of `node`, with no field changed yet.
26021        pub fn from_node(node: &'gc super::TSIndexSignature<'gc>) -> Self {
26022            Self {
26023                is_changed: false,
26024                inner: super::TSIndexSignature {
26025                    metadata: node.metadata.duplicate(),
26026                    parameters: node.parameters.duplicate(),
26027                    type_annotation: node.type_annotation.duplicate(),
26028                },
26029            }
26030        }
26031        /// Allocate the rebuilt node if a setter ran, else
26032        /// `TransformResult::Unchanged`.
26033        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26034            if self.is_changed {
26035                TransformResult::Changed(self.build_forced(gc))
26036            } else {
26037                TransformResult::Unchanged
26038            }
26039        }
26040        /// Allocate the node unconditionally, changed or not.
26041        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26042            gc.alloc(Node::TSIndexSignature(self.inner))
26043        }
26044        /// Set the `parameters` field and mark the builder changed.
26045        pub fn parameters(&mut self, parameters: NodeList<'gc>) { self.is_changed = true; self.inner.parameters = parameters; }
26046        /// Set the `type_annotation` field and mark the builder changed.
26047        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
26048    }
26049    /// Clone-with-changes builder for [`super::TSCallSignatureDeclaration`].
26050    #[derive(Debug)]
26051    pub struct TSCallSignatureDeclaration<'gc> {
26052        is_changed: bool,
26053        pub(super) inner: super::TSCallSignatureDeclaration<'gc>,
26054    }
26055    impl<'gc> TSCallSignatureDeclaration<'gc> {
26056        /// Start from a copy of `node`, with no field changed yet.
26057        pub fn from_node(node: &'gc super::TSCallSignatureDeclaration<'gc>) -> Self {
26058            Self {
26059                is_changed: false,
26060                inner: super::TSCallSignatureDeclaration {
26061                    metadata: node.metadata.duplicate(),
26062                    params: node.params.duplicate(),
26063                    return_type: node.return_type.duplicate(),
26064                },
26065            }
26066        }
26067        /// Allocate the rebuilt node if a setter ran, else
26068        /// `TransformResult::Unchanged`.
26069        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26070            if self.is_changed {
26071                TransformResult::Changed(self.build_forced(gc))
26072            } else {
26073                TransformResult::Unchanged
26074            }
26075        }
26076        /// Allocate the node unconditionally, changed or not.
26077        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26078            gc.alloc(Node::TSCallSignatureDeclaration(self.inner))
26079        }
26080        /// Set the `params` field and mark the builder changed.
26081        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
26082        /// Set the `return_type` field and mark the builder changed.
26083        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
26084    }
26085    /// Clone-with-changes builder for [`super::TSModifiers`].
26086    #[derive(Debug)]
26087    pub struct TSModifiers<'gc> {
26088        is_changed: bool,
26089        pub(super) inner: super::TSModifiers<'gc>,
26090    }
26091    impl<'gc> TSModifiers<'gc> {
26092        /// Start from a copy of `node`, with no field changed yet.
26093        pub fn from_node(node: &'gc super::TSModifiers<'gc>) -> Self {
26094            Self {
26095                is_changed: false,
26096                inner: super::TSModifiers {
26097                    metadata: node.metadata.duplicate(),
26098                    accessibility: Cell::new(node.accessibility.get()),
26099                    readonly: Cell::new(node.readonly.get()),
26100                },
26101            }
26102        }
26103        /// Allocate the rebuilt node if a setter ran, else
26104        /// `TransformResult::Unchanged`.
26105        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26106            if self.is_changed {
26107                TransformResult::Changed(self.build_forced(gc))
26108            } else {
26109                TransformResult::Unchanged
26110            }
26111        }
26112        /// Allocate the node unconditionally, changed or not.
26113        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26114            gc.alloc(Node::TSModifiers(self.inner))
26115        }
26116    }
26117    /// Clone-with-changes builder for [`super::CoverEmptyArgs`].
26118    #[derive(Debug)]
26119    pub struct CoverEmptyArgs<'gc> {
26120        is_changed: bool,
26121        pub(super) inner: super::CoverEmptyArgs<'gc>,
26122    }
26123    impl<'gc> CoverEmptyArgs<'gc> {
26124        /// Start from a copy of `node`, with no field changed yet.
26125        pub fn from_node(node: &'gc super::CoverEmptyArgs<'gc>) -> Self {
26126            Self {
26127                is_changed: false,
26128                inner: super::CoverEmptyArgs {
26129                    metadata: node.metadata.duplicate(),
26130                },
26131            }
26132        }
26133        /// Allocate the rebuilt node if a setter ran, else
26134        /// `TransformResult::Unchanged`.
26135        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26136            if self.is_changed {
26137                TransformResult::Changed(self.build_forced(gc))
26138            } else {
26139                TransformResult::Unchanged
26140            }
26141        }
26142        /// Allocate the node unconditionally, changed or not.
26143        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26144            gc.alloc(Node::CoverEmptyArgs(self.inner))
26145        }
26146    }
26147    /// Clone-with-changes builder for [`super::CoverTrailingComma`].
26148    #[derive(Debug)]
26149    pub struct CoverTrailingComma<'gc> {
26150        is_changed: bool,
26151        pub(super) inner: super::CoverTrailingComma<'gc>,
26152    }
26153    impl<'gc> CoverTrailingComma<'gc> {
26154        /// Start from a copy of `node`, with no field changed yet.
26155        pub fn from_node(node: &'gc super::CoverTrailingComma<'gc>) -> Self {
26156            Self {
26157                is_changed: false,
26158                inner: super::CoverTrailingComma {
26159                    metadata: node.metadata.duplicate(),
26160                },
26161            }
26162        }
26163        /// Allocate the rebuilt node if a setter ran, else
26164        /// `TransformResult::Unchanged`.
26165        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26166            if self.is_changed {
26167                TransformResult::Changed(self.build_forced(gc))
26168            } else {
26169                TransformResult::Unchanged
26170            }
26171        }
26172        /// Allocate the node unconditionally, changed or not.
26173        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26174            gc.alloc(Node::CoverTrailingComma(self.inner))
26175        }
26176    }
26177    /// Clone-with-changes builder for [`super::CoverInitializer`].
26178    #[derive(Debug)]
26179    pub struct CoverInitializer<'gc> {
26180        is_changed: bool,
26181        pub(super) inner: super::CoverInitializer<'gc>,
26182    }
26183    impl<'gc> CoverInitializer<'gc> {
26184        /// Start from a copy of `node`, with no field changed yet.
26185        pub fn from_node(node: &'gc super::CoverInitializer<'gc>) -> Self {
26186            Self {
26187                is_changed: false,
26188                inner: super::CoverInitializer {
26189                    metadata: node.metadata.duplicate(),
26190                    init: node.init.duplicate(),
26191                },
26192            }
26193        }
26194        /// Allocate the rebuilt node if a setter ran, else
26195        /// `TransformResult::Unchanged`.
26196        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26197            if self.is_changed {
26198                TransformResult::Changed(self.build_forced(gc))
26199            } else {
26200                TransformResult::Unchanged
26201            }
26202        }
26203        /// Allocate the node unconditionally, changed or not.
26204        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26205            gc.alloc(Node::CoverInitializer(self.inner))
26206        }
26207        /// Set the `init` field and mark the builder changed.
26208        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
26209    }
26210    /// Clone-with-changes builder for [`super::CoverRestElement`].
26211    #[derive(Debug)]
26212    pub struct CoverRestElement<'gc> {
26213        is_changed: bool,
26214        pub(super) inner: super::CoverRestElement<'gc>,
26215    }
26216    impl<'gc> CoverRestElement<'gc> {
26217        /// Start from a copy of `node`, with no field changed yet.
26218        pub fn from_node(node: &'gc super::CoverRestElement<'gc>) -> Self {
26219            Self {
26220                is_changed: false,
26221                inner: super::CoverRestElement {
26222                    metadata: node.metadata.duplicate(),
26223                    rest: node.rest.duplicate(),
26224                },
26225            }
26226        }
26227        /// Allocate the rebuilt node if a setter ran, else
26228        /// `TransformResult::Unchanged`.
26229        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26230            if self.is_changed {
26231                TransformResult::Changed(self.build_forced(gc))
26232            } else {
26233                TransformResult::Unchanged
26234            }
26235        }
26236        /// Allocate the node unconditionally, changed or not.
26237        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26238            gc.alloc(Node::CoverRestElement(self.inner))
26239        }
26240        /// Set the `rest` field and mark the builder changed.
26241        pub fn rest(&mut self, rest: &'gc Node<'gc>) { self.is_changed = true; self.inner.rest = rest; }
26242    }
26243    /// Clone-with-changes builder for [`super::CoverTypedIdentifier`].
26244    #[derive(Debug)]
26245    pub struct CoverTypedIdentifier<'gc> {
26246        is_changed: bool,
26247        pub(super) inner: super::CoverTypedIdentifier<'gc>,
26248    }
26249    impl<'gc> CoverTypedIdentifier<'gc> {
26250        /// Start from a copy of `node`, with no field changed yet.
26251        pub fn from_node(node: &'gc super::CoverTypedIdentifier<'gc>) -> Self {
26252            Self {
26253                is_changed: false,
26254                inner: super::CoverTypedIdentifier {
26255                    metadata: node.metadata.duplicate(),
26256                    left: node.left.duplicate(),
26257                    right: node.right.duplicate(),
26258                    optional: Cell::new(node.optional.get()),
26259                },
26260            }
26261        }
26262        /// Allocate the rebuilt node if a setter ran, else
26263        /// `TransformResult::Unchanged`.
26264        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26265            if self.is_changed {
26266                TransformResult::Changed(self.build_forced(gc))
26267            } else {
26268                TransformResult::Unchanged
26269            }
26270        }
26271        /// Allocate the node unconditionally, changed or not.
26272        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26273            gc.alloc(Node::CoverTypedIdentifier(self.inner))
26274        }
26275        /// Set the `left` field and mark the builder changed.
26276        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
26277        /// Set the `right` field and mark the builder changed.
26278        pub fn right(&mut self, right: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.right = right; }
26279    }
26280    /// Clone-with-changes builder for [`super::SHBuiltin`].
26281    #[derive(Debug)]
26282    pub struct SHBuiltin<'gc> {
26283        is_changed: bool,
26284        pub(super) inner: super::SHBuiltin<'gc>,
26285    }
26286    impl<'gc> SHBuiltin<'gc> {
26287        /// Start from a copy of `node`, with no field changed yet.
26288        pub fn from_node(node: &'gc super::SHBuiltin<'gc>) -> Self {
26289            Self {
26290                is_changed: false,
26291                inner: super::SHBuiltin {
26292                    metadata: node.metadata.duplicate(),
26293                },
26294            }
26295        }
26296        /// Allocate the rebuilt node if a setter ran, else
26297        /// `TransformResult::Unchanged`.
26298        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26299            if self.is_changed {
26300                TransformResult::Changed(self.build_forced(gc))
26301            } else {
26302                TransformResult::Unchanged
26303            }
26304        }
26305        /// Allocate the node unconditionally, changed or not.
26306        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26307            gc.alloc(Node::SHBuiltin(self.inner))
26308        }
26309    }
26310    /// Clone-with-changes builder for [`super::ImplicitCheckedCast`].
26311    #[derive(Debug)]
26312    pub struct ImplicitCheckedCast<'gc> {
26313        is_changed: bool,
26314        pub(super) inner: super::ImplicitCheckedCast<'gc>,
26315    }
26316    impl<'gc> ImplicitCheckedCast<'gc> {
26317        /// Start from a copy of `node`, with no field changed yet.
26318        pub fn from_node(node: &'gc super::ImplicitCheckedCast<'gc>) -> Self {
26319            Self {
26320                is_changed: false,
26321                inner: super::ImplicitCheckedCast {
26322                    metadata: node.metadata.duplicate(),
26323                    argument: node.argument.duplicate(),
26324                },
26325            }
26326        }
26327        /// Allocate the rebuilt node if a setter ran, else
26328        /// `TransformResult::Unchanged`.
26329        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26330            if self.is_changed {
26331                TransformResult::Changed(self.build_forced(gc))
26332            } else {
26333                TransformResult::Unchanged
26334            }
26335        }
26336        /// Allocate the node unconditionally, changed or not.
26337        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26338            gc.alloc(Node::ImplicitCheckedCast(self.inner))
26339        }
26340        /// Set the `argument` field and mark the builder changed.
26341        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
26342    }
26343}