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    /// The `directive` string value as UTF-8, or `None` if it has no UTF-8
1764    /// form.
1765    ///
1766    /// A JS string value is a sequence of UTF-16 code units, so it may legally
1767    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
1768    /// error). That, and only that, is what `None` reports: the value is
1769    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
1770    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
1771    ///
1772    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
1773    /// *pair* is not: the lexer interns an astral character in surrogate-pair
1774    /// form, and it is folded back into the character it encodes, so a `"😀"`
1775    /// literal yields `Some("😀")`, not `None`.
1776    ///
1777    /// There is deliberately no plain `directive_str`: an unrepresentable
1778    /// identifier means something is broken, but an unrepresentable string
1779    /// literal is legal JS, and a codegen or refactoring tool that let U+FFFD
1780    /// be substituted here would silently rewrite the user's program. Reach for
1781    /// [`Self::directive_str_lossy`] only when a best-effort rendering is what
1782    /// you want.
1783    ///
1784    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
1785    /// folding a surrogate pair allocates once per atom, cached in the context.
1786    /// The returned `&str` borrows from `gc`, not from `self`.
1787    pub fn try_directive_str<'a>(
1788        &self,
1789        gc: &'a crate::context::GCLock<'_, '_>,
1790    ) -> Option<&'a str> {
1791        gc.try_bytes_str(self.directive.get())
1792    }
1793    /// The `directive` string value as UTF-8, substituting U+FFFD for anything
1794    /// unrepresentable.
1795    ///
1796    /// **This is lossy.** A JS string value may legally contain an unpaired
1797    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
1798    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
1799    /// refactoring tool would silently rewrite the user's program.
1800    ///
1801    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
1802    /// *pair* is not: the lexer interns an astral character in surrogate-pair
1803    /// form, and it is folded back into the character it encodes, so a `"😀"`
1804    /// literal comes out intact.
1805    ///
1806    /// Use [`Self::try_directive_str`] or
1807    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
1808    /// matters. The returned `&str` borrows from `gc`, not from `self`.
1809    pub fn directive_str_lossy<'a>(
1810        &self,
1811        gc: &'a crate::context::GCLock<'_, '_>,
1812    ) -> &'a str {
1813        gc.bytes_str_lossy(self.directive.get())
1814    }
1815}
1816
1817/// The `TryStatement` AST node.
1818#[derive(Debug)]
1819#[repr(C)]
1820pub struct TryStatement<'gc> {
1821    /// Source range, debug location, paren count, and node id.
1822    pub metadata: NodeMetadata<'gc>,
1823    /// ESTree `block` property.
1824    pub block: &'gc Node<'gc>,
1825    /// ESTree `handler` property.
1826    pub handler: Option<&'gc Node<'gc>>,
1827    /// ESTree `finalizer` property.
1828    pub finalizer: Option<&'gc Node<'gc>>,
1829}
1830impl<'gc> TryStatement<'gc> {
1831    /// Build `TryStatement` from its metadata and `ESTree.def` fields.
1832    pub fn new(
1833        metadata: NodeMetadata<'gc>,
1834        block: &'gc Node<'gc>,
1835        handler: Option<&'gc Node<'gc>>,
1836        finalizer: Option<&'gc Node<'gc>>,
1837    ) -> Self {
1838        TryStatement {
1839            metadata,
1840            block,
1841            handler,
1842            finalizer,
1843        }
1844    }
1845}
1846
1847/// The `IfStatement` AST node.
1848#[derive(Debug)]
1849#[repr(C)]
1850pub struct IfStatement<'gc> {
1851    /// Source range, debug location, paren count, and node id.
1852    pub metadata: NodeMetadata<'gc>,
1853    /// ESTree `test` property.
1854    pub test: &'gc Node<'gc>,
1855    /// ESTree `consequent` property.
1856    pub consequent: &'gc Node<'gc>,
1857    /// ESTree `alternate` property.
1858    pub alternate: Option<&'gc Node<'gc>>,
1859}
1860impl<'gc> IfStatement<'gc> {
1861    /// Build `IfStatement` from its metadata and `ESTree.def` fields.
1862    pub fn new(
1863        metadata: NodeMetadata<'gc>,
1864        test: &'gc Node<'gc>,
1865        consequent: &'gc Node<'gc>,
1866        alternate: Option<&'gc Node<'gc>>,
1867    ) -> Self {
1868        IfStatement {
1869            metadata,
1870            test,
1871            consequent,
1872            alternate,
1873        }
1874    }
1875}
1876
1877/// The `NullLiteral` AST node.
1878#[derive(Debug)]
1879#[repr(C)]
1880pub struct NullLiteral<'gc> {
1881    /// Source range, debug location, paren count, and node id.
1882    pub metadata: NodeMetadata<'gc>,
1883}
1884impl<'gc> NullLiteral<'gc> {
1885    /// Build `NullLiteral` from its metadata and `ESTree.def` fields.
1886    pub fn new(
1887        metadata: NodeMetadata<'gc>,
1888    ) -> Self {
1889        NullLiteral {
1890            metadata,
1891        }
1892    }
1893}
1894
1895/// The `BooleanLiteral` AST node.
1896#[derive(Debug)]
1897#[repr(C)]
1898pub struct BooleanLiteral<'gc> {
1899    /// Source range, debug location, paren count, and node id.
1900    pub metadata: NodeMetadata<'gc>,
1901    /// ESTree `value` property.
1902    pub value: Cell<bool>,
1903}
1904impl<'gc> BooleanLiteral<'gc> {
1905    /// Build `BooleanLiteral` from its metadata and `ESTree.def` fields.
1906    pub fn new(
1907        metadata: NodeMetadata<'gc>,
1908        value: bool,
1909    ) -> Self {
1910        BooleanLiteral {
1911            metadata,
1912            value: Cell::new(value),
1913        }
1914    }
1915}
1916
1917/// The `StringLiteral` AST node.
1918#[derive(Debug)]
1919#[repr(C)]
1920pub struct StringLiteral<'gc> {
1921    /// Source range, debug location, paren count, and node id.
1922    pub metadata: NodeMetadata<'gc>,
1923    /// ESTree `value` property.
1924    pub value: Cell<NodeString>,
1925}
1926impl<'gc> StringLiteral<'gc> {
1927    /// Build `StringLiteral` from its metadata and `ESTree.def` fields.
1928    pub fn new(
1929        metadata: NodeMetadata<'gc>,
1930        value: NodeString,
1931    ) -> Self {
1932        StringLiteral {
1933            metadata,
1934            value: Cell::new(value),
1935        }
1936    }
1937    /// The `value` string value as UTF-8, or `None` if it has no UTF-8 form.
1938    ///
1939    /// A JS string value is a sequence of UTF-16 code units, so it may legally
1940    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
1941    /// error). That, and only that, is what `None` reports: the value is
1942    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
1943    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
1944    ///
1945    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
1946    /// *pair* is not: the lexer interns an astral character in surrogate-pair
1947    /// form, and it is folded back into the character it encodes, so a `"😀"`
1948    /// literal yields `Some("😀")`, not `None`.
1949    ///
1950    /// There is deliberately no plain `value_str`: an unrepresentable
1951    /// identifier means something is broken, but an unrepresentable string
1952    /// literal is legal JS, and a codegen or refactoring tool that let U+FFFD
1953    /// be substituted here would silently rewrite the user's program. Reach for
1954    /// [`Self::value_str_lossy`] only when a best-effort rendering is what you
1955    /// want.
1956    ///
1957    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
1958    /// folding a surrogate pair allocates once per atom, cached in the context.
1959    /// The returned `&str` borrows from `gc`, not from `self`.
1960    pub fn try_value_str<'a>(
1961        &self,
1962        gc: &'a crate::context::GCLock<'_, '_>,
1963    ) -> Option<&'a str> {
1964        gc.try_bytes_str(self.value.get())
1965    }
1966    /// The `value` string value as UTF-8, substituting U+FFFD for anything
1967    /// unrepresentable.
1968    ///
1969    /// **This is lossy.** A JS string value may legally contain an unpaired
1970    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
1971    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
1972    /// refactoring tool would silently rewrite the user's program.
1973    ///
1974    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
1975    /// *pair* is not: the lexer interns an astral character in surrogate-pair
1976    /// form, and it is folded back into the character it encodes, so a `"😀"`
1977    /// literal comes out intact.
1978    ///
1979    /// Use [`Self::try_value_str`] or
1980    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
1981    /// matters. The returned `&str` borrows from `gc`, not from `self`.
1982    pub fn value_str_lossy<'a>(
1983        &self,
1984        gc: &'a crate::context::GCLock<'_, '_>,
1985    ) -> &'a str {
1986        gc.bytes_str_lossy(self.value.get())
1987    }
1988}
1989
1990/// The `NumericLiteral` AST node.
1991#[derive(Debug)]
1992#[repr(C)]
1993pub struct NumericLiteral<'gc> {
1994    /// Source range, debug location, paren count, and node id.
1995    pub metadata: NodeMetadata<'gc>,
1996    /// ESTree `value` property.
1997    pub value: Cell<f64>,
1998}
1999impl<'gc> NumericLiteral<'gc> {
2000    /// Build `NumericLiteral` from its metadata and `ESTree.def` fields.
2001    pub fn new(
2002        metadata: NodeMetadata<'gc>,
2003        value: f64,
2004    ) -> Self {
2005        NumericLiteral {
2006            metadata,
2007            value: Cell::new(value),
2008        }
2009    }
2010}
2011
2012/// The `RegExpLiteral` AST node.
2013#[derive(Debug)]
2014#[repr(C)]
2015pub struct RegExpLiteral<'gc> {
2016    /// Source range, debug location, paren count, and node id.
2017    pub metadata: NodeMetadata<'gc>,
2018    /// ESTree `pattern` property.
2019    pub pattern: Cell<NodeLabel>,
2020    /// ESTree `flags` property.
2021    pub flags: Cell<NodeLabel>,
2022}
2023impl<'gc> RegExpLiteral<'gc> {
2024    /// Build `RegExpLiteral` from its metadata and `ESTree.def` fields.
2025    pub fn new(
2026        metadata: NodeMetadata<'gc>,
2027        pattern: NodeLabel,
2028        flags: NodeLabel,
2029    ) -> Self {
2030        RegExpLiteral {
2031            metadata,
2032            pattern: Cell::new(pattern),
2033            flags: Cell::new(flags),
2034        }
2035    }
2036    /// The `pattern` label as UTF-8 text.
2037    ///
2038    /// Label fields hold identifier names, operators, keyword-like kinds and
2039    /// raw source spans. An identifier cannot contain an unpaired surrogate —
2040    /// the lexer rejects one with a dedicated diagnostic — and the remaining
2041    /// labels are literal source text, so in practice the bytes are already
2042    /// valid UTF-8 and this borrows them directly, allocating nothing.
2043    ///
2044    /// A label that is nevertheless unrepresentable, which realistically means
2045    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
2046    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
2047    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
2048    /// character it encodes, so a `"😀"` label comes out intact.
2049    ///
2050    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
2051    /// bytes, or
2052    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
2053    /// detect the substitution. The returned `&str` borrows from `gc`, not from
2054    /// `self`.
2055    pub fn pattern_str<'a>(
2056        &self,
2057        gc: &'a crate::context::GCLock<'_, '_>,
2058    ) -> &'a str {
2059        gc.bytes_str_lossy(self.pattern.get())
2060    }
2061    /// The `flags` label as UTF-8 text.
2062    ///
2063    /// Label fields hold identifier names, operators, keyword-like kinds and
2064    /// raw source spans. An identifier cannot contain an unpaired surrogate —
2065    /// the lexer rejects one with a dedicated diagnostic — and the remaining
2066    /// labels are literal source text, so in practice the bytes are already
2067    /// valid UTF-8 and this borrows them directly, allocating nothing.
2068    ///
2069    /// A label that is nevertheless unrepresentable, which realistically means
2070    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
2071    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
2072    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
2073    /// character it encodes, so a `"😀"` label comes out intact.
2074    ///
2075    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
2076    /// bytes, or
2077    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
2078    /// detect the substitution. The returned `&str` borrows from `gc`, not from
2079    /// `self`.
2080    pub fn flags_str<'a>(
2081        &self,
2082        gc: &'a crate::context::GCLock<'_, '_>,
2083    ) -> &'a str {
2084        gc.bytes_str_lossy(self.flags.get())
2085    }
2086}
2087
2088/// The `BigIntLiteral` AST node.
2089#[derive(Debug)]
2090#[repr(C)]
2091pub struct BigIntLiteral<'gc> {
2092    /// Source range, debug location, paren count, and node id.
2093    pub metadata: NodeMetadata<'gc>,
2094    /// ESTree `bigint` property.
2095    pub bigint: Cell<NodeLabel>,
2096}
2097impl<'gc> BigIntLiteral<'gc> {
2098    /// Build `BigIntLiteral` from its metadata and `ESTree.def` fields.
2099    pub fn new(
2100        metadata: NodeMetadata<'gc>,
2101        bigint: NodeLabel,
2102    ) -> Self {
2103        BigIntLiteral {
2104            metadata,
2105            bigint: Cell::new(bigint),
2106        }
2107    }
2108    /// The `bigint` label as UTF-8 text.
2109    ///
2110    /// Label fields hold identifier names, operators, keyword-like kinds and
2111    /// raw source spans. An identifier cannot contain an unpaired surrogate —
2112    /// the lexer rejects one with a dedicated diagnostic — and the remaining
2113    /// labels are literal source text, so in practice the bytes are already
2114    /// valid UTF-8 and this borrows them directly, allocating nothing.
2115    ///
2116    /// A label that is nevertheless unrepresentable, which realistically means
2117    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
2118    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
2119    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
2120    /// character it encodes, so a `"😀"` label comes out intact.
2121    ///
2122    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
2123    /// bytes, or
2124    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
2125    /// detect the substitution. The returned `&str` borrows from `gc`, not from
2126    /// `self`.
2127    pub fn bigint_str<'a>(
2128        &self,
2129        gc: &'a crate::context::GCLock<'_, '_>,
2130    ) -> &'a str {
2131        gc.bytes_str_lossy(self.bigint.get())
2132    }
2133}
2134
2135/// The `ThisExpression` AST node.
2136#[derive(Debug)]
2137#[repr(C)]
2138pub struct ThisExpression<'gc> {
2139    /// Source range, debug location, paren count, and node id.
2140    pub metadata: NodeMetadata<'gc>,
2141}
2142impl<'gc> ThisExpression<'gc> {
2143    /// Build `ThisExpression` from its metadata and `ESTree.def` fields.
2144    pub fn new(
2145        metadata: NodeMetadata<'gc>,
2146    ) -> Self {
2147        ThisExpression {
2148            metadata,
2149        }
2150    }
2151}
2152
2153/// The `Super` AST node.
2154#[derive(Debug)]
2155#[repr(C)]
2156pub struct Super<'gc> {
2157    /// Source range, debug location, paren count, and node id.
2158    pub metadata: NodeMetadata<'gc>,
2159}
2160impl<'gc> Super<'gc> {
2161    /// Build `Super` from its metadata and `ESTree.def` fields.
2162    pub fn new(
2163        metadata: NodeMetadata<'gc>,
2164    ) -> Self {
2165        Super {
2166            metadata,
2167        }
2168    }
2169}
2170
2171/// The `SequenceExpression` AST node.
2172#[derive(Debug)]
2173#[repr(C)]
2174pub struct SequenceExpression<'gc> {
2175    /// Source range, debug location, paren count, and node id.
2176    pub metadata: NodeMetadata<'gc>,
2177    /// ESTree `expressions` property.
2178    pub expressions: NodeList<'gc>,
2179}
2180impl<'gc> SequenceExpression<'gc> {
2181    /// Build `SequenceExpression` from its metadata and `ESTree.def` fields.
2182    pub fn new(
2183        metadata: NodeMetadata<'gc>,
2184        expressions: NodeList<'gc>,
2185    ) -> Self {
2186        SequenceExpression {
2187            metadata,
2188            expressions,
2189        }
2190    }
2191}
2192
2193/// The `ObjectExpression` AST node.
2194#[derive(Debug)]
2195#[repr(C)]
2196pub struct ObjectExpression<'gc> {
2197    /// Source range, debug location, paren count, and node id.
2198    pub metadata: NodeMetadata<'gc>,
2199    /// ESTree `properties` property.
2200    pub properties: NodeList<'gc>,
2201}
2202impl<'gc> ObjectExpression<'gc> {
2203    /// Build `ObjectExpression` from its metadata and `ESTree.def` fields.
2204    pub fn new(
2205        metadata: NodeMetadata<'gc>,
2206        properties: NodeList<'gc>,
2207    ) -> Self {
2208        ObjectExpression {
2209            metadata,
2210            properties,
2211        }
2212    }
2213}
2214
2215/// The `ArrayExpression` AST node.
2216#[derive(Debug)]
2217#[repr(C)]
2218pub struct ArrayExpression<'gc> {
2219    /// Source range, debug location, paren count, and node id.
2220    pub metadata: NodeMetadata<'gc>,
2221    /// ESTree `elements` property.
2222    pub elements: NodeList<'gc>,
2223    /// ESTree `trailingComma` property.
2224    pub trailing_comma: Cell<bool>,
2225}
2226impl<'gc> ArrayExpression<'gc> {
2227    /// Build `ArrayExpression` from its metadata and `ESTree.def` fields.
2228    pub fn new(
2229        metadata: NodeMetadata<'gc>,
2230        elements: NodeList<'gc>,
2231        trailing_comma: bool,
2232    ) -> Self {
2233        ArrayExpression {
2234            metadata,
2235            elements,
2236            trailing_comma: Cell::new(trailing_comma),
2237        }
2238    }
2239}
2240
2241/// The `SpreadElement` AST node.
2242#[derive(Debug)]
2243#[repr(C)]
2244pub struct SpreadElement<'gc> {
2245    /// Source range, debug location, paren count, and node id.
2246    pub metadata: NodeMetadata<'gc>,
2247    /// ESTree `argument` property.
2248    pub argument: &'gc Node<'gc>,
2249}
2250impl<'gc> SpreadElement<'gc> {
2251    /// Build `SpreadElement` from its metadata and `ESTree.def` fields.
2252    pub fn new(
2253        metadata: NodeMetadata<'gc>,
2254        argument: &'gc Node<'gc>,
2255    ) -> Self {
2256        SpreadElement {
2257            metadata,
2258            argument,
2259        }
2260    }
2261}
2262
2263/// The `NewExpression` AST node.
2264#[derive(Debug)]
2265#[repr(C)]
2266pub struct NewExpression<'gc> {
2267    /// Source range, debug location, paren count, and node id.
2268    pub metadata: NodeMetadata<'gc>,
2269    /// ESTree `callee` property.
2270    pub callee: &'gc Node<'gc>,
2271    /// ESTree `typeArguments` property.
2272    pub type_arguments: Option<&'gc Node<'gc>>,
2273    /// ESTree `arguments` property.
2274    pub arguments: NodeList<'gc>,
2275}
2276impl<'gc> NewExpression<'gc> {
2277    /// Build `NewExpression` from its metadata and `ESTree.def` fields.
2278    pub fn new(
2279        metadata: NodeMetadata<'gc>,
2280        callee: &'gc Node<'gc>,
2281        type_arguments: Option<&'gc Node<'gc>>,
2282        arguments: NodeList<'gc>,
2283    ) -> Self {
2284        NewExpression {
2285            metadata,
2286            callee,
2287            type_arguments,
2288            arguments,
2289        }
2290    }
2291}
2292
2293/// The `YieldExpression` AST node.
2294#[derive(Debug)]
2295#[repr(C)]
2296pub struct YieldExpression<'gc> {
2297    /// Source range, debug location, paren count, and node id.
2298    pub metadata: NodeMetadata<'gc>,
2299    /// ESTree `argument` property.
2300    pub argument: Option<&'gc Node<'gc>>,
2301    /// ESTree `delegate` property.
2302    pub delegate: Cell<bool>,
2303}
2304impl<'gc> YieldExpression<'gc> {
2305    /// Build `YieldExpression` from its metadata and `ESTree.def` fields.
2306    pub fn new(
2307        metadata: NodeMetadata<'gc>,
2308        argument: Option<&'gc Node<'gc>>,
2309        delegate: bool,
2310    ) -> Self {
2311        YieldExpression {
2312            metadata,
2313            argument,
2314            delegate: Cell::new(delegate),
2315        }
2316    }
2317}
2318
2319/// The `AwaitExpression` AST node.
2320#[derive(Debug)]
2321#[repr(C)]
2322pub struct AwaitExpression<'gc> {
2323    /// Source range, debug location, paren count, and node id.
2324    pub metadata: NodeMetadata<'gc>,
2325    /// ESTree `argument` property.
2326    pub argument: &'gc Node<'gc>,
2327}
2328impl<'gc> AwaitExpression<'gc> {
2329    /// Build `AwaitExpression` from its metadata and `ESTree.def` fields.
2330    pub fn new(
2331        metadata: NodeMetadata<'gc>,
2332        argument: &'gc Node<'gc>,
2333    ) -> Self {
2334        AwaitExpression {
2335            metadata,
2336            argument,
2337        }
2338    }
2339}
2340
2341/// The `ImportExpression` AST node.
2342#[derive(Debug)]
2343#[repr(C)]
2344pub struct ImportExpression<'gc> {
2345    /// Source range, debug location, paren count, and node id.
2346    pub metadata: NodeMetadata<'gc>,
2347    /// ESTree `source` property.
2348    pub source: &'gc Node<'gc>,
2349    /// ESTree `options` property.
2350    pub options: Option<&'gc Node<'gc>>,
2351}
2352impl<'gc> ImportExpression<'gc> {
2353    /// Build `ImportExpression` from its metadata and `ESTree.def` fields.
2354    pub fn new(
2355        metadata: NodeMetadata<'gc>,
2356        source: &'gc Node<'gc>,
2357        options: Option<&'gc Node<'gc>>,
2358    ) -> Self {
2359        ImportExpression {
2360            metadata,
2361            source,
2362            options,
2363        }
2364    }
2365}
2366
2367/// The `CallExpression` AST node.
2368#[derive(Debug)]
2369#[repr(C)]
2370pub struct CallExpression<'gc> {
2371    /// Source range, debug location, paren count, and node id.
2372    pub metadata: NodeMetadata<'gc>,
2373    /// ESTree `callee` property.
2374    pub callee: &'gc Node<'gc>,
2375    /// ESTree `typeArguments` property.
2376    pub type_arguments: Option<&'gc Node<'gc>>,
2377    /// ESTree `arguments` property.
2378    pub arguments: NodeList<'gc>,
2379}
2380impl<'gc> CallExpression<'gc> {
2381    /// Build `CallExpression` from its metadata and `ESTree.def` fields.
2382    pub fn new(
2383        metadata: NodeMetadata<'gc>,
2384        callee: &'gc Node<'gc>,
2385        type_arguments: Option<&'gc Node<'gc>>,
2386        arguments: NodeList<'gc>,
2387    ) -> Self {
2388        CallExpression {
2389            metadata,
2390            callee,
2391            type_arguments,
2392            arguments,
2393        }
2394    }
2395}
2396
2397/// The `OptionalCallExpression` AST node.
2398#[derive(Debug)]
2399#[repr(C)]
2400pub struct OptionalCallExpression<'gc> {
2401    /// Source range, debug location, paren count, and node id.
2402    pub metadata: NodeMetadata<'gc>,
2403    /// ESTree `callee` property.
2404    pub callee: &'gc Node<'gc>,
2405    /// ESTree `typeArguments` property.
2406    pub type_arguments: Option<&'gc Node<'gc>>,
2407    /// ESTree `arguments` property.
2408    pub arguments: NodeList<'gc>,
2409    /// ESTree `optional` property.
2410    pub optional: Cell<bool>,
2411}
2412impl<'gc> OptionalCallExpression<'gc> {
2413    /// Build `OptionalCallExpression` from its metadata and `ESTree.def`
2414    /// fields.
2415    pub fn new(
2416        metadata: NodeMetadata<'gc>,
2417        callee: &'gc Node<'gc>,
2418        type_arguments: Option<&'gc Node<'gc>>,
2419        arguments: NodeList<'gc>,
2420        optional: bool,
2421    ) -> Self {
2422        OptionalCallExpression {
2423            metadata,
2424            callee,
2425            type_arguments,
2426            arguments,
2427            optional: Cell::new(optional),
2428        }
2429    }
2430}
2431
2432/// The `AssignmentExpression` AST node.
2433#[derive(Debug)]
2434#[repr(C)]
2435pub struct AssignmentExpression<'gc> {
2436    /// Source range, debug location, paren count, and node id.
2437    pub metadata: NodeMetadata<'gc>,
2438    /// ESTree `operator` property.
2439    pub operator: Cell<NodeLabel>,
2440    /// ESTree `left` property.
2441    pub left: &'gc Node<'gc>,
2442    /// ESTree `right` property.
2443    pub right: &'gc Node<'gc>,
2444}
2445impl<'gc> AssignmentExpression<'gc> {
2446    /// Build `AssignmentExpression` from its metadata and `ESTree.def` fields.
2447    pub fn new(
2448        metadata: NodeMetadata<'gc>,
2449        operator: NodeLabel,
2450        left: &'gc Node<'gc>,
2451        right: &'gc Node<'gc>,
2452    ) -> Self {
2453        AssignmentExpression {
2454            metadata,
2455            operator: Cell::new(operator),
2456            left,
2457            right,
2458        }
2459    }
2460    /// The `operator` label as UTF-8 text.
2461    ///
2462    /// Label fields hold identifier names, operators, keyword-like kinds and
2463    /// raw source spans. An identifier cannot contain an unpaired surrogate —
2464    /// the lexer rejects one with a dedicated diagnostic — and the remaining
2465    /// labels are literal source text, so in practice the bytes are already
2466    /// valid UTF-8 and this borrows them directly, allocating nothing.
2467    ///
2468    /// A label that is nevertheless unrepresentable, which realistically means
2469    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
2470    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
2471    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
2472    /// character it encodes, so a `"😀"` label comes out intact.
2473    ///
2474    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
2475    /// bytes, or
2476    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
2477    /// detect the substitution. The returned `&str` borrows from `gc`, not from
2478    /// `self`.
2479    pub fn operator_str<'a>(
2480        &self,
2481        gc: &'a crate::context::GCLock<'_, '_>,
2482    ) -> &'a str {
2483        gc.bytes_str_lossy(self.operator.get())
2484    }
2485}
2486
2487/// The `UnaryExpression` AST node.
2488#[derive(Debug)]
2489#[repr(C)]
2490pub struct UnaryExpression<'gc> {
2491    /// Source range, debug location, paren count, and node id.
2492    pub metadata: NodeMetadata<'gc>,
2493    /// ESTree `operator` property.
2494    pub operator: Cell<NodeLabel>,
2495    /// ESTree `argument` property.
2496    pub argument: &'gc Node<'gc>,
2497    /// ESTree `prefix` property.
2498    pub prefix: Cell<bool>,
2499}
2500impl<'gc> UnaryExpression<'gc> {
2501    /// Build `UnaryExpression` from its metadata and `ESTree.def` fields.
2502    pub fn new(
2503        metadata: NodeMetadata<'gc>,
2504        operator: NodeLabel,
2505        argument: &'gc Node<'gc>,
2506        prefix: bool,
2507    ) -> Self {
2508        UnaryExpression {
2509            metadata,
2510            operator: Cell::new(operator),
2511            argument,
2512            prefix: Cell::new(prefix),
2513        }
2514    }
2515    /// The `operator` label as UTF-8 text.
2516    ///
2517    /// Label fields hold identifier names, operators, keyword-like kinds and
2518    /// raw source spans. An identifier cannot contain an unpaired surrogate —
2519    /// the lexer rejects one with a dedicated diagnostic — and the remaining
2520    /// labels are literal source text, so in practice the bytes are already
2521    /// valid UTF-8 and this borrows them directly, allocating nothing.
2522    ///
2523    /// A label that is nevertheless unrepresentable, which realistically means
2524    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
2525    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
2526    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
2527    /// character it encodes, so a `"😀"` label comes out intact.
2528    ///
2529    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
2530    /// bytes, or
2531    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
2532    /// detect the substitution. The returned `&str` borrows from `gc`, not from
2533    /// `self`.
2534    pub fn operator_str<'a>(
2535        &self,
2536        gc: &'a crate::context::GCLock<'_, '_>,
2537    ) -> &'a str {
2538        gc.bytes_str_lossy(self.operator.get())
2539    }
2540}
2541
2542/// The `UpdateExpression` AST node.
2543#[derive(Debug)]
2544#[repr(C)]
2545pub struct UpdateExpression<'gc> {
2546    /// Source range, debug location, paren count, and node id.
2547    pub metadata: NodeMetadata<'gc>,
2548    /// ESTree `operator` property.
2549    pub operator: Cell<NodeLabel>,
2550    /// ESTree `argument` property.
2551    pub argument: &'gc Node<'gc>,
2552    /// ESTree `prefix` property.
2553    pub prefix: Cell<bool>,
2554}
2555impl<'gc> UpdateExpression<'gc> {
2556    /// Build `UpdateExpression` from its metadata and `ESTree.def` fields.
2557    pub fn new(
2558        metadata: NodeMetadata<'gc>,
2559        operator: NodeLabel,
2560        argument: &'gc Node<'gc>,
2561        prefix: bool,
2562    ) -> Self {
2563        UpdateExpression {
2564            metadata,
2565            operator: Cell::new(operator),
2566            argument,
2567            prefix: Cell::new(prefix),
2568        }
2569    }
2570    /// The `operator` label as UTF-8 text.
2571    ///
2572    /// Label fields hold identifier names, operators, keyword-like kinds and
2573    /// raw source spans. An identifier cannot contain an unpaired surrogate —
2574    /// the lexer rejects one with a dedicated diagnostic — and the remaining
2575    /// labels are literal source text, so in practice the bytes are already
2576    /// valid UTF-8 and this borrows them directly, allocating nothing.
2577    ///
2578    /// A label that is nevertheless unrepresentable, which realistically means
2579    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
2580    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
2581    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
2582    /// character it encodes, so a `"😀"` label comes out intact.
2583    ///
2584    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
2585    /// bytes, or
2586    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
2587    /// detect the substitution. The returned `&str` borrows from `gc`, not from
2588    /// `self`.
2589    pub fn operator_str<'a>(
2590        &self,
2591        gc: &'a crate::context::GCLock<'_, '_>,
2592    ) -> &'a str {
2593        gc.bytes_str_lossy(self.operator.get())
2594    }
2595}
2596
2597/// The `MemberExpression` AST node.
2598#[derive(Debug)]
2599#[repr(C)]
2600pub struct MemberExpression<'gc> {
2601    /// Source range, debug location, paren count, and node id.
2602    pub metadata: NodeMetadata<'gc>,
2603    /// ESTree `object` property.
2604    pub object: &'gc Node<'gc>,
2605    /// ESTree `property` property.
2606    pub property: &'gc Node<'gc>,
2607    /// ESTree `computed` property.
2608    pub computed: Cell<bool>,
2609}
2610impl<'gc> MemberExpression<'gc> {
2611    /// Build `MemberExpression` from its metadata and `ESTree.def` fields.
2612    pub fn new(
2613        metadata: NodeMetadata<'gc>,
2614        object: &'gc Node<'gc>,
2615        property: &'gc Node<'gc>,
2616        computed: bool,
2617    ) -> Self {
2618        MemberExpression {
2619            metadata,
2620            object,
2621            property,
2622            computed: Cell::new(computed),
2623        }
2624    }
2625}
2626
2627/// The `OptionalMemberExpression` AST node.
2628#[derive(Debug)]
2629#[repr(C)]
2630pub struct OptionalMemberExpression<'gc> {
2631    /// Source range, debug location, paren count, and node id.
2632    pub metadata: NodeMetadata<'gc>,
2633    /// ESTree `object` property.
2634    pub object: &'gc Node<'gc>,
2635    /// ESTree `property` property.
2636    pub property: &'gc Node<'gc>,
2637    /// ESTree `computed` property.
2638    pub computed: Cell<bool>,
2639    /// ESTree `optional` property.
2640    pub optional: Cell<bool>,
2641}
2642impl<'gc> OptionalMemberExpression<'gc> {
2643    /// Build `OptionalMemberExpression` from its metadata and `ESTree.def`
2644    /// fields.
2645    pub fn new(
2646        metadata: NodeMetadata<'gc>,
2647        object: &'gc Node<'gc>,
2648        property: &'gc Node<'gc>,
2649        computed: bool,
2650        optional: bool,
2651    ) -> Self {
2652        OptionalMemberExpression {
2653            metadata,
2654            object,
2655            property,
2656            computed: Cell::new(computed),
2657            optional: Cell::new(optional),
2658        }
2659    }
2660}
2661
2662/// The `LogicalExpression` AST node.
2663#[derive(Debug)]
2664#[repr(C)]
2665pub struct LogicalExpression<'gc> {
2666    /// Source range, debug location, paren count, and node id.
2667    pub metadata: NodeMetadata<'gc>,
2668    /// ESTree `left` property.
2669    pub left: &'gc Node<'gc>,
2670    /// ESTree `right` property.
2671    pub right: &'gc Node<'gc>,
2672    /// ESTree `operator` property.
2673    pub operator: Cell<NodeLabel>,
2674}
2675impl<'gc> LogicalExpression<'gc> {
2676    /// Build `LogicalExpression` from its metadata and `ESTree.def` fields.
2677    pub fn new(
2678        metadata: NodeMetadata<'gc>,
2679        left: &'gc Node<'gc>,
2680        right: &'gc Node<'gc>,
2681        operator: NodeLabel,
2682    ) -> Self {
2683        LogicalExpression {
2684            metadata,
2685            left,
2686            right,
2687            operator: Cell::new(operator),
2688        }
2689    }
2690    /// The `operator` label as UTF-8 text.
2691    ///
2692    /// Label fields hold identifier names, operators, keyword-like kinds and
2693    /// raw source spans. An identifier cannot contain an unpaired surrogate —
2694    /// the lexer rejects one with a dedicated diagnostic — and the remaining
2695    /// labels are literal source text, so in practice the bytes are already
2696    /// valid UTF-8 and this borrows them directly, allocating nothing.
2697    ///
2698    /// A label that is nevertheless unrepresentable, which realistically means
2699    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
2700    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
2701    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
2702    /// character it encodes, so a `"😀"` label comes out intact.
2703    ///
2704    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
2705    /// bytes, or
2706    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
2707    /// detect the substitution. The returned `&str` borrows from `gc`, not from
2708    /// `self`.
2709    pub fn operator_str<'a>(
2710        &self,
2711        gc: &'a crate::context::GCLock<'_, '_>,
2712    ) -> &'a str {
2713        gc.bytes_str_lossy(self.operator.get())
2714    }
2715}
2716
2717/// The `ConditionalExpression` AST node.
2718#[derive(Debug)]
2719#[repr(C)]
2720pub struct ConditionalExpression<'gc> {
2721    /// Source range, debug location, paren count, and node id.
2722    pub metadata: NodeMetadata<'gc>,
2723    /// ESTree `test` property.
2724    pub test: &'gc Node<'gc>,
2725    /// ESTree `alternate` property.
2726    pub alternate: &'gc Node<'gc>,
2727    /// ESTree `consequent` property.
2728    pub consequent: &'gc Node<'gc>,
2729}
2730impl<'gc> ConditionalExpression<'gc> {
2731    /// Build `ConditionalExpression` from its metadata and `ESTree.def` fields.
2732    pub fn new(
2733        metadata: NodeMetadata<'gc>,
2734        test: &'gc Node<'gc>,
2735        alternate: &'gc Node<'gc>,
2736        consequent: &'gc Node<'gc>,
2737    ) -> Self {
2738        ConditionalExpression {
2739            metadata,
2740            test,
2741            alternate,
2742            consequent,
2743        }
2744    }
2745}
2746
2747/// The `BinaryExpression` AST node.
2748#[derive(Debug)]
2749#[repr(C)]
2750pub struct BinaryExpression<'gc> {
2751    /// Source range, debug location, paren count, and node id.
2752    pub metadata: NodeMetadata<'gc>,
2753    /// ESTree `left` property.
2754    pub left: &'gc Node<'gc>,
2755    /// ESTree `right` property.
2756    pub right: &'gc Node<'gc>,
2757    /// ESTree `operator` property.
2758    pub operator: Cell<NodeLabel>,
2759}
2760impl<'gc> BinaryExpression<'gc> {
2761    /// Build `BinaryExpression` from its metadata and `ESTree.def` fields.
2762    pub fn new(
2763        metadata: NodeMetadata<'gc>,
2764        left: &'gc Node<'gc>,
2765        right: &'gc Node<'gc>,
2766        operator: NodeLabel,
2767    ) -> Self {
2768        BinaryExpression {
2769            metadata,
2770            left,
2771            right,
2772            operator: Cell::new(operator),
2773        }
2774    }
2775    /// The `operator` label as UTF-8 text.
2776    ///
2777    /// Label fields hold identifier names, operators, keyword-like kinds and
2778    /// raw source spans. An identifier cannot contain an unpaired surrogate —
2779    /// the lexer rejects one with a dedicated diagnostic — and the remaining
2780    /// labels are literal source text, so in practice the bytes are already
2781    /// valid UTF-8 and this borrows them directly, allocating nothing.
2782    ///
2783    /// A label that is nevertheless unrepresentable, which realistically means
2784    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
2785    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
2786    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
2787    /// character it encodes, so a `"😀"` label comes out intact.
2788    ///
2789    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
2790    /// bytes, or
2791    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
2792    /// detect the substitution. The returned `&str` borrows from `gc`, not from
2793    /// `self`.
2794    pub fn operator_str<'a>(
2795        &self,
2796        gc: &'a crate::context::GCLock<'_, '_>,
2797    ) -> &'a str {
2798        gc.bytes_str_lossy(self.operator.get())
2799    }
2800}
2801
2802/// The `Directive` AST node.
2803#[derive(Debug)]
2804#[repr(C)]
2805pub struct Directive<'gc> {
2806    /// Source range, debug location, paren count, and node id.
2807    pub metadata: NodeMetadata<'gc>,
2808    /// ESTree `value` property.
2809    pub value: &'gc Node<'gc>,
2810}
2811impl<'gc> Directive<'gc> {
2812    /// Build `Directive` from its metadata and `ESTree.def` fields.
2813    pub fn new(
2814        metadata: NodeMetadata<'gc>,
2815        value: &'gc Node<'gc>,
2816    ) -> Self {
2817        Directive {
2818            metadata,
2819            value,
2820        }
2821    }
2822}
2823
2824/// The `DirectiveLiteral` AST node.
2825#[derive(Debug)]
2826#[repr(C)]
2827pub struct DirectiveLiteral<'gc> {
2828    /// Source range, debug location, paren count, and node id.
2829    pub metadata: NodeMetadata<'gc>,
2830    /// ESTree `value` property.
2831    pub value: Cell<NodeString>,
2832}
2833impl<'gc> DirectiveLiteral<'gc> {
2834    /// Build `DirectiveLiteral` from its metadata and `ESTree.def` fields.
2835    pub fn new(
2836        metadata: NodeMetadata<'gc>,
2837        value: NodeString,
2838    ) -> Self {
2839        DirectiveLiteral {
2840            metadata,
2841            value: Cell::new(value),
2842        }
2843    }
2844    /// The `value` string value as UTF-8, or `None` if it has no UTF-8 form.
2845    ///
2846    /// A JS string value is a sequence of UTF-16 code units, so it may legally
2847    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
2848    /// error). That, and only that, is what `None` reports: the value is
2849    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
2850    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
2851    ///
2852    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
2853    /// *pair* is not: the lexer interns an astral character in surrogate-pair
2854    /// form, and it is folded back into the character it encodes, so a `"😀"`
2855    /// literal yields `Some("😀")`, not `None`.
2856    ///
2857    /// There is deliberately no plain `value_str`: an unrepresentable
2858    /// identifier means something is broken, but an unrepresentable string
2859    /// literal is legal JS, and a codegen or refactoring tool that let U+FFFD
2860    /// be substituted here would silently rewrite the user's program. Reach for
2861    /// [`Self::value_str_lossy`] only when a best-effort rendering is what you
2862    /// want.
2863    ///
2864    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
2865    /// folding a surrogate pair allocates once per atom, cached in the context.
2866    /// The returned `&str` borrows from `gc`, not from `self`.
2867    pub fn try_value_str<'a>(
2868        &self,
2869        gc: &'a crate::context::GCLock<'_, '_>,
2870    ) -> Option<&'a str> {
2871        gc.try_bytes_str(self.value.get())
2872    }
2873    /// The `value` string value as UTF-8, substituting U+FFFD for anything
2874    /// unrepresentable.
2875    ///
2876    /// **This is lossy.** A JS string value may legally contain an unpaired
2877    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
2878    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
2879    /// refactoring tool would silently rewrite the user's program.
2880    ///
2881    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
2882    /// *pair* is not: the lexer interns an astral character in surrogate-pair
2883    /// form, and it is folded back into the character it encodes, so a `"😀"`
2884    /// literal comes out intact.
2885    ///
2886    /// Use [`Self::try_value_str`] or
2887    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
2888    /// matters. The returned `&str` borrows from `gc`, not from `self`.
2889    pub fn value_str_lossy<'a>(
2890        &self,
2891        gc: &'a crate::context::GCLock<'_, '_>,
2892    ) -> &'a str {
2893        gc.bytes_str_lossy(self.value.get())
2894    }
2895}
2896
2897/// The `Identifier` AST node.
2898#[derive(Debug)]
2899#[repr(C)]
2900pub struct Identifier<'gc> {
2901    /// Source range, debug location, paren count, and node id.
2902    pub metadata: NodeMetadata<'gc>,
2903    /// ESTree `name` property.
2904    pub name: Cell<NodeLabel>,
2905    /// ESTree `typeAnnotation` property.
2906    pub type_annotation: Option<&'gc Node<'gc>>,
2907    /// ESTree `optional` property.
2908    pub optional: Cell<bool>,
2909    /// Sema: unresolvable because of an enclosing `eval` or `with`.
2910    pub unresolvable: Cell<bool>,
2911    /// Sema: how to read `decl` — the `BitHave*` bits of `ESTree.h`'s
2912    /// `IdentifierDecoration`.
2913    pub decl_state: Cell<u8>,
2914    /// Sema: the declaration this identifier resolves to; `None` until a
2915    /// resolution is recorded.
2916    pub decl: Cell<Option<SemaId>>,
2917}
2918impl<'gc> Identifier<'gc> {
2919    /// Build `Identifier` from its metadata and `ESTree.def` fields.
2920    /// Decoration fields start at their defaults.
2921    pub fn new(
2922        metadata: NodeMetadata<'gc>,
2923        name: NodeLabel,
2924        type_annotation: Option<&'gc Node<'gc>>,
2925        optional: bool,
2926    ) -> Self {
2927        Identifier {
2928            metadata,
2929            name: Cell::new(name),
2930            type_annotation,
2931            optional: Cell::new(optional),
2932            unresolvable: Cell::new(false),
2933            decl_state: Cell::new(0),
2934            decl: Cell::new(None),
2935        }
2936    }
2937    /// The `name` label as UTF-8 text.
2938    ///
2939    /// Label fields hold identifier names, operators, keyword-like kinds and
2940    /// raw source spans. An identifier cannot contain an unpaired surrogate —
2941    /// the lexer rejects one with a dedicated diagnostic — and the remaining
2942    /// labels are literal source text, so in practice the bytes are already
2943    /// valid UTF-8 and this borrows them directly, allocating nothing.
2944    ///
2945    /// A label that is nevertheless unrepresentable, which realistically means
2946    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
2947    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
2948    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
2949    /// character it encodes, so a `"😀"` label comes out intact.
2950    ///
2951    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
2952    /// bytes, or
2953    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
2954    /// detect the substitution. The returned `&str` borrows from `gc`, not from
2955    /// `self`.
2956    pub fn name_str<'a>(
2957        &self,
2958        gc: &'a crate::context::GCLock<'_, '_>,
2959    ) -> &'a str {
2960        gc.bytes_str_lossy(self.name.get())
2961    }
2962}
2963
2964/// The `PrivateName` AST node.
2965#[derive(Debug)]
2966#[repr(C)]
2967pub struct PrivateName<'gc> {
2968    /// Source range, debug location, paren count, and node id.
2969    pub metadata: NodeMetadata<'gc>,
2970    /// ESTree `id` property.
2971    pub id: &'gc Node<'gc>,
2972}
2973impl<'gc> PrivateName<'gc> {
2974    /// Build `PrivateName` from its metadata and `ESTree.def` fields.
2975    pub fn new(
2976        metadata: NodeMetadata<'gc>,
2977        id: &'gc Node<'gc>,
2978    ) -> Self {
2979        PrivateName {
2980            metadata,
2981            id,
2982        }
2983    }
2984}
2985
2986/// The `MetaProperty` AST node.
2987#[derive(Debug)]
2988#[repr(C)]
2989pub struct MetaProperty<'gc> {
2990    /// Source range, debug location, paren count, and node id.
2991    pub metadata: NodeMetadata<'gc>,
2992    /// ESTree `meta` property.
2993    pub meta: &'gc Node<'gc>,
2994    /// ESTree `property` property.
2995    pub property: &'gc Node<'gc>,
2996}
2997impl<'gc> MetaProperty<'gc> {
2998    /// Build `MetaProperty` from its metadata and `ESTree.def` fields.
2999    pub fn new(
3000        metadata: NodeMetadata<'gc>,
3001        meta: &'gc Node<'gc>,
3002        property: &'gc Node<'gc>,
3003    ) -> Self {
3004        MetaProperty {
3005            metadata,
3006            meta,
3007            property,
3008        }
3009    }
3010}
3011
3012/// The `SwitchCase` AST node.
3013#[derive(Debug)]
3014#[repr(C)]
3015pub struct SwitchCase<'gc> {
3016    /// Source range, debug location, paren count, and node id.
3017    pub metadata: NodeMetadata<'gc>,
3018    /// ESTree `test` property.
3019    pub test: Option<&'gc Node<'gc>>,
3020    /// ESTree `consequent` property.
3021    pub consequent: NodeList<'gc>,
3022}
3023impl<'gc> SwitchCase<'gc> {
3024    /// Build `SwitchCase` from its metadata and `ESTree.def` fields.
3025    pub fn new(
3026        metadata: NodeMetadata<'gc>,
3027        test: Option<&'gc Node<'gc>>,
3028        consequent: NodeList<'gc>,
3029    ) -> Self {
3030        SwitchCase {
3031            metadata,
3032            test,
3033            consequent,
3034        }
3035    }
3036}
3037
3038/// The `CatchClause` AST node.
3039#[derive(Debug)]
3040#[repr(C)]
3041pub struct CatchClause<'gc> {
3042    /// Source range, debug location, paren count, and node id.
3043    pub metadata: NodeMetadata<'gc>,
3044    /// ESTree `param` property.
3045    pub param: Option<&'gc Node<'gc>>,
3046    /// ESTree `body` property.
3047    pub body: &'gc Node<'gc>,
3048    /// Sema: the lexical scope created by this node, if any.
3049    pub scope: Cell<Option<SemaId>>,
3050}
3051impl<'gc> CatchClause<'gc> {
3052    /// Build `CatchClause` from its metadata and `ESTree.def` fields.
3053    /// Decoration fields start at their defaults.
3054    pub fn new(
3055        metadata: NodeMetadata<'gc>,
3056        param: Option<&'gc Node<'gc>>,
3057        body: &'gc Node<'gc>,
3058    ) -> Self {
3059        CatchClause {
3060            metadata,
3061            param,
3062            body,
3063            scope: Cell::new(None),
3064        }
3065    }
3066}
3067
3068/// The `VariableDeclarator` AST node.
3069#[derive(Debug)]
3070#[repr(C)]
3071pub struct VariableDeclarator<'gc> {
3072    /// Source range, debug location, paren count, and node id.
3073    pub metadata: NodeMetadata<'gc>,
3074    /// ESTree `init` property.
3075    pub init: Option<&'gc Node<'gc>>,
3076    /// ESTree `id` property.
3077    pub id: &'gc Node<'gc>,
3078}
3079impl<'gc> VariableDeclarator<'gc> {
3080    /// Build `VariableDeclarator` from its metadata and `ESTree.def` fields.
3081    pub fn new(
3082        metadata: NodeMetadata<'gc>,
3083        init: Option<&'gc Node<'gc>>,
3084        id: &'gc Node<'gc>,
3085    ) -> Self {
3086        VariableDeclarator {
3087            metadata,
3088            init,
3089            id,
3090        }
3091    }
3092}
3093
3094/// The `VariableDeclaration` AST node.
3095#[derive(Debug)]
3096#[repr(C)]
3097pub struct VariableDeclaration<'gc> {
3098    /// Source range, debug location, paren count, and node id.
3099    pub metadata: NodeMetadata<'gc>,
3100    /// ESTree `kind` property.
3101    pub kind: Cell<NodeLabel>,
3102    /// ESTree `declarations` property.
3103    pub declarations: NodeList<'gc>,
3104}
3105impl<'gc> VariableDeclaration<'gc> {
3106    /// Build `VariableDeclaration` from its metadata and `ESTree.def` fields.
3107    pub fn new(
3108        metadata: NodeMetadata<'gc>,
3109        kind: NodeLabel,
3110        declarations: NodeList<'gc>,
3111    ) -> Self {
3112        VariableDeclaration {
3113            metadata,
3114            kind: Cell::new(kind),
3115            declarations,
3116        }
3117    }
3118    /// The `kind` label as UTF-8 text.
3119    ///
3120    /// Label fields hold identifier names, operators, keyword-like kinds and
3121    /// raw source spans. An identifier cannot contain an unpaired surrogate —
3122    /// the lexer rejects one with a dedicated diagnostic — and the remaining
3123    /// labels are literal source text, so in practice the bytes are already
3124    /// valid UTF-8 and this borrows them directly, allocating nothing.
3125    ///
3126    /// A label that is nevertheless unrepresentable, which realistically means
3127    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
3128    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
3129    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
3130    /// character it encodes, so a `"😀"` label comes out intact.
3131    ///
3132    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
3133    /// bytes, or
3134    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
3135    /// detect the substitution. The returned `&str` borrows from `gc`, not from
3136    /// `self`.
3137    pub fn kind_str<'a>(
3138        &self,
3139        gc: &'a crate::context::GCLock<'_, '_>,
3140    ) -> &'a str {
3141        gc.bytes_str_lossy(self.kind.get())
3142    }
3143}
3144
3145/// The `TemplateLiteral` AST node.
3146#[derive(Debug)]
3147#[repr(C)]
3148pub struct TemplateLiteral<'gc> {
3149    /// Source range, debug location, paren count, and node id.
3150    pub metadata: NodeMetadata<'gc>,
3151    /// ESTree `quasis` property.
3152    pub quasis: NodeList<'gc>,
3153    /// ESTree `expressions` property.
3154    pub expressions: NodeList<'gc>,
3155}
3156impl<'gc> TemplateLiteral<'gc> {
3157    /// Build `TemplateLiteral` from its metadata and `ESTree.def` fields.
3158    pub fn new(
3159        metadata: NodeMetadata<'gc>,
3160        quasis: NodeList<'gc>,
3161        expressions: NodeList<'gc>,
3162    ) -> Self {
3163        TemplateLiteral {
3164            metadata,
3165            quasis,
3166            expressions,
3167        }
3168    }
3169}
3170
3171/// The `TaggedTemplateExpression` AST node.
3172#[derive(Debug)]
3173#[repr(C)]
3174pub struct TaggedTemplateExpression<'gc> {
3175    /// Source range, debug location, paren count, and node id.
3176    pub metadata: NodeMetadata<'gc>,
3177    /// ESTree `tag` property.
3178    pub tag: &'gc Node<'gc>,
3179    /// ESTree `quasi` property.
3180    pub quasi: &'gc Node<'gc>,
3181}
3182impl<'gc> TaggedTemplateExpression<'gc> {
3183    /// Build `TaggedTemplateExpression` from its metadata and `ESTree.def`
3184    /// fields.
3185    pub fn new(
3186        metadata: NodeMetadata<'gc>,
3187        tag: &'gc Node<'gc>,
3188        quasi: &'gc Node<'gc>,
3189    ) -> Self {
3190        TaggedTemplateExpression {
3191            metadata,
3192            tag,
3193            quasi,
3194        }
3195    }
3196}
3197
3198/// The `TemplateElement` AST node.
3199#[derive(Debug)]
3200#[repr(C)]
3201pub struct TemplateElement<'gc> {
3202    /// Source range, debug location, paren count, and node id.
3203    pub metadata: NodeMetadata<'gc>,
3204    /// ESTree `tail` property.
3205    pub tail: Cell<bool>,
3206    /// ESTree `cooked` property.
3207    pub cooked: Cell<NodeString>,
3208    /// ESTree `raw` property.
3209    pub raw: Cell<NodeLabel>,
3210}
3211impl<'gc> TemplateElement<'gc> {
3212    /// Build `TemplateElement` from its metadata and `ESTree.def` fields.
3213    pub fn new(
3214        metadata: NodeMetadata<'gc>,
3215        tail: bool,
3216        cooked: NodeString,
3217        raw: NodeLabel,
3218    ) -> Self {
3219        TemplateElement {
3220            metadata,
3221            tail: Cell::new(tail),
3222            cooked: Cell::new(cooked),
3223            raw: Cell::new(raw),
3224        }
3225    }
3226    /// The `cooked` string value as UTF-8, or `None` if it has no UTF-8 form.
3227    ///
3228    /// A JS string value is a sequence of UTF-16 code units, so it may legally
3229    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
3230    /// error). That, and only that, is what `None` reports: the value is
3231    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
3232    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
3233    ///
3234    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
3235    /// *pair* is not: the lexer interns an astral character in surrogate-pair
3236    /// form, and it is folded back into the character it encodes, so a `"😀"`
3237    /// literal yields `Some("😀")`, not `None`.
3238    ///
3239    /// There is deliberately no plain `cooked_str`: an unrepresentable
3240    /// identifier means something is broken, but an unrepresentable string
3241    /// literal is legal JS, and a codegen or refactoring tool that let U+FFFD
3242    /// be substituted here would silently rewrite the user's program. Reach for
3243    /// [`Self::cooked_str_lossy`] only when a best-effort rendering is what you
3244    /// want.
3245    ///
3246    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
3247    /// folding a surrogate pair allocates once per atom, cached in the context.
3248    /// The returned `&str` borrows from `gc`, not from `self`.
3249    pub fn try_cooked_str<'a>(
3250        &self,
3251        gc: &'a crate::context::GCLock<'_, '_>,
3252    ) -> Option<&'a str> {
3253        gc.try_bytes_str(self.cooked.get())
3254    }
3255    /// The `cooked` string value as UTF-8, substituting U+FFFD for anything
3256    /// unrepresentable.
3257    ///
3258    /// **This is lossy.** A JS string value may legally contain an unpaired
3259    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
3260    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
3261    /// refactoring tool would silently rewrite the user's program.
3262    ///
3263    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
3264    /// *pair* is not: the lexer interns an astral character in surrogate-pair
3265    /// form, and it is folded back into the character it encodes, so a `"😀"`
3266    /// literal comes out intact.
3267    ///
3268    /// Use [`Self::try_cooked_str`] or
3269    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
3270    /// matters. The returned `&str` borrows from `gc`, not from `self`.
3271    pub fn cooked_str_lossy<'a>(
3272        &self,
3273        gc: &'a crate::context::GCLock<'_, '_>,
3274    ) -> &'a str {
3275        gc.bytes_str_lossy(self.cooked.get())
3276    }
3277    /// The `raw` label as UTF-8 text.
3278    ///
3279    /// Label fields hold identifier names, operators, keyword-like kinds and
3280    /// raw source spans. An identifier cannot contain an unpaired surrogate —
3281    /// the lexer rejects one with a dedicated diagnostic — and the remaining
3282    /// labels are literal source text, so in practice the bytes are already
3283    /// valid UTF-8 and this borrows them directly, allocating nothing.
3284    ///
3285    /// A label that is nevertheless unrepresentable, which realistically means
3286    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
3287    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
3288    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
3289    /// character it encodes, so a `"😀"` label comes out intact.
3290    ///
3291    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
3292    /// bytes, or
3293    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
3294    /// detect the substitution. The returned `&str` borrows from `gc`, not from
3295    /// `self`.
3296    pub fn raw_str<'a>(
3297        &self,
3298        gc: &'a crate::context::GCLock<'_, '_>,
3299    ) -> &'a str {
3300        gc.bytes_str_lossy(self.raw.get())
3301    }
3302}
3303
3304/// The `Property` AST node.
3305#[derive(Debug)]
3306#[repr(C)]
3307pub struct Property<'gc> {
3308    /// Source range, debug location, paren count, and node id.
3309    pub metadata: NodeMetadata<'gc>,
3310    /// ESTree `key` property.
3311    pub key: &'gc Node<'gc>,
3312    /// ESTree `value` property.
3313    pub value: &'gc Node<'gc>,
3314    /// ESTree `kind` property.
3315    pub kind: Cell<NodeLabel>,
3316    /// ESTree `computed` property.
3317    pub computed: Cell<bool>,
3318    /// ESTree `method` property.
3319    pub method: Cell<bool>,
3320    /// ESTree `shorthand` property.
3321    pub shorthand: Cell<bool>,
3322}
3323impl<'gc> Property<'gc> {
3324    /// Build `Property` from its metadata and `ESTree.def` fields.
3325    pub fn new(
3326        metadata: NodeMetadata<'gc>,
3327        key: &'gc Node<'gc>,
3328        value: &'gc Node<'gc>,
3329        kind: NodeLabel,
3330        computed: bool,
3331        method: bool,
3332        shorthand: bool,
3333    ) -> Self {
3334        Property {
3335            metadata,
3336            key,
3337            value,
3338            kind: Cell::new(kind),
3339            computed: Cell::new(computed),
3340            method: Cell::new(method),
3341            shorthand: Cell::new(shorthand),
3342        }
3343    }
3344    /// The `kind` label as UTF-8 text.
3345    ///
3346    /// Label fields hold identifier names, operators, keyword-like kinds and
3347    /// raw source spans. An identifier cannot contain an unpaired surrogate —
3348    /// the lexer rejects one with a dedicated diagnostic — and the remaining
3349    /// labels are literal source text, so in practice the bytes are already
3350    /// valid UTF-8 and this borrows them directly, allocating nothing.
3351    ///
3352    /// A label that is nevertheless unrepresentable, which realistically means
3353    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
3354    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
3355    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
3356    /// character it encodes, so a `"😀"` label comes out intact.
3357    ///
3358    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
3359    /// bytes, or
3360    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
3361    /// detect the substitution. The returned `&str` borrows from `gc`, not from
3362    /// `self`.
3363    pub fn kind_str<'a>(
3364        &self,
3365        gc: &'a crate::context::GCLock<'_, '_>,
3366    ) -> &'a str {
3367        gc.bytes_str_lossy(self.kind.get())
3368    }
3369}
3370
3371/// The `Decorator` AST node.
3372#[derive(Debug)]
3373#[repr(C)]
3374pub struct Decorator<'gc> {
3375    /// Source range, debug location, paren count, and node id.
3376    pub metadata: NodeMetadata<'gc>,
3377    /// ESTree `expression` property.
3378    pub expression: &'gc Node<'gc>,
3379}
3380impl<'gc> Decorator<'gc> {
3381    /// Build `Decorator` from its metadata and `ESTree.def` fields.
3382    pub fn new(
3383        metadata: NodeMetadata<'gc>,
3384        expression: &'gc Node<'gc>,
3385    ) -> Self {
3386        Decorator {
3387            metadata,
3388            expression,
3389        }
3390    }
3391}
3392
3393/// The `ClassDeclaration` AST node.
3394#[derive(Debug)]
3395#[repr(C)]
3396pub struct ClassDeclaration<'gc> {
3397    /// Source range, debug location, paren count, and node id.
3398    pub metadata: NodeMetadata<'gc>,
3399    /// ESTree `id` property.
3400    pub id: Option<&'gc Node<'gc>>,
3401    /// ESTree `typeParameters` property.
3402    pub type_parameters: Option<&'gc Node<'gc>>,
3403    /// ESTree `superClass` property.
3404    pub super_class: Option<&'gc Node<'gc>>,
3405    /// ESTree `superTypeArguments` property.
3406    pub super_type_arguments: Option<&'gc Node<'gc>>,
3407    /// ESTree `implements` property.
3408    pub implements: NodeList<'gc>,
3409    /// ESTree `decorators` property.
3410    pub decorators: NodeList<'gc>,
3411    /// ESTree `body` property.
3412    pub body: &'gc Node<'gc>,
3413    /// Sema: the lexical scope created by this node, if any.
3414    pub scope: Cell<Option<SemaId>>,
3415    /// Sema: `FunctionInfo` of the synthetic implicit constructor, if the
3416    /// class has one.
3417    pub implicit_ctor_function_info: Cell<Option<SemaId>>,
3418    /// Sema: `FunctionInfo` of the synthetic function that initializes the
3419    /// instance elements, if the class needs one.
3420    pub instance_elements_init_function_info: Cell<Option<SemaId>>,
3421    /// Sema: `FunctionInfo` of the synthetic function that runs the static
3422    /// field initializers, if the class has any.
3423    pub static_elements_init_function_info: Cell<Option<SemaId>>,
3424}
3425impl<'gc> ClassDeclaration<'gc> {
3426    /// Build `ClassDeclaration` from its metadata and `ESTree.def` fields.
3427    /// Decoration fields start at their defaults.
3428    pub fn new(
3429        metadata: NodeMetadata<'gc>,
3430        id: Option<&'gc Node<'gc>>,
3431        type_parameters: Option<&'gc Node<'gc>>,
3432        super_class: Option<&'gc Node<'gc>>,
3433        super_type_arguments: Option<&'gc Node<'gc>>,
3434        implements: NodeList<'gc>,
3435        decorators: NodeList<'gc>,
3436        body: &'gc Node<'gc>,
3437    ) -> Self {
3438        ClassDeclaration {
3439            metadata,
3440            id,
3441            type_parameters,
3442            super_class,
3443            super_type_arguments,
3444            implements,
3445            decorators,
3446            body,
3447            scope: Cell::new(None),
3448            implicit_ctor_function_info: Cell::new(None),
3449            instance_elements_init_function_info: Cell::new(None),
3450            static_elements_init_function_info: Cell::new(None),
3451        }
3452    }
3453}
3454
3455/// The `ClassExpression` AST node.
3456#[derive(Debug)]
3457#[repr(C)]
3458pub struct ClassExpression<'gc> {
3459    /// Source range, debug location, paren count, and node id.
3460    pub metadata: NodeMetadata<'gc>,
3461    /// ESTree `id` property.
3462    pub id: Option<&'gc Node<'gc>>,
3463    /// ESTree `typeParameters` property.
3464    pub type_parameters: Option<&'gc Node<'gc>>,
3465    /// ESTree `superClass` property.
3466    pub super_class: Option<&'gc Node<'gc>>,
3467    /// ESTree `superTypeArguments` property.
3468    pub super_type_arguments: Option<&'gc Node<'gc>>,
3469    /// ESTree `implements` property.
3470    pub implements: NodeList<'gc>,
3471    /// ESTree `decorators` property.
3472    pub decorators: NodeList<'gc>,
3473    /// ESTree `body` property.
3474    pub body: &'gc Node<'gc>,
3475    /// Sema: the lexical scope created by this node, if any.
3476    pub scope: Cell<Option<SemaId>>,
3477    /// Sema: `FunctionInfo` of the synthetic implicit constructor, if the
3478    /// class has one.
3479    pub implicit_ctor_function_info: Cell<Option<SemaId>>,
3480    /// Sema: `FunctionInfo` of the synthetic function that initializes the
3481    /// instance elements, if the class needs one.
3482    pub instance_elements_init_function_info: Cell<Option<SemaId>>,
3483    /// Sema: `FunctionInfo` of the synthetic function that runs the static
3484    /// field initializers, if the class has any.
3485    pub static_elements_init_function_info: Cell<Option<SemaId>>,
3486}
3487impl<'gc> ClassExpression<'gc> {
3488    /// Build `ClassExpression` from its metadata and `ESTree.def` fields.
3489    /// Decoration fields start at their defaults.
3490    pub fn new(
3491        metadata: NodeMetadata<'gc>,
3492        id: Option<&'gc Node<'gc>>,
3493        type_parameters: Option<&'gc Node<'gc>>,
3494        super_class: Option<&'gc Node<'gc>>,
3495        super_type_arguments: Option<&'gc Node<'gc>>,
3496        implements: NodeList<'gc>,
3497        decorators: NodeList<'gc>,
3498        body: &'gc Node<'gc>,
3499    ) -> Self {
3500        ClassExpression {
3501            metadata,
3502            id,
3503            type_parameters,
3504            super_class,
3505            super_type_arguments,
3506            implements,
3507            decorators,
3508            body,
3509            scope: Cell::new(None),
3510            implicit_ctor_function_info: Cell::new(None),
3511            instance_elements_init_function_info: Cell::new(None),
3512            static_elements_init_function_info: Cell::new(None),
3513        }
3514    }
3515}
3516
3517/// The `ClassBody` AST node.
3518#[derive(Debug)]
3519#[repr(C)]
3520pub struct ClassBody<'gc> {
3521    /// Source range, debug location, paren count, and node id.
3522    pub metadata: NodeMetadata<'gc>,
3523    /// ESTree `body` property.
3524    pub body: NodeList<'gc>,
3525}
3526impl<'gc> ClassBody<'gc> {
3527    /// Build `ClassBody` from its metadata and `ESTree.def` fields.
3528    pub fn new(
3529        metadata: NodeMetadata<'gc>,
3530        body: NodeList<'gc>,
3531    ) -> Self {
3532        ClassBody {
3533            metadata,
3534            body,
3535        }
3536    }
3537}
3538
3539/// The `ClassProperty` AST node.
3540#[derive(Debug)]
3541#[repr(C)]
3542pub struct ClassProperty<'gc> {
3543    /// Source range, debug location, paren count, and node id.
3544    pub metadata: NodeMetadata<'gc>,
3545    /// ESTree `key` property.
3546    pub key: &'gc Node<'gc>,
3547    /// ESTree `value` property.
3548    pub value: Option<&'gc Node<'gc>>,
3549    /// ESTree `computed` property.
3550    pub computed: Cell<bool>,
3551    /// ESTree `static` property.
3552    pub r#static: Cell<bool>,
3553    /// ESTree `decorators` property.
3554    pub decorators: NodeList<'gc>,
3555    /// ESTree `declare` property.
3556    pub declare: Cell<bool>,
3557    /// ESTree `optional` property.
3558    pub optional: Cell<bool>,
3559    /// ESTree `variance` property.
3560    pub variance: Option<&'gc Node<'gc>>,
3561    /// ESTree `typeAnnotation` property.
3562    pub type_annotation: Option<&'gc Node<'gc>>,
3563    /// ESTree `tsModifiers` property.
3564    pub ts_modifiers: Option<&'gc Node<'gc>>,
3565}
3566impl<'gc> ClassProperty<'gc> {
3567    /// Build `ClassProperty` from its metadata and `ESTree.def` fields.
3568    pub fn new(
3569        metadata: NodeMetadata<'gc>,
3570        key: &'gc Node<'gc>,
3571        value: Option<&'gc Node<'gc>>,
3572        computed: bool,
3573        r#static: bool,
3574        decorators: NodeList<'gc>,
3575        declare: bool,
3576        optional: bool,
3577        variance: Option<&'gc Node<'gc>>,
3578        type_annotation: Option<&'gc Node<'gc>>,
3579        ts_modifiers: Option<&'gc Node<'gc>>,
3580    ) -> Self {
3581        ClassProperty {
3582            metadata,
3583            key,
3584            value,
3585            computed: Cell::new(computed),
3586            r#static: Cell::new(r#static),
3587            decorators,
3588            declare: Cell::new(declare),
3589            optional: Cell::new(optional),
3590            variance,
3591            type_annotation,
3592            ts_modifiers,
3593        }
3594    }
3595}
3596
3597/// The `ClassPrivateProperty` AST node.
3598#[derive(Debug)]
3599#[repr(C)]
3600pub struct ClassPrivateProperty<'gc> {
3601    /// Source range, debug location, paren count, and node id.
3602    pub metadata: NodeMetadata<'gc>,
3603    /// ESTree `key` property.
3604    pub key: &'gc Node<'gc>,
3605    /// ESTree `value` property.
3606    pub value: Option<&'gc Node<'gc>>,
3607    /// ESTree `static` property.
3608    pub r#static: Cell<bool>,
3609    /// ESTree `decorators` property.
3610    pub decorators: NodeList<'gc>,
3611    /// ESTree `declare` property.
3612    pub declare: Cell<bool>,
3613    /// ESTree `optional` property.
3614    pub optional: Cell<bool>,
3615    /// ESTree `variance` property.
3616    pub variance: Option<&'gc Node<'gc>>,
3617    /// ESTree `typeAnnotation` property.
3618    pub type_annotation: Option<&'gc Node<'gc>>,
3619    /// ESTree `tsModifiers` property.
3620    pub ts_modifiers: Option<&'gc Node<'gc>>,
3621}
3622impl<'gc> ClassPrivateProperty<'gc> {
3623    /// Build `ClassPrivateProperty` from its metadata and `ESTree.def` fields.
3624    pub fn new(
3625        metadata: NodeMetadata<'gc>,
3626        key: &'gc Node<'gc>,
3627        value: Option<&'gc Node<'gc>>,
3628        r#static: bool,
3629        decorators: NodeList<'gc>,
3630        declare: bool,
3631        optional: bool,
3632        variance: Option<&'gc Node<'gc>>,
3633        type_annotation: Option<&'gc Node<'gc>>,
3634        ts_modifiers: Option<&'gc Node<'gc>>,
3635    ) -> Self {
3636        ClassPrivateProperty {
3637            metadata,
3638            key,
3639            value,
3640            r#static: Cell::new(r#static),
3641            decorators,
3642            declare: Cell::new(declare),
3643            optional: Cell::new(optional),
3644            variance,
3645            type_annotation,
3646            ts_modifiers,
3647        }
3648    }
3649}
3650
3651/// The `MethodDefinition` AST node.
3652#[derive(Debug)]
3653#[repr(C)]
3654pub struct MethodDefinition<'gc> {
3655    /// Source range, debug location, paren count, and node id.
3656    pub metadata: NodeMetadata<'gc>,
3657    /// ESTree `key` property.
3658    pub key: &'gc Node<'gc>,
3659    /// ESTree `value` property.
3660    pub value: &'gc Node<'gc>,
3661    /// ESTree `kind` property.
3662    pub kind: Cell<NodeLabel>,
3663    /// ESTree `computed` property.
3664    pub computed: Cell<bool>,
3665    /// ESTree `static` property.
3666    pub r#static: Cell<bool>,
3667    /// ESTree `decorators` property.
3668    pub decorators: NodeList<'gc>,
3669}
3670impl<'gc> MethodDefinition<'gc> {
3671    /// Build `MethodDefinition` from its metadata and `ESTree.def` fields.
3672    pub fn new(
3673        metadata: NodeMetadata<'gc>,
3674        key: &'gc Node<'gc>,
3675        value: &'gc Node<'gc>,
3676        kind: NodeLabel,
3677        computed: bool,
3678        r#static: bool,
3679        decorators: NodeList<'gc>,
3680    ) -> Self {
3681        MethodDefinition {
3682            metadata,
3683            key,
3684            value,
3685            kind: Cell::new(kind),
3686            computed: Cell::new(computed),
3687            r#static: Cell::new(r#static),
3688            decorators,
3689        }
3690    }
3691    /// The `kind` label as UTF-8 text.
3692    ///
3693    /// Label fields hold identifier names, operators, keyword-like kinds and
3694    /// raw source spans. An identifier cannot contain an unpaired surrogate —
3695    /// the lexer rejects one with a dedicated diagnostic — and the remaining
3696    /// labels are literal source text, so in practice the bytes are already
3697    /// valid UTF-8 and this borrows them directly, allocating nothing.
3698    ///
3699    /// A label that is nevertheless unrepresentable, which realistically means
3700    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
3701    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
3702    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
3703    /// character it encodes, so a `"😀"` label comes out intact.
3704    ///
3705    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
3706    /// bytes, or
3707    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
3708    /// detect the substitution. The returned `&str` borrows from `gc`, not from
3709    /// `self`.
3710    pub fn kind_str<'a>(
3711        &self,
3712        gc: &'a crate::context::GCLock<'_, '_>,
3713    ) -> &'a str {
3714        gc.bytes_str_lossy(self.kind.get())
3715    }
3716}
3717
3718/// The `ImportDeclaration` AST node.
3719#[derive(Debug)]
3720#[repr(C)]
3721pub struct ImportDeclaration<'gc> {
3722    /// Source range, debug location, paren count, and node id.
3723    pub metadata: NodeMetadata<'gc>,
3724    /// ESTree `specifiers` property.
3725    pub specifiers: NodeList<'gc>,
3726    /// ESTree `source` property.
3727    pub source: &'gc Node<'gc>,
3728    /// ESTree `attributes` property.
3729    pub attributes: NodeList<'gc>,
3730    /// ESTree `importKind` property.
3731    pub import_kind: Cell<NodeLabel>,
3732}
3733impl<'gc> ImportDeclaration<'gc> {
3734    /// Build `ImportDeclaration` from its metadata and `ESTree.def` fields.
3735    pub fn new(
3736        metadata: NodeMetadata<'gc>,
3737        specifiers: NodeList<'gc>,
3738        source: &'gc Node<'gc>,
3739        attributes: NodeList<'gc>,
3740        import_kind: NodeLabel,
3741    ) -> Self {
3742        ImportDeclaration {
3743            metadata,
3744            specifiers,
3745            source,
3746            attributes,
3747            import_kind: Cell::new(import_kind),
3748        }
3749    }
3750    /// The `importKind` label as UTF-8 text.
3751    ///
3752    /// Label fields hold identifier names, operators, keyword-like kinds and
3753    /// raw source spans. An identifier cannot contain an unpaired surrogate —
3754    /// the lexer rejects one with a dedicated diagnostic — and the remaining
3755    /// labels are literal source text, so in practice the bytes are already
3756    /// valid UTF-8 and this borrows them directly, allocating nothing.
3757    ///
3758    /// A label that is nevertheless unrepresentable, which realistically means
3759    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
3760    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
3761    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
3762    /// character it encodes, so a `"😀"` label comes out intact.
3763    ///
3764    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
3765    /// bytes, or
3766    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
3767    /// detect the substitution. The returned `&str` borrows from `gc`, not from
3768    /// `self`.
3769    pub fn import_kind_str<'a>(
3770        &self,
3771        gc: &'a crate::context::GCLock<'_, '_>,
3772    ) -> &'a str {
3773        gc.bytes_str_lossy(self.import_kind.get())
3774    }
3775}
3776
3777/// The `ImportSpecifier` AST node.
3778#[derive(Debug)]
3779#[repr(C)]
3780pub struct ImportSpecifier<'gc> {
3781    /// Source range, debug location, paren count, and node id.
3782    pub metadata: NodeMetadata<'gc>,
3783    /// ESTree `imported` property.
3784    pub imported: &'gc Node<'gc>,
3785    /// ESTree `local` property.
3786    pub local: &'gc Node<'gc>,
3787    /// ESTree `importKind` property.
3788    pub import_kind: Cell<NodeLabel>,
3789}
3790impl<'gc> ImportSpecifier<'gc> {
3791    /// Build `ImportSpecifier` from its metadata and `ESTree.def` fields.
3792    pub fn new(
3793        metadata: NodeMetadata<'gc>,
3794        imported: &'gc Node<'gc>,
3795        local: &'gc Node<'gc>,
3796        import_kind: NodeLabel,
3797    ) -> Self {
3798        ImportSpecifier {
3799            metadata,
3800            imported,
3801            local,
3802            import_kind: Cell::new(import_kind),
3803        }
3804    }
3805    /// The `importKind` label as UTF-8 text.
3806    ///
3807    /// Label fields hold identifier names, operators, keyword-like kinds and
3808    /// raw source spans. An identifier cannot contain an unpaired surrogate —
3809    /// the lexer rejects one with a dedicated diagnostic — and the remaining
3810    /// labels are literal source text, so in practice the bytes are already
3811    /// valid UTF-8 and this borrows them directly, allocating nothing.
3812    ///
3813    /// A label that is nevertheless unrepresentable, which realistically means
3814    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
3815    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
3816    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
3817    /// character it encodes, so a `"😀"` label comes out intact.
3818    ///
3819    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
3820    /// bytes, or
3821    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
3822    /// detect the substitution. The returned `&str` borrows from `gc`, not from
3823    /// `self`.
3824    pub fn import_kind_str<'a>(
3825        &self,
3826        gc: &'a crate::context::GCLock<'_, '_>,
3827    ) -> &'a str {
3828        gc.bytes_str_lossy(self.import_kind.get())
3829    }
3830}
3831
3832/// The `ImportDefaultSpecifier` AST node.
3833#[derive(Debug)]
3834#[repr(C)]
3835pub struct ImportDefaultSpecifier<'gc> {
3836    /// Source range, debug location, paren count, and node id.
3837    pub metadata: NodeMetadata<'gc>,
3838    /// ESTree `local` property.
3839    pub local: &'gc Node<'gc>,
3840}
3841impl<'gc> ImportDefaultSpecifier<'gc> {
3842    /// Build `ImportDefaultSpecifier` from its metadata and `ESTree.def`
3843    /// fields.
3844    pub fn new(
3845        metadata: NodeMetadata<'gc>,
3846        local: &'gc Node<'gc>,
3847    ) -> Self {
3848        ImportDefaultSpecifier {
3849            metadata,
3850            local,
3851        }
3852    }
3853}
3854
3855/// The `ImportNamespaceSpecifier` AST node.
3856#[derive(Debug)]
3857#[repr(C)]
3858pub struct ImportNamespaceSpecifier<'gc> {
3859    /// Source range, debug location, paren count, and node id.
3860    pub metadata: NodeMetadata<'gc>,
3861    /// ESTree `local` property.
3862    pub local: &'gc Node<'gc>,
3863}
3864impl<'gc> ImportNamespaceSpecifier<'gc> {
3865    /// Build `ImportNamespaceSpecifier` from its metadata and `ESTree.def`
3866    /// fields.
3867    pub fn new(
3868        metadata: NodeMetadata<'gc>,
3869        local: &'gc Node<'gc>,
3870    ) -> Self {
3871        ImportNamespaceSpecifier {
3872            metadata,
3873            local,
3874        }
3875    }
3876}
3877
3878/// The `ImportAttribute` AST node.
3879#[derive(Debug)]
3880#[repr(C)]
3881pub struct ImportAttribute<'gc> {
3882    /// Source range, debug location, paren count, and node id.
3883    pub metadata: NodeMetadata<'gc>,
3884    /// ESTree `key` property.
3885    pub key: &'gc Node<'gc>,
3886    /// ESTree `value` property.
3887    pub value: &'gc Node<'gc>,
3888}
3889impl<'gc> ImportAttribute<'gc> {
3890    /// Build `ImportAttribute` from its metadata and `ESTree.def` fields.
3891    pub fn new(
3892        metadata: NodeMetadata<'gc>,
3893        key: &'gc Node<'gc>,
3894        value: &'gc Node<'gc>,
3895    ) -> Self {
3896        ImportAttribute {
3897            metadata,
3898            key,
3899            value,
3900        }
3901    }
3902}
3903
3904/// The `ExportNamedDeclaration` AST node.
3905#[derive(Debug)]
3906#[repr(C)]
3907pub struct ExportNamedDeclaration<'gc> {
3908    /// Source range, debug location, paren count, and node id.
3909    pub metadata: NodeMetadata<'gc>,
3910    /// ESTree `declaration` property.
3911    pub declaration: Option<&'gc Node<'gc>>,
3912    /// ESTree `specifiers` property.
3913    pub specifiers: NodeList<'gc>,
3914    /// ESTree `source` property.
3915    pub source: Option<&'gc Node<'gc>>,
3916    /// ESTree `exportKind` property.
3917    pub export_kind: Cell<NodeLabel>,
3918}
3919impl<'gc> ExportNamedDeclaration<'gc> {
3920    /// Build `ExportNamedDeclaration` from its metadata and `ESTree.def`
3921    /// fields.
3922    pub fn new(
3923        metadata: NodeMetadata<'gc>,
3924        declaration: Option<&'gc Node<'gc>>,
3925        specifiers: NodeList<'gc>,
3926        source: Option<&'gc Node<'gc>>,
3927        export_kind: NodeLabel,
3928    ) -> Self {
3929        ExportNamedDeclaration {
3930            metadata,
3931            declaration,
3932            specifiers,
3933            source,
3934            export_kind: Cell::new(export_kind),
3935        }
3936    }
3937    /// The `exportKind` label as UTF-8 text.
3938    ///
3939    /// Label fields hold identifier names, operators, keyword-like kinds and
3940    /// raw source spans. An identifier cannot contain an unpaired surrogate —
3941    /// the lexer rejects one with a dedicated diagnostic — and the remaining
3942    /// labels are literal source text, so in practice the bytes are already
3943    /// valid UTF-8 and this borrows them directly, allocating nothing.
3944    ///
3945    /// A label that is nevertheless unrepresentable, which realistically means
3946    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
3947    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
3948    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
3949    /// character it encodes, so a `"😀"` label comes out intact.
3950    ///
3951    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
3952    /// bytes, or
3953    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
3954    /// detect the substitution. The returned `&str` borrows from `gc`, not from
3955    /// `self`.
3956    pub fn export_kind_str<'a>(
3957        &self,
3958        gc: &'a crate::context::GCLock<'_, '_>,
3959    ) -> &'a str {
3960        gc.bytes_str_lossy(self.export_kind.get())
3961    }
3962}
3963
3964/// The `ExportSpecifier` AST node.
3965#[derive(Debug)]
3966#[repr(C)]
3967pub struct ExportSpecifier<'gc> {
3968    /// Source range, debug location, paren count, and node id.
3969    pub metadata: NodeMetadata<'gc>,
3970    /// ESTree `exported` property.
3971    pub exported: &'gc Node<'gc>,
3972    /// ESTree `local` property.
3973    pub local: &'gc Node<'gc>,
3974}
3975impl<'gc> ExportSpecifier<'gc> {
3976    /// Build `ExportSpecifier` from its metadata and `ESTree.def` fields.
3977    pub fn new(
3978        metadata: NodeMetadata<'gc>,
3979        exported: &'gc Node<'gc>,
3980        local: &'gc Node<'gc>,
3981    ) -> Self {
3982        ExportSpecifier {
3983            metadata,
3984            exported,
3985            local,
3986        }
3987    }
3988}
3989
3990/// The `ExportNamespaceSpecifier` AST node.
3991#[derive(Debug)]
3992#[repr(C)]
3993pub struct ExportNamespaceSpecifier<'gc> {
3994    /// Source range, debug location, paren count, and node id.
3995    pub metadata: NodeMetadata<'gc>,
3996    /// ESTree `exported` property.
3997    pub exported: &'gc Node<'gc>,
3998}
3999impl<'gc> ExportNamespaceSpecifier<'gc> {
4000    /// Build `ExportNamespaceSpecifier` from its metadata and `ESTree.def`
4001    /// fields.
4002    pub fn new(
4003        metadata: NodeMetadata<'gc>,
4004        exported: &'gc Node<'gc>,
4005    ) -> Self {
4006        ExportNamespaceSpecifier {
4007            metadata,
4008            exported,
4009        }
4010    }
4011}
4012
4013/// The `ExportDefaultDeclaration` AST node.
4014#[derive(Debug)]
4015#[repr(C)]
4016pub struct ExportDefaultDeclaration<'gc> {
4017    /// Source range, debug location, paren count, and node id.
4018    pub metadata: NodeMetadata<'gc>,
4019    /// ESTree `declaration` property.
4020    pub declaration: &'gc Node<'gc>,
4021}
4022impl<'gc> ExportDefaultDeclaration<'gc> {
4023    /// Build `ExportDefaultDeclaration` from its metadata and `ESTree.def`
4024    /// fields.
4025    pub fn new(
4026        metadata: NodeMetadata<'gc>,
4027        declaration: &'gc Node<'gc>,
4028    ) -> Self {
4029        ExportDefaultDeclaration {
4030            metadata,
4031            declaration,
4032        }
4033    }
4034}
4035
4036/// The `ExportAllDeclaration` AST node.
4037#[derive(Debug)]
4038#[repr(C)]
4039pub struct ExportAllDeclaration<'gc> {
4040    /// Source range, debug location, paren count, and node id.
4041    pub metadata: NodeMetadata<'gc>,
4042    /// ESTree `source` property.
4043    pub source: &'gc Node<'gc>,
4044    /// ESTree `exportKind` property.
4045    pub export_kind: Cell<NodeLabel>,
4046}
4047impl<'gc> ExportAllDeclaration<'gc> {
4048    /// Build `ExportAllDeclaration` from its metadata and `ESTree.def` fields.
4049    pub fn new(
4050        metadata: NodeMetadata<'gc>,
4051        source: &'gc Node<'gc>,
4052        export_kind: NodeLabel,
4053    ) -> Self {
4054        ExportAllDeclaration {
4055            metadata,
4056            source,
4057            export_kind: Cell::new(export_kind),
4058        }
4059    }
4060    /// The `exportKind` label as UTF-8 text.
4061    ///
4062    /// Label fields hold identifier names, operators, keyword-like kinds and
4063    /// raw source spans. An identifier cannot contain an unpaired surrogate —
4064    /// the lexer rejects one with a dedicated diagnostic — and the remaining
4065    /// labels are literal source text, so in practice the bytes are already
4066    /// valid UTF-8 and this borrows them directly, allocating nothing.
4067    ///
4068    /// A label that is nevertheless unrepresentable, which realistically means
4069    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
4070    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
4071    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
4072    /// character it encodes, so a `"😀"` label comes out intact.
4073    ///
4074    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
4075    /// bytes, or
4076    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
4077    /// detect the substitution. The returned `&str` borrows from `gc`, not from
4078    /// `self`.
4079    pub fn export_kind_str<'a>(
4080        &self,
4081        gc: &'a crate::context::GCLock<'_, '_>,
4082    ) -> &'a str {
4083        gc.bytes_str_lossy(self.export_kind.get())
4084    }
4085}
4086
4087/// The `ObjectPattern` AST node.
4088#[derive(Debug)]
4089#[repr(C)]
4090pub struct ObjectPattern<'gc> {
4091    /// Source range, debug location, paren count, and node id.
4092    pub metadata: NodeMetadata<'gc>,
4093    /// ESTree `properties` property.
4094    pub properties: NodeList<'gc>,
4095    /// ESTree `typeAnnotation` property.
4096    pub type_annotation: Option<&'gc Node<'gc>>,
4097}
4098impl<'gc> ObjectPattern<'gc> {
4099    /// Build `ObjectPattern` from its metadata and `ESTree.def` fields.
4100    pub fn new(
4101        metadata: NodeMetadata<'gc>,
4102        properties: NodeList<'gc>,
4103        type_annotation: Option<&'gc Node<'gc>>,
4104    ) -> Self {
4105        ObjectPattern {
4106            metadata,
4107            properties,
4108            type_annotation,
4109        }
4110    }
4111}
4112
4113/// The `ArrayPattern` AST node.
4114#[derive(Debug)]
4115#[repr(C)]
4116pub struct ArrayPattern<'gc> {
4117    /// Source range, debug location, paren count, and node id.
4118    pub metadata: NodeMetadata<'gc>,
4119    /// ESTree `elements` property.
4120    pub elements: NodeList<'gc>,
4121    /// ESTree `typeAnnotation` property.
4122    pub type_annotation: Option<&'gc Node<'gc>>,
4123}
4124impl<'gc> ArrayPattern<'gc> {
4125    /// Build `ArrayPattern` from its metadata and `ESTree.def` fields.
4126    pub fn new(
4127        metadata: NodeMetadata<'gc>,
4128        elements: NodeList<'gc>,
4129        type_annotation: Option<&'gc Node<'gc>>,
4130    ) -> Self {
4131        ArrayPattern {
4132            metadata,
4133            elements,
4134            type_annotation,
4135        }
4136    }
4137}
4138
4139/// The `RestElement` AST node.
4140#[derive(Debug)]
4141#[repr(C)]
4142pub struct RestElement<'gc> {
4143    /// Source range, debug location, paren count, and node id.
4144    pub metadata: NodeMetadata<'gc>,
4145    /// ESTree `argument` property.
4146    pub argument: &'gc Node<'gc>,
4147}
4148impl<'gc> RestElement<'gc> {
4149    /// Build `RestElement` from its metadata and `ESTree.def` fields.
4150    pub fn new(
4151        metadata: NodeMetadata<'gc>,
4152        argument: &'gc Node<'gc>,
4153    ) -> Self {
4154        RestElement {
4155            metadata,
4156            argument,
4157        }
4158    }
4159}
4160
4161/// The `AssignmentPattern` AST node.
4162#[derive(Debug)]
4163#[repr(C)]
4164pub struct AssignmentPattern<'gc> {
4165    /// Source range, debug location, paren count, and node id.
4166    pub metadata: NodeMetadata<'gc>,
4167    /// ESTree `left` property.
4168    pub left: &'gc Node<'gc>,
4169    /// ESTree `right` property.
4170    pub right: &'gc Node<'gc>,
4171}
4172impl<'gc> AssignmentPattern<'gc> {
4173    /// Build `AssignmentPattern` from its metadata and `ESTree.def` fields.
4174    pub fn new(
4175        metadata: NodeMetadata<'gc>,
4176        left: &'gc Node<'gc>,
4177        right: &'gc Node<'gc>,
4178    ) -> Self {
4179        AssignmentPattern {
4180            metadata,
4181            left,
4182            right,
4183        }
4184    }
4185}
4186
4187/// The `MatchStatementCase` AST node.
4188#[derive(Debug)]
4189#[repr(C)]
4190pub struct MatchStatementCase<'gc> {
4191    /// Source range, debug location, paren count, and node id.
4192    pub metadata: NodeMetadata<'gc>,
4193    /// ESTree `pattern` property.
4194    pub pattern: &'gc Node<'gc>,
4195    /// ESTree `body` property.
4196    pub body: &'gc Node<'gc>,
4197    /// ESTree `guard` property.
4198    pub guard: Option<&'gc Node<'gc>>,
4199}
4200impl<'gc> MatchStatementCase<'gc> {
4201    /// Build `MatchStatementCase` from its metadata and `ESTree.def` fields.
4202    pub fn new(
4203        metadata: NodeMetadata<'gc>,
4204        pattern: &'gc Node<'gc>,
4205        body: &'gc Node<'gc>,
4206        guard: Option<&'gc Node<'gc>>,
4207    ) -> Self {
4208        MatchStatementCase {
4209            metadata,
4210            pattern,
4211            body,
4212            guard,
4213        }
4214    }
4215}
4216
4217/// The `MatchExpression` AST node.
4218#[derive(Debug)]
4219#[repr(C)]
4220pub struct MatchExpression<'gc> {
4221    /// Source range, debug location, paren count, and node id.
4222    pub metadata: NodeMetadata<'gc>,
4223    /// ESTree `argument` property.
4224    pub argument: &'gc Node<'gc>,
4225    /// ESTree `cases` property.
4226    pub cases: NodeList<'gc>,
4227}
4228impl<'gc> MatchExpression<'gc> {
4229    /// Build `MatchExpression` from its metadata and `ESTree.def` fields.
4230    pub fn new(
4231        metadata: NodeMetadata<'gc>,
4232        argument: &'gc Node<'gc>,
4233        cases: NodeList<'gc>,
4234    ) -> Self {
4235        MatchExpression {
4236            metadata,
4237            argument,
4238            cases,
4239        }
4240    }
4241}
4242
4243/// The `MatchExpressionCase` AST node.
4244#[derive(Debug)]
4245#[repr(C)]
4246pub struct MatchExpressionCase<'gc> {
4247    /// Source range, debug location, paren count, and node id.
4248    pub metadata: NodeMetadata<'gc>,
4249    /// ESTree `pattern` property.
4250    pub pattern: &'gc Node<'gc>,
4251    /// ESTree `body` property.
4252    pub body: &'gc Node<'gc>,
4253    /// ESTree `guard` property.
4254    pub guard: Option<&'gc Node<'gc>>,
4255}
4256impl<'gc> MatchExpressionCase<'gc> {
4257    /// Build `MatchExpressionCase` from its metadata and `ESTree.def` fields.
4258    pub fn new(
4259        metadata: NodeMetadata<'gc>,
4260        pattern: &'gc Node<'gc>,
4261        body: &'gc Node<'gc>,
4262        guard: Option<&'gc Node<'gc>>,
4263    ) -> Self {
4264        MatchExpressionCase {
4265            metadata,
4266            pattern,
4267            body,
4268            guard,
4269        }
4270    }
4271}
4272
4273/// The `MatchWildcardPattern` AST node.
4274#[derive(Debug)]
4275#[repr(C)]
4276pub struct MatchWildcardPattern<'gc> {
4277    /// Source range, debug location, paren count, and node id.
4278    pub metadata: NodeMetadata<'gc>,
4279}
4280impl<'gc> MatchWildcardPattern<'gc> {
4281    /// Build `MatchWildcardPattern` from its metadata and `ESTree.def` fields.
4282    pub fn new(
4283        metadata: NodeMetadata<'gc>,
4284    ) -> Self {
4285        MatchWildcardPattern {
4286            metadata,
4287        }
4288    }
4289}
4290
4291/// The `MatchLiteralPattern` AST node.
4292#[derive(Debug)]
4293#[repr(C)]
4294pub struct MatchLiteralPattern<'gc> {
4295    /// Source range, debug location, paren count, and node id.
4296    pub metadata: NodeMetadata<'gc>,
4297    /// ESTree `literal` property.
4298    pub literal: &'gc Node<'gc>,
4299}
4300impl<'gc> MatchLiteralPattern<'gc> {
4301    /// Build `MatchLiteralPattern` from its metadata and `ESTree.def` fields.
4302    pub fn new(
4303        metadata: NodeMetadata<'gc>,
4304        literal: &'gc Node<'gc>,
4305    ) -> Self {
4306        MatchLiteralPattern {
4307            metadata,
4308            literal,
4309        }
4310    }
4311}
4312
4313/// The `MatchUnaryPattern` AST node.
4314#[derive(Debug)]
4315#[repr(C)]
4316pub struct MatchUnaryPattern<'gc> {
4317    /// Source range, debug location, paren count, and node id.
4318    pub metadata: NodeMetadata<'gc>,
4319    /// ESTree `argument` property.
4320    pub argument: &'gc Node<'gc>,
4321    /// ESTree `operator` property.
4322    pub operator: Cell<NodeLabel>,
4323}
4324impl<'gc> MatchUnaryPattern<'gc> {
4325    /// Build `MatchUnaryPattern` from its metadata and `ESTree.def` fields.
4326    pub fn new(
4327        metadata: NodeMetadata<'gc>,
4328        argument: &'gc Node<'gc>,
4329        operator: NodeLabel,
4330    ) -> Self {
4331        MatchUnaryPattern {
4332            metadata,
4333            argument,
4334            operator: Cell::new(operator),
4335        }
4336    }
4337    /// The `operator` label as UTF-8 text.
4338    ///
4339    /// Label fields hold identifier names, operators, keyword-like kinds and
4340    /// raw source spans. An identifier cannot contain an unpaired surrogate —
4341    /// the lexer rejects one with a dedicated diagnostic — and the remaining
4342    /// labels are literal source text, so in practice the bytes are already
4343    /// valid UTF-8 and this borrows them directly, allocating nothing.
4344    ///
4345    /// A label that is nevertheless unrepresentable, which realistically means
4346    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
4347    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
4348    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
4349    /// character it encodes, so a `"😀"` label comes out intact.
4350    ///
4351    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
4352    /// bytes, or
4353    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
4354    /// detect the substitution. The returned `&str` borrows from `gc`, not from
4355    /// `self`.
4356    pub fn operator_str<'a>(
4357        &self,
4358        gc: &'a crate::context::GCLock<'_, '_>,
4359    ) -> &'a str {
4360        gc.bytes_str_lossy(self.operator.get())
4361    }
4362}
4363
4364/// The `MatchIdentifierPattern` AST node.
4365#[derive(Debug)]
4366#[repr(C)]
4367pub struct MatchIdentifierPattern<'gc> {
4368    /// Source range, debug location, paren count, and node id.
4369    pub metadata: NodeMetadata<'gc>,
4370    /// ESTree `id` property.
4371    pub id: &'gc Node<'gc>,
4372}
4373impl<'gc> MatchIdentifierPattern<'gc> {
4374    /// Build `MatchIdentifierPattern` from its metadata and `ESTree.def`
4375    /// fields.
4376    pub fn new(
4377        metadata: NodeMetadata<'gc>,
4378        id: &'gc Node<'gc>,
4379    ) -> Self {
4380        MatchIdentifierPattern {
4381            metadata,
4382            id,
4383        }
4384    }
4385}
4386
4387/// The `MatchBindingPattern` AST node.
4388#[derive(Debug)]
4389#[repr(C)]
4390pub struct MatchBindingPattern<'gc> {
4391    /// Source range, debug location, paren count, and node id.
4392    pub metadata: NodeMetadata<'gc>,
4393    /// ESTree `id` property.
4394    pub id: &'gc Node<'gc>,
4395    /// ESTree `kind` property.
4396    pub kind: Cell<NodeLabel>,
4397}
4398impl<'gc> MatchBindingPattern<'gc> {
4399    /// Build `MatchBindingPattern` from its metadata and `ESTree.def` fields.
4400    pub fn new(
4401        metadata: NodeMetadata<'gc>,
4402        id: &'gc Node<'gc>,
4403        kind: NodeLabel,
4404    ) -> Self {
4405        MatchBindingPattern {
4406            metadata,
4407            id,
4408            kind: Cell::new(kind),
4409        }
4410    }
4411    /// The `kind` label as UTF-8 text.
4412    ///
4413    /// Label fields hold identifier names, operators, keyword-like kinds and
4414    /// raw source spans. An identifier cannot contain an unpaired surrogate —
4415    /// the lexer rejects one with a dedicated diagnostic — and the remaining
4416    /// labels are literal source text, so in practice the bytes are already
4417    /// valid UTF-8 and this borrows them directly, allocating nothing.
4418    ///
4419    /// A label that is nevertheless unrepresentable, which realistically means
4420    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
4421    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
4422    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
4423    /// character it encodes, so a `"😀"` label comes out intact.
4424    ///
4425    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
4426    /// bytes, or
4427    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
4428    /// detect the substitution. The returned `&str` borrows from `gc`, not from
4429    /// `self`.
4430    pub fn kind_str<'a>(
4431        &self,
4432        gc: &'a crate::context::GCLock<'_, '_>,
4433    ) -> &'a str {
4434        gc.bytes_str_lossy(self.kind.get())
4435    }
4436}
4437
4438/// The `MatchObjectPattern` AST node.
4439#[derive(Debug)]
4440#[repr(C)]
4441pub struct MatchObjectPattern<'gc> {
4442    /// Source range, debug location, paren count, and node id.
4443    pub metadata: NodeMetadata<'gc>,
4444    /// ESTree `properties` property.
4445    pub properties: NodeList<'gc>,
4446    /// ESTree `rest` property.
4447    pub rest: Option<&'gc Node<'gc>>,
4448}
4449impl<'gc> MatchObjectPattern<'gc> {
4450    /// Build `MatchObjectPattern` from its metadata and `ESTree.def` fields.
4451    pub fn new(
4452        metadata: NodeMetadata<'gc>,
4453        properties: NodeList<'gc>,
4454        rest: Option<&'gc Node<'gc>>,
4455    ) -> Self {
4456        MatchObjectPattern {
4457            metadata,
4458            properties,
4459            rest,
4460        }
4461    }
4462}
4463
4464/// The `MatchArrayPattern` AST node.
4465#[derive(Debug)]
4466#[repr(C)]
4467pub struct MatchArrayPattern<'gc> {
4468    /// Source range, debug location, paren count, and node id.
4469    pub metadata: NodeMetadata<'gc>,
4470    /// ESTree `elements` property.
4471    pub elements: NodeList<'gc>,
4472    /// ESTree `rest` property.
4473    pub rest: Option<&'gc Node<'gc>>,
4474}
4475impl<'gc> MatchArrayPattern<'gc> {
4476    /// Build `MatchArrayPattern` from its metadata and `ESTree.def` fields.
4477    pub fn new(
4478        metadata: NodeMetadata<'gc>,
4479        elements: NodeList<'gc>,
4480        rest: Option<&'gc Node<'gc>>,
4481    ) -> Self {
4482        MatchArrayPattern {
4483            metadata,
4484            elements,
4485            rest,
4486        }
4487    }
4488}
4489
4490/// The `MatchOrPattern` AST node.
4491#[derive(Debug)]
4492#[repr(C)]
4493pub struct MatchOrPattern<'gc> {
4494    /// Source range, debug location, paren count, and node id.
4495    pub metadata: NodeMetadata<'gc>,
4496    /// ESTree `patterns` property.
4497    pub patterns: NodeList<'gc>,
4498}
4499impl<'gc> MatchOrPattern<'gc> {
4500    /// Build `MatchOrPattern` from its metadata and `ESTree.def` fields.
4501    pub fn new(
4502        metadata: NodeMetadata<'gc>,
4503        patterns: NodeList<'gc>,
4504    ) -> Self {
4505        MatchOrPattern {
4506            metadata,
4507            patterns,
4508        }
4509    }
4510}
4511
4512/// The `MatchAsPattern` AST node.
4513#[derive(Debug)]
4514#[repr(C)]
4515pub struct MatchAsPattern<'gc> {
4516    /// Source range, debug location, paren count, and node id.
4517    pub metadata: NodeMetadata<'gc>,
4518    /// ESTree `pattern` property.
4519    pub pattern: &'gc Node<'gc>,
4520    /// ESTree `target` property.
4521    pub target: &'gc Node<'gc>,
4522}
4523impl<'gc> MatchAsPattern<'gc> {
4524    /// Build `MatchAsPattern` from its metadata and `ESTree.def` fields.
4525    pub fn new(
4526        metadata: NodeMetadata<'gc>,
4527        pattern: &'gc Node<'gc>,
4528        target: &'gc Node<'gc>,
4529    ) -> Self {
4530        MatchAsPattern {
4531            metadata,
4532            pattern,
4533            target,
4534        }
4535    }
4536}
4537
4538/// The `MatchMemberPattern` AST node.
4539#[derive(Debug)]
4540#[repr(C)]
4541pub struct MatchMemberPattern<'gc> {
4542    /// Source range, debug location, paren count, and node id.
4543    pub metadata: NodeMetadata<'gc>,
4544    /// ESTree `base` property.
4545    pub base: &'gc Node<'gc>,
4546    /// ESTree `property` property.
4547    pub property: &'gc Node<'gc>,
4548}
4549impl<'gc> MatchMemberPattern<'gc> {
4550    /// Build `MatchMemberPattern` from its metadata and `ESTree.def` fields.
4551    pub fn new(
4552        metadata: NodeMetadata<'gc>,
4553        base: &'gc Node<'gc>,
4554        property: &'gc Node<'gc>,
4555    ) -> Self {
4556        MatchMemberPattern {
4557            metadata,
4558            base,
4559            property,
4560        }
4561    }
4562}
4563
4564/// The `MatchInstancePattern` AST node.
4565#[derive(Debug)]
4566#[repr(C)]
4567pub struct MatchInstancePattern<'gc> {
4568    /// Source range, debug location, paren count, and node id.
4569    pub metadata: NodeMetadata<'gc>,
4570    /// ESTree `targetConstructor` property.
4571    pub target_constructor: &'gc Node<'gc>,
4572    /// ESTree `properties` property.
4573    pub properties: &'gc Node<'gc>,
4574}
4575impl<'gc> MatchInstancePattern<'gc> {
4576    /// Build `MatchInstancePattern` from its metadata and `ESTree.def` fields.
4577    pub fn new(
4578        metadata: NodeMetadata<'gc>,
4579        target_constructor: &'gc Node<'gc>,
4580        properties: &'gc Node<'gc>,
4581    ) -> Self {
4582        MatchInstancePattern {
4583            metadata,
4584            target_constructor,
4585            properties,
4586        }
4587    }
4588}
4589
4590/// The `MatchObjectPatternProperty` AST node.
4591#[derive(Debug)]
4592#[repr(C)]
4593pub struct MatchObjectPatternProperty<'gc> {
4594    /// Source range, debug location, paren count, and node id.
4595    pub metadata: NodeMetadata<'gc>,
4596    /// ESTree `key` property.
4597    pub key: &'gc Node<'gc>,
4598    /// ESTree `pattern` property.
4599    pub pattern: &'gc Node<'gc>,
4600    /// ESTree `shorthand` property.
4601    pub shorthand: Cell<bool>,
4602}
4603impl<'gc> MatchObjectPatternProperty<'gc> {
4604    /// Build `MatchObjectPatternProperty` from its metadata and `ESTree.def`
4605    /// fields.
4606    pub fn new(
4607        metadata: NodeMetadata<'gc>,
4608        key: &'gc Node<'gc>,
4609        pattern: &'gc Node<'gc>,
4610        shorthand: bool,
4611    ) -> Self {
4612        MatchObjectPatternProperty {
4613            metadata,
4614            key,
4615            pattern,
4616            shorthand: Cell::new(shorthand),
4617        }
4618    }
4619}
4620
4621/// The `MatchInstanceObjectPattern` AST node.
4622#[derive(Debug)]
4623#[repr(C)]
4624pub struct MatchInstanceObjectPattern<'gc> {
4625    /// Source range, debug location, paren count, and node id.
4626    pub metadata: NodeMetadata<'gc>,
4627    /// ESTree `properties` property.
4628    pub properties: NodeList<'gc>,
4629    /// ESTree `rest` property.
4630    pub rest: Option<&'gc Node<'gc>>,
4631}
4632impl<'gc> MatchInstanceObjectPattern<'gc> {
4633    /// Build `MatchInstanceObjectPattern` from its metadata and `ESTree.def`
4634    /// fields.
4635    pub fn new(
4636        metadata: NodeMetadata<'gc>,
4637        properties: NodeList<'gc>,
4638        rest: Option<&'gc Node<'gc>>,
4639    ) -> Self {
4640        MatchInstanceObjectPattern {
4641            metadata,
4642            properties,
4643            rest,
4644        }
4645    }
4646}
4647
4648/// The `MatchRestPattern` AST node.
4649#[derive(Debug)]
4650#[repr(C)]
4651pub struct MatchRestPattern<'gc> {
4652    /// Source range, debug location, paren count, and node id.
4653    pub metadata: NodeMetadata<'gc>,
4654    /// ESTree `argument` property.
4655    pub argument: Option<&'gc Node<'gc>>,
4656}
4657impl<'gc> MatchRestPattern<'gc> {
4658    /// Build `MatchRestPattern` from its metadata and `ESTree.def` fields.
4659    pub fn new(
4660        metadata: NodeMetadata<'gc>,
4661        argument: Option<&'gc Node<'gc>>,
4662    ) -> Self {
4663        MatchRestPattern {
4664            metadata,
4665            argument,
4666        }
4667    }
4668}
4669
4670/// The `JSXIdentifier` AST node.
4671#[derive(Debug)]
4672#[repr(C)]
4673pub struct JSXIdentifier<'gc> {
4674    /// Source range, debug location, paren count, and node id.
4675    pub metadata: NodeMetadata<'gc>,
4676    /// ESTree `name` property.
4677    pub name: Cell<NodeLabel>,
4678}
4679impl<'gc> JSXIdentifier<'gc> {
4680    /// Build `JSXIdentifier` from its metadata and `ESTree.def` fields.
4681    pub fn new(
4682        metadata: NodeMetadata<'gc>,
4683        name: NodeLabel,
4684    ) -> Self {
4685        JSXIdentifier {
4686            metadata,
4687            name: Cell::new(name),
4688        }
4689    }
4690    /// The `name` label as UTF-8 text.
4691    ///
4692    /// Label fields hold identifier names, operators, keyword-like kinds and
4693    /// raw source spans. An identifier cannot contain an unpaired surrogate —
4694    /// the lexer rejects one with a dedicated diagnostic — and the remaining
4695    /// labels are literal source text, so in practice the bytes are already
4696    /// valid UTF-8 and this borrows them directly, allocating nothing.
4697    ///
4698    /// A label that is nevertheless unrepresentable, which realistically means
4699    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
4700    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
4701    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
4702    /// character it encodes, so a `"😀"` label comes out intact.
4703    ///
4704    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
4705    /// bytes, or
4706    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
4707    /// detect the substitution. The returned `&str` borrows from `gc`, not from
4708    /// `self`.
4709    pub fn name_str<'a>(
4710        &self,
4711        gc: &'a crate::context::GCLock<'_, '_>,
4712    ) -> &'a str {
4713        gc.bytes_str_lossy(self.name.get())
4714    }
4715}
4716
4717/// The `JSXMemberExpression` AST node.
4718#[derive(Debug)]
4719#[repr(C)]
4720pub struct JSXMemberExpression<'gc> {
4721    /// Source range, debug location, paren count, and node id.
4722    pub metadata: NodeMetadata<'gc>,
4723    /// ESTree `object` property.
4724    pub object: &'gc Node<'gc>,
4725    /// ESTree `property` property.
4726    pub property: &'gc Node<'gc>,
4727}
4728impl<'gc> JSXMemberExpression<'gc> {
4729    /// Build `JSXMemberExpression` from its metadata and `ESTree.def` fields.
4730    pub fn new(
4731        metadata: NodeMetadata<'gc>,
4732        object: &'gc Node<'gc>,
4733        property: &'gc Node<'gc>,
4734    ) -> Self {
4735        JSXMemberExpression {
4736            metadata,
4737            object,
4738            property,
4739        }
4740    }
4741}
4742
4743/// The `JSXNamespacedName` AST node.
4744#[derive(Debug)]
4745#[repr(C)]
4746pub struct JSXNamespacedName<'gc> {
4747    /// Source range, debug location, paren count, and node id.
4748    pub metadata: NodeMetadata<'gc>,
4749    /// ESTree `namespace` property.
4750    pub namespace: &'gc Node<'gc>,
4751    /// ESTree `name` property.
4752    pub name: &'gc Node<'gc>,
4753}
4754impl<'gc> JSXNamespacedName<'gc> {
4755    /// Build `JSXNamespacedName` from its metadata and `ESTree.def` fields.
4756    pub fn new(
4757        metadata: NodeMetadata<'gc>,
4758        namespace: &'gc Node<'gc>,
4759        name: &'gc Node<'gc>,
4760    ) -> Self {
4761        JSXNamespacedName {
4762            metadata,
4763            namespace,
4764            name,
4765        }
4766    }
4767}
4768
4769/// The `JSXEmptyExpression` AST node.
4770#[derive(Debug)]
4771#[repr(C)]
4772pub struct JSXEmptyExpression<'gc> {
4773    /// Source range, debug location, paren count, and node id.
4774    pub metadata: NodeMetadata<'gc>,
4775}
4776impl<'gc> JSXEmptyExpression<'gc> {
4777    /// Build `JSXEmptyExpression` from its metadata and `ESTree.def` fields.
4778    pub fn new(
4779        metadata: NodeMetadata<'gc>,
4780    ) -> Self {
4781        JSXEmptyExpression {
4782            metadata,
4783        }
4784    }
4785}
4786
4787/// The `JSXExpressionContainer` AST node.
4788#[derive(Debug)]
4789#[repr(C)]
4790pub struct JSXExpressionContainer<'gc> {
4791    /// Source range, debug location, paren count, and node id.
4792    pub metadata: NodeMetadata<'gc>,
4793    /// ESTree `expression` property.
4794    pub expression: &'gc Node<'gc>,
4795}
4796impl<'gc> JSXExpressionContainer<'gc> {
4797    /// Build `JSXExpressionContainer` from its metadata and `ESTree.def`
4798    /// fields.
4799    pub fn new(
4800        metadata: NodeMetadata<'gc>,
4801        expression: &'gc Node<'gc>,
4802    ) -> Self {
4803        JSXExpressionContainer {
4804            metadata,
4805            expression,
4806        }
4807    }
4808}
4809
4810/// The `JSXSpreadChild` AST node.
4811#[derive(Debug)]
4812#[repr(C)]
4813pub struct JSXSpreadChild<'gc> {
4814    /// Source range, debug location, paren count, and node id.
4815    pub metadata: NodeMetadata<'gc>,
4816    /// ESTree `expression` property.
4817    pub expression: &'gc Node<'gc>,
4818}
4819impl<'gc> JSXSpreadChild<'gc> {
4820    /// Build `JSXSpreadChild` from its metadata and `ESTree.def` fields.
4821    pub fn new(
4822        metadata: NodeMetadata<'gc>,
4823        expression: &'gc Node<'gc>,
4824    ) -> Self {
4825        JSXSpreadChild {
4826            metadata,
4827            expression,
4828        }
4829    }
4830}
4831
4832/// The `JSXOpeningElement` AST node.
4833#[derive(Debug)]
4834#[repr(C)]
4835pub struct JSXOpeningElement<'gc> {
4836    /// Source range, debug location, paren count, and node id.
4837    pub metadata: NodeMetadata<'gc>,
4838    /// ESTree `name` property.
4839    pub name: &'gc Node<'gc>,
4840    /// ESTree `attributes` property.
4841    pub attributes: NodeList<'gc>,
4842    /// ESTree `selfClosing` property.
4843    pub self_closing: Cell<bool>,
4844    /// ESTree `typeArguments` property.
4845    pub type_arguments: Option<&'gc Node<'gc>>,
4846}
4847impl<'gc> JSXOpeningElement<'gc> {
4848    /// Build `JSXOpeningElement` from its metadata and `ESTree.def` fields.
4849    pub fn new(
4850        metadata: NodeMetadata<'gc>,
4851        name: &'gc Node<'gc>,
4852        attributes: NodeList<'gc>,
4853        self_closing: bool,
4854        type_arguments: Option<&'gc Node<'gc>>,
4855    ) -> Self {
4856        JSXOpeningElement {
4857            metadata,
4858            name,
4859            attributes,
4860            self_closing: Cell::new(self_closing),
4861            type_arguments,
4862        }
4863    }
4864}
4865
4866/// The `JSXClosingElement` AST node.
4867#[derive(Debug)]
4868#[repr(C)]
4869pub struct JSXClosingElement<'gc> {
4870    /// Source range, debug location, paren count, and node id.
4871    pub metadata: NodeMetadata<'gc>,
4872    /// ESTree `name` property.
4873    pub name: &'gc Node<'gc>,
4874}
4875impl<'gc> JSXClosingElement<'gc> {
4876    /// Build `JSXClosingElement` from its metadata and `ESTree.def` fields.
4877    pub fn new(
4878        metadata: NodeMetadata<'gc>,
4879        name: &'gc Node<'gc>,
4880    ) -> Self {
4881        JSXClosingElement {
4882            metadata,
4883            name,
4884        }
4885    }
4886}
4887
4888/// The `JSXAttribute` AST node.
4889#[derive(Debug)]
4890#[repr(C)]
4891pub struct JSXAttribute<'gc> {
4892    /// Source range, debug location, paren count, and node id.
4893    pub metadata: NodeMetadata<'gc>,
4894    /// ESTree `name` property.
4895    pub name: &'gc Node<'gc>,
4896    /// ESTree `value` property.
4897    pub value: Option<&'gc Node<'gc>>,
4898}
4899impl<'gc> JSXAttribute<'gc> {
4900    /// Build `JSXAttribute` from its metadata and `ESTree.def` fields.
4901    pub fn new(
4902        metadata: NodeMetadata<'gc>,
4903        name: &'gc Node<'gc>,
4904        value: Option<&'gc Node<'gc>>,
4905    ) -> Self {
4906        JSXAttribute {
4907            metadata,
4908            name,
4909            value,
4910        }
4911    }
4912}
4913
4914/// The `JSXSpreadAttribute` AST node.
4915#[derive(Debug)]
4916#[repr(C)]
4917pub struct JSXSpreadAttribute<'gc> {
4918    /// Source range, debug location, paren count, and node id.
4919    pub metadata: NodeMetadata<'gc>,
4920    /// ESTree `argument` property.
4921    pub argument: &'gc Node<'gc>,
4922}
4923impl<'gc> JSXSpreadAttribute<'gc> {
4924    /// Build `JSXSpreadAttribute` from its metadata and `ESTree.def` fields.
4925    pub fn new(
4926        metadata: NodeMetadata<'gc>,
4927        argument: &'gc Node<'gc>,
4928    ) -> Self {
4929        JSXSpreadAttribute {
4930            metadata,
4931            argument,
4932        }
4933    }
4934}
4935
4936/// The `JSXStringLiteral` AST node.
4937#[derive(Debug)]
4938#[repr(C)]
4939pub struct JSXStringLiteral<'gc> {
4940    /// Source range, debug location, paren count, and node id.
4941    pub metadata: NodeMetadata<'gc>,
4942    /// ESTree `value` property.
4943    pub value: Cell<NodeString>,
4944    /// ESTree `raw` property.
4945    pub raw: Cell<NodeLabel>,
4946}
4947impl<'gc> JSXStringLiteral<'gc> {
4948    /// Build `JSXStringLiteral` from its metadata and `ESTree.def` fields.
4949    pub fn new(
4950        metadata: NodeMetadata<'gc>,
4951        value: NodeString,
4952        raw: NodeLabel,
4953    ) -> Self {
4954        JSXStringLiteral {
4955            metadata,
4956            value: Cell::new(value),
4957            raw: Cell::new(raw),
4958        }
4959    }
4960    /// The `value` string value as UTF-8, or `None` if it has no UTF-8 form.
4961    ///
4962    /// A JS string value is a sequence of UTF-16 code units, so it may legally
4963    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
4964    /// error). That, and only that, is what `None` reports: the value is
4965    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
4966    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
4967    ///
4968    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
4969    /// *pair* is not: the lexer interns an astral character in surrogate-pair
4970    /// form, and it is folded back into the character it encodes, so a `"😀"`
4971    /// literal yields `Some("😀")`, not `None`.
4972    ///
4973    /// There is deliberately no plain `value_str`: an unrepresentable
4974    /// identifier means something is broken, but an unrepresentable string
4975    /// literal is legal JS, and a codegen or refactoring tool that let U+FFFD
4976    /// be substituted here would silently rewrite the user's program. Reach for
4977    /// [`Self::value_str_lossy`] only when a best-effort rendering is what you
4978    /// want.
4979    ///
4980    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
4981    /// folding a surrogate pair allocates once per atom, cached in the context.
4982    /// The returned `&str` borrows from `gc`, not from `self`.
4983    pub fn try_value_str<'a>(
4984        &self,
4985        gc: &'a crate::context::GCLock<'_, '_>,
4986    ) -> Option<&'a str> {
4987        gc.try_bytes_str(self.value.get())
4988    }
4989    /// The `value` string value as UTF-8, substituting U+FFFD for anything
4990    /// unrepresentable.
4991    ///
4992    /// **This is lossy.** A JS string value may legally contain an unpaired
4993    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
4994    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
4995    /// refactoring tool would silently rewrite the user's program.
4996    ///
4997    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
4998    /// *pair* is not: the lexer interns an astral character in surrogate-pair
4999    /// form, and it is folded back into the character it encodes, so a `"😀"`
5000    /// literal comes out intact.
5001    ///
5002    /// Use [`Self::try_value_str`] or
5003    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
5004    /// matters. The returned `&str` borrows from `gc`, not from `self`.
5005    pub fn value_str_lossy<'a>(
5006        &self,
5007        gc: &'a crate::context::GCLock<'_, '_>,
5008    ) -> &'a str {
5009        gc.bytes_str_lossy(self.value.get())
5010    }
5011    /// The `raw` label as UTF-8 text.
5012    ///
5013    /// Label fields hold identifier names, operators, keyword-like kinds and
5014    /// raw source spans. An identifier cannot contain an unpaired surrogate —
5015    /// the lexer rejects one with a dedicated diagnostic — and the remaining
5016    /// labels are literal source text, so in practice the bytes are already
5017    /// valid UTF-8 and this borrows them directly, allocating nothing.
5018    ///
5019    /// A label that is nevertheless unrepresentable, which realistically means
5020    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
5021    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
5022    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
5023    /// character it encodes, so a `"😀"` label comes out intact.
5024    ///
5025    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
5026    /// bytes, or
5027    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
5028    /// detect the substitution. The returned `&str` borrows from `gc`, not from
5029    /// `self`.
5030    pub fn raw_str<'a>(
5031        &self,
5032        gc: &'a crate::context::GCLock<'_, '_>,
5033    ) -> &'a str {
5034        gc.bytes_str_lossy(self.raw.get())
5035    }
5036}
5037
5038/// The `JSXText` AST node.
5039#[derive(Debug)]
5040#[repr(C)]
5041pub struct JSXText<'gc> {
5042    /// Source range, debug location, paren count, and node id.
5043    pub metadata: NodeMetadata<'gc>,
5044    /// ESTree `value` property.
5045    pub value: Cell<NodeString>,
5046    /// ESTree `raw` property.
5047    pub raw: Cell<NodeLabel>,
5048}
5049impl<'gc> JSXText<'gc> {
5050    /// Build `JSXText` from its metadata and `ESTree.def` fields.
5051    pub fn new(
5052        metadata: NodeMetadata<'gc>,
5053        value: NodeString,
5054        raw: NodeLabel,
5055    ) -> Self {
5056        JSXText {
5057            metadata,
5058            value: Cell::new(value),
5059            raw: Cell::new(raw),
5060        }
5061    }
5062    /// The `value` string value as UTF-8, or `None` if it has no UTF-8 form.
5063    ///
5064    /// A JS string value is a sequence of UTF-16 code units, so it may legally
5065    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
5066    /// error). That, and only that, is what `None` reports: the value is
5067    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
5068    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
5069    ///
5070    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
5071    /// *pair* is not: the lexer interns an astral character in surrogate-pair
5072    /// form, and it is folded back into the character it encodes, so a `"😀"`
5073    /// literal yields `Some("😀")`, not `None`.
5074    ///
5075    /// There is deliberately no plain `value_str`: an unrepresentable
5076    /// identifier means something is broken, but an unrepresentable string
5077    /// literal is legal JS, and a codegen or refactoring tool that let U+FFFD
5078    /// be substituted here would silently rewrite the user's program. Reach for
5079    /// [`Self::value_str_lossy`] only when a best-effort rendering is what you
5080    /// want.
5081    ///
5082    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
5083    /// folding a surrogate pair allocates once per atom, cached in the context.
5084    /// The returned `&str` borrows from `gc`, not from `self`.
5085    pub fn try_value_str<'a>(
5086        &self,
5087        gc: &'a crate::context::GCLock<'_, '_>,
5088    ) -> Option<&'a str> {
5089        gc.try_bytes_str(self.value.get())
5090    }
5091    /// The `value` string value as UTF-8, substituting U+FFFD for anything
5092    /// unrepresentable.
5093    ///
5094    /// **This is lossy.** A JS string value may legally contain an unpaired
5095    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
5096    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
5097    /// refactoring tool would silently rewrite the user's program.
5098    ///
5099    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
5100    /// *pair* is not: the lexer interns an astral character in surrogate-pair
5101    /// form, and it is folded back into the character it encodes, so a `"😀"`
5102    /// literal comes out intact.
5103    ///
5104    /// Use [`Self::try_value_str`] or
5105    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
5106    /// matters. The returned `&str` borrows from `gc`, not from `self`.
5107    pub fn value_str_lossy<'a>(
5108        &self,
5109        gc: &'a crate::context::GCLock<'_, '_>,
5110    ) -> &'a str {
5111        gc.bytes_str_lossy(self.value.get())
5112    }
5113    /// The `raw` label as UTF-8 text.
5114    ///
5115    /// Label fields hold identifier names, operators, keyword-like kinds and
5116    /// raw source spans. An identifier cannot contain an unpaired surrogate —
5117    /// the lexer rejects one with a dedicated diagnostic — and the remaining
5118    /// labels are literal source text, so in practice the bytes are already
5119    /// valid UTF-8 and this borrows them directly, allocating nothing.
5120    ///
5121    /// A label that is nevertheless unrepresentable, which realistically means
5122    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
5123    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
5124    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
5125    /// character it encodes, so a `"😀"` label comes out intact.
5126    ///
5127    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
5128    /// bytes, or
5129    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
5130    /// detect the substitution. The returned `&str` borrows from `gc`, not from
5131    /// `self`.
5132    pub fn raw_str<'a>(
5133        &self,
5134        gc: &'a crate::context::GCLock<'_, '_>,
5135    ) -> &'a str {
5136        gc.bytes_str_lossy(self.raw.get())
5137    }
5138}
5139
5140/// The `JSXElement` AST node.
5141#[derive(Debug)]
5142#[repr(C)]
5143pub struct JSXElement<'gc> {
5144    /// Source range, debug location, paren count, and node id.
5145    pub metadata: NodeMetadata<'gc>,
5146    /// ESTree `openingElement` property.
5147    pub opening_element: &'gc Node<'gc>,
5148    /// ESTree `children` property.
5149    pub children: NodeList<'gc>,
5150    /// ESTree `closingElement` property.
5151    pub closing_element: Option<&'gc Node<'gc>>,
5152}
5153impl<'gc> JSXElement<'gc> {
5154    /// Build `JSXElement` from its metadata and `ESTree.def` fields.
5155    pub fn new(
5156        metadata: NodeMetadata<'gc>,
5157        opening_element: &'gc Node<'gc>,
5158        children: NodeList<'gc>,
5159        closing_element: Option<&'gc Node<'gc>>,
5160    ) -> Self {
5161        JSXElement {
5162            metadata,
5163            opening_element,
5164            children,
5165            closing_element,
5166        }
5167    }
5168}
5169
5170/// The `JSXFragment` AST node.
5171#[derive(Debug)]
5172#[repr(C)]
5173pub struct JSXFragment<'gc> {
5174    /// Source range, debug location, paren count, and node id.
5175    pub metadata: NodeMetadata<'gc>,
5176    /// ESTree `openingFragment` property.
5177    pub opening_fragment: &'gc Node<'gc>,
5178    /// ESTree `children` property.
5179    pub children: NodeList<'gc>,
5180    /// ESTree `closingFragment` property.
5181    pub closing_fragment: &'gc Node<'gc>,
5182}
5183impl<'gc> JSXFragment<'gc> {
5184    /// Build `JSXFragment` from its metadata and `ESTree.def` fields.
5185    pub fn new(
5186        metadata: NodeMetadata<'gc>,
5187        opening_fragment: &'gc Node<'gc>,
5188        children: NodeList<'gc>,
5189        closing_fragment: &'gc Node<'gc>,
5190    ) -> Self {
5191        JSXFragment {
5192            metadata,
5193            opening_fragment,
5194            children,
5195            closing_fragment,
5196        }
5197    }
5198}
5199
5200/// The `JSXOpeningFragment` AST node.
5201#[derive(Debug)]
5202#[repr(C)]
5203pub struct JSXOpeningFragment<'gc> {
5204    /// Source range, debug location, paren count, and node id.
5205    pub metadata: NodeMetadata<'gc>,
5206}
5207impl<'gc> JSXOpeningFragment<'gc> {
5208    /// Build `JSXOpeningFragment` from its metadata and `ESTree.def` fields.
5209    pub fn new(
5210        metadata: NodeMetadata<'gc>,
5211    ) -> Self {
5212        JSXOpeningFragment {
5213            metadata,
5214        }
5215    }
5216}
5217
5218/// The `JSXClosingFragment` AST node.
5219#[derive(Debug)]
5220#[repr(C)]
5221pub struct JSXClosingFragment<'gc> {
5222    /// Source range, debug location, paren count, and node id.
5223    pub metadata: NodeMetadata<'gc>,
5224}
5225impl<'gc> JSXClosingFragment<'gc> {
5226    /// Build `JSXClosingFragment` from its metadata and `ESTree.def` fields.
5227    pub fn new(
5228        metadata: NodeMetadata<'gc>,
5229    ) -> Self {
5230        JSXClosingFragment {
5231            metadata,
5232        }
5233    }
5234}
5235
5236/// The `ExistsTypeAnnotation` AST node.
5237#[derive(Debug)]
5238#[repr(C)]
5239pub struct ExistsTypeAnnotation<'gc> {
5240    /// Source range, debug location, paren count, and node id.
5241    pub metadata: NodeMetadata<'gc>,
5242}
5243impl<'gc> ExistsTypeAnnotation<'gc> {
5244    /// Build `ExistsTypeAnnotation` from its metadata and `ESTree.def` fields.
5245    pub fn new(
5246        metadata: NodeMetadata<'gc>,
5247    ) -> Self {
5248        ExistsTypeAnnotation {
5249            metadata,
5250        }
5251    }
5252}
5253
5254/// The `EmptyTypeAnnotation` AST node.
5255#[derive(Debug)]
5256#[repr(C)]
5257pub struct EmptyTypeAnnotation<'gc> {
5258    /// Source range, debug location, paren count, and node id.
5259    pub metadata: NodeMetadata<'gc>,
5260}
5261impl<'gc> EmptyTypeAnnotation<'gc> {
5262    /// Build `EmptyTypeAnnotation` from its metadata and `ESTree.def` fields.
5263    pub fn new(
5264        metadata: NodeMetadata<'gc>,
5265    ) -> Self {
5266        EmptyTypeAnnotation {
5267            metadata,
5268        }
5269    }
5270}
5271
5272/// The `StringTypeAnnotation` AST node.
5273#[derive(Debug)]
5274#[repr(C)]
5275pub struct StringTypeAnnotation<'gc> {
5276    /// Source range, debug location, paren count, and node id.
5277    pub metadata: NodeMetadata<'gc>,
5278}
5279impl<'gc> StringTypeAnnotation<'gc> {
5280    /// Build `StringTypeAnnotation` from its metadata and `ESTree.def` fields.
5281    pub fn new(
5282        metadata: NodeMetadata<'gc>,
5283    ) -> Self {
5284        StringTypeAnnotation {
5285            metadata,
5286        }
5287    }
5288}
5289
5290/// The `NumberTypeAnnotation` AST node.
5291#[derive(Debug)]
5292#[repr(C)]
5293pub struct NumberTypeAnnotation<'gc> {
5294    /// Source range, debug location, paren count, and node id.
5295    pub metadata: NodeMetadata<'gc>,
5296}
5297impl<'gc> NumberTypeAnnotation<'gc> {
5298    /// Build `NumberTypeAnnotation` from its metadata and `ESTree.def` fields.
5299    pub fn new(
5300        metadata: NodeMetadata<'gc>,
5301    ) -> Self {
5302        NumberTypeAnnotation {
5303            metadata,
5304        }
5305    }
5306}
5307
5308/// The `StringLiteralTypeAnnotation` AST node.
5309#[derive(Debug)]
5310#[repr(C)]
5311pub struct StringLiteralTypeAnnotation<'gc> {
5312    /// Source range, debug location, paren count, and node id.
5313    pub metadata: NodeMetadata<'gc>,
5314    /// ESTree `value` property.
5315    pub value: Cell<NodeString>,
5316    /// ESTree `raw` property.
5317    pub raw: Cell<NodeString>,
5318}
5319impl<'gc> StringLiteralTypeAnnotation<'gc> {
5320    /// Build `StringLiteralTypeAnnotation` from its metadata and `ESTree.def`
5321    /// fields.
5322    pub fn new(
5323        metadata: NodeMetadata<'gc>,
5324        value: NodeString,
5325        raw: NodeString,
5326    ) -> Self {
5327        StringLiteralTypeAnnotation {
5328            metadata,
5329            value: Cell::new(value),
5330            raw: Cell::new(raw),
5331        }
5332    }
5333    /// The `value` string value as UTF-8, or `None` if it has no UTF-8 form.
5334    ///
5335    /// A JS string value is a sequence of UTF-16 code units, so it may legally
5336    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
5337    /// error). That, and only that, is what `None` reports: the value is
5338    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
5339    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
5340    ///
5341    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
5342    /// *pair* is not: the lexer interns an astral character in surrogate-pair
5343    /// form, and it is folded back into the character it encodes, so a `"😀"`
5344    /// literal yields `Some("😀")`, not `None`.
5345    ///
5346    /// There is deliberately no plain `value_str`: an unrepresentable
5347    /// identifier means something is broken, but an unrepresentable string
5348    /// literal is legal JS, and a codegen or refactoring tool that let U+FFFD
5349    /// be substituted here would silently rewrite the user's program. Reach for
5350    /// [`Self::value_str_lossy`] only when a best-effort rendering is what you
5351    /// want.
5352    ///
5353    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
5354    /// folding a surrogate pair allocates once per atom, cached in the context.
5355    /// The returned `&str` borrows from `gc`, not from `self`.
5356    pub fn try_value_str<'a>(
5357        &self,
5358        gc: &'a crate::context::GCLock<'_, '_>,
5359    ) -> Option<&'a str> {
5360        gc.try_bytes_str(self.value.get())
5361    }
5362    /// The `value` string value as UTF-8, substituting U+FFFD for anything
5363    /// unrepresentable.
5364    ///
5365    /// **This is lossy.** A JS string value may legally contain an unpaired
5366    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
5367    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
5368    /// refactoring tool would silently rewrite the user's program.
5369    ///
5370    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
5371    /// *pair* is not: the lexer interns an astral character in surrogate-pair
5372    /// form, and it is folded back into the character it encodes, so a `"😀"`
5373    /// literal comes out intact.
5374    ///
5375    /// Use [`Self::try_value_str`] or
5376    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
5377    /// matters. The returned `&str` borrows from `gc`, not from `self`.
5378    pub fn value_str_lossy<'a>(
5379        &self,
5380        gc: &'a crate::context::GCLock<'_, '_>,
5381    ) -> &'a str {
5382        gc.bytes_str_lossy(self.value.get())
5383    }
5384    /// The `raw` string value as UTF-8, or `None` if it has no UTF-8 form.
5385    ///
5386    /// A JS string value is a sequence of UTF-16 code units, so it may legally
5387    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
5388    /// error). That, and only that, is what `None` reports: the value is
5389    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
5390    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
5391    ///
5392    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
5393    /// *pair* is not: the lexer interns an astral character in surrogate-pair
5394    /// form, and it is folded back into the character it encodes, so a `"😀"`
5395    /// literal yields `Some("😀")`, not `None`.
5396    ///
5397    /// There is deliberately no plain `raw_str`: an unrepresentable identifier
5398    /// means something is broken, but an unrepresentable string literal is
5399    /// legal JS, and a codegen or refactoring tool that let U+FFFD be
5400    /// substituted here would silently rewrite the user's program. Reach for
5401    /// [`Self::raw_str_lossy`] only when a best-effort rendering is what you
5402    /// want.
5403    ///
5404    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
5405    /// folding a surrogate pair allocates once per atom, cached in the context.
5406    /// The returned `&str` borrows from `gc`, not from `self`.
5407    pub fn try_raw_str<'a>(
5408        &self,
5409        gc: &'a crate::context::GCLock<'_, '_>,
5410    ) -> Option<&'a str> {
5411        gc.try_bytes_str(self.raw.get())
5412    }
5413    /// The `raw` string value as UTF-8, substituting U+FFFD for anything
5414    /// unrepresentable.
5415    ///
5416    /// **This is lossy.** A JS string value may legally contain an unpaired
5417    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
5418    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
5419    /// refactoring tool would silently rewrite the user's program.
5420    ///
5421    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
5422    /// *pair* is not: the lexer interns an astral character in surrogate-pair
5423    /// form, and it is folded back into the character it encodes, so a `"😀"`
5424    /// literal comes out intact.
5425    ///
5426    /// Use [`Self::try_raw_str`] or
5427    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
5428    /// matters. The returned `&str` borrows from `gc`, not from `self`.
5429    pub fn raw_str_lossy<'a>(
5430        &self,
5431        gc: &'a crate::context::GCLock<'_, '_>,
5432    ) -> &'a str {
5433        gc.bytes_str_lossy(self.raw.get())
5434    }
5435}
5436
5437/// The `NumberLiteralTypeAnnotation` AST node.
5438#[derive(Debug)]
5439#[repr(C)]
5440pub struct NumberLiteralTypeAnnotation<'gc> {
5441    /// Source range, debug location, paren count, and node id.
5442    pub metadata: NodeMetadata<'gc>,
5443    /// ESTree `value` property.
5444    pub value: Cell<f64>,
5445    /// ESTree `raw` property.
5446    pub raw: Cell<NodeLabel>,
5447}
5448impl<'gc> NumberLiteralTypeAnnotation<'gc> {
5449    /// Build `NumberLiteralTypeAnnotation` from its metadata and `ESTree.def`
5450    /// fields.
5451    pub fn new(
5452        metadata: NodeMetadata<'gc>,
5453        value: f64,
5454        raw: NodeLabel,
5455    ) -> Self {
5456        NumberLiteralTypeAnnotation {
5457            metadata,
5458            value: Cell::new(value),
5459            raw: Cell::new(raw),
5460        }
5461    }
5462    /// The `raw` label as UTF-8 text.
5463    ///
5464    /// Label fields hold identifier names, operators, keyword-like kinds and
5465    /// raw source spans. An identifier cannot contain an unpaired surrogate —
5466    /// the lexer rejects one with a dedicated diagnostic — and the remaining
5467    /// labels are literal source text, so in practice the bytes are already
5468    /// valid UTF-8 and this borrows them directly, allocating nothing.
5469    ///
5470    /// A label that is nevertheless unrepresentable, which realistically means
5471    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
5472    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
5473    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
5474    /// character it encodes, so a `"😀"` label comes out intact.
5475    ///
5476    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
5477    /// bytes, or
5478    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
5479    /// detect the substitution. The returned `&str` borrows from `gc`, not from
5480    /// `self`.
5481    pub fn raw_str<'a>(
5482        &self,
5483        gc: &'a crate::context::GCLock<'_, '_>,
5484    ) -> &'a str {
5485        gc.bytes_str_lossy(self.raw.get())
5486    }
5487}
5488
5489/// The `BigIntLiteralTypeAnnotation` AST node.
5490#[derive(Debug)]
5491#[repr(C)]
5492pub struct BigIntLiteralTypeAnnotation<'gc> {
5493    /// Source range, debug location, paren count, and node id.
5494    pub metadata: NodeMetadata<'gc>,
5495    /// ESTree `raw` property.
5496    pub raw: Cell<NodeLabel>,
5497}
5498impl<'gc> BigIntLiteralTypeAnnotation<'gc> {
5499    /// Build `BigIntLiteralTypeAnnotation` from its metadata and `ESTree.def`
5500    /// fields.
5501    pub fn new(
5502        metadata: NodeMetadata<'gc>,
5503        raw: NodeLabel,
5504    ) -> Self {
5505        BigIntLiteralTypeAnnotation {
5506            metadata,
5507            raw: Cell::new(raw),
5508        }
5509    }
5510    /// The `raw` label as UTF-8 text.
5511    ///
5512    /// Label fields hold identifier names, operators, keyword-like kinds and
5513    /// raw source spans. An identifier cannot contain an unpaired surrogate —
5514    /// the lexer rejects one with a dedicated diagnostic — and the remaining
5515    /// labels are literal source text, so in practice the bytes are already
5516    /// valid UTF-8 and this borrows them directly, allocating nothing.
5517    ///
5518    /// A label that is nevertheless unrepresentable, which realistically means
5519    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
5520    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
5521    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
5522    /// character it encodes, so a `"😀"` label comes out intact.
5523    ///
5524    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
5525    /// bytes, or
5526    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
5527    /// detect the substitution. The returned `&str` borrows from `gc`, not from
5528    /// `self`.
5529    pub fn raw_str<'a>(
5530        &self,
5531        gc: &'a crate::context::GCLock<'_, '_>,
5532    ) -> &'a str {
5533        gc.bytes_str_lossy(self.raw.get())
5534    }
5535}
5536
5537/// The `BooleanTypeAnnotation` AST node.
5538#[derive(Debug)]
5539#[repr(C)]
5540pub struct BooleanTypeAnnotation<'gc> {
5541    /// Source range, debug location, paren count, and node id.
5542    pub metadata: NodeMetadata<'gc>,
5543}
5544impl<'gc> BooleanTypeAnnotation<'gc> {
5545    /// Build `BooleanTypeAnnotation` from its metadata and `ESTree.def` fields.
5546    pub fn new(
5547        metadata: NodeMetadata<'gc>,
5548    ) -> Self {
5549        BooleanTypeAnnotation {
5550            metadata,
5551        }
5552    }
5553}
5554
5555/// The `BooleanLiteralTypeAnnotation` AST node.
5556#[derive(Debug)]
5557#[repr(C)]
5558pub struct BooleanLiteralTypeAnnotation<'gc> {
5559    /// Source range, debug location, paren count, and node id.
5560    pub metadata: NodeMetadata<'gc>,
5561    /// ESTree `value` property.
5562    pub value: Cell<bool>,
5563    /// ESTree `raw` property.
5564    pub raw: Cell<NodeLabel>,
5565}
5566impl<'gc> BooleanLiteralTypeAnnotation<'gc> {
5567    /// Build `BooleanLiteralTypeAnnotation` from its metadata and `ESTree.def`
5568    /// fields.
5569    pub fn new(
5570        metadata: NodeMetadata<'gc>,
5571        value: bool,
5572        raw: NodeLabel,
5573    ) -> Self {
5574        BooleanLiteralTypeAnnotation {
5575            metadata,
5576            value: Cell::new(value),
5577            raw: Cell::new(raw),
5578        }
5579    }
5580    /// The `raw` label as UTF-8 text.
5581    ///
5582    /// Label fields hold identifier names, operators, keyword-like kinds and
5583    /// raw source spans. An identifier cannot contain an unpaired surrogate —
5584    /// the lexer rejects one with a dedicated diagnostic — and the remaining
5585    /// labels are literal source text, so in practice the bytes are already
5586    /// valid UTF-8 and this borrows them directly, allocating nothing.
5587    ///
5588    /// A label that is nevertheless unrepresentable, which realistically means
5589    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
5590    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
5591    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
5592    /// character it encodes, so a `"😀"` label comes out intact.
5593    ///
5594    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
5595    /// bytes, or
5596    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
5597    /// detect the substitution. The returned `&str` borrows from `gc`, not from
5598    /// `self`.
5599    pub fn raw_str<'a>(
5600        &self,
5601        gc: &'a crate::context::GCLock<'_, '_>,
5602    ) -> &'a str {
5603        gc.bytes_str_lossy(self.raw.get())
5604    }
5605}
5606
5607/// The `NullLiteralTypeAnnotation` AST node.
5608#[derive(Debug)]
5609#[repr(C)]
5610pub struct NullLiteralTypeAnnotation<'gc> {
5611    /// Source range, debug location, paren count, and node id.
5612    pub metadata: NodeMetadata<'gc>,
5613}
5614impl<'gc> NullLiteralTypeAnnotation<'gc> {
5615    /// Build `NullLiteralTypeAnnotation` from its metadata and `ESTree.def`
5616    /// fields.
5617    pub fn new(
5618        metadata: NodeMetadata<'gc>,
5619    ) -> Self {
5620        NullLiteralTypeAnnotation {
5621            metadata,
5622        }
5623    }
5624}
5625
5626/// The `SymbolTypeAnnotation` AST node.
5627#[derive(Debug)]
5628#[repr(C)]
5629pub struct SymbolTypeAnnotation<'gc> {
5630    /// Source range, debug location, paren count, and node id.
5631    pub metadata: NodeMetadata<'gc>,
5632}
5633impl<'gc> SymbolTypeAnnotation<'gc> {
5634    /// Build `SymbolTypeAnnotation` from its metadata and `ESTree.def` fields.
5635    pub fn new(
5636        metadata: NodeMetadata<'gc>,
5637    ) -> Self {
5638        SymbolTypeAnnotation {
5639            metadata,
5640        }
5641    }
5642}
5643
5644/// The `AnyTypeAnnotation` AST node.
5645#[derive(Debug)]
5646#[repr(C)]
5647pub struct AnyTypeAnnotation<'gc> {
5648    /// Source range, debug location, paren count, and node id.
5649    pub metadata: NodeMetadata<'gc>,
5650}
5651impl<'gc> AnyTypeAnnotation<'gc> {
5652    /// Build `AnyTypeAnnotation` from its metadata and `ESTree.def` fields.
5653    pub fn new(
5654        metadata: NodeMetadata<'gc>,
5655    ) -> Self {
5656        AnyTypeAnnotation {
5657            metadata,
5658        }
5659    }
5660}
5661
5662/// The `MixedTypeAnnotation` AST node.
5663#[derive(Debug)]
5664#[repr(C)]
5665pub struct MixedTypeAnnotation<'gc> {
5666    /// Source range, debug location, paren count, and node id.
5667    pub metadata: NodeMetadata<'gc>,
5668}
5669impl<'gc> MixedTypeAnnotation<'gc> {
5670    /// Build `MixedTypeAnnotation` from its metadata and `ESTree.def` fields.
5671    pub fn new(
5672        metadata: NodeMetadata<'gc>,
5673    ) -> Self {
5674        MixedTypeAnnotation {
5675            metadata,
5676        }
5677    }
5678}
5679
5680/// The `BigIntTypeAnnotation` AST node.
5681#[derive(Debug)]
5682#[repr(C)]
5683pub struct BigIntTypeAnnotation<'gc> {
5684    /// Source range, debug location, paren count, and node id.
5685    pub metadata: NodeMetadata<'gc>,
5686}
5687impl<'gc> BigIntTypeAnnotation<'gc> {
5688    /// Build `BigIntTypeAnnotation` from its metadata and `ESTree.def` fields.
5689    pub fn new(
5690        metadata: NodeMetadata<'gc>,
5691    ) -> Self {
5692        BigIntTypeAnnotation {
5693            metadata,
5694        }
5695    }
5696}
5697
5698/// The `VoidTypeAnnotation` AST node.
5699#[derive(Debug)]
5700#[repr(C)]
5701pub struct VoidTypeAnnotation<'gc> {
5702    /// Source range, debug location, paren count, and node id.
5703    pub metadata: NodeMetadata<'gc>,
5704}
5705impl<'gc> VoidTypeAnnotation<'gc> {
5706    /// Build `VoidTypeAnnotation` from its metadata and `ESTree.def` fields.
5707    pub fn new(
5708        metadata: NodeMetadata<'gc>,
5709    ) -> Self {
5710        VoidTypeAnnotation {
5711            metadata,
5712        }
5713    }
5714}
5715
5716/// The `NeverTypeAnnotation` AST node.
5717#[derive(Debug)]
5718#[repr(C)]
5719pub struct NeverTypeAnnotation<'gc> {
5720    /// Source range, debug location, paren count, and node id.
5721    pub metadata: NodeMetadata<'gc>,
5722}
5723impl<'gc> NeverTypeAnnotation<'gc> {
5724    /// Build `NeverTypeAnnotation` from its metadata and `ESTree.def` fields.
5725    pub fn new(
5726        metadata: NodeMetadata<'gc>,
5727    ) -> Self {
5728        NeverTypeAnnotation {
5729            metadata,
5730        }
5731    }
5732}
5733
5734/// The `UnknownTypeAnnotation` AST node.
5735#[derive(Debug)]
5736#[repr(C)]
5737pub struct UnknownTypeAnnotation<'gc> {
5738    /// Source range, debug location, paren count, and node id.
5739    pub metadata: NodeMetadata<'gc>,
5740}
5741impl<'gc> UnknownTypeAnnotation<'gc> {
5742    /// Build `UnknownTypeAnnotation` from its metadata and `ESTree.def` fields.
5743    pub fn new(
5744        metadata: NodeMetadata<'gc>,
5745    ) -> Self {
5746        UnknownTypeAnnotation {
5747            metadata,
5748        }
5749    }
5750}
5751
5752/// The `UndefinedTypeAnnotation` AST node.
5753#[derive(Debug)]
5754#[repr(C)]
5755pub struct UndefinedTypeAnnotation<'gc> {
5756    /// Source range, debug location, paren count, and node id.
5757    pub metadata: NodeMetadata<'gc>,
5758}
5759impl<'gc> UndefinedTypeAnnotation<'gc> {
5760    /// Build `UndefinedTypeAnnotation` from its metadata and `ESTree.def`
5761    /// fields.
5762    pub fn new(
5763        metadata: NodeMetadata<'gc>,
5764    ) -> Self {
5765        UndefinedTypeAnnotation {
5766            metadata,
5767        }
5768    }
5769}
5770
5771/// The `FunctionTypeAnnotation` AST node.
5772#[derive(Debug)]
5773#[repr(C)]
5774pub struct FunctionTypeAnnotation<'gc> {
5775    /// Source range, debug location, paren count, and node id.
5776    pub metadata: NodeMetadata<'gc>,
5777    /// ESTree `params` property.
5778    pub params: NodeList<'gc>,
5779    /// ESTree `this` property.
5780    pub this: Option<&'gc Node<'gc>>,
5781    /// ESTree `returnType` property.
5782    pub return_type: &'gc Node<'gc>,
5783    /// ESTree `rest` property.
5784    pub rest: Option<&'gc Node<'gc>>,
5785    /// ESTree `typeParameters` property.
5786    pub type_parameters: Option<&'gc Node<'gc>>,
5787}
5788impl<'gc> FunctionTypeAnnotation<'gc> {
5789    /// Build `FunctionTypeAnnotation` from its metadata and `ESTree.def`
5790    /// fields.
5791    pub fn new(
5792        metadata: NodeMetadata<'gc>,
5793        params: NodeList<'gc>,
5794        this: Option<&'gc Node<'gc>>,
5795        return_type: &'gc Node<'gc>,
5796        rest: Option<&'gc Node<'gc>>,
5797        type_parameters: Option<&'gc Node<'gc>>,
5798    ) -> Self {
5799        FunctionTypeAnnotation {
5800            metadata,
5801            params,
5802            this,
5803            return_type,
5804            rest,
5805            type_parameters,
5806        }
5807    }
5808}
5809
5810/// The `HookTypeAnnotation` AST node.
5811#[derive(Debug)]
5812#[repr(C)]
5813pub struct HookTypeAnnotation<'gc> {
5814    /// Source range, debug location, paren count, and node id.
5815    pub metadata: NodeMetadata<'gc>,
5816    /// ESTree `params` property.
5817    pub params: NodeList<'gc>,
5818    /// ESTree `returnType` property.
5819    pub return_type: &'gc Node<'gc>,
5820    /// ESTree `rest` property.
5821    pub rest: Option<&'gc Node<'gc>>,
5822    /// ESTree `typeParameters` property.
5823    pub type_parameters: Option<&'gc Node<'gc>>,
5824}
5825impl<'gc> HookTypeAnnotation<'gc> {
5826    /// Build `HookTypeAnnotation` from its metadata and `ESTree.def` fields.
5827    pub fn new(
5828        metadata: NodeMetadata<'gc>,
5829        params: NodeList<'gc>,
5830        return_type: &'gc Node<'gc>,
5831        rest: Option<&'gc Node<'gc>>,
5832        type_parameters: Option<&'gc Node<'gc>>,
5833    ) -> Self {
5834        HookTypeAnnotation {
5835            metadata,
5836            params,
5837            return_type,
5838            rest,
5839            type_parameters,
5840        }
5841    }
5842}
5843
5844/// The `FunctionTypeParam` AST node.
5845#[derive(Debug)]
5846#[repr(C)]
5847pub struct FunctionTypeParam<'gc> {
5848    /// Source range, debug location, paren count, and node id.
5849    pub metadata: NodeMetadata<'gc>,
5850    /// ESTree `name` property.
5851    pub name: Option<&'gc Node<'gc>>,
5852    /// ESTree `typeAnnotation` property.
5853    pub type_annotation: &'gc Node<'gc>,
5854    /// ESTree `optional` property.
5855    pub optional: Cell<bool>,
5856}
5857impl<'gc> FunctionTypeParam<'gc> {
5858    /// Build `FunctionTypeParam` from its metadata and `ESTree.def` fields.
5859    pub fn new(
5860        metadata: NodeMetadata<'gc>,
5861        name: Option<&'gc Node<'gc>>,
5862        type_annotation: &'gc Node<'gc>,
5863        optional: bool,
5864    ) -> Self {
5865        FunctionTypeParam {
5866            metadata,
5867            name,
5868            type_annotation,
5869            optional: Cell::new(optional),
5870        }
5871    }
5872}
5873
5874/// The `ComponentTypeAnnotation` AST node.
5875#[derive(Debug)]
5876#[repr(C)]
5877pub struct ComponentTypeAnnotation<'gc> {
5878    /// Source range, debug location, paren count, and node id.
5879    pub metadata: NodeMetadata<'gc>,
5880    /// ESTree `params` property.
5881    pub params: NodeList<'gc>,
5882    /// ESTree `rest` property.
5883    pub rest: Option<&'gc Node<'gc>>,
5884    /// ESTree `typeParameters` property.
5885    pub type_parameters: Option<&'gc Node<'gc>>,
5886    /// ESTree `rendersType` property.
5887    pub renders_type: Option<&'gc Node<'gc>>,
5888}
5889impl<'gc> ComponentTypeAnnotation<'gc> {
5890    /// Build `ComponentTypeAnnotation` from its metadata and `ESTree.def`
5891    /// fields.
5892    pub fn new(
5893        metadata: NodeMetadata<'gc>,
5894        params: NodeList<'gc>,
5895        rest: Option<&'gc Node<'gc>>,
5896        type_parameters: Option<&'gc Node<'gc>>,
5897        renders_type: Option<&'gc Node<'gc>>,
5898    ) -> Self {
5899        ComponentTypeAnnotation {
5900            metadata,
5901            params,
5902            rest,
5903            type_parameters,
5904            renders_type,
5905        }
5906    }
5907}
5908
5909/// The `ComponentTypeParameter` AST node.
5910#[derive(Debug)]
5911#[repr(C)]
5912pub struct ComponentTypeParameter<'gc> {
5913    /// Source range, debug location, paren count, and node id.
5914    pub metadata: NodeMetadata<'gc>,
5915    /// ESTree `name` property.
5916    pub name: Option<&'gc Node<'gc>>,
5917    /// ESTree `typeAnnotation` property.
5918    pub type_annotation: &'gc Node<'gc>,
5919    /// ESTree `optional` property.
5920    pub optional: Cell<bool>,
5921}
5922impl<'gc> ComponentTypeParameter<'gc> {
5923    /// Build `ComponentTypeParameter` from its metadata and `ESTree.def`
5924    /// fields.
5925    pub fn new(
5926        metadata: NodeMetadata<'gc>,
5927        name: Option<&'gc Node<'gc>>,
5928        type_annotation: &'gc Node<'gc>,
5929        optional: bool,
5930    ) -> Self {
5931        ComponentTypeParameter {
5932            metadata,
5933            name,
5934            type_annotation,
5935            optional: Cell::new(optional),
5936        }
5937    }
5938}
5939
5940/// The `NullableTypeAnnotation` AST node.
5941#[derive(Debug)]
5942#[repr(C)]
5943pub struct NullableTypeAnnotation<'gc> {
5944    /// Source range, debug location, paren count, and node id.
5945    pub metadata: NodeMetadata<'gc>,
5946    /// ESTree `typeAnnotation` property.
5947    pub type_annotation: &'gc Node<'gc>,
5948}
5949impl<'gc> NullableTypeAnnotation<'gc> {
5950    /// Build `NullableTypeAnnotation` from its metadata and `ESTree.def`
5951    /// fields.
5952    pub fn new(
5953        metadata: NodeMetadata<'gc>,
5954        type_annotation: &'gc Node<'gc>,
5955    ) -> Self {
5956        NullableTypeAnnotation {
5957            metadata,
5958            type_annotation,
5959        }
5960    }
5961}
5962
5963/// The `QualifiedTypeIdentifier` AST node.
5964#[derive(Debug)]
5965#[repr(C)]
5966pub struct QualifiedTypeIdentifier<'gc> {
5967    /// Source range, debug location, paren count, and node id.
5968    pub metadata: NodeMetadata<'gc>,
5969    /// ESTree `qualification` property.
5970    pub qualification: &'gc Node<'gc>,
5971    /// ESTree `id` property.
5972    pub id: &'gc Node<'gc>,
5973}
5974impl<'gc> QualifiedTypeIdentifier<'gc> {
5975    /// Build `QualifiedTypeIdentifier` from its metadata and `ESTree.def`
5976    /// fields.
5977    pub fn new(
5978        metadata: NodeMetadata<'gc>,
5979        qualification: &'gc Node<'gc>,
5980        id: &'gc Node<'gc>,
5981    ) -> Self {
5982        QualifiedTypeIdentifier {
5983            metadata,
5984            qualification,
5985            id,
5986        }
5987    }
5988}
5989
5990/// The `TypeofTypeAnnotation` AST node.
5991#[derive(Debug)]
5992#[repr(C)]
5993pub struct TypeofTypeAnnotation<'gc> {
5994    /// Source range, debug location, paren count, and node id.
5995    pub metadata: NodeMetadata<'gc>,
5996    /// ESTree `argument` property.
5997    pub argument: &'gc Node<'gc>,
5998    /// ESTree `typeArguments` property.
5999    pub type_arguments: Option<&'gc Node<'gc>>,
6000}
6001impl<'gc> TypeofTypeAnnotation<'gc> {
6002    /// Build `TypeofTypeAnnotation` from its metadata and `ESTree.def` fields.
6003    pub fn new(
6004        metadata: NodeMetadata<'gc>,
6005        argument: &'gc Node<'gc>,
6006        type_arguments: Option<&'gc Node<'gc>>,
6007    ) -> Self {
6008        TypeofTypeAnnotation {
6009            metadata,
6010            argument,
6011            type_arguments,
6012        }
6013    }
6014}
6015
6016/// The `KeyofTypeAnnotation` AST node.
6017#[derive(Debug)]
6018#[repr(C)]
6019pub struct KeyofTypeAnnotation<'gc> {
6020    /// Source range, debug location, paren count, and node id.
6021    pub metadata: NodeMetadata<'gc>,
6022    /// ESTree `argument` property.
6023    pub argument: &'gc Node<'gc>,
6024}
6025impl<'gc> KeyofTypeAnnotation<'gc> {
6026    /// Build `KeyofTypeAnnotation` from its metadata and `ESTree.def` fields.
6027    pub fn new(
6028        metadata: NodeMetadata<'gc>,
6029        argument: &'gc Node<'gc>,
6030    ) -> Self {
6031        KeyofTypeAnnotation {
6032            metadata,
6033            argument,
6034        }
6035    }
6036}
6037
6038/// The `TypeOperator` AST node.
6039#[derive(Debug)]
6040#[repr(C)]
6041pub struct TypeOperator<'gc> {
6042    /// Source range, debug location, paren count, and node id.
6043    pub metadata: NodeMetadata<'gc>,
6044    /// ESTree `operator` property.
6045    pub operator: Cell<NodeLabel>,
6046    /// ESTree `typeAnnotation` property.
6047    pub type_annotation: &'gc Node<'gc>,
6048}
6049impl<'gc> TypeOperator<'gc> {
6050    /// Build `TypeOperator` from its metadata and `ESTree.def` fields.
6051    pub fn new(
6052        metadata: NodeMetadata<'gc>,
6053        operator: NodeLabel,
6054        type_annotation: &'gc Node<'gc>,
6055    ) -> Self {
6056        TypeOperator {
6057            metadata,
6058            operator: Cell::new(operator),
6059            type_annotation,
6060        }
6061    }
6062    /// The `operator` label as UTF-8 text.
6063    ///
6064    /// Label fields hold identifier names, operators, keyword-like kinds and
6065    /// raw source spans. An identifier cannot contain an unpaired surrogate —
6066    /// the lexer rejects one with a dedicated diagnostic — and the remaining
6067    /// labels are literal source text, so in practice the bytes are already
6068    /// valid UTF-8 and this borrows them directly, allocating nothing.
6069    ///
6070    /// A label that is nevertheless unrepresentable, which realistically means
6071    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
6072    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
6073    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
6074    /// character it encodes, so a `"😀"` label comes out intact.
6075    ///
6076    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
6077    /// bytes, or
6078    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
6079    /// detect the substitution. The returned `&str` borrows from `gc`, not from
6080    /// `self`.
6081    pub fn operator_str<'a>(
6082        &self,
6083        gc: &'a crate::context::GCLock<'_, '_>,
6084    ) -> &'a str {
6085        gc.bytes_str_lossy(self.operator.get())
6086    }
6087}
6088
6089/// The `QualifiedTypeofIdentifier` AST node.
6090#[derive(Debug)]
6091#[repr(C)]
6092pub struct QualifiedTypeofIdentifier<'gc> {
6093    /// Source range, debug location, paren count, and node id.
6094    pub metadata: NodeMetadata<'gc>,
6095    /// ESTree `qualification` property.
6096    pub qualification: &'gc Node<'gc>,
6097    /// ESTree `id` property.
6098    pub id: &'gc Node<'gc>,
6099}
6100impl<'gc> QualifiedTypeofIdentifier<'gc> {
6101    /// Build `QualifiedTypeofIdentifier` from its metadata and `ESTree.def`
6102    /// fields.
6103    pub fn new(
6104        metadata: NodeMetadata<'gc>,
6105        qualification: &'gc Node<'gc>,
6106        id: &'gc Node<'gc>,
6107    ) -> Self {
6108        QualifiedTypeofIdentifier {
6109            metadata,
6110            qualification,
6111            id,
6112        }
6113    }
6114}
6115
6116/// The `TupleTypeAnnotation` AST node.
6117#[derive(Debug)]
6118#[repr(C)]
6119pub struct TupleTypeAnnotation<'gc> {
6120    /// Source range, debug location, paren count, and node id.
6121    pub metadata: NodeMetadata<'gc>,
6122    /// ESTree `elementTypes` property.
6123    pub element_types: NodeList<'gc>,
6124    /// ESTree `inexact` property.
6125    pub inexact: Cell<bool>,
6126}
6127impl<'gc> TupleTypeAnnotation<'gc> {
6128    /// Build `TupleTypeAnnotation` from its metadata and `ESTree.def` fields.
6129    pub fn new(
6130        metadata: NodeMetadata<'gc>,
6131        element_types: NodeList<'gc>,
6132        inexact: bool,
6133    ) -> Self {
6134        TupleTypeAnnotation {
6135            metadata,
6136            element_types,
6137            inexact: Cell::new(inexact),
6138        }
6139    }
6140}
6141
6142/// The `TupleTypeSpreadElement` AST node.
6143#[derive(Debug)]
6144#[repr(C)]
6145pub struct TupleTypeSpreadElement<'gc> {
6146    /// Source range, debug location, paren count, and node id.
6147    pub metadata: NodeMetadata<'gc>,
6148    /// ESTree `label` property.
6149    pub label: Option<&'gc Node<'gc>>,
6150    /// ESTree `typeAnnotation` property.
6151    pub type_annotation: &'gc Node<'gc>,
6152}
6153impl<'gc> TupleTypeSpreadElement<'gc> {
6154    /// Build `TupleTypeSpreadElement` from its metadata and `ESTree.def`
6155    /// fields.
6156    pub fn new(
6157        metadata: NodeMetadata<'gc>,
6158        label: Option<&'gc Node<'gc>>,
6159        type_annotation: &'gc Node<'gc>,
6160    ) -> Self {
6161        TupleTypeSpreadElement {
6162            metadata,
6163            label,
6164            type_annotation,
6165        }
6166    }
6167}
6168
6169/// The `TupleTypeLabeledElement` AST node.
6170#[derive(Debug)]
6171#[repr(C)]
6172pub struct TupleTypeLabeledElement<'gc> {
6173    /// Source range, debug location, paren count, and node id.
6174    pub metadata: NodeMetadata<'gc>,
6175    /// ESTree `label` property.
6176    pub label: &'gc Node<'gc>,
6177    /// ESTree `elementType` property.
6178    pub element_type: &'gc Node<'gc>,
6179    /// ESTree `optional` property.
6180    pub optional: Cell<bool>,
6181    /// ESTree `variance` property.
6182    pub variance: Option<&'gc Node<'gc>>,
6183}
6184impl<'gc> TupleTypeLabeledElement<'gc> {
6185    /// Build `TupleTypeLabeledElement` from its metadata and `ESTree.def`
6186    /// fields.
6187    pub fn new(
6188        metadata: NodeMetadata<'gc>,
6189        label: &'gc Node<'gc>,
6190        element_type: &'gc Node<'gc>,
6191        optional: bool,
6192        variance: Option<&'gc Node<'gc>>,
6193    ) -> Self {
6194        TupleTypeLabeledElement {
6195            metadata,
6196            label,
6197            element_type,
6198            optional: Cell::new(optional),
6199            variance,
6200        }
6201    }
6202}
6203
6204/// The `ArrayTypeAnnotation` AST node.
6205#[derive(Debug)]
6206#[repr(C)]
6207pub struct ArrayTypeAnnotation<'gc> {
6208    /// Source range, debug location, paren count, and node id.
6209    pub metadata: NodeMetadata<'gc>,
6210    /// ESTree `elementType` property.
6211    pub element_type: &'gc Node<'gc>,
6212}
6213impl<'gc> ArrayTypeAnnotation<'gc> {
6214    /// Build `ArrayTypeAnnotation` from its metadata and `ESTree.def` fields.
6215    pub fn new(
6216        metadata: NodeMetadata<'gc>,
6217        element_type: &'gc Node<'gc>,
6218    ) -> Self {
6219        ArrayTypeAnnotation {
6220            metadata,
6221            element_type,
6222        }
6223    }
6224}
6225
6226/// The `InferTypeAnnotation` AST node.
6227#[derive(Debug)]
6228#[repr(C)]
6229pub struct InferTypeAnnotation<'gc> {
6230    /// Source range, debug location, paren count, and node id.
6231    pub metadata: NodeMetadata<'gc>,
6232    /// ESTree `typeParameter` property.
6233    pub type_parameter: &'gc Node<'gc>,
6234}
6235impl<'gc> InferTypeAnnotation<'gc> {
6236    /// Build `InferTypeAnnotation` from its metadata and `ESTree.def` fields.
6237    pub fn new(
6238        metadata: NodeMetadata<'gc>,
6239        type_parameter: &'gc Node<'gc>,
6240    ) -> Self {
6241        InferTypeAnnotation {
6242            metadata,
6243            type_parameter,
6244        }
6245    }
6246}
6247
6248/// The `UnionTypeAnnotation` AST node.
6249#[derive(Debug)]
6250#[repr(C)]
6251pub struct UnionTypeAnnotation<'gc> {
6252    /// Source range, debug location, paren count, and node id.
6253    pub metadata: NodeMetadata<'gc>,
6254    /// ESTree `types` property.
6255    pub types: NodeList<'gc>,
6256}
6257impl<'gc> UnionTypeAnnotation<'gc> {
6258    /// Build `UnionTypeAnnotation` from its metadata and `ESTree.def` fields.
6259    pub fn new(
6260        metadata: NodeMetadata<'gc>,
6261        types: NodeList<'gc>,
6262    ) -> Self {
6263        UnionTypeAnnotation {
6264            metadata,
6265            types,
6266        }
6267    }
6268}
6269
6270/// The `IntersectionTypeAnnotation` AST node.
6271#[derive(Debug)]
6272#[repr(C)]
6273pub struct IntersectionTypeAnnotation<'gc> {
6274    /// Source range, debug location, paren count, and node id.
6275    pub metadata: NodeMetadata<'gc>,
6276    /// ESTree `types` property.
6277    pub types: NodeList<'gc>,
6278}
6279impl<'gc> IntersectionTypeAnnotation<'gc> {
6280    /// Build `IntersectionTypeAnnotation` from its metadata and `ESTree.def`
6281    /// fields.
6282    pub fn new(
6283        metadata: NodeMetadata<'gc>,
6284        types: NodeList<'gc>,
6285    ) -> Self {
6286        IntersectionTypeAnnotation {
6287            metadata,
6288            types,
6289        }
6290    }
6291}
6292
6293/// The `GenericTypeAnnotation` AST node.
6294#[derive(Debug)]
6295#[repr(C)]
6296pub struct GenericTypeAnnotation<'gc> {
6297    /// Source range, debug location, paren count, and node id.
6298    pub metadata: NodeMetadata<'gc>,
6299    /// ESTree `id` property.
6300    pub id: &'gc Node<'gc>,
6301    /// ESTree `typeParameters` property.
6302    pub type_parameters: Option<&'gc Node<'gc>>,
6303}
6304impl<'gc> GenericTypeAnnotation<'gc> {
6305    /// Build `GenericTypeAnnotation` from its metadata and `ESTree.def` fields.
6306    pub fn new(
6307        metadata: NodeMetadata<'gc>,
6308        id: &'gc Node<'gc>,
6309        type_parameters: Option<&'gc Node<'gc>>,
6310    ) -> Self {
6311        GenericTypeAnnotation {
6312            metadata,
6313            id,
6314            type_parameters,
6315        }
6316    }
6317}
6318
6319/// The `IndexedAccessType` AST node.
6320#[derive(Debug)]
6321#[repr(C)]
6322pub struct IndexedAccessType<'gc> {
6323    /// Source range, debug location, paren count, and node id.
6324    pub metadata: NodeMetadata<'gc>,
6325    /// ESTree `objectType` property.
6326    pub object_type: &'gc Node<'gc>,
6327    /// ESTree `indexType` property.
6328    pub index_type: &'gc Node<'gc>,
6329}
6330impl<'gc> IndexedAccessType<'gc> {
6331    /// Build `IndexedAccessType` from its metadata and `ESTree.def` fields.
6332    pub fn new(
6333        metadata: NodeMetadata<'gc>,
6334        object_type: &'gc Node<'gc>,
6335        index_type: &'gc Node<'gc>,
6336    ) -> Self {
6337        IndexedAccessType {
6338            metadata,
6339            object_type,
6340            index_type,
6341        }
6342    }
6343}
6344
6345/// The `OptionalIndexedAccessType` AST node.
6346#[derive(Debug)]
6347#[repr(C)]
6348pub struct OptionalIndexedAccessType<'gc> {
6349    /// Source range, debug location, paren count, and node id.
6350    pub metadata: NodeMetadata<'gc>,
6351    /// ESTree `objectType` property.
6352    pub object_type: &'gc Node<'gc>,
6353    /// ESTree `indexType` property.
6354    pub index_type: &'gc Node<'gc>,
6355    /// ESTree `optional` property.
6356    pub optional: Cell<bool>,
6357}
6358impl<'gc> OptionalIndexedAccessType<'gc> {
6359    /// Build `OptionalIndexedAccessType` from its metadata and `ESTree.def`
6360    /// fields.
6361    pub fn new(
6362        metadata: NodeMetadata<'gc>,
6363        object_type: &'gc Node<'gc>,
6364        index_type: &'gc Node<'gc>,
6365        optional: bool,
6366    ) -> Self {
6367        OptionalIndexedAccessType {
6368            metadata,
6369            object_type,
6370            index_type,
6371            optional: Cell::new(optional),
6372        }
6373    }
6374}
6375
6376/// The `ConditionalTypeAnnotation` AST node.
6377#[derive(Debug)]
6378#[repr(C)]
6379pub struct ConditionalTypeAnnotation<'gc> {
6380    /// Source range, debug location, paren count, and node id.
6381    pub metadata: NodeMetadata<'gc>,
6382    /// ESTree `checkType` property.
6383    pub check_type: &'gc Node<'gc>,
6384    /// ESTree `extendsType` property.
6385    pub extends_type: &'gc Node<'gc>,
6386    /// ESTree `trueType` property.
6387    pub true_type: &'gc Node<'gc>,
6388    /// ESTree `falseType` property.
6389    pub false_type: &'gc Node<'gc>,
6390}
6391impl<'gc> ConditionalTypeAnnotation<'gc> {
6392    /// Build `ConditionalTypeAnnotation` from its metadata and `ESTree.def`
6393    /// fields.
6394    pub fn new(
6395        metadata: NodeMetadata<'gc>,
6396        check_type: &'gc Node<'gc>,
6397        extends_type: &'gc Node<'gc>,
6398        true_type: &'gc Node<'gc>,
6399        false_type: &'gc Node<'gc>,
6400    ) -> Self {
6401        ConditionalTypeAnnotation {
6402            metadata,
6403            check_type,
6404            extends_type,
6405            true_type,
6406            false_type,
6407        }
6408    }
6409}
6410
6411/// The `TypePredicate` AST node.
6412#[derive(Debug)]
6413#[repr(C)]
6414pub struct TypePredicate<'gc> {
6415    /// Source range, debug location, paren count, and node id.
6416    pub metadata: NodeMetadata<'gc>,
6417    /// ESTree `parameterName` property.
6418    pub parameter_name: &'gc Node<'gc>,
6419    /// ESTree `typeAnnotation` property.
6420    pub type_annotation: Option<&'gc Node<'gc>>,
6421    /// ESTree `kind` property.
6422    pub kind: Cell<NodeString>,
6423}
6424impl<'gc> TypePredicate<'gc> {
6425    /// Build `TypePredicate` from its metadata and `ESTree.def` fields.
6426    pub fn new(
6427        metadata: NodeMetadata<'gc>,
6428        parameter_name: &'gc Node<'gc>,
6429        type_annotation: Option<&'gc Node<'gc>>,
6430        kind: NodeString,
6431    ) -> Self {
6432        TypePredicate {
6433            metadata,
6434            parameter_name,
6435            type_annotation,
6436            kind: Cell::new(kind),
6437        }
6438    }
6439    /// The `kind` string value as UTF-8, or `None` if it has no UTF-8 form.
6440    ///
6441    /// A JS string value is a sequence of UTF-16 code units, so it may legally
6442    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
6443    /// error). That, and only that, is what `None` reports: the value is
6444    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
6445    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
6446    ///
6447    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
6448    /// *pair* is not: the lexer interns an astral character in surrogate-pair
6449    /// form, and it is folded back into the character it encodes, so a `"😀"`
6450    /// literal yields `Some("😀")`, not `None`.
6451    ///
6452    /// There is deliberately no plain `kind_str`: an unrepresentable identifier
6453    /// means something is broken, but an unrepresentable string literal is
6454    /// legal JS, and a codegen or refactoring tool that let U+FFFD be
6455    /// substituted here would silently rewrite the user's program. Reach for
6456    /// [`Self::kind_str_lossy`] only when a best-effort rendering is what you
6457    /// want.
6458    ///
6459    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
6460    /// folding a surrogate pair allocates once per atom, cached in the context.
6461    /// The returned `&str` borrows from `gc`, not from `self`.
6462    pub fn try_kind_str<'a>(
6463        &self,
6464        gc: &'a crate::context::GCLock<'_, '_>,
6465    ) -> Option<&'a str> {
6466        gc.try_bytes_str(self.kind.get())
6467    }
6468    /// The `kind` string value as UTF-8, substituting U+FFFD for anything
6469    /// unrepresentable.
6470    ///
6471    /// **This is lossy.** A JS string value may legally contain an unpaired
6472    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
6473    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
6474    /// refactoring tool would silently rewrite the user's program.
6475    ///
6476    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
6477    /// *pair* is not: the lexer interns an astral character in surrogate-pair
6478    /// form, and it is folded back into the character it encodes, so a `"😀"`
6479    /// literal comes out intact.
6480    ///
6481    /// Use [`Self::try_kind_str`] or
6482    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
6483    /// matters. The returned `&str` borrows from `gc`, not from `self`.
6484    pub fn kind_str_lossy<'a>(
6485        &self,
6486        gc: &'a crate::context::GCLock<'_, '_>,
6487    ) -> &'a str {
6488        gc.bytes_str_lossy(self.kind.get())
6489    }
6490}
6491
6492/// The `InterfaceTypeAnnotation` AST node.
6493#[derive(Debug)]
6494#[repr(C)]
6495pub struct InterfaceTypeAnnotation<'gc> {
6496    /// Source range, debug location, paren count, and node id.
6497    pub metadata: NodeMetadata<'gc>,
6498    /// ESTree `extends` property.
6499    pub extends: NodeList<'gc>,
6500    /// ESTree `body` property.
6501    pub body: Option<&'gc Node<'gc>>,
6502}
6503impl<'gc> InterfaceTypeAnnotation<'gc> {
6504    /// Build `InterfaceTypeAnnotation` from its metadata and `ESTree.def`
6505    /// fields.
6506    pub fn new(
6507        metadata: NodeMetadata<'gc>,
6508        extends: NodeList<'gc>,
6509        body: Option<&'gc Node<'gc>>,
6510    ) -> Self {
6511        InterfaceTypeAnnotation {
6512            metadata,
6513            extends,
6514            body,
6515        }
6516    }
6517}
6518
6519/// The `TypeAlias` AST node.
6520#[derive(Debug)]
6521#[repr(C)]
6522pub struct TypeAlias<'gc> {
6523    /// Source range, debug location, paren count, and node id.
6524    pub metadata: NodeMetadata<'gc>,
6525    /// ESTree `id` property.
6526    pub id: &'gc Node<'gc>,
6527    /// ESTree `typeParameters` property.
6528    pub type_parameters: Option<&'gc Node<'gc>>,
6529    /// ESTree `right` property.
6530    pub right: &'gc Node<'gc>,
6531}
6532impl<'gc> TypeAlias<'gc> {
6533    /// Build `TypeAlias` from its metadata and `ESTree.def` fields.
6534    pub fn new(
6535        metadata: NodeMetadata<'gc>,
6536        id: &'gc Node<'gc>,
6537        type_parameters: Option<&'gc Node<'gc>>,
6538        right: &'gc Node<'gc>,
6539    ) -> Self {
6540        TypeAlias {
6541            metadata,
6542            id,
6543            type_parameters,
6544            right,
6545        }
6546    }
6547}
6548
6549/// The `OpaqueType` AST node.
6550#[derive(Debug)]
6551#[repr(C)]
6552pub struct OpaqueType<'gc> {
6553    /// Source range, debug location, paren count, and node id.
6554    pub metadata: NodeMetadata<'gc>,
6555    /// ESTree `id` property.
6556    pub id: &'gc Node<'gc>,
6557    /// ESTree `typeParameters` property.
6558    pub type_parameters: Option<&'gc Node<'gc>>,
6559    /// ESTree `impltype` property.
6560    pub impltype: &'gc Node<'gc>,
6561    /// ESTree `lowerBound` property.
6562    pub lower_bound: Option<&'gc Node<'gc>>,
6563    /// ESTree `upperBound` property.
6564    pub upper_bound: Option<&'gc Node<'gc>>,
6565    /// ESTree `supertype` property.
6566    pub supertype: Option<&'gc Node<'gc>>,
6567}
6568impl<'gc> OpaqueType<'gc> {
6569    /// Build `OpaqueType` from its metadata and `ESTree.def` fields.
6570    pub fn new(
6571        metadata: NodeMetadata<'gc>,
6572        id: &'gc Node<'gc>,
6573        type_parameters: Option<&'gc Node<'gc>>,
6574        impltype: &'gc Node<'gc>,
6575        lower_bound: Option<&'gc Node<'gc>>,
6576        upper_bound: Option<&'gc Node<'gc>>,
6577        supertype: Option<&'gc Node<'gc>>,
6578    ) -> Self {
6579        OpaqueType {
6580            metadata,
6581            id,
6582            type_parameters,
6583            impltype,
6584            lower_bound,
6585            upper_bound,
6586            supertype,
6587        }
6588    }
6589}
6590
6591/// The `InterfaceDeclaration` AST node.
6592#[derive(Debug)]
6593#[repr(C)]
6594pub struct InterfaceDeclaration<'gc> {
6595    /// Source range, debug location, paren count, and node id.
6596    pub metadata: NodeMetadata<'gc>,
6597    /// ESTree `id` property.
6598    pub id: &'gc Node<'gc>,
6599    /// ESTree `typeParameters` property.
6600    pub type_parameters: Option<&'gc Node<'gc>>,
6601    /// ESTree `extends` property.
6602    pub extends: NodeList<'gc>,
6603    /// ESTree `body` property.
6604    pub body: &'gc Node<'gc>,
6605}
6606impl<'gc> InterfaceDeclaration<'gc> {
6607    /// Build `InterfaceDeclaration` from its metadata and `ESTree.def` fields.
6608    pub fn new(
6609        metadata: NodeMetadata<'gc>,
6610        id: &'gc Node<'gc>,
6611        type_parameters: Option<&'gc Node<'gc>>,
6612        extends: NodeList<'gc>,
6613        body: &'gc Node<'gc>,
6614    ) -> Self {
6615        InterfaceDeclaration {
6616            metadata,
6617            id,
6618            type_parameters,
6619            extends,
6620            body,
6621        }
6622    }
6623}
6624
6625/// The `DeclareTypeAlias` AST node.
6626#[derive(Debug)]
6627#[repr(C)]
6628pub struct DeclareTypeAlias<'gc> {
6629    /// Source range, debug location, paren count, and node id.
6630    pub metadata: NodeMetadata<'gc>,
6631    /// ESTree `id` property.
6632    pub id: &'gc Node<'gc>,
6633    /// ESTree `typeParameters` property.
6634    pub type_parameters: Option<&'gc Node<'gc>>,
6635    /// ESTree `right` property.
6636    pub right: &'gc Node<'gc>,
6637}
6638impl<'gc> DeclareTypeAlias<'gc> {
6639    /// Build `DeclareTypeAlias` from its metadata and `ESTree.def` fields.
6640    pub fn new(
6641        metadata: NodeMetadata<'gc>,
6642        id: &'gc Node<'gc>,
6643        type_parameters: Option<&'gc Node<'gc>>,
6644        right: &'gc Node<'gc>,
6645    ) -> Self {
6646        DeclareTypeAlias {
6647            metadata,
6648            id,
6649            type_parameters,
6650            right,
6651        }
6652    }
6653}
6654
6655/// The `DeclareOpaqueType` AST node.
6656#[derive(Debug)]
6657#[repr(C)]
6658pub struct DeclareOpaqueType<'gc> {
6659    /// Source range, debug location, paren count, and node id.
6660    pub metadata: NodeMetadata<'gc>,
6661    /// ESTree `id` property.
6662    pub id: &'gc Node<'gc>,
6663    /// ESTree `typeParameters` property.
6664    pub type_parameters: Option<&'gc Node<'gc>>,
6665    /// ESTree `impltype` property.
6666    pub impltype: Option<&'gc Node<'gc>>,
6667    /// ESTree `lowerBound` property.
6668    pub lower_bound: Option<&'gc Node<'gc>>,
6669    /// ESTree `upperBound` property.
6670    pub upper_bound: Option<&'gc Node<'gc>>,
6671    /// ESTree `supertype` property.
6672    pub supertype: Option<&'gc Node<'gc>>,
6673}
6674impl<'gc> DeclareOpaqueType<'gc> {
6675    /// Build `DeclareOpaqueType` from its metadata and `ESTree.def` fields.
6676    pub fn new(
6677        metadata: NodeMetadata<'gc>,
6678        id: &'gc Node<'gc>,
6679        type_parameters: Option<&'gc Node<'gc>>,
6680        impltype: Option<&'gc Node<'gc>>,
6681        lower_bound: Option<&'gc Node<'gc>>,
6682        upper_bound: Option<&'gc Node<'gc>>,
6683        supertype: Option<&'gc Node<'gc>>,
6684    ) -> Self {
6685        DeclareOpaqueType {
6686            metadata,
6687            id,
6688            type_parameters,
6689            impltype,
6690            lower_bound,
6691            upper_bound,
6692            supertype,
6693        }
6694    }
6695}
6696
6697/// The `DeclareInterface` AST node.
6698#[derive(Debug)]
6699#[repr(C)]
6700pub struct DeclareInterface<'gc> {
6701    /// Source range, debug location, paren count, and node id.
6702    pub metadata: NodeMetadata<'gc>,
6703    /// ESTree `id` property.
6704    pub id: &'gc Node<'gc>,
6705    /// ESTree `typeParameters` property.
6706    pub type_parameters: Option<&'gc Node<'gc>>,
6707    /// ESTree `extends` property.
6708    pub extends: NodeList<'gc>,
6709    /// ESTree `body` property.
6710    pub body: &'gc Node<'gc>,
6711}
6712impl<'gc> DeclareInterface<'gc> {
6713    /// Build `DeclareInterface` from its metadata and `ESTree.def` fields.
6714    pub fn new(
6715        metadata: NodeMetadata<'gc>,
6716        id: &'gc Node<'gc>,
6717        type_parameters: Option<&'gc Node<'gc>>,
6718        extends: NodeList<'gc>,
6719        body: &'gc Node<'gc>,
6720    ) -> Self {
6721        DeclareInterface {
6722            metadata,
6723            id,
6724            type_parameters,
6725            extends,
6726            body,
6727        }
6728    }
6729}
6730
6731/// The `DeclareClass` AST node.
6732#[derive(Debug)]
6733#[repr(C)]
6734pub struct DeclareClass<'gc> {
6735    /// Source range, debug location, paren count, and node id.
6736    pub metadata: NodeMetadata<'gc>,
6737    /// ESTree `id` property.
6738    pub id: &'gc Node<'gc>,
6739    /// ESTree `typeParameters` property.
6740    pub type_parameters: Option<&'gc Node<'gc>>,
6741    /// ESTree `extends` property.
6742    pub extends: NodeList<'gc>,
6743    /// ESTree `implements` property.
6744    pub implements: NodeList<'gc>,
6745    /// ESTree `mixins` property.
6746    pub mixins: NodeList<'gc>,
6747    /// ESTree `body` property.
6748    pub body: &'gc Node<'gc>,
6749}
6750impl<'gc> DeclareClass<'gc> {
6751    /// Build `DeclareClass` from its metadata and `ESTree.def` fields.
6752    pub fn new(
6753        metadata: NodeMetadata<'gc>,
6754        id: &'gc Node<'gc>,
6755        type_parameters: Option<&'gc Node<'gc>>,
6756        extends: NodeList<'gc>,
6757        implements: NodeList<'gc>,
6758        mixins: NodeList<'gc>,
6759        body: &'gc Node<'gc>,
6760    ) -> Self {
6761        DeclareClass {
6762            metadata,
6763            id,
6764            type_parameters,
6765            extends,
6766            implements,
6767            mixins,
6768            body,
6769        }
6770    }
6771}
6772
6773/// The `DeclareFunction` AST node.
6774#[derive(Debug)]
6775#[repr(C)]
6776pub struct DeclareFunction<'gc> {
6777    /// Source range, debug location, paren count, and node id.
6778    pub metadata: NodeMetadata<'gc>,
6779    /// ESTree `id` property.
6780    pub id: &'gc Node<'gc>,
6781    /// ESTree `predicate` property.
6782    pub predicate: Option<&'gc Node<'gc>>,
6783}
6784impl<'gc> DeclareFunction<'gc> {
6785    /// Build `DeclareFunction` from its metadata and `ESTree.def` fields.
6786    pub fn new(
6787        metadata: NodeMetadata<'gc>,
6788        id: &'gc Node<'gc>,
6789        predicate: Option<&'gc Node<'gc>>,
6790    ) -> Self {
6791        DeclareFunction {
6792            metadata,
6793            id,
6794            predicate,
6795        }
6796    }
6797}
6798
6799/// The `DeclareHook` AST node.
6800#[derive(Debug)]
6801#[repr(C)]
6802pub struct DeclareHook<'gc> {
6803    /// Source range, debug location, paren count, and node id.
6804    pub metadata: NodeMetadata<'gc>,
6805    /// ESTree `id` property.
6806    pub id: &'gc Node<'gc>,
6807}
6808impl<'gc> DeclareHook<'gc> {
6809    /// Build `DeclareHook` from its metadata and `ESTree.def` fields.
6810    pub fn new(
6811        metadata: NodeMetadata<'gc>,
6812        id: &'gc Node<'gc>,
6813    ) -> Self {
6814        DeclareHook {
6815            metadata,
6816            id,
6817        }
6818    }
6819}
6820
6821/// The `DeclareComponent` AST node.
6822#[derive(Debug)]
6823#[repr(C)]
6824pub struct DeclareComponent<'gc> {
6825    /// Source range, debug location, paren count, and node id.
6826    pub metadata: NodeMetadata<'gc>,
6827    /// ESTree `id` property.
6828    pub id: &'gc Node<'gc>,
6829    /// ESTree `params` property.
6830    pub params: NodeList<'gc>,
6831    /// ESTree `rest` property.
6832    pub rest: Option<&'gc Node<'gc>>,
6833    /// ESTree `typeParameters` property.
6834    pub type_parameters: Option<&'gc Node<'gc>>,
6835    /// ESTree `rendersType` property.
6836    pub renders_type: Option<&'gc Node<'gc>>,
6837}
6838impl<'gc> DeclareComponent<'gc> {
6839    /// Build `DeclareComponent` from its metadata and `ESTree.def` fields.
6840    pub fn new(
6841        metadata: NodeMetadata<'gc>,
6842        id: &'gc Node<'gc>,
6843        params: NodeList<'gc>,
6844        rest: Option<&'gc Node<'gc>>,
6845        type_parameters: Option<&'gc Node<'gc>>,
6846        renders_type: Option<&'gc Node<'gc>>,
6847    ) -> Self {
6848        DeclareComponent {
6849            metadata,
6850            id,
6851            params,
6852            rest,
6853            type_parameters,
6854            renders_type,
6855        }
6856    }
6857}
6858
6859/// The `DeclareVariable` AST node.
6860#[derive(Debug)]
6861#[repr(C)]
6862pub struct DeclareVariable<'gc> {
6863    /// Source range, debug location, paren count, and node id.
6864    pub metadata: NodeMetadata<'gc>,
6865    /// ESTree `id` property.
6866    pub id: &'gc Node<'gc>,
6867    /// ESTree `kind` property.
6868    pub kind: Cell<NodeLabel>,
6869}
6870impl<'gc> DeclareVariable<'gc> {
6871    /// Build `DeclareVariable` from its metadata and `ESTree.def` fields.
6872    pub fn new(
6873        metadata: NodeMetadata<'gc>,
6874        id: &'gc Node<'gc>,
6875        kind: NodeLabel,
6876    ) -> Self {
6877        DeclareVariable {
6878            metadata,
6879            id,
6880            kind: Cell::new(kind),
6881        }
6882    }
6883    /// The `kind` label as UTF-8 text.
6884    ///
6885    /// Label fields hold identifier names, operators, keyword-like kinds and
6886    /// raw source spans. An identifier cannot contain an unpaired surrogate —
6887    /// the lexer rejects one with a dedicated diagnostic — and the remaining
6888    /// labels are literal source text, so in practice the bytes are already
6889    /// valid UTF-8 and this borrows them directly, allocating nothing.
6890    ///
6891    /// A label that is nevertheless unrepresentable, which realistically means
6892    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
6893    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
6894    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
6895    /// character it encodes, so a `"😀"` label comes out intact.
6896    ///
6897    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
6898    /// bytes, or
6899    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
6900    /// detect the substitution. The returned `&str` borrows from `gc`, not from
6901    /// `self`.
6902    pub fn kind_str<'a>(
6903        &self,
6904        gc: &'a crate::context::GCLock<'_, '_>,
6905    ) -> &'a str {
6906        gc.bytes_str_lossy(self.kind.get())
6907    }
6908}
6909
6910/// The `DeclareEnum` AST node.
6911#[derive(Debug)]
6912#[repr(C)]
6913pub struct DeclareEnum<'gc> {
6914    /// Source range, debug location, paren count, and node id.
6915    pub metadata: NodeMetadata<'gc>,
6916    /// ESTree `id` property.
6917    pub id: &'gc Node<'gc>,
6918    /// ESTree `body` property.
6919    pub body: &'gc Node<'gc>,
6920}
6921impl<'gc> DeclareEnum<'gc> {
6922    /// Build `DeclareEnum` from its metadata and `ESTree.def` fields.
6923    pub fn new(
6924        metadata: NodeMetadata<'gc>,
6925        id: &'gc Node<'gc>,
6926        body: &'gc Node<'gc>,
6927    ) -> Self {
6928        DeclareEnum {
6929            metadata,
6930            id,
6931            body,
6932        }
6933    }
6934}
6935
6936/// The `DeclareExportDeclaration` AST node.
6937#[derive(Debug)]
6938#[repr(C)]
6939pub struct DeclareExportDeclaration<'gc> {
6940    /// Source range, debug location, paren count, and node id.
6941    pub metadata: NodeMetadata<'gc>,
6942    /// ESTree `declaration` property.
6943    pub declaration: Option<&'gc Node<'gc>>,
6944    /// ESTree `specifiers` property.
6945    pub specifiers: NodeList<'gc>,
6946    /// ESTree `source` property.
6947    pub source: Option<&'gc Node<'gc>>,
6948    /// ESTree `default` property.
6949    pub default: Cell<bool>,
6950}
6951impl<'gc> DeclareExportDeclaration<'gc> {
6952    /// Build `DeclareExportDeclaration` from its metadata and `ESTree.def`
6953    /// fields.
6954    pub fn new(
6955        metadata: NodeMetadata<'gc>,
6956        declaration: Option<&'gc Node<'gc>>,
6957        specifiers: NodeList<'gc>,
6958        source: Option<&'gc Node<'gc>>,
6959        default: bool,
6960    ) -> Self {
6961        DeclareExportDeclaration {
6962            metadata,
6963            declaration,
6964            specifiers,
6965            source,
6966            default: Cell::new(default),
6967        }
6968    }
6969}
6970
6971/// The `DeclareExportAllDeclaration` AST node.
6972#[derive(Debug)]
6973#[repr(C)]
6974pub struct DeclareExportAllDeclaration<'gc> {
6975    /// Source range, debug location, paren count, and node id.
6976    pub metadata: NodeMetadata<'gc>,
6977    /// ESTree `source` property.
6978    pub source: &'gc Node<'gc>,
6979}
6980impl<'gc> DeclareExportAllDeclaration<'gc> {
6981    /// Build `DeclareExportAllDeclaration` from its metadata and `ESTree.def`
6982    /// fields.
6983    pub fn new(
6984        metadata: NodeMetadata<'gc>,
6985        source: &'gc Node<'gc>,
6986    ) -> Self {
6987        DeclareExportAllDeclaration {
6988            metadata,
6989            source,
6990        }
6991    }
6992}
6993
6994/// The `DeclareModule` AST node.
6995#[derive(Debug)]
6996#[repr(C)]
6997pub struct DeclareModule<'gc> {
6998    /// Source range, debug location, paren count, and node id.
6999    pub metadata: NodeMetadata<'gc>,
7000    /// ESTree `id` property.
7001    pub id: &'gc Node<'gc>,
7002    /// ESTree `body` property.
7003    pub body: &'gc Node<'gc>,
7004}
7005impl<'gc> DeclareModule<'gc> {
7006    /// Build `DeclareModule` from its metadata and `ESTree.def` fields.
7007    pub fn new(
7008        metadata: NodeMetadata<'gc>,
7009        id: &'gc Node<'gc>,
7010        body: &'gc Node<'gc>,
7011    ) -> Self {
7012        DeclareModule {
7013            metadata,
7014            id,
7015            body,
7016        }
7017    }
7018}
7019
7020/// The `DeclareNamespace` AST node.
7021#[derive(Debug)]
7022#[repr(C)]
7023pub struct DeclareNamespace<'gc> {
7024    /// Source range, debug location, paren count, and node id.
7025    pub metadata: NodeMetadata<'gc>,
7026    /// ESTree `id` property.
7027    pub id: &'gc Node<'gc>,
7028    /// ESTree `body` property.
7029    pub body: &'gc Node<'gc>,
7030}
7031impl<'gc> DeclareNamespace<'gc> {
7032    /// Build `DeclareNamespace` from its metadata and `ESTree.def` fields.
7033    pub fn new(
7034        metadata: NodeMetadata<'gc>,
7035        id: &'gc Node<'gc>,
7036        body: &'gc Node<'gc>,
7037    ) -> Self {
7038        DeclareNamespace {
7039            metadata,
7040            id,
7041            body,
7042        }
7043    }
7044}
7045
7046/// The `DeclareModuleExports` AST node.
7047#[derive(Debug)]
7048#[repr(C)]
7049pub struct DeclareModuleExports<'gc> {
7050    /// Source range, debug location, paren count, and node id.
7051    pub metadata: NodeMetadata<'gc>,
7052    /// ESTree `typeAnnotation` property.
7053    pub type_annotation: &'gc Node<'gc>,
7054}
7055impl<'gc> DeclareModuleExports<'gc> {
7056    /// Build `DeclareModuleExports` from its metadata and `ESTree.def` fields.
7057    pub fn new(
7058        metadata: NodeMetadata<'gc>,
7059        type_annotation: &'gc Node<'gc>,
7060    ) -> Self {
7061        DeclareModuleExports {
7062            metadata,
7063            type_annotation,
7064        }
7065    }
7066}
7067
7068/// The `InterfaceExtends` AST node.
7069#[derive(Debug)]
7070#[repr(C)]
7071pub struct InterfaceExtends<'gc> {
7072    /// Source range, debug location, paren count, and node id.
7073    pub metadata: NodeMetadata<'gc>,
7074    /// ESTree `id` property.
7075    pub id: &'gc Node<'gc>,
7076    /// ESTree `typeParameters` property.
7077    pub type_parameters: Option<&'gc Node<'gc>>,
7078}
7079impl<'gc> InterfaceExtends<'gc> {
7080    /// Build `InterfaceExtends` from its metadata and `ESTree.def` fields.
7081    pub fn new(
7082        metadata: NodeMetadata<'gc>,
7083        id: &'gc Node<'gc>,
7084        type_parameters: Option<&'gc Node<'gc>>,
7085    ) -> Self {
7086        InterfaceExtends {
7087            metadata,
7088            id,
7089            type_parameters,
7090        }
7091    }
7092}
7093
7094/// The `ClassImplements` AST node.
7095#[derive(Debug)]
7096#[repr(C)]
7097pub struct ClassImplements<'gc> {
7098    /// Source range, debug location, paren count, and node id.
7099    pub metadata: NodeMetadata<'gc>,
7100    /// ESTree `id` property.
7101    pub id: &'gc Node<'gc>,
7102    /// ESTree `typeParameters` property.
7103    pub type_parameters: Option<&'gc Node<'gc>>,
7104}
7105impl<'gc> ClassImplements<'gc> {
7106    /// Build `ClassImplements` from its metadata and `ESTree.def` fields.
7107    pub fn new(
7108        metadata: NodeMetadata<'gc>,
7109        id: &'gc Node<'gc>,
7110        type_parameters: Option<&'gc Node<'gc>>,
7111    ) -> Self {
7112        ClassImplements {
7113            metadata,
7114            id,
7115            type_parameters,
7116        }
7117    }
7118}
7119
7120/// The `TypeAnnotation` AST node.
7121#[derive(Debug)]
7122#[repr(C)]
7123pub struct TypeAnnotation<'gc> {
7124    /// Source range, debug location, paren count, and node id.
7125    pub metadata: NodeMetadata<'gc>,
7126    /// ESTree `typeAnnotation` property.
7127    pub type_annotation: &'gc Node<'gc>,
7128}
7129impl<'gc> TypeAnnotation<'gc> {
7130    /// Build `TypeAnnotation` from its metadata and `ESTree.def` fields.
7131    pub fn new(
7132        metadata: NodeMetadata<'gc>,
7133        type_annotation: &'gc Node<'gc>,
7134    ) -> Self {
7135        TypeAnnotation {
7136            metadata,
7137            type_annotation,
7138        }
7139    }
7140}
7141
7142/// The `ObjectTypeAnnotation` AST node.
7143#[derive(Debug)]
7144#[repr(C)]
7145pub struct ObjectTypeAnnotation<'gc> {
7146    /// Source range, debug location, paren count, and node id.
7147    pub metadata: NodeMetadata<'gc>,
7148    /// ESTree `properties` property.
7149    pub properties: NodeList<'gc>,
7150    /// ESTree `indexers` property.
7151    pub indexers: NodeList<'gc>,
7152    /// ESTree `callProperties` property.
7153    pub call_properties: NodeList<'gc>,
7154    /// ESTree `internalSlots` property.
7155    pub internal_slots: NodeList<'gc>,
7156    /// ESTree `inexact` property.
7157    pub inexact: Cell<bool>,
7158    /// ESTree `exact` property.
7159    pub exact: Cell<bool>,
7160}
7161impl<'gc> ObjectTypeAnnotation<'gc> {
7162    /// Build `ObjectTypeAnnotation` from its metadata and `ESTree.def` fields.
7163    pub fn new(
7164        metadata: NodeMetadata<'gc>,
7165        properties: NodeList<'gc>,
7166        indexers: NodeList<'gc>,
7167        call_properties: NodeList<'gc>,
7168        internal_slots: NodeList<'gc>,
7169        inexact: bool,
7170        exact: bool,
7171    ) -> Self {
7172        ObjectTypeAnnotation {
7173            metadata,
7174            properties,
7175            indexers,
7176            call_properties,
7177            internal_slots,
7178            inexact: Cell::new(inexact),
7179            exact: Cell::new(exact),
7180        }
7181    }
7182}
7183
7184/// The `ObjectTypeProperty` AST node.
7185#[derive(Debug)]
7186#[repr(C)]
7187pub struct ObjectTypeProperty<'gc> {
7188    /// Source range, debug location, paren count, and node id.
7189    pub metadata: NodeMetadata<'gc>,
7190    /// ESTree `key` property.
7191    pub key: &'gc Node<'gc>,
7192    /// ESTree `value` property.
7193    pub value: &'gc Node<'gc>,
7194    /// ESTree `method` property.
7195    pub method: Cell<bool>,
7196    /// ESTree `optional` property.
7197    pub optional: Cell<bool>,
7198    /// ESTree `static` property.
7199    pub r#static: Cell<bool>,
7200    /// ESTree `proto` property.
7201    pub proto: Cell<bool>,
7202    /// ESTree `variance` property.
7203    pub variance: Option<&'gc Node<'gc>>,
7204    /// ESTree `kind` property.
7205    pub kind: Cell<NodeLabel>,
7206}
7207impl<'gc> ObjectTypeProperty<'gc> {
7208    /// Build `ObjectTypeProperty` from its metadata and `ESTree.def` fields.
7209    pub fn new(
7210        metadata: NodeMetadata<'gc>,
7211        key: &'gc Node<'gc>,
7212        value: &'gc Node<'gc>,
7213        method: bool,
7214        optional: bool,
7215        r#static: bool,
7216        proto: bool,
7217        variance: Option<&'gc Node<'gc>>,
7218        kind: NodeLabel,
7219    ) -> Self {
7220        ObjectTypeProperty {
7221            metadata,
7222            key,
7223            value,
7224            method: Cell::new(method),
7225            optional: Cell::new(optional),
7226            r#static: Cell::new(r#static),
7227            proto: Cell::new(proto),
7228            variance,
7229            kind: Cell::new(kind),
7230        }
7231    }
7232    /// The `kind` label as UTF-8 text.
7233    ///
7234    /// Label fields hold identifier names, operators, keyword-like kinds and
7235    /// raw source spans. An identifier cannot contain an unpaired surrogate —
7236    /// the lexer rejects one with a dedicated diagnostic — and the remaining
7237    /// labels are literal source text, so in practice the bytes are already
7238    /// valid UTF-8 and this borrows them directly, allocating nothing.
7239    ///
7240    /// A label that is nevertheless unrepresentable, which realistically means
7241    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
7242    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
7243    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
7244    /// character it encodes, so a `"😀"` label comes out intact.
7245    ///
7246    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
7247    /// bytes, or
7248    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
7249    /// detect the substitution. The returned `&str` borrows from `gc`, not from
7250    /// `self`.
7251    pub fn kind_str<'a>(
7252        &self,
7253        gc: &'a crate::context::GCLock<'_, '_>,
7254    ) -> &'a str {
7255        gc.bytes_str_lossy(self.kind.get())
7256    }
7257}
7258
7259/// The `ObjectTypeSpreadProperty` AST node.
7260#[derive(Debug)]
7261#[repr(C)]
7262pub struct ObjectTypeSpreadProperty<'gc> {
7263    /// Source range, debug location, paren count, and node id.
7264    pub metadata: NodeMetadata<'gc>,
7265    /// ESTree `argument` property.
7266    pub argument: &'gc Node<'gc>,
7267}
7268impl<'gc> ObjectTypeSpreadProperty<'gc> {
7269    /// Build `ObjectTypeSpreadProperty` from its metadata and `ESTree.def`
7270    /// fields.
7271    pub fn new(
7272        metadata: NodeMetadata<'gc>,
7273        argument: &'gc Node<'gc>,
7274    ) -> Self {
7275        ObjectTypeSpreadProperty {
7276            metadata,
7277            argument,
7278        }
7279    }
7280}
7281
7282/// The `ObjectTypeInternalSlot` AST node.
7283#[derive(Debug)]
7284#[repr(C)]
7285pub struct ObjectTypeInternalSlot<'gc> {
7286    /// Source range, debug location, paren count, and node id.
7287    pub metadata: NodeMetadata<'gc>,
7288    /// ESTree `id` property.
7289    pub id: &'gc Node<'gc>,
7290    /// ESTree `value` property.
7291    pub value: &'gc Node<'gc>,
7292    /// ESTree `optional` property.
7293    pub optional: Cell<bool>,
7294    /// ESTree `static` property.
7295    pub r#static: Cell<bool>,
7296    /// ESTree `method` property.
7297    pub method: Cell<bool>,
7298}
7299impl<'gc> ObjectTypeInternalSlot<'gc> {
7300    /// Build `ObjectTypeInternalSlot` from its metadata and `ESTree.def`
7301    /// fields.
7302    pub fn new(
7303        metadata: NodeMetadata<'gc>,
7304        id: &'gc Node<'gc>,
7305        value: &'gc Node<'gc>,
7306        optional: bool,
7307        r#static: bool,
7308        method: bool,
7309    ) -> Self {
7310        ObjectTypeInternalSlot {
7311            metadata,
7312            id,
7313            value,
7314            optional: Cell::new(optional),
7315            r#static: Cell::new(r#static),
7316            method: Cell::new(method),
7317        }
7318    }
7319}
7320
7321/// The `ObjectTypeCallProperty` AST node.
7322#[derive(Debug)]
7323#[repr(C)]
7324pub struct ObjectTypeCallProperty<'gc> {
7325    /// Source range, debug location, paren count, and node id.
7326    pub metadata: NodeMetadata<'gc>,
7327    /// ESTree `value` property.
7328    pub value: &'gc Node<'gc>,
7329    /// ESTree `static` property.
7330    pub r#static: Cell<bool>,
7331}
7332impl<'gc> ObjectTypeCallProperty<'gc> {
7333    /// Build `ObjectTypeCallProperty` from its metadata and `ESTree.def`
7334    /// fields.
7335    pub fn new(
7336        metadata: NodeMetadata<'gc>,
7337        value: &'gc Node<'gc>,
7338        r#static: bool,
7339    ) -> Self {
7340        ObjectTypeCallProperty {
7341            metadata,
7342            value,
7343            r#static: Cell::new(r#static),
7344        }
7345    }
7346}
7347
7348/// The `ObjectTypeIndexer` AST node.
7349#[derive(Debug)]
7350#[repr(C)]
7351pub struct ObjectTypeIndexer<'gc> {
7352    /// Source range, debug location, paren count, and node id.
7353    pub metadata: NodeMetadata<'gc>,
7354    /// ESTree `id` property.
7355    pub id: Option<&'gc Node<'gc>>,
7356    /// ESTree `key` property.
7357    pub key: &'gc Node<'gc>,
7358    /// ESTree `value` property.
7359    pub value: &'gc Node<'gc>,
7360    /// ESTree `static` property.
7361    pub r#static: Cell<bool>,
7362    /// ESTree `variance` property.
7363    pub variance: Option<&'gc Node<'gc>>,
7364}
7365impl<'gc> ObjectTypeIndexer<'gc> {
7366    /// Build `ObjectTypeIndexer` from its metadata and `ESTree.def` fields.
7367    pub fn new(
7368        metadata: NodeMetadata<'gc>,
7369        id: Option<&'gc Node<'gc>>,
7370        key: &'gc Node<'gc>,
7371        value: &'gc Node<'gc>,
7372        r#static: bool,
7373        variance: Option<&'gc Node<'gc>>,
7374    ) -> Self {
7375        ObjectTypeIndexer {
7376            metadata,
7377            id,
7378            key,
7379            value,
7380            r#static: Cell::new(r#static),
7381            variance,
7382        }
7383    }
7384}
7385
7386/// The `ObjectTypeMappedTypeProperty` AST node.
7387#[derive(Debug)]
7388#[repr(C)]
7389pub struct ObjectTypeMappedTypeProperty<'gc> {
7390    /// Source range, debug location, paren count, and node id.
7391    pub metadata: NodeMetadata<'gc>,
7392    /// ESTree `keyTparam` property.
7393    pub key_tparam: &'gc Node<'gc>,
7394    /// ESTree `propType` property.
7395    pub prop_type: &'gc Node<'gc>,
7396    /// ESTree `sourceType` property.
7397    pub source_type: &'gc Node<'gc>,
7398    /// ESTree `variance` property.
7399    pub variance: Option<&'gc Node<'gc>>,
7400    /// ESTree `optional` property.
7401    pub optional: Cell<NodeString>,
7402}
7403impl<'gc> ObjectTypeMappedTypeProperty<'gc> {
7404    /// Build `ObjectTypeMappedTypeProperty` from its metadata and `ESTree.def`
7405    /// fields.
7406    pub fn new(
7407        metadata: NodeMetadata<'gc>,
7408        key_tparam: &'gc Node<'gc>,
7409        prop_type: &'gc Node<'gc>,
7410        source_type: &'gc Node<'gc>,
7411        variance: Option<&'gc Node<'gc>>,
7412        optional: NodeString,
7413    ) -> Self {
7414        ObjectTypeMappedTypeProperty {
7415            metadata,
7416            key_tparam,
7417            prop_type,
7418            source_type,
7419            variance,
7420            optional: Cell::new(optional),
7421        }
7422    }
7423    /// The `optional` string value as UTF-8, or `None` if it has no UTF-8 form.
7424    ///
7425    /// A JS string value is a sequence of UTF-16 code units, so it may legally
7426    /// contain an *unpaired* surrogate (`"\uD800"` parses, and is not an
7427    /// error). That, and only that, is what `None` reports: the value is
7428    /// intact, it simply cannot be spelled in UTF-8. Read it losslessly with
7429    /// [`GCLock::bytes`](crate::context::GCLock::bytes).
7430    ///
7431    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
7432    /// *pair* is not: the lexer interns an astral character in surrogate-pair
7433    /// form, and it is folded back into the character it encodes, so a `"😀"`
7434    /// literal yields `Some("😀")`, not `None`.
7435    ///
7436    /// There is deliberately no plain `optional_str`: an unrepresentable
7437    /// identifier means something is broken, but an unrepresentable string
7438    /// literal is legal JS, and a codegen or refactoring tool that let U+FFFD
7439    /// be substituted here would silently rewrite the user's program. Reach for
7440    /// [`Self::optional_str_lossy`] only when a best-effort rendering is what
7441    /// you want.
7442    ///
7443    /// Valid UTF-8 is borrowed from the atom's own bytes and allocates nothing;
7444    /// folding a surrogate pair allocates once per atom, cached in the context.
7445    /// The returned `&str` borrows from `gc`, not from `self`.
7446    pub fn try_optional_str<'a>(
7447        &self,
7448        gc: &'a crate::context::GCLock<'_, '_>,
7449    ) -> Option<&'a str> {
7450        gc.try_bytes_str(self.optional.get())
7451    }
7452    /// The `optional` string value as UTF-8, substituting U+FFFD for anything
7453    /// unrepresentable.
7454    ///
7455    /// **This is lossy.** A JS string value may legally contain an unpaired
7456    /// surrogate (`"\uD800"` parses), which has no UTF-8 form; each one becomes
7457    /// exactly one U+FFFD here. Do not use this to re-emit source: a codegen or
7458    /// refactoring tool would silently rewrite the user's program.
7459    ///
7460    /// Only an *unpaired* surrogate is unrepresentable. A WTF-8 surrogate
7461    /// *pair* is not: the lexer interns an astral character in surrogate-pair
7462    /// form, and it is folded back into the character it encodes, so a `"😀"`
7463    /// literal comes out intact.
7464    ///
7465    /// Use [`Self::try_optional_str`] or
7466    /// [`GCLock::bytes`](crate::context::GCLock::bytes) when the exact value
7467    /// matters. The returned `&str` borrows from `gc`, not from `self`.
7468    pub fn optional_str_lossy<'a>(
7469        &self,
7470        gc: &'a crate::context::GCLock<'_, '_>,
7471    ) -> &'a str {
7472        gc.bytes_str_lossy(self.optional.get())
7473    }
7474}
7475
7476/// The `Variance` AST node.
7477#[derive(Debug)]
7478#[repr(C)]
7479pub struct Variance<'gc> {
7480    /// Source range, debug location, paren count, and node id.
7481    pub metadata: NodeMetadata<'gc>,
7482    /// ESTree `kind` property.
7483    pub kind: Cell<NodeLabel>,
7484}
7485impl<'gc> Variance<'gc> {
7486    /// Build `Variance` from its metadata and `ESTree.def` fields.
7487    pub fn new(
7488        metadata: NodeMetadata<'gc>,
7489        kind: NodeLabel,
7490    ) -> Self {
7491        Variance {
7492            metadata,
7493            kind: Cell::new(kind),
7494        }
7495    }
7496    /// The `kind` label as UTF-8 text.
7497    ///
7498    /// Label fields hold identifier names, operators, keyword-like kinds and
7499    /// raw source spans. An identifier cannot contain an unpaired surrogate —
7500    /// the lexer rejects one with a dedicated diagnostic — and the remaining
7501    /// labels are literal source text, so in practice the bytes are already
7502    /// valid UTF-8 and this borrows them directly, allocating nothing.
7503    ///
7504    /// A label that is nevertheless unrepresentable, which realistically means
7505    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
7506    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
7507    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
7508    /// character it encodes, so a `"😀"` label comes out intact.
7509    ///
7510    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
7511    /// bytes, or
7512    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
7513    /// detect the substitution. The returned `&str` borrows from `gc`, not from
7514    /// `self`.
7515    pub fn kind_str<'a>(
7516        &self,
7517        gc: &'a crate::context::GCLock<'_, '_>,
7518    ) -> &'a str {
7519        gc.bytes_str_lossy(self.kind.get())
7520    }
7521}
7522
7523/// The `TypeParameterDeclaration` AST node.
7524#[derive(Debug)]
7525#[repr(C)]
7526pub struct TypeParameterDeclaration<'gc> {
7527    /// Source range, debug location, paren count, and node id.
7528    pub metadata: NodeMetadata<'gc>,
7529    /// ESTree `params` property.
7530    pub params: NodeList<'gc>,
7531}
7532impl<'gc> TypeParameterDeclaration<'gc> {
7533    /// Build `TypeParameterDeclaration` from its metadata and `ESTree.def`
7534    /// fields.
7535    pub fn new(
7536        metadata: NodeMetadata<'gc>,
7537        params: NodeList<'gc>,
7538    ) -> Self {
7539        TypeParameterDeclaration {
7540            metadata,
7541            params,
7542        }
7543    }
7544}
7545
7546/// The `TypeParameter` AST node.
7547#[derive(Debug)]
7548#[repr(C)]
7549pub struct TypeParameter<'gc> {
7550    /// Source range, debug location, paren count, and node id.
7551    pub metadata: NodeMetadata<'gc>,
7552    /// ESTree `name` property.
7553    pub name: Cell<NodeLabel>,
7554    /// ESTree `const` property.
7555    pub r#const: Cell<bool>,
7556    /// ESTree `bound` property.
7557    pub bound: Option<&'gc Node<'gc>>,
7558    /// ESTree `variance` property.
7559    pub variance: Option<&'gc Node<'gc>>,
7560    /// ESTree `default` property.
7561    pub default: Option<&'gc Node<'gc>>,
7562    /// ESTree `usesExtendsBound` property.
7563    pub uses_extends_bound: Cell<bool>,
7564}
7565impl<'gc> TypeParameter<'gc> {
7566    /// Build `TypeParameter` from its metadata and `ESTree.def` fields.
7567    pub fn new(
7568        metadata: NodeMetadata<'gc>,
7569        name: NodeLabel,
7570        r#const: bool,
7571        bound: Option<&'gc Node<'gc>>,
7572        variance: Option<&'gc Node<'gc>>,
7573        default: Option<&'gc Node<'gc>>,
7574        uses_extends_bound: bool,
7575    ) -> Self {
7576        TypeParameter {
7577            metadata,
7578            name: Cell::new(name),
7579            r#const: Cell::new(r#const),
7580            bound,
7581            variance,
7582            default,
7583            uses_extends_bound: Cell::new(uses_extends_bound),
7584        }
7585    }
7586    /// The `name` label as UTF-8 text.
7587    ///
7588    /// Label fields hold identifier names, operators, keyword-like kinds and
7589    /// raw source spans. An identifier cannot contain an unpaired surrogate —
7590    /// the lexer rejects one with a dedicated diagnostic — and the remaining
7591    /// labels are literal source text, so in practice the bytes are already
7592    /// valid UTF-8 and this borrows them directly, allocating nothing.
7593    ///
7594    /// A label that is nevertheless unrepresentable, which realistically means
7595    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
7596    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
7597    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
7598    /// character it encodes, so a `"😀"` label comes out intact.
7599    ///
7600    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
7601    /// bytes, or
7602    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
7603    /// detect the substitution. The returned `&str` borrows from `gc`, not from
7604    /// `self`.
7605    pub fn name_str<'a>(
7606        &self,
7607        gc: &'a crate::context::GCLock<'_, '_>,
7608    ) -> &'a str {
7609        gc.bytes_str_lossy(self.name.get())
7610    }
7611}
7612
7613/// The `TypeParameterInstantiation` AST node.
7614#[derive(Debug)]
7615#[repr(C)]
7616pub struct TypeParameterInstantiation<'gc> {
7617    /// Source range, debug location, paren count, and node id.
7618    pub metadata: NodeMetadata<'gc>,
7619    /// ESTree `params` property.
7620    pub params: NodeList<'gc>,
7621}
7622impl<'gc> TypeParameterInstantiation<'gc> {
7623    /// Build `TypeParameterInstantiation` from its metadata and `ESTree.def`
7624    /// fields.
7625    pub fn new(
7626        metadata: NodeMetadata<'gc>,
7627        params: NodeList<'gc>,
7628    ) -> Self {
7629        TypeParameterInstantiation {
7630            metadata,
7631            params,
7632        }
7633    }
7634}
7635
7636/// The `TypeCastExpression` AST node.
7637#[derive(Debug)]
7638#[repr(C)]
7639pub struct TypeCastExpression<'gc> {
7640    /// Source range, debug location, paren count, and node id.
7641    pub metadata: NodeMetadata<'gc>,
7642    /// ESTree `expression` property.
7643    pub expression: &'gc Node<'gc>,
7644    /// ESTree `typeAnnotation` property.
7645    pub type_annotation: &'gc Node<'gc>,
7646}
7647impl<'gc> TypeCastExpression<'gc> {
7648    /// Build `TypeCastExpression` from its metadata and `ESTree.def` fields.
7649    pub fn new(
7650        metadata: NodeMetadata<'gc>,
7651        expression: &'gc Node<'gc>,
7652        type_annotation: &'gc Node<'gc>,
7653    ) -> Self {
7654        TypeCastExpression {
7655            metadata,
7656            expression,
7657            type_annotation,
7658        }
7659    }
7660}
7661
7662/// The `AsExpression` AST node.
7663#[derive(Debug)]
7664#[repr(C)]
7665pub struct AsExpression<'gc> {
7666    /// Source range, debug location, paren count, and node id.
7667    pub metadata: NodeMetadata<'gc>,
7668    /// ESTree `expression` property.
7669    pub expression: &'gc Node<'gc>,
7670    /// ESTree `typeAnnotation` property.
7671    pub type_annotation: &'gc Node<'gc>,
7672}
7673impl<'gc> AsExpression<'gc> {
7674    /// Build `AsExpression` from its metadata and `ESTree.def` fields.
7675    pub fn new(
7676        metadata: NodeMetadata<'gc>,
7677        expression: &'gc Node<'gc>,
7678        type_annotation: &'gc Node<'gc>,
7679    ) -> Self {
7680        AsExpression {
7681            metadata,
7682            expression,
7683            type_annotation,
7684        }
7685    }
7686}
7687
7688/// The `AsConstExpression` AST node.
7689#[derive(Debug)]
7690#[repr(C)]
7691pub struct AsConstExpression<'gc> {
7692    /// Source range, debug location, paren count, and node id.
7693    pub metadata: NodeMetadata<'gc>,
7694    /// ESTree `expression` property.
7695    pub expression: &'gc Node<'gc>,
7696}
7697impl<'gc> AsConstExpression<'gc> {
7698    /// Build `AsConstExpression` from its metadata and `ESTree.def` fields.
7699    pub fn new(
7700        metadata: NodeMetadata<'gc>,
7701        expression: &'gc Node<'gc>,
7702    ) -> Self {
7703        AsConstExpression {
7704            metadata,
7705            expression,
7706        }
7707    }
7708}
7709
7710/// The `InferredPredicate` AST node.
7711#[derive(Debug)]
7712#[repr(C)]
7713pub struct InferredPredicate<'gc> {
7714    /// Source range, debug location, paren count, and node id.
7715    pub metadata: NodeMetadata<'gc>,
7716}
7717impl<'gc> InferredPredicate<'gc> {
7718    /// Build `InferredPredicate` from its metadata and `ESTree.def` fields.
7719    pub fn new(
7720        metadata: NodeMetadata<'gc>,
7721    ) -> Self {
7722        InferredPredicate {
7723            metadata,
7724        }
7725    }
7726}
7727
7728/// The `DeclaredPredicate` AST node.
7729#[derive(Debug)]
7730#[repr(C)]
7731pub struct DeclaredPredicate<'gc> {
7732    /// Source range, debug location, paren count, and node id.
7733    pub metadata: NodeMetadata<'gc>,
7734    /// ESTree `value` property.
7735    pub value: &'gc Node<'gc>,
7736}
7737impl<'gc> DeclaredPredicate<'gc> {
7738    /// Build `DeclaredPredicate` from its metadata and `ESTree.def` fields.
7739    pub fn new(
7740        metadata: NodeMetadata<'gc>,
7741        value: &'gc Node<'gc>,
7742    ) -> Self {
7743        DeclaredPredicate {
7744            metadata,
7745            value,
7746        }
7747    }
7748}
7749
7750/// The `EnumDeclaration` AST node.
7751#[derive(Debug)]
7752#[repr(C)]
7753pub struct EnumDeclaration<'gc> {
7754    /// Source range, debug location, paren count, and node id.
7755    pub metadata: NodeMetadata<'gc>,
7756    /// ESTree `id` property.
7757    pub id: &'gc Node<'gc>,
7758    /// ESTree `body` property.
7759    pub body: &'gc Node<'gc>,
7760}
7761impl<'gc> EnumDeclaration<'gc> {
7762    /// Build `EnumDeclaration` from its metadata and `ESTree.def` fields.
7763    pub fn new(
7764        metadata: NodeMetadata<'gc>,
7765        id: &'gc Node<'gc>,
7766        body: &'gc Node<'gc>,
7767    ) -> Self {
7768        EnumDeclaration {
7769            metadata,
7770            id,
7771            body,
7772        }
7773    }
7774}
7775
7776/// The `EnumStringBody` AST node.
7777#[derive(Debug)]
7778#[repr(C)]
7779pub struct EnumStringBody<'gc> {
7780    /// Source range, debug location, paren count, and node id.
7781    pub metadata: NodeMetadata<'gc>,
7782    /// ESTree `members` property.
7783    pub members: NodeList<'gc>,
7784    /// ESTree `explicitType` property.
7785    pub explicit_type: Cell<bool>,
7786    /// ESTree `hasUnknownMembers` property.
7787    pub has_unknown_members: Cell<bool>,
7788}
7789impl<'gc> EnumStringBody<'gc> {
7790    /// Build `EnumStringBody` from its metadata and `ESTree.def` fields.
7791    pub fn new(
7792        metadata: NodeMetadata<'gc>,
7793        members: NodeList<'gc>,
7794        explicit_type: bool,
7795        has_unknown_members: bool,
7796    ) -> Self {
7797        EnumStringBody {
7798            metadata,
7799            members,
7800            explicit_type: Cell::new(explicit_type),
7801            has_unknown_members: Cell::new(has_unknown_members),
7802        }
7803    }
7804}
7805
7806/// The `EnumNumberBody` AST node.
7807#[derive(Debug)]
7808#[repr(C)]
7809pub struct EnumNumberBody<'gc> {
7810    /// Source range, debug location, paren count, and node id.
7811    pub metadata: NodeMetadata<'gc>,
7812    /// ESTree `members` property.
7813    pub members: NodeList<'gc>,
7814    /// ESTree `explicitType` property.
7815    pub explicit_type: Cell<bool>,
7816    /// ESTree `hasUnknownMembers` property.
7817    pub has_unknown_members: Cell<bool>,
7818}
7819impl<'gc> EnumNumberBody<'gc> {
7820    /// Build `EnumNumberBody` from its metadata and `ESTree.def` fields.
7821    pub fn new(
7822        metadata: NodeMetadata<'gc>,
7823        members: NodeList<'gc>,
7824        explicit_type: bool,
7825        has_unknown_members: bool,
7826    ) -> Self {
7827        EnumNumberBody {
7828            metadata,
7829            members,
7830            explicit_type: Cell::new(explicit_type),
7831            has_unknown_members: Cell::new(has_unknown_members),
7832        }
7833    }
7834}
7835
7836/// The `EnumBigIntBody` AST node.
7837#[derive(Debug)]
7838#[repr(C)]
7839pub struct EnumBigIntBody<'gc> {
7840    /// Source range, debug location, paren count, and node id.
7841    pub metadata: NodeMetadata<'gc>,
7842    /// ESTree `members` property.
7843    pub members: NodeList<'gc>,
7844    /// ESTree `explicitType` property.
7845    pub explicit_type: Cell<bool>,
7846    /// ESTree `hasUnknownMembers` property.
7847    pub has_unknown_members: Cell<bool>,
7848}
7849impl<'gc> EnumBigIntBody<'gc> {
7850    /// Build `EnumBigIntBody` from its metadata and `ESTree.def` fields.
7851    pub fn new(
7852        metadata: NodeMetadata<'gc>,
7853        members: NodeList<'gc>,
7854        explicit_type: bool,
7855        has_unknown_members: bool,
7856    ) -> Self {
7857        EnumBigIntBody {
7858            metadata,
7859            members,
7860            explicit_type: Cell::new(explicit_type),
7861            has_unknown_members: Cell::new(has_unknown_members),
7862        }
7863    }
7864}
7865
7866/// The `EnumBooleanBody` AST node.
7867#[derive(Debug)]
7868#[repr(C)]
7869pub struct EnumBooleanBody<'gc> {
7870    /// Source range, debug location, paren count, and node id.
7871    pub metadata: NodeMetadata<'gc>,
7872    /// ESTree `members` property.
7873    pub members: NodeList<'gc>,
7874    /// ESTree `explicitType` property.
7875    pub explicit_type: Cell<bool>,
7876    /// ESTree `hasUnknownMembers` property.
7877    pub has_unknown_members: Cell<bool>,
7878}
7879impl<'gc> EnumBooleanBody<'gc> {
7880    /// Build `EnumBooleanBody` from its metadata and `ESTree.def` fields.
7881    pub fn new(
7882        metadata: NodeMetadata<'gc>,
7883        members: NodeList<'gc>,
7884        explicit_type: bool,
7885        has_unknown_members: bool,
7886    ) -> Self {
7887        EnumBooleanBody {
7888            metadata,
7889            members,
7890            explicit_type: Cell::new(explicit_type),
7891            has_unknown_members: Cell::new(has_unknown_members),
7892        }
7893    }
7894}
7895
7896/// The `EnumSymbolBody` AST node.
7897#[derive(Debug)]
7898#[repr(C)]
7899pub struct EnumSymbolBody<'gc> {
7900    /// Source range, debug location, paren count, and node id.
7901    pub metadata: NodeMetadata<'gc>,
7902    /// ESTree `members` property.
7903    pub members: NodeList<'gc>,
7904    /// ESTree `hasUnknownMembers` property.
7905    pub has_unknown_members: Cell<bool>,
7906}
7907impl<'gc> EnumSymbolBody<'gc> {
7908    /// Build `EnumSymbolBody` from its metadata and `ESTree.def` fields.
7909    pub fn new(
7910        metadata: NodeMetadata<'gc>,
7911        members: NodeList<'gc>,
7912        has_unknown_members: bool,
7913    ) -> Self {
7914        EnumSymbolBody {
7915            metadata,
7916            members,
7917            has_unknown_members: Cell::new(has_unknown_members),
7918        }
7919    }
7920}
7921
7922/// The `EnumDefaultedMember` AST node.
7923#[derive(Debug)]
7924#[repr(C)]
7925pub struct EnumDefaultedMember<'gc> {
7926    /// Source range, debug location, paren count, and node id.
7927    pub metadata: NodeMetadata<'gc>,
7928    /// ESTree `id` property.
7929    pub id: &'gc Node<'gc>,
7930}
7931impl<'gc> EnumDefaultedMember<'gc> {
7932    /// Build `EnumDefaultedMember` from its metadata and `ESTree.def` fields.
7933    pub fn new(
7934        metadata: NodeMetadata<'gc>,
7935        id: &'gc Node<'gc>,
7936    ) -> Self {
7937        EnumDefaultedMember {
7938            metadata,
7939            id,
7940        }
7941    }
7942}
7943
7944/// The `EnumStringMember` AST node.
7945#[derive(Debug)]
7946#[repr(C)]
7947pub struct EnumStringMember<'gc> {
7948    /// Source range, debug location, paren count, and node id.
7949    pub metadata: NodeMetadata<'gc>,
7950    /// ESTree `id` property.
7951    pub id: &'gc Node<'gc>,
7952    /// ESTree `init` property.
7953    pub init: &'gc Node<'gc>,
7954}
7955impl<'gc> EnumStringMember<'gc> {
7956    /// Build `EnumStringMember` from its metadata and `ESTree.def` fields.
7957    pub fn new(
7958        metadata: NodeMetadata<'gc>,
7959        id: &'gc Node<'gc>,
7960        init: &'gc Node<'gc>,
7961    ) -> Self {
7962        EnumStringMember {
7963            metadata,
7964            id,
7965            init,
7966        }
7967    }
7968}
7969
7970/// The `EnumNumberMember` AST node.
7971#[derive(Debug)]
7972#[repr(C)]
7973pub struct EnumNumberMember<'gc> {
7974    /// Source range, debug location, paren count, and node id.
7975    pub metadata: NodeMetadata<'gc>,
7976    /// ESTree `id` property.
7977    pub id: &'gc Node<'gc>,
7978    /// ESTree `init` property.
7979    pub init: &'gc Node<'gc>,
7980}
7981impl<'gc> EnumNumberMember<'gc> {
7982    /// Build `EnumNumberMember` from its metadata and `ESTree.def` fields.
7983    pub fn new(
7984        metadata: NodeMetadata<'gc>,
7985        id: &'gc Node<'gc>,
7986        init: &'gc Node<'gc>,
7987    ) -> Self {
7988        EnumNumberMember {
7989            metadata,
7990            id,
7991            init,
7992        }
7993    }
7994}
7995
7996/// The `EnumBigIntMember` AST node.
7997#[derive(Debug)]
7998#[repr(C)]
7999pub struct EnumBigIntMember<'gc> {
8000    /// Source range, debug location, paren count, and node id.
8001    pub metadata: NodeMetadata<'gc>,
8002    /// ESTree `id` property.
8003    pub id: &'gc Node<'gc>,
8004    /// ESTree `init` property.
8005    pub init: &'gc Node<'gc>,
8006}
8007impl<'gc> EnumBigIntMember<'gc> {
8008    /// Build `EnumBigIntMember` from its metadata and `ESTree.def` fields.
8009    pub fn new(
8010        metadata: NodeMetadata<'gc>,
8011        id: &'gc Node<'gc>,
8012        init: &'gc Node<'gc>,
8013    ) -> Self {
8014        EnumBigIntMember {
8015            metadata,
8016            id,
8017            init,
8018        }
8019    }
8020}
8021
8022/// The `EnumBooleanMember` AST node.
8023#[derive(Debug)]
8024#[repr(C)]
8025pub struct EnumBooleanMember<'gc> {
8026    /// Source range, debug location, paren count, and node id.
8027    pub metadata: NodeMetadata<'gc>,
8028    /// ESTree `id` property.
8029    pub id: &'gc Node<'gc>,
8030    /// ESTree `init` property.
8031    pub init: &'gc Node<'gc>,
8032}
8033impl<'gc> EnumBooleanMember<'gc> {
8034    /// Build `EnumBooleanMember` from its metadata and `ESTree.def` fields.
8035    pub fn new(
8036        metadata: NodeMetadata<'gc>,
8037        id: &'gc Node<'gc>,
8038        init: &'gc Node<'gc>,
8039    ) -> Self {
8040        EnumBooleanMember {
8041            metadata,
8042            id,
8043            init,
8044        }
8045    }
8046}
8047
8048/// The `ComponentParameter` AST node.
8049#[derive(Debug)]
8050#[repr(C)]
8051pub struct ComponentParameter<'gc> {
8052    /// Source range, debug location, paren count, and node id.
8053    pub metadata: NodeMetadata<'gc>,
8054    /// ESTree `name` property.
8055    pub name: &'gc Node<'gc>,
8056    /// ESTree `local` property.
8057    pub local: &'gc Node<'gc>,
8058    /// ESTree `shorthand` property.
8059    pub shorthand: Cell<bool>,
8060}
8061impl<'gc> ComponentParameter<'gc> {
8062    /// Build `ComponentParameter` from its metadata and `ESTree.def` fields.
8063    pub fn new(
8064        metadata: NodeMetadata<'gc>,
8065        name: &'gc Node<'gc>,
8066        local: &'gc Node<'gc>,
8067        shorthand: bool,
8068    ) -> Self {
8069        ComponentParameter {
8070            metadata,
8071            name,
8072            local,
8073            shorthand: Cell::new(shorthand),
8074        }
8075    }
8076}
8077
8078/// The `RecordDeclaration` AST node.
8079#[derive(Debug)]
8080#[repr(C)]
8081pub struct RecordDeclaration<'gc> {
8082    /// Source range, debug location, paren count, and node id.
8083    pub metadata: NodeMetadata<'gc>,
8084    /// ESTree `id` property.
8085    pub id: &'gc Node<'gc>,
8086    /// ESTree `typeParameters` property.
8087    pub type_parameters: Option<&'gc Node<'gc>>,
8088    /// ESTree `implements` property.
8089    pub implements: NodeList<'gc>,
8090    /// ESTree `body` property.
8091    pub body: &'gc Node<'gc>,
8092}
8093impl<'gc> RecordDeclaration<'gc> {
8094    /// Build `RecordDeclaration` from its metadata and `ESTree.def` fields.
8095    pub fn new(
8096        metadata: NodeMetadata<'gc>,
8097        id: &'gc Node<'gc>,
8098        type_parameters: Option<&'gc Node<'gc>>,
8099        implements: NodeList<'gc>,
8100        body: &'gc Node<'gc>,
8101    ) -> Self {
8102        RecordDeclaration {
8103            metadata,
8104            id,
8105            type_parameters,
8106            implements,
8107            body,
8108        }
8109    }
8110}
8111
8112/// The `RecordDeclarationImplements` AST node.
8113#[derive(Debug)]
8114#[repr(C)]
8115pub struct RecordDeclarationImplements<'gc> {
8116    /// Source range, debug location, paren count, and node id.
8117    pub metadata: NodeMetadata<'gc>,
8118    /// ESTree `id` property.
8119    pub id: &'gc Node<'gc>,
8120    /// ESTree `typeArguments` property.
8121    pub type_arguments: Option<&'gc Node<'gc>>,
8122}
8123impl<'gc> RecordDeclarationImplements<'gc> {
8124    /// Build `RecordDeclarationImplements` from its metadata and `ESTree.def`
8125    /// fields.
8126    pub fn new(
8127        metadata: NodeMetadata<'gc>,
8128        id: &'gc Node<'gc>,
8129        type_arguments: Option<&'gc Node<'gc>>,
8130    ) -> Self {
8131        RecordDeclarationImplements {
8132            metadata,
8133            id,
8134            type_arguments,
8135        }
8136    }
8137}
8138
8139/// The `RecordDeclarationBody` AST node.
8140#[derive(Debug)]
8141#[repr(C)]
8142pub struct RecordDeclarationBody<'gc> {
8143    /// Source range, debug location, paren count, and node id.
8144    pub metadata: NodeMetadata<'gc>,
8145    /// ESTree `elements` property.
8146    pub elements: NodeList<'gc>,
8147}
8148impl<'gc> RecordDeclarationBody<'gc> {
8149    /// Build `RecordDeclarationBody` from its metadata and `ESTree.def` fields.
8150    pub fn new(
8151        metadata: NodeMetadata<'gc>,
8152        elements: NodeList<'gc>,
8153    ) -> Self {
8154        RecordDeclarationBody {
8155            metadata,
8156            elements,
8157        }
8158    }
8159}
8160
8161/// The `RecordDeclarationProperty` AST node.
8162#[derive(Debug)]
8163#[repr(C)]
8164pub struct RecordDeclarationProperty<'gc> {
8165    /// Source range, debug location, paren count, and node id.
8166    pub metadata: NodeMetadata<'gc>,
8167    /// ESTree `key` property.
8168    pub key: &'gc Node<'gc>,
8169    /// ESTree `typeAnnotation` property.
8170    pub type_annotation: &'gc Node<'gc>,
8171    /// ESTree `defaultValue` property.
8172    pub default_value: Option<&'gc Node<'gc>>,
8173}
8174impl<'gc> RecordDeclarationProperty<'gc> {
8175    /// Build `RecordDeclarationProperty` from its metadata and `ESTree.def`
8176    /// fields.
8177    pub fn new(
8178        metadata: NodeMetadata<'gc>,
8179        key: &'gc Node<'gc>,
8180        type_annotation: &'gc Node<'gc>,
8181        default_value: Option<&'gc Node<'gc>>,
8182    ) -> Self {
8183        RecordDeclarationProperty {
8184            metadata,
8185            key,
8186            type_annotation,
8187            default_value,
8188        }
8189    }
8190}
8191
8192/// The `RecordDeclarationStaticProperty` AST node.
8193#[derive(Debug)]
8194#[repr(C)]
8195pub struct RecordDeclarationStaticProperty<'gc> {
8196    /// Source range, debug location, paren count, and node id.
8197    pub metadata: NodeMetadata<'gc>,
8198    /// ESTree `key` property.
8199    pub key: &'gc Node<'gc>,
8200    /// ESTree `typeAnnotation` property.
8201    pub type_annotation: &'gc Node<'gc>,
8202    /// ESTree `value` property.
8203    pub value: &'gc Node<'gc>,
8204}
8205impl<'gc> RecordDeclarationStaticProperty<'gc> {
8206    /// Build `RecordDeclarationStaticProperty` from its metadata and
8207    /// `ESTree.def` fields.
8208    pub fn new(
8209        metadata: NodeMetadata<'gc>,
8210        key: &'gc Node<'gc>,
8211        type_annotation: &'gc Node<'gc>,
8212        value: &'gc Node<'gc>,
8213    ) -> Self {
8214        RecordDeclarationStaticProperty {
8215            metadata,
8216            key,
8217            type_annotation,
8218            value,
8219        }
8220    }
8221}
8222
8223/// The `RecordExpression` AST node.
8224#[derive(Debug)]
8225#[repr(C)]
8226pub struct RecordExpression<'gc> {
8227    /// Source range, debug location, paren count, and node id.
8228    pub metadata: NodeMetadata<'gc>,
8229    /// ESTree `recordConstructor` property.
8230    pub record_constructor: &'gc Node<'gc>,
8231    /// ESTree `typeArguments` property.
8232    pub type_arguments: Option<&'gc Node<'gc>>,
8233    /// ESTree `properties` property.
8234    pub properties: &'gc Node<'gc>,
8235}
8236impl<'gc> RecordExpression<'gc> {
8237    /// Build `RecordExpression` from its metadata and `ESTree.def` fields.
8238    pub fn new(
8239        metadata: NodeMetadata<'gc>,
8240        record_constructor: &'gc Node<'gc>,
8241        type_arguments: Option<&'gc Node<'gc>>,
8242        properties: &'gc Node<'gc>,
8243    ) -> Self {
8244        RecordExpression {
8245            metadata,
8246            record_constructor,
8247            type_arguments,
8248            properties,
8249        }
8250    }
8251}
8252
8253/// The `RecordExpressionProperties` AST node.
8254#[derive(Debug)]
8255#[repr(C)]
8256pub struct RecordExpressionProperties<'gc> {
8257    /// Source range, debug location, paren count, and node id.
8258    pub metadata: NodeMetadata<'gc>,
8259    /// ESTree `properties` property.
8260    pub properties: NodeList<'gc>,
8261}
8262impl<'gc> RecordExpressionProperties<'gc> {
8263    /// Build `RecordExpressionProperties` from its metadata and `ESTree.def`
8264    /// fields.
8265    pub fn new(
8266        metadata: NodeMetadata<'gc>,
8267        properties: NodeList<'gc>,
8268    ) -> Self {
8269        RecordExpressionProperties {
8270            metadata,
8271            properties,
8272        }
8273    }
8274}
8275
8276/// The `TSTypeAnnotation` AST node.
8277#[derive(Debug)]
8278#[repr(C)]
8279pub struct TSTypeAnnotation<'gc> {
8280    /// Source range, debug location, paren count, and node id.
8281    pub metadata: NodeMetadata<'gc>,
8282    /// ESTree `typeAnnotation` property.
8283    pub type_annotation: &'gc Node<'gc>,
8284}
8285impl<'gc> TSTypeAnnotation<'gc> {
8286    /// Build `TSTypeAnnotation` from its metadata and `ESTree.def` fields.
8287    pub fn new(
8288        metadata: NodeMetadata<'gc>,
8289        type_annotation: &'gc Node<'gc>,
8290    ) -> Self {
8291        TSTypeAnnotation {
8292            metadata,
8293            type_annotation,
8294        }
8295    }
8296}
8297
8298/// The `TSAnyKeyword` AST node.
8299#[derive(Debug)]
8300#[repr(C)]
8301pub struct TSAnyKeyword<'gc> {
8302    /// Source range, debug location, paren count, and node id.
8303    pub metadata: NodeMetadata<'gc>,
8304}
8305impl<'gc> TSAnyKeyword<'gc> {
8306    /// Build `TSAnyKeyword` from its metadata and `ESTree.def` fields.
8307    pub fn new(
8308        metadata: NodeMetadata<'gc>,
8309    ) -> Self {
8310        TSAnyKeyword {
8311            metadata,
8312        }
8313    }
8314}
8315
8316/// The `TSNumberKeyword` AST node.
8317#[derive(Debug)]
8318#[repr(C)]
8319pub struct TSNumberKeyword<'gc> {
8320    /// Source range, debug location, paren count, and node id.
8321    pub metadata: NodeMetadata<'gc>,
8322}
8323impl<'gc> TSNumberKeyword<'gc> {
8324    /// Build `TSNumberKeyword` from its metadata and `ESTree.def` fields.
8325    pub fn new(
8326        metadata: NodeMetadata<'gc>,
8327    ) -> Self {
8328        TSNumberKeyword {
8329            metadata,
8330        }
8331    }
8332}
8333
8334/// The `TSBooleanKeyword` AST node.
8335#[derive(Debug)]
8336#[repr(C)]
8337pub struct TSBooleanKeyword<'gc> {
8338    /// Source range, debug location, paren count, and node id.
8339    pub metadata: NodeMetadata<'gc>,
8340}
8341impl<'gc> TSBooleanKeyword<'gc> {
8342    /// Build `TSBooleanKeyword` from its metadata and `ESTree.def` fields.
8343    pub fn new(
8344        metadata: NodeMetadata<'gc>,
8345    ) -> Self {
8346        TSBooleanKeyword {
8347            metadata,
8348        }
8349    }
8350}
8351
8352/// The `TSStringKeyword` AST node.
8353#[derive(Debug)]
8354#[repr(C)]
8355pub struct TSStringKeyword<'gc> {
8356    /// Source range, debug location, paren count, and node id.
8357    pub metadata: NodeMetadata<'gc>,
8358}
8359impl<'gc> TSStringKeyword<'gc> {
8360    /// Build `TSStringKeyword` from its metadata and `ESTree.def` fields.
8361    pub fn new(
8362        metadata: NodeMetadata<'gc>,
8363    ) -> Self {
8364        TSStringKeyword {
8365            metadata,
8366        }
8367    }
8368}
8369
8370/// The `TSSymbolKeyword` AST node.
8371#[derive(Debug)]
8372#[repr(C)]
8373pub struct TSSymbolKeyword<'gc> {
8374    /// Source range, debug location, paren count, and node id.
8375    pub metadata: NodeMetadata<'gc>,
8376}
8377impl<'gc> TSSymbolKeyword<'gc> {
8378    /// Build `TSSymbolKeyword` from its metadata and `ESTree.def` fields.
8379    pub fn new(
8380        metadata: NodeMetadata<'gc>,
8381    ) -> Self {
8382        TSSymbolKeyword {
8383            metadata,
8384        }
8385    }
8386}
8387
8388/// The `TSVoidKeyword` AST node.
8389#[derive(Debug)]
8390#[repr(C)]
8391pub struct TSVoidKeyword<'gc> {
8392    /// Source range, debug location, paren count, and node id.
8393    pub metadata: NodeMetadata<'gc>,
8394}
8395impl<'gc> TSVoidKeyword<'gc> {
8396    /// Build `TSVoidKeyword` from its metadata and `ESTree.def` fields.
8397    pub fn new(
8398        metadata: NodeMetadata<'gc>,
8399    ) -> Self {
8400        TSVoidKeyword {
8401            metadata,
8402        }
8403    }
8404}
8405
8406/// The `TSUndefinedKeyword` AST node.
8407#[derive(Debug)]
8408#[repr(C)]
8409pub struct TSUndefinedKeyword<'gc> {
8410    /// Source range, debug location, paren count, and node id.
8411    pub metadata: NodeMetadata<'gc>,
8412}
8413impl<'gc> TSUndefinedKeyword<'gc> {
8414    /// Build `TSUndefinedKeyword` from its metadata and `ESTree.def` fields.
8415    pub fn new(
8416        metadata: NodeMetadata<'gc>,
8417    ) -> Self {
8418        TSUndefinedKeyword {
8419            metadata,
8420        }
8421    }
8422}
8423
8424/// The `TSUnknownKeyword` AST node.
8425#[derive(Debug)]
8426#[repr(C)]
8427pub struct TSUnknownKeyword<'gc> {
8428    /// Source range, debug location, paren count, and node id.
8429    pub metadata: NodeMetadata<'gc>,
8430}
8431impl<'gc> TSUnknownKeyword<'gc> {
8432    /// Build `TSUnknownKeyword` from its metadata and `ESTree.def` fields.
8433    pub fn new(
8434        metadata: NodeMetadata<'gc>,
8435    ) -> Self {
8436        TSUnknownKeyword {
8437            metadata,
8438        }
8439    }
8440}
8441
8442/// The `TSNeverKeyword` AST node.
8443#[derive(Debug)]
8444#[repr(C)]
8445pub struct TSNeverKeyword<'gc> {
8446    /// Source range, debug location, paren count, and node id.
8447    pub metadata: NodeMetadata<'gc>,
8448}
8449impl<'gc> TSNeverKeyword<'gc> {
8450    /// Build `TSNeverKeyword` from its metadata and `ESTree.def` fields.
8451    pub fn new(
8452        metadata: NodeMetadata<'gc>,
8453    ) -> Self {
8454        TSNeverKeyword {
8455            metadata,
8456        }
8457    }
8458}
8459
8460/// The `TSBigIntKeyword` AST node.
8461#[derive(Debug)]
8462#[repr(C)]
8463pub struct TSBigIntKeyword<'gc> {
8464    /// Source range, debug location, paren count, and node id.
8465    pub metadata: NodeMetadata<'gc>,
8466}
8467impl<'gc> TSBigIntKeyword<'gc> {
8468    /// Build `TSBigIntKeyword` from its metadata and `ESTree.def` fields.
8469    pub fn new(
8470        metadata: NodeMetadata<'gc>,
8471    ) -> Self {
8472        TSBigIntKeyword {
8473            metadata,
8474        }
8475    }
8476}
8477
8478/// The `TSThisType` AST node.
8479#[derive(Debug)]
8480#[repr(C)]
8481pub struct TSThisType<'gc> {
8482    /// Source range, debug location, paren count, and node id.
8483    pub metadata: NodeMetadata<'gc>,
8484}
8485impl<'gc> TSThisType<'gc> {
8486    /// Build `TSThisType` from its metadata and `ESTree.def` fields.
8487    pub fn new(
8488        metadata: NodeMetadata<'gc>,
8489    ) -> Self {
8490        TSThisType {
8491            metadata,
8492        }
8493    }
8494}
8495
8496/// The `TSLiteralType` AST node.
8497#[derive(Debug)]
8498#[repr(C)]
8499pub struct TSLiteralType<'gc> {
8500    /// Source range, debug location, paren count, and node id.
8501    pub metadata: NodeMetadata<'gc>,
8502    /// ESTree `literal` property.
8503    pub literal: &'gc Node<'gc>,
8504}
8505impl<'gc> TSLiteralType<'gc> {
8506    /// Build `TSLiteralType` from its metadata and `ESTree.def` fields.
8507    pub fn new(
8508        metadata: NodeMetadata<'gc>,
8509        literal: &'gc Node<'gc>,
8510    ) -> Self {
8511        TSLiteralType {
8512            metadata,
8513            literal,
8514        }
8515    }
8516}
8517
8518/// The `TSIndexedAccessType` AST node.
8519#[derive(Debug)]
8520#[repr(C)]
8521pub struct TSIndexedAccessType<'gc> {
8522    /// Source range, debug location, paren count, and node id.
8523    pub metadata: NodeMetadata<'gc>,
8524    /// ESTree `objectType` property.
8525    pub object_type: &'gc Node<'gc>,
8526    /// ESTree `indexType` property.
8527    pub index_type: &'gc Node<'gc>,
8528}
8529impl<'gc> TSIndexedAccessType<'gc> {
8530    /// Build `TSIndexedAccessType` from its metadata and `ESTree.def` fields.
8531    pub fn new(
8532        metadata: NodeMetadata<'gc>,
8533        object_type: &'gc Node<'gc>,
8534        index_type: &'gc Node<'gc>,
8535    ) -> Self {
8536        TSIndexedAccessType {
8537            metadata,
8538            object_type,
8539            index_type,
8540        }
8541    }
8542}
8543
8544/// The `TSArrayType` AST node.
8545#[derive(Debug)]
8546#[repr(C)]
8547pub struct TSArrayType<'gc> {
8548    /// Source range, debug location, paren count, and node id.
8549    pub metadata: NodeMetadata<'gc>,
8550    /// ESTree `elementType` property.
8551    pub element_type: &'gc Node<'gc>,
8552}
8553impl<'gc> TSArrayType<'gc> {
8554    /// Build `TSArrayType` from its metadata and `ESTree.def` fields.
8555    pub fn new(
8556        metadata: NodeMetadata<'gc>,
8557        element_type: &'gc Node<'gc>,
8558    ) -> Self {
8559        TSArrayType {
8560            metadata,
8561            element_type,
8562        }
8563    }
8564}
8565
8566/// The `TSTypeReference` AST node.
8567#[derive(Debug)]
8568#[repr(C)]
8569pub struct TSTypeReference<'gc> {
8570    /// Source range, debug location, paren count, and node id.
8571    pub metadata: NodeMetadata<'gc>,
8572    /// ESTree `typeName` property.
8573    pub type_name: &'gc Node<'gc>,
8574    /// ESTree `typeParameters` property.
8575    pub type_parameters: Option<&'gc Node<'gc>>,
8576}
8577impl<'gc> TSTypeReference<'gc> {
8578    /// Build `TSTypeReference` from its metadata and `ESTree.def` fields.
8579    pub fn new(
8580        metadata: NodeMetadata<'gc>,
8581        type_name: &'gc Node<'gc>,
8582        type_parameters: Option<&'gc Node<'gc>>,
8583    ) -> Self {
8584        TSTypeReference {
8585            metadata,
8586            type_name,
8587            type_parameters,
8588        }
8589    }
8590}
8591
8592/// The `TSQualifiedName` AST node.
8593#[derive(Debug)]
8594#[repr(C)]
8595pub struct TSQualifiedName<'gc> {
8596    /// Source range, debug location, paren count, and node id.
8597    pub metadata: NodeMetadata<'gc>,
8598    /// ESTree `left` property.
8599    pub left: &'gc Node<'gc>,
8600    /// ESTree `right` property.
8601    pub right: Option<&'gc Node<'gc>>,
8602}
8603impl<'gc> TSQualifiedName<'gc> {
8604    /// Build `TSQualifiedName` from its metadata and `ESTree.def` fields.
8605    pub fn new(
8606        metadata: NodeMetadata<'gc>,
8607        left: &'gc Node<'gc>,
8608        right: Option<&'gc Node<'gc>>,
8609    ) -> Self {
8610        TSQualifiedName {
8611            metadata,
8612            left,
8613            right,
8614        }
8615    }
8616}
8617
8618/// The `TSFunctionType` AST node.
8619#[derive(Debug)]
8620#[repr(C)]
8621pub struct TSFunctionType<'gc> {
8622    /// Source range, debug location, paren count, and node id.
8623    pub metadata: NodeMetadata<'gc>,
8624    /// ESTree `params` property.
8625    pub params: NodeList<'gc>,
8626    /// ESTree `returnType` property.
8627    pub return_type: &'gc Node<'gc>,
8628    /// ESTree `typeParameters` property.
8629    pub type_parameters: Option<&'gc Node<'gc>>,
8630}
8631impl<'gc> TSFunctionType<'gc> {
8632    /// Build `TSFunctionType` from its metadata and `ESTree.def` fields.
8633    pub fn new(
8634        metadata: NodeMetadata<'gc>,
8635        params: NodeList<'gc>,
8636        return_type: &'gc Node<'gc>,
8637        type_parameters: Option<&'gc Node<'gc>>,
8638    ) -> Self {
8639        TSFunctionType {
8640            metadata,
8641            params,
8642            return_type,
8643            type_parameters,
8644        }
8645    }
8646}
8647
8648/// The `TSConstructorType` AST node.
8649#[derive(Debug)]
8650#[repr(C)]
8651pub struct TSConstructorType<'gc> {
8652    /// Source range, debug location, paren count, and node id.
8653    pub metadata: NodeMetadata<'gc>,
8654    /// ESTree `params` property.
8655    pub params: NodeList<'gc>,
8656    /// ESTree `returnType` property.
8657    pub return_type: &'gc Node<'gc>,
8658    /// ESTree `typeParameters` property.
8659    pub type_parameters: Option<&'gc Node<'gc>>,
8660}
8661impl<'gc> TSConstructorType<'gc> {
8662    /// Build `TSConstructorType` from its metadata and `ESTree.def` fields.
8663    pub fn new(
8664        metadata: NodeMetadata<'gc>,
8665        params: NodeList<'gc>,
8666        return_type: &'gc Node<'gc>,
8667        type_parameters: Option<&'gc Node<'gc>>,
8668    ) -> Self {
8669        TSConstructorType {
8670            metadata,
8671            params,
8672            return_type,
8673            type_parameters,
8674        }
8675    }
8676}
8677
8678/// The `TSTypePredicate` AST node.
8679#[derive(Debug)]
8680#[repr(C)]
8681pub struct TSTypePredicate<'gc> {
8682    /// Source range, debug location, paren count, and node id.
8683    pub metadata: NodeMetadata<'gc>,
8684    /// ESTree `parameterName` property.
8685    pub parameter_name: &'gc Node<'gc>,
8686    /// ESTree `typeAnnotation` property.
8687    pub type_annotation: &'gc Node<'gc>,
8688}
8689impl<'gc> TSTypePredicate<'gc> {
8690    /// Build `TSTypePredicate` from its metadata and `ESTree.def` fields.
8691    pub fn new(
8692        metadata: NodeMetadata<'gc>,
8693        parameter_name: &'gc Node<'gc>,
8694        type_annotation: &'gc Node<'gc>,
8695    ) -> Self {
8696        TSTypePredicate {
8697            metadata,
8698            parameter_name,
8699            type_annotation,
8700        }
8701    }
8702}
8703
8704/// The `TSTupleType` AST node.
8705#[derive(Debug)]
8706#[repr(C)]
8707pub struct TSTupleType<'gc> {
8708    /// Source range, debug location, paren count, and node id.
8709    pub metadata: NodeMetadata<'gc>,
8710    /// ESTree `elementTypes` property.
8711    pub element_types: NodeList<'gc>,
8712}
8713impl<'gc> TSTupleType<'gc> {
8714    /// Build `TSTupleType` from its metadata and `ESTree.def` fields.
8715    pub fn new(
8716        metadata: NodeMetadata<'gc>,
8717        element_types: NodeList<'gc>,
8718    ) -> Self {
8719        TSTupleType {
8720            metadata,
8721            element_types,
8722        }
8723    }
8724}
8725
8726/// The `TSTypeAssertion` AST node.
8727#[derive(Debug)]
8728#[repr(C)]
8729pub struct TSTypeAssertion<'gc> {
8730    /// Source range, debug location, paren count, and node id.
8731    pub metadata: NodeMetadata<'gc>,
8732    /// ESTree `typeAnnotation` property.
8733    pub type_annotation: &'gc Node<'gc>,
8734    /// ESTree `expression` property.
8735    pub expression: &'gc Node<'gc>,
8736}
8737impl<'gc> TSTypeAssertion<'gc> {
8738    /// Build `TSTypeAssertion` from its metadata and `ESTree.def` fields.
8739    pub fn new(
8740        metadata: NodeMetadata<'gc>,
8741        type_annotation: &'gc Node<'gc>,
8742        expression: &'gc Node<'gc>,
8743    ) -> Self {
8744        TSTypeAssertion {
8745            metadata,
8746            type_annotation,
8747            expression,
8748        }
8749    }
8750}
8751
8752/// The `TSAsExpression` AST node.
8753#[derive(Debug)]
8754#[repr(C)]
8755pub struct TSAsExpression<'gc> {
8756    /// Source range, debug location, paren count, and node id.
8757    pub metadata: NodeMetadata<'gc>,
8758    /// ESTree `expression` property.
8759    pub expression: &'gc Node<'gc>,
8760    /// ESTree `typeAnnotation` property.
8761    pub type_annotation: &'gc Node<'gc>,
8762}
8763impl<'gc> TSAsExpression<'gc> {
8764    /// Build `TSAsExpression` from its metadata and `ESTree.def` fields.
8765    pub fn new(
8766        metadata: NodeMetadata<'gc>,
8767        expression: &'gc Node<'gc>,
8768        type_annotation: &'gc Node<'gc>,
8769    ) -> Self {
8770        TSAsExpression {
8771            metadata,
8772            expression,
8773            type_annotation,
8774        }
8775    }
8776}
8777
8778/// The `TSParameterProperty` AST node.
8779#[derive(Debug)]
8780#[repr(C)]
8781pub struct TSParameterProperty<'gc> {
8782    /// Source range, debug location, paren count, and node id.
8783    pub metadata: NodeMetadata<'gc>,
8784    /// ESTree `parameter` property.
8785    pub parameter: &'gc Node<'gc>,
8786    /// ESTree `accessibility` property.
8787    pub accessibility: Cell<NodeLabel>,
8788    /// ESTree `readonly` property.
8789    pub readonly: Cell<bool>,
8790    /// ESTree `static` property.
8791    pub r#static: Cell<bool>,
8792    /// ESTree `export` property.
8793    pub export: Cell<bool>,
8794}
8795impl<'gc> TSParameterProperty<'gc> {
8796    /// Build `TSParameterProperty` from its metadata and `ESTree.def` fields.
8797    pub fn new(
8798        metadata: NodeMetadata<'gc>,
8799        parameter: &'gc Node<'gc>,
8800        accessibility: NodeLabel,
8801        readonly: bool,
8802        r#static: bool,
8803        export: bool,
8804    ) -> Self {
8805        TSParameterProperty {
8806            metadata,
8807            parameter,
8808            accessibility: Cell::new(accessibility),
8809            readonly: Cell::new(readonly),
8810            r#static: Cell::new(r#static),
8811            export: Cell::new(export),
8812        }
8813    }
8814    /// The `accessibility` label as UTF-8 text.
8815    ///
8816    /// Label fields hold identifier names, operators, keyword-like kinds and
8817    /// raw source spans. An identifier cannot contain an unpaired surrogate —
8818    /// the lexer rejects one with a dedicated diagnostic — and the remaining
8819    /// labels are literal source text, so in practice the bytes are already
8820    /// valid UTF-8 and this borrows them directly, allocating nothing.
8821    ///
8822    /// A label that is nevertheless unrepresentable, which realistically means
8823    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
8824    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
8825    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
8826    /// character it encodes, so a `"😀"` label comes out intact.
8827    ///
8828    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
8829    /// bytes, or
8830    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
8831    /// detect the substitution. The returned `&str` borrows from `gc`, not from
8832    /// `self`.
8833    pub fn accessibility_str<'a>(
8834        &self,
8835        gc: &'a crate::context::GCLock<'_, '_>,
8836    ) -> &'a str {
8837        gc.bytes_str_lossy(self.accessibility.get())
8838    }
8839}
8840
8841/// The `TSTypeAliasDeclaration` AST node.
8842#[derive(Debug)]
8843#[repr(C)]
8844pub struct TSTypeAliasDeclaration<'gc> {
8845    /// Source range, debug location, paren count, and node id.
8846    pub metadata: NodeMetadata<'gc>,
8847    /// ESTree `id` property.
8848    pub id: &'gc Node<'gc>,
8849    /// ESTree `typeParameters` property.
8850    pub type_parameters: Option<&'gc Node<'gc>>,
8851    /// ESTree `typeAnnotation` property.
8852    pub type_annotation: &'gc Node<'gc>,
8853}
8854impl<'gc> TSTypeAliasDeclaration<'gc> {
8855    /// Build `TSTypeAliasDeclaration` from its metadata and `ESTree.def`
8856    /// fields.
8857    pub fn new(
8858        metadata: NodeMetadata<'gc>,
8859        id: &'gc Node<'gc>,
8860        type_parameters: Option<&'gc Node<'gc>>,
8861        type_annotation: &'gc Node<'gc>,
8862    ) -> Self {
8863        TSTypeAliasDeclaration {
8864            metadata,
8865            id,
8866            type_parameters,
8867            type_annotation,
8868        }
8869    }
8870}
8871
8872/// The `TSInterfaceDeclaration` AST node.
8873#[derive(Debug)]
8874#[repr(C)]
8875pub struct TSInterfaceDeclaration<'gc> {
8876    /// Source range, debug location, paren count, and node id.
8877    pub metadata: NodeMetadata<'gc>,
8878    /// ESTree `id` property.
8879    pub id: &'gc Node<'gc>,
8880    /// ESTree `body` property.
8881    pub body: &'gc Node<'gc>,
8882    /// ESTree `extends` property.
8883    pub extends: NodeList<'gc>,
8884    /// ESTree `typeParameters` property.
8885    pub type_parameters: Option<&'gc Node<'gc>>,
8886}
8887impl<'gc> TSInterfaceDeclaration<'gc> {
8888    /// Build `TSInterfaceDeclaration` from its metadata and `ESTree.def`
8889    /// fields.
8890    pub fn new(
8891        metadata: NodeMetadata<'gc>,
8892        id: &'gc Node<'gc>,
8893        body: &'gc Node<'gc>,
8894        extends: NodeList<'gc>,
8895        type_parameters: Option<&'gc Node<'gc>>,
8896    ) -> Self {
8897        TSInterfaceDeclaration {
8898            metadata,
8899            id,
8900            body,
8901            extends,
8902            type_parameters,
8903        }
8904    }
8905}
8906
8907/// The `TSInterfaceHeritage` AST node.
8908#[derive(Debug)]
8909#[repr(C)]
8910pub struct TSInterfaceHeritage<'gc> {
8911    /// Source range, debug location, paren count, and node id.
8912    pub metadata: NodeMetadata<'gc>,
8913    /// ESTree `expression` property.
8914    pub expression: &'gc Node<'gc>,
8915    /// ESTree `typeParameters` property.
8916    pub type_parameters: Option<&'gc Node<'gc>>,
8917}
8918impl<'gc> TSInterfaceHeritage<'gc> {
8919    /// Build `TSInterfaceHeritage` from its metadata and `ESTree.def` fields.
8920    pub fn new(
8921        metadata: NodeMetadata<'gc>,
8922        expression: &'gc Node<'gc>,
8923        type_parameters: Option<&'gc Node<'gc>>,
8924    ) -> Self {
8925        TSInterfaceHeritage {
8926            metadata,
8927            expression,
8928            type_parameters,
8929        }
8930    }
8931}
8932
8933/// The `TSInterfaceBody` AST node.
8934#[derive(Debug)]
8935#[repr(C)]
8936pub struct TSInterfaceBody<'gc> {
8937    /// Source range, debug location, paren count, and node id.
8938    pub metadata: NodeMetadata<'gc>,
8939    /// ESTree `body` property.
8940    pub body: NodeList<'gc>,
8941}
8942impl<'gc> TSInterfaceBody<'gc> {
8943    /// Build `TSInterfaceBody` from its metadata and `ESTree.def` fields.
8944    pub fn new(
8945        metadata: NodeMetadata<'gc>,
8946        body: NodeList<'gc>,
8947    ) -> Self {
8948        TSInterfaceBody {
8949            metadata,
8950            body,
8951        }
8952    }
8953}
8954
8955/// The `TSEnumDeclaration` AST node.
8956#[derive(Debug)]
8957#[repr(C)]
8958pub struct TSEnumDeclaration<'gc> {
8959    /// Source range, debug location, paren count, and node id.
8960    pub metadata: NodeMetadata<'gc>,
8961    /// ESTree `id` property.
8962    pub id: &'gc Node<'gc>,
8963    /// ESTree `members` property.
8964    pub members: NodeList<'gc>,
8965}
8966impl<'gc> TSEnumDeclaration<'gc> {
8967    /// Build `TSEnumDeclaration` from its metadata and `ESTree.def` fields.
8968    pub fn new(
8969        metadata: NodeMetadata<'gc>,
8970        id: &'gc Node<'gc>,
8971        members: NodeList<'gc>,
8972    ) -> Self {
8973        TSEnumDeclaration {
8974            metadata,
8975            id,
8976            members,
8977        }
8978    }
8979}
8980
8981/// The `TSEnumMember` AST node.
8982#[derive(Debug)]
8983#[repr(C)]
8984pub struct TSEnumMember<'gc> {
8985    /// Source range, debug location, paren count, and node id.
8986    pub metadata: NodeMetadata<'gc>,
8987    /// ESTree `id` property.
8988    pub id: &'gc Node<'gc>,
8989    /// ESTree `initializer` property.
8990    pub initializer: Option<&'gc Node<'gc>>,
8991}
8992impl<'gc> TSEnumMember<'gc> {
8993    /// Build `TSEnumMember` from its metadata and `ESTree.def` fields.
8994    pub fn new(
8995        metadata: NodeMetadata<'gc>,
8996        id: &'gc Node<'gc>,
8997        initializer: Option<&'gc Node<'gc>>,
8998    ) -> Self {
8999        TSEnumMember {
9000            metadata,
9001            id,
9002            initializer,
9003        }
9004    }
9005}
9006
9007/// The `TSModuleDeclaration` AST node.
9008#[derive(Debug)]
9009#[repr(C)]
9010pub struct TSModuleDeclaration<'gc> {
9011    /// Source range, debug location, paren count, and node id.
9012    pub metadata: NodeMetadata<'gc>,
9013    /// ESTree `id` property.
9014    pub id: &'gc Node<'gc>,
9015    /// ESTree `body` property.
9016    pub body: &'gc Node<'gc>,
9017}
9018impl<'gc> TSModuleDeclaration<'gc> {
9019    /// Build `TSModuleDeclaration` from its metadata and `ESTree.def` fields.
9020    pub fn new(
9021        metadata: NodeMetadata<'gc>,
9022        id: &'gc Node<'gc>,
9023        body: &'gc Node<'gc>,
9024    ) -> Self {
9025        TSModuleDeclaration {
9026            metadata,
9027            id,
9028            body,
9029        }
9030    }
9031}
9032
9033/// The `TSModuleBlock` AST node.
9034#[derive(Debug)]
9035#[repr(C)]
9036pub struct TSModuleBlock<'gc> {
9037    /// Source range, debug location, paren count, and node id.
9038    pub metadata: NodeMetadata<'gc>,
9039    /// ESTree `body` property.
9040    pub body: NodeList<'gc>,
9041}
9042impl<'gc> TSModuleBlock<'gc> {
9043    /// Build `TSModuleBlock` from its metadata and `ESTree.def` fields.
9044    pub fn new(
9045        metadata: NodeMetadata<'gc>,
9046        body: NodeList<'gc>,
9047    ) -> Self {
9048        TSModuleBlock {
9049            metadata,
9050            body,
9051        }
9052    }
9053}
9054
9055/// The `TSModuleMember` AST node.
9056#[derive(Debug)]
9057#[repr(C)]
9058pub struct TSModuleMember<'gc> {
9059    /// Source range, debug location, paren count, and node id.
9060    pub metadata: NodeMetadata<'gc>,
9061    /// ESTree `id` property.
9062    pub id: &'gc Node<'gc>,
9063    /// ESTree `initializer` property.
9064    pub initializer: Option<&'gc Node<'gc>>,
9065}
9066impl<'gc> TSModuleMember<'gc> {
9067    /// Build `TSModuleMember` from its metadata and `ESTree.def` fields.
9068    pub fn new(
9069        metadata: NodeMetadata<'gc>,
9070        id: &'gc Node<'gc>,
9071        initializer: Option<&'gc Node<'gc>>,
9072    ) -> Self {
9073        TSModuleMember {
9074            metadata,
9075            id,
9076            initializer,
9077        }
9078    }
9079}
9080
9081/// The `TSTypeParameterDeclaration` AST node.
9082#[derive(Debug)]
9083#[repr(C)]
9084pub struct TSTypeParameterDeclaration<'gc> {
9085    /// Source range, debug location, paren count, and node id.
9086    pub metadata: NodeMetadata<'gc>,
9087    /// ESTree `params` property.
9088    pub params: NodeList<'gc>,
9089}
9090impl<'gc> TSTypeParameterDeclaration<'gc> {
9091    /// Build `TSTypeParameterDeclaration` from its metadata and `ESTree.def`
9092    /// fields.
9093    pub fn new(
9094        metadata: NodeMetadata<'gc>,
9095        params: NodeList<'gc>,
9096    ) -> Self {
9097        TSTypeParameterDeclaration {
9098            metadata,
9099            params,
9100        }
9101    }
9102}
9103
9104/// The `TSTypeParameter` AST node.
9105#[derive(Debug)]
9106#[repr(C)]
9107pub struct TSTypeParameter<'gc> {
9108    /// Source range, debug location, paren count, and node id.
9109    pub metadata: NodeMetadata<'gc>,
9110    /// ESTree `name` property.
9111    pub name: &'gc Node<'gc>,
9112    /// ESTree `constraint` property.
9113    pub constraint: Option<&'gc Node<'gc>>,
9114    /// ESTree `default` property.
9115    pub default: Option<&'gc Node<'gc>>,
9116}
9117impl<'gc> TSTypeParameter<'gc> {
9118    /// Build `TSTypeParameter` from its metadata and `ESTree.def` fields.
9119    pub fn new(
9120        metadata: NodeMetadata<'gc>,
9121        name: &'gc Node<'gc>,
9122        constraint: Option<&'gc Node<'gc>>,
9123        default: Option<&'gc Node<'gc>>,
9124    ) -> Self {
9125        TSTypeParameter {
9126            metadata,
9127            name,
9128            constraint,
9129            default,
9130        }
9131    }
9132}
9133
9134/// The `TSTypeParameterInstantiation` AST node.
9135#[derive(Debug)]
9136#[repr(C)]
9137pub struct TSTypeParameterInstantiation<'gc> {
9138    /// Source range, debug location, paren count, and node id.
9139    pub metadata: NodeMetadata<'gc>,
9140    /// ESTree `params` property.
9141    pub params: NodeList<'gc>,
9142}
9143impl<'gc> TSTypeParameterInstantiation<'gc> {
9144    /// Build `TSTypeParameterInstantiation` from its metadata and `ESTree.def`
9145    /// fields.
9146    pub fn new(
9147        metadata: NodeMetadata<'gc>,
9148        params: NodeList<'gc>,
9149    ) -> Self {
9150        TSTypeParameterInstantiation {
9151            metadata,
9152            params,
9153        }
9154    }
9155}
9156
9157/// The `TSUnionType` AST node.
9158#[derive(Debug)]
9159#[repr(C)]
9160pub struct TSUnionType<'gc> {
9161    /// Source range, debug location, paren count, and node id.
9162    pub metadata: NodeMetadata<'gc>,
9163    /// ESTree `types` property.
9164    pub types: NodeList<'gc>,
9165}
9166impl<'gc> TSUnionType<'gc> {
9167    /// Build `TSUnionType` from its metadata and `ESTree.def` fields.
9168    pub fn new(
9169        metadata: NodeMetadata<'gc>,
9170        types: NodeList<'gc>,
9171    ) -> Self {
9172        TSUnionType {
9173            metadata,
9174            types,
9175        }
9176    }
9177}
9178
9179/// The `TSIntersectionType` AST node.
9180#[derive(Debug)]
9181#[repr(C)]
9182pub struct TSIntersectionType<'gc> {
9183    /// Source range, debug location, paren count, and node id.
9184    pub metadata: NodeMetadata<'gc>,
9185    /// ESTree `types` property.
9186    pub types: NodeList<'gc>,
9187}
9188impl<'gc> TSIntersectionType<'gc> {
9189    /// Build `TSIntersectionType` from its metadata and `ESTree.def` fields.
9190    pub fn new(
9191        metadata: NodeMetadata<'gc>,
9192        types: NodeList<'gc>,
9193    ) -> Self {
9194        TSIntersectionType {
9195            metadata,
9196            types,
9197        }
9198    }
9199}
9200
9201/// The `TSTypeQuery` AST node.
9202#[derive(Debug)]
9203#[repr(C)]
9204pub struct TSTypeQuery<'gc> {
9205    /// Source range, debug location, paren count, and node id.
9206    pub metadata: NodeMetadata<'gc>,
9207    /// ESTree `exprName` property.
9208    pub expr_name: &'gc Node<'gc>,
9209}
9210impl<'gc> TSTypeQuery<'gc> {
9211    /// Build `TSTypeQuery` from its metadata and `ESTree.def` fields.
9212    pub fn new(
9213        metadata: NodeMetadata<'gc>,
9214        expr_name: &'gc Node<'gc>,
9215    ) -> Self {
9216        TSTypeQuery {
9217            metadata,
9218            expr_name,
9219        }
9220    }
9221}
9222
9223/// The `TSConditionalType` AST node.
9224#[derive(Debug)]
9225#[repr(C)]
9226pub struct TSConditionalType<'gc> {
9227    /// Source range, debug location, paren count, and node id.
9228    pub metadata: NodeMetadata<'gc>,
9229    /// ESTree `checkType` property.
9230    pub check_type: &'gc Node<'gc>,
9231    /// ESTree `extendsType` property.
9232    pub extends_type: &'gc Node<'gc>,
9233    /// ESTree `trueType` property.
9234    pub true_type: &'gc Node<'gc>,
9235    /// ESTree `falseType` property.
9236    pub false_type: &'gc Node<'gc>,
9237}
9238impl<'gc> TSConditionalType<'gc> {
9239    /// Build `TSConditionalType` from its metadata and `ESTree.def` fields.
9240    pub fn new(
9241        metadata: NodeMetadata<'gc>,
9242        check_type: &'gc Node<'gc>,
9243        extends_type: &'gc Node<'gc>,
9244        true_type: &'gc Node<'gc>,
9245        false_type: &'gc Node<'gc>,
9246    ) -> Self {
9247        TSConditionalType {
9248            metadata,
9249            check_type,
9250            extends_type,
9251            true_type,
9252            false_type,
9253        }
9254    }
9255}
9256
9257/// The `TSTypeLiteral` AST node.
9258#[derive(Debug)]
9259#[repr(C)]
9260pub struct TSTypeLiteral<'gc> {
9261    /// Source range, debug location, paren count, and node id.
9262    pub metadata: NodeMetadata<'gc>,
9263    /// ESTree `members` property.
9264    pub members: NodeList<'gc>,
9265}
9266impl<'gc> TSTypeLiteral<'gc> {
9267    /// Build `TSTypeLiteral` from its metadata and `ESTree.def` fields.
9268    pub fn new(
9269        metadata: NodeMetadata<'gc>,
9270        members: NodeList<'gc>,
9271    ) -> Self {
9272        TSTypeLiteral {
9273            metadata,
9274            members,
9275        }
9276    }
9277}
9278
9279/// The `TSPropertySignature` AST node.
9280#[derive(Debug)]
9281#[repr(C)]
9282pub struct TSPropertySignature<'gc> {
9283    /// Source range, debug location, paren count, and node id.
9284    pub metadata: NodeMetadata<'gc>,
9285    /// ESTree `key` property.
9286    pub key: &'gc Node<'gc>,
9287    /// ESTree `typeAnnotation` property.
9288    pub type_annotation: Option<&'gc Node<'gc>>,
9289    /// ESTree `initializer` property.
9290    pub initializer: Option<&'gc Node<'gc>>,
9291    /// ESTree `optional` property.
9292    pub optional: Cell<bool>,
9293    /// ESTree `computed` property.
9294    pub computed: Cell<bool>,
9295    /// ESTree `readonly` property.
9296    pub readonly: Cell<bool>,
9297    /// ESTree `static` property.
9298    pub r#static: Cell<bool>,
9299    /// ESTree `export` property.
9300    pub export: Cell<bool>,
9301}
9302impl<'gc> TSPropertySignature<'gc> {
9303    /// Build `TSPropertySignature` from its metadata and `ESTree.def` fields.
9304    pub fn new(
9305        metadata: NodeMetadata<'gc>,
9306        key: &'gc Node<'gc>,
9307        type_annotation: Option<&'gc Node<'gc>>,
9308        initializer: Option<&'gc Node<'gc>>,
9309        optional: bool,
9310        computed: bool,
9311        readonly: bool,
9312        r#static: bool,
9313        export: bool,
9314    ) -> Self {
9315        TSPropertySignature {
9316            metadata,
9317            key,
9318            type_annotation,
9319            initializer,
9320            optional: Cell::new(optional),
9321            computed: Cell::new(computed),
9322            readonly: Cell::new(readonly),
9323            r#static: Cell::new(r#static),
9324            export: Cell::new(export),
9325        }
9326    }
9327}
9328
9329/// The `TSMethodSignature` AST node.
9330#[derive(Debug)]
9331#[repr(C)]
9332pub struct TSMethodSignature<'gc> {
9333    /// Source range, debug location, paren count, and node id.
9334    pub metadata: NodeMetadata<'gc>,
9335    /// ESTree `key` property.
9336    pub key: &'gc Node<'gc>,
9337    /// ESTree `params` property.
9338    pub params: NodeList<'gc>,
9339    /// ESTree `returnType` property.
9340    pub return_type: Option<&'gc Node<'gc>>,
9341    /// ESTree `computed` property.
9342    pub computed: Cell<bool>,
9343}
9344impl<'gc> TSMethodSignature<'gc> {
9345    /// Build `TSMethodSignature` from its metadata and `ESTree.def` fields.
9346    pub fn new(
9347        metadata: NodeMetadata<'gc>,
9348        key: &'gc Node<'gc>,
9349        params: NodeList<'gc>,
9350        return_type: Option<&'gc Node<'gc>>,
9351        computed: bool,
9352    ) -> Self {
9353        TSMethodSignature {
9354            metadata,
9355            key,
9356            params,
9357            return_type,
9358            computed: Cell::new(computed),
9359        }
9360    }
9361}
9362
9363/// The `TSIndexSignature` AST node.
9364#[derive(Debug)]
9365#[repr(C)]
9366pub struct TSIndexSignature<'gc> {
9367    /// Source range, debug location, paren count, and node id.
9368    pub metadata: NodeMetadata<'gc>,
9369    /// ESTree `parameters` property.
9370    pub parameters: NodeList<'gc>,
9371    /// ESTree `typeAnnotation` property.
9372    pub type_annotation: Option<&'gc Node<'gc>>,
9373}
9374impl<'gc> TSIndexSignature<'gc> {
9375    /// Build `TSIndexSignature` from its metadata and `ESTree.def` fields.
9376    pub fn new(
9377        metadata: NodeMetadata<'gc>,
9378        parameters: NodeList<'gc>,
9379        type_annotation: Option<&'gc Node<'gc>>,
9380    ) -> Self {
9381        TSIndexSignature {
9382            metadata,
9383            parameters,
9384            type_annotation,
9385        }
9386    }
9387}
9388
9389/// The `TSCallSignatureDeclaration` AST node.
9390#[derive(Debug)]
9391#[repr(C)]
9392pub struct TSCallSignatureDeclaration<'gc> {
9393    /// Source range, debug location, paren count, and node id.
9394    pub metadata: NodeMetadata<'gc>,
9395    /// ESTree `params` property.
9396    pub params: NodeList<'gc>,
9397    /// ESTree `returnType` property.
9398    pub return_type: Option<&'gc Node<'gc>>,
9399}
9400impl<'gc> TSCallSignatureDeclaration<'gc> {
9401    /// Build `TSCallSignatureDeclaration` from its metadata and `ESTree.def`
9402    /// fields.
9403    pub fn new(
9404        metadata: NodeMetadata<'gc>,
9405        params: NodeList<'gc>,
9406        return_type: Option<&'gc Node<'gc>>,
9407    ) -> Self {
9408        TSCallSignatureDeclaration {
9409            metadata,
9410            params,
9411            return_type,
9412        }
9413    }
9414}
9415
9416/// The `TSModifiers` AST node.
9417#[derive(Debug)]
9418#[repr(C)]
9419pub struct TSModifiers<'gc> {
9420    /// Source range, debug location, paren count, and node id.
9421    pub metadata: NodeMetadata<'gc>,
9422    /// ESTree `accessibility` property.
9423    pub accessibility: Cell<NodeLabel>,
9424    /// ESTree `readonly` property.
9425    pub readonly: Cell<bool>,
9426}
9427impl<'gc> TSModifiers<'gc> {
9428    /// Build `TSModifiers` from its metadata and `ESTree.def` fields.
9429    pub fn new(
9430        metadata: NodeMetadata<'gc>,
9431        accessibility: NodeLabel,
9432        readonly: bool,
9433    ) -> Self {
9434        TSModifiers {
9435            metadata,
9436            accessibility: Cell::new(accessibility),
9437            readonly: Cell::new(readonly),
9438        }
9439    }
9440    /// The `accessibility` label as UTF-8 text.
9441    ///
9442    /// Label fields hold identifier names, operators, keyword-like kinds and
9443    /// raw source spans. An identifier cannot contain an unpaired surrogate —
9444    /// the lexer rejects one with a dedicated diagnostic — and the remaining
9445    /// labels are literal source text, so in practice the bytes are already
9446    /// valid UTF-8 and this borrows them directly, allocating nothing.
9447    ///
9448    /// A label that is nevertheless unrepresentable, which realistically means
9449    /// a hand-built AST rather than a parsed one, has each unpaired surrogate
9450    /// rendered as a single U+FFFD instead of being reported. Only an unpaired
9451    /// surrogate is affected: a WTF-8 surrogate *pair* is folded back into the
9452    /// character it encodes, so a `"😀"` label comes out intact.
9453    ///
9454    /// Use [`GCLock::bytes`](crate::context::GCLock::bytes) for the exact
9455    /// bytes, or
9456    /// [`GCLock::try_bytes_str`](crate::context::GCLock::try_bytes_str) to
9457    /// detect the substitution. The returned `&str` borrows from `gc`, not from
9458    /// `self`.
9459    pub fn accessibility_str<'a>(
9460        &self,
9461        gc: &'a crate::context::GCLock<'_, '_>,
9462    ) -> &'a str {
9463        gc.bytes_str_lossy(self.accessibility.get())
9464    }
9465}
9466
9467/// The `CoverEmptyArgs` AST node.
9468#[derive(Debug)]
9469#[repr(C)]
9470pub struct CoverEmptyArgs<'gc> {
9471    /// Source range, debug location, paren count, and node id.
9472    pub metadata: NodeMetadata<'gc>,
9473}
9474impl<'gc> CoverEmptyArgs<'gc> {
9475    /// Build `CoverEmptyArgs` from its metadata and `ESTree.def` fields.
9476    pub fn new(
9477        metadata: NodeMetadata<'gc>,
9478    ) -> Self {
9479        CoverEmptyArgs {
9480            metadata,
9481        }
9482    }
9483}
9484
9485/// The `CoverTrailingComma` AST node.
9486#[derive(Debug)]
9487#[repr(C)]
9488pub struct CoverTrailingComma<'gc> {
9489    /// Source range, debug location, paren count, and node id.
9490    pub metadata: NodeMetadata<'gc>,
9491}
9492impl<'gc> CoverTrailingComma<'gc> {
9493    /// Build `CoverTrailingComma` from its metadata and `ESTree.def` fields.
9494    pub fn new(
9495        metadata: NodeMetadata<'gc>,
9496    ) -> Self {
9497        CoverTrailingComma {
9498            metadata,
9499        }
9500    }
9501}
9502
9503/// The `CoverInitializer` AST node.
9504#[derive(Debug)]
9505#[repr(C)]
9506pub struct CoverInitializer<'gc> {
9507    /// Source range, debug location, paren count, and node id.
9508    pub metadata: NodeMetadata<'gc>,
9509    /// ESTree `init` property.
9510    pub init: &'gc Node<'gc>,
9511}
9512impl<'gc> CoverInitializer<'gc> {
9513    /// Build `CoverInitializer` from its metadata and `ESTree.def` fields.
9514    pub fn new(
9515        metadata: NodeMetadata<'gc>,
9516        init: &'gc Node<'gc>,
9517    ) -> Self {
9518        CoverInitializer {
9519            metadata,
9520            init,
9521        }
9522    }
9523}
9524
9525/// The `CoverRestElement` AST node.
9526#[derive(Debug)]
9527#[repr(C)]
9528pub struct CoverRestElement<'gc> {
9529    /// Source range, debug location, paren count, and node id.
9530    pub metadata: NodeMetadata<'gc>,
9531    /// ESTree `rest` property.
9532    pub rest: &'gc Node<'gc>,
9533}
9534impl<'gc> CoverRestElement<'gc> {
9535    /// Build `CoverRestElement` from its metadata and `ESTree.def` fields.
9536    pub fn new(
9537        metadata: NodeMetadata<'gc>,
9538        rest: &'gc Node<'gc>,
9539    ) -> Self {
9540        CoverRestElement {
9541            metadata,
9542            rest,
9543        }
9544    }
9545}
9546
9547/// The `CoverTypedIdentifier` AST node.
9548#[derive(Debug)]
9549#[repr(C)]
9550pub struct CoverTypedIdentifier<'gc> {
9551    /// Source range, debug location, paren count, and node id.
9552    pub metadata: NodeMetadata<'gc>,
9553    /// ESTree `left` property.
9554    pub left: &'gc Node<'gc>,
9555    /// ESTree `right` property.
9556    pub right: Option<&'gc Node<'gc>>,
9557    /// ESTree `optional` property.
9558    pub optional: Cell<bool>,
9559}
9560impl<'gc> CoverTypedIdentifier<'gc> {
9561    /// Build `CoverTypedIdentifier` from its metadata and `ESTree.def` fields.
9562    pub fn new(
9563        metadata: NodeMetadata<'gc>,
9564        left: &'gc Node<'gc>,
9565        right: Option<&'gc Node<'gc>>,
9566        optional: bool,
9567    ) -> Self {
9568        CoverTypedIdentifier {
9569            metadata,
9570            left,
9571            right,
9572            optional: Cell::new(optional),
9573        }
9574    }
9575}
9576
9577/// The `SHBuiltin` AST node.
9578#[derive(Debug)]
9579#[repr(C)]
9580pub struct SHBuiltin<'gc> {
9581    /// Source range, debug location, paren count, and node id.
9582    pub metadata: NodeMetadata<'gc>,
9583}
9584impl<'gc> SHBuiltin<'gc> {
9585    /// Build `SHBuiltin` from its metadata and `ESTree.def` fields.
9586    pub fn new(
9587        metadata: NodeMetadata<'gc>,
9588    ) -> Self {
9589        SHBuiltin {
9590            metadata,
9591        }
9592    }
9593}
9594
9595/// The `ImplicitCheckedCast` AST node.
9596#[derive(Debug)]
9597#[repr(C)]
9598pub struct ImplicitCheckedCast<'gc> {
9599    /// Source range, debug location, paren count, and node id.
9600    pub metadata: NodeMetadata<'gc>,
9601    /// ESTree `argument` property.
9602    pub argument: &'gc Node<'gc>,
9603}
9604impl<'gc> ImplicitCheckedCast<'gc> {
9605    /// Build `ImplicitCheckedCast` from its metadata and `ESTree.def` fields.
9606    pub fn new(
9607        metadata: NodeMetadata<'gc>,
9608        argument: &'gc Node<'gc>,
9609    ) -> Self {
9610        ImplicitCheckedCast {
9611            metadata,
9612            argument,
9613        }
9614    }
9615}
9616
9617/// An AST node: one arm per `ESTree.def` node kind.
9618///
9619/// `#[repr(C)]`, and each arm's payload struct is named after the arm,
9620/// so a deep `match` compiles to a single dispatch. Nodes live in the
9621/// [`crate::context::Context`] arena and are handed out as `&'gc Node`
9622/// for as long as a [`crate::context::GCLock`] is held.
9623#[derive(Debug)]
9624#[repr(C)]
9625pub enum Node<'gc> {
9626    /// A [`Empty`] node.
9627    Empty(Empty<'gc>),
9628    /// A [`Metadata`] node.
9629    Metadata(Metadata<'gc>),
9630    /// A [`Program`] node.
9631    Program(Program<'gc>),
9632    /// A [`FunctionExpression`] node.
9633    FunctionExpression(FunctionExpression<'gc>),
9634    /// A [`ArrowFunctionExpression`] node.
9635    ArrowFunctionExpression(ArrowFunctionExpression<'gc>),
9636    /// A [`FunctionDeclaration`] node.
9637    FunctionDeclaration(FunctionDeclaration<'gc>),
9638    /// A [`ComponentDeclaration`] node.
9639    ComponentDeclaration(ComponentDeclaration<'gc>),
9640    /// A [`HookDeclaration`] node.
9641    HookDeclaration(HookDeclaration<'gc>),
9642    /// A [`MatchStatement`] node.
9643    MatchStatement(MatchStatement<'gc>),
9644    /// A [`WhileStatement`] node.
9645    WhileStatement(WhileStatement<'gc>),
9646    /// A [`DoWhileStatement`] node.
9647    DoWhileStatement(DoWhileStatement<'gc>),
9648    /// A [`ForInStatement`] node.
9649    ForInStatement(ForInStatement<'gc>),
9650    /// A [`ForOfStatement`] node.
9651    ForOfStatement(ForOfStatement<'gc>),
9652    /// A [`ForStatement`] node.
9653    ForStatement(ForStatement<'gc>),
9654    /// A [`DebuggerStatement`] node.
9655    DebuggerStatement(DebuggerStatement<'gc>),
9656    /// A [`EmptyStatement`] node.
9657    EmptyStatement(EmptyStatement<'gc>),
9658    /// A [`BlockStatement`] node.
9659    BlockStatement(BlockStatement<'gc>),
9660    /// A [`StaticBlock`] node.
9661    StaticBlock(StaticBlock<'gc>),
9662    /// A [`BreakStatement`] node.
9663    BreakStatement(BreakStatement<'gc>),
9664    /// A [`ContinueStatement`] node.
9665    ContinueStatement(ContinueStatement<'gc>),
9666    /// A [`ThrowStatement`] node.
9667    ThrowStatement(ThrowStatement<'gc>),
9668    /// A [`ReturnStatement`] node.
9669    ReturnStatement(ReturnStatement<'gc>),
9670    /// A [`WithStatement`] node.
9671    WithStatement(WithStatement<'gc>),
9672    /// A [`SwitchStatement`] node.
9673    SwitchStatement(SwitchStatement<'gc>),
9674    /// A [`LabeledStatement`] node.
9675    LabeledStatement(LabeledStatement<'gc>),
9676    /// A [`ExpressionStatement`] node.
9677    ExpressionStatement(ExpressionStatement<'gc>),
9678    /// A [`TryStatement`] node.
9679    TryStatement(TryStatement<'gc>),
9680    /// A [`IfStatement`] node.
9681    IfStatement(IfStatement<'gc>),
9682    /// A [`NullLiteral`] node.
9683    NullLiteral(NullLiteral<'gc>),
9684    /// A [`BooleanLiteral`] node.
9685    BooleanLiteral(BooleanLiteral<'gc>),
9686    /// A [`StringLiteral`] node.
9687    StringLiteral(StringLiteral<'gc>),
9688    /// A [`NumericLiteral`] node.
9689    NumericLiteral(NumericLiteral<'gc>),
9690    /// A [`RegExpLiteral`] node.
9691    RegExpLiteral(RegExpLiteral<'gc>),
9692    /// A [`BigIntLiteral`] node.
9693    BigIntLiteral(BigIntLiteral<'gc>),
9694    /// A [`ThisExpression`] node.
9695    ThisExpression(ThisExpression<'gc>),
9696    /// A [`Super`] node.
9697    Super(Super<'gc>),
9698    /// A [`SequenceExpression`] node.
9699    SequenceExpression(SequenceExpression<'gc>),
9700    /// A [`ObjectExpression`] node.
9701    ObjectExpression(ObjectExpression<'gc>),
9702    /// A [`ArrayExpression`] node.
9703    ArrayExpression(ArrayExpression<'gc>),
9704    /// A [`SpreadElement`] node.
9705    SpreadElement(SpreadElement<'gc>),
9706    /// A [`NewExpression`] node.
9707    NewExpression(NewExpression<'gc>),
9708    /// A [`YieldExpression`] node.
9709    YieldExpression(YieldExpression<'gc>),
9710    /// A [`AwaitExpression`] node.
9711    AwaitExpression(AwaitExpression<'gc>),
9712    /// A [`ImportExpression`] node.
9713    ImportExpression(ImportExpression<'gc>),
9714    /// A [`CallExpression`] node.
9715    CallExpression(CallExpression<'gc>),
9716    /// A [`OptionalCallExpression`] node.
9717    OptionalCallExpression(OptionalCallExpression<'gc>),
9718    /// A [`AssignmentExpression`] node.
9719    AssignmentExpression(AssignmentExpression<'gc>),
9720    /// A [`UnaryExpression`] node.
9721    UnaryExpression(UnaryExpression<'gc>),
9722    /// A [`UpdateExpression`] node.
9723    UpdateExpression(UpdateExpression<'gc>),
9724    /// A [`MemberExpression`] node.
9725    MemberExpression(MemberExpression<'gc>),
9726    /// A [`OptionalMemberExpression`] node.
9727    OptionalMemberExpression(OptionalMemberExpression<'gc>),
9728    /// A [`LogicalExpression`] node.
9729    LogicalExpression(LogicalExpression<'gc>),
9730    /// A [`ConditionalExpression`] node.
9731    ConditionalExpression(ConditionalExpression<'gc>),
9732    /// A [`BinaryExpression`] node.
9733    BinaryExpression(BinaryExpression<'gc>),
9734    /// A [`Directive`] node.
9735    Directive(Directive<'gc>),
9736    /// A [`DirectiveLiteral`] node.
9737    DirectiveLiteral(DirectiveLiteral<'gc>),
9738    /// A [`Identifier`] node.
9739    Identifier(Identifier<'gc>),
9740    /// A [`PrivateName`] node.
9741    PrivateName(PrivateName<'gc>),
9742    /// A [`MetaProperty`] node.
9743    MetaProperty(MetaProperty<'gc>),
9744    /// A [`SwitchCase`] node.
9745    SwitchCase(SwitchCase<'gc>),
9746    /// A [`CatchClause`] node.
9747    CatchClause(CatchClause<'gc>),
9748    /// A [`VariableDeclarator`] node.
9749    VariableDeclarator(VariableDeclarator<'gc>),
9750    /// A [`VariableDeclaration`] node.
9751    VariableDeclaration(VariableDeclaration<'gc>),
9752    /// A [`TemplateLiteral`] node.
9753    TemplateLiteral(TemplateLiteral<'gc>),
9754    /// A [`TaggedTemplateExpression`] node.
9755    TaggedTemplateExpression(TaggedTemplateExpression<'gc>),
9756    /// A [`TemplateElement`] node.
9757    TemplateElement(TemplateElement<'gc>),
9758    /// A [`Property`] node.
9759    Property(Property<'gc>),
9760    /// A [`Decorator`] node.
9761    Decorator(Decorator<'gc>),
9762    /// A [`ClassDeclaration`] node.
9763    ClassDeclaration(ClassDeclaration<'gc>),
9764    /// A [`ClassExpression`] node.
9765    ClassExpression(ClassExpression<'gc>),
9766    /// A [`ClassBody`] node.
9767    ClassBody(ClassBody<'gc>),
9768    /// A [`ClassProperty`] node.
9769    ClassProperty(ClassProperty<'gc>),
9770    /// A [`ClassPrivateProperty`] node.
9771    ClassPrivateProperty(ClassPrivateProperty<'gc>),
9772    /// A [`MethodDefinition`] node.
9773    MethodDefinition(MethodDefinition<'gc>),
9774    /// A [`ImportDeclaration`] node.
9775    ImportDeclaration(ImportDeclaration<'gc>),
9776    /// A [`ImportSpecifier`] node.
9777    ImportSpecifier(ImportSpecifier<'gc>),
9778    /// A [`ImportDefaultSpecifier`] node.
9779    ImportDefaultSpecifier(ImportDefaultSpecifier<'gc>),
9780    /// A [`ImportNamespaceSpecifier`] node.
9781    ImportNamespaceSpecifier(ImportNamespaceSpecifier<'gc>),
9782    /// A [`ImportAttribute`] node.
9783    ImportAttribute(ImportAttribute<'gc>),
9784    /// A [`ExportNamedDeclaration`] node.
9785    ExportNamedDeclaration(ExportNamedDeclaration<'gc>),
9786    /// A [`ExportSpecifier`] node.
9787    ExportSpecifier(ExportSpecifier<'gc>),
9788    /// A [`ExportNamespaceSpecifier`] node.
9789    ExportNamespaceSpecifier(ExportNamespaceSpecifier<'gc>),
9790    /// A [`ExportDefaultDeclaration`] node.
9791    ExportDefaultDeclaration(ExportDefaultDeclaration<'gc>),
9792    /// A [`ExportAllDeclaration`] node.
9793    ExportAllDeclaration(ExportAllDeclaration<'gc>),
9794    /// A [`ObjectPattern`] node.
9795    ObjectPattern(ObjectPattern<'gc>),
9796    /// A [`ArrayPattern`] node.
9797    ArrayPattern(ArrayPattern<'gc>),
9798    /// A [`RestElement`] node.
9799    RestElement(RestElement<'gc>),
9800    /// A [`AssignmentPattern`] node.
9801    AssignmentPattern(AssignmentPattern<'gc>),
9802    /// A [`MatchStatementCase`] node.
9803    MatchStatementCase(MatchStatementCase<'gc>),
9804    /// A [`MatchExpression`] node.
9805    MatchExpression(MatchExpression<'gc>),
9806    /// A [`MatchExpressionCase`] node.
9807    MatchExpressionCase(MatchExpressionCase<'gc>),
9808    /// A [`MatchWildcardPattern`] node.
9809    MatchWildcardPattern(MatchWildcardPattern<'gc>),
9810    /// A [`MatchLiteralPattern`] node.
9811    MatchLiteralPattern(MatchLiteralPattern<'gc>),
9812    /// A [`MatchUnaryPattern`] node.
9813    MatchUnaryPattern(MatchUnaryPattern<'gc>),
9814    /// A [`MatchIdentifierPattern`] node.
9815    MatchIdentifierPattern(MatchIdentifierPattern<'gc>),
9816    /// A [`MatchBindingPattern`] node.
9817    MatchBindingPattern(MatchBindingPattern<'gc>),
9818    /// A [`MatchObjectPattern`] node.
9819    MatchObjectPattern(MatchObjectPattern<'gc>),
9820    /// A [`MatchArrayPattern`] node.
9821    MatchArrayPattern(MatchArrayPattern<'gc>),
9822    /// A [`MatchOrPattern`] node.
9823    MatchOrPattern(MatchOrPattern<'gc>),
9824    /// A [`MatchAsPattern`] node.
9825    MatchAsPattern(MatchAsPattern<'gc>),
9826    /// A [`MatchMemberPattern`] node.
9827    MatchMemberPattern(MatchMemberPattern<'gc>),
9828    /// A [`MatchInstancePattern`] node.
9829    MatchInstancePattern(MatchInstancePattern<'gc>),
9830    /// A [`MatchObjectPatternProperty`] node.
9831    MatchObjectPatternProperty(MatchObjectPatternProperty<'gc>),
9832    /// A [`MatchInstanceObjectPattern`] node.
9833    MatchInstanceObjectPattern(MatchInstanceObjectPattern<'gc>),
9834    /// A [`MatchRestPattern`] node.
9835    MatchRestPattern(MatchRestPattern<'gc>),
9836    /// A [`JSXIdentifier`] node.
9837    JSXIdentifier(JSXIdentifier<'gc>),
9838    /// A [`JSXMemberExpression`] node.
9839    JSXMemberExpression(JSXMemberExpression<'gc>),
9840    /// A [`JSXNamespacedName`] node.
9841    JSXNamespacedName(JSXNamespacedName<'gc>),
9842    /// A [`JSXEmptyExpression`] node.
9843    JSXEmptyExpression(JSXEmptyExpression<'gc>),
9844    /// A [`JSXExpressionContainer`] node.
9845    JSXExpressionContainer(JSXExpressionContainer<'gc>),
9846    /// A [`JSXSpreadChild`] node.
9847    JSXSpreadChild(JSXSpreadChild<'gc>),
9848    /// A [`JSXOpeningElement`] node.
9849    JSXOpeningElement(JSXOpeningElement<'gc>),
9850    /// A [`JSXClosingElement`] node.
9851    JSXClosingElement(JSXClosingElement<'gc>),
9852    /// A [`JSXAttribute`] node.
9853    JSXAttribute(JSXAttribute<'gc>),
9854    /// A [`JSXSpreadAttribute`] node.
9855    JSXSpreadAttribute(JSXSpreadAttribute<'gc>),
9856    /// A [`JSXStringLiteral`] node.
9857    JSXStringLiteral(JSXStringLiteral<'gc>),
9858    /// A [`JSXText`] node.
9859    JSXText(JSXText<'gc>),
9860    /// A [`JSXElement`] node.
9861    JSXElement(JSXElement<'gc>),
9862    /// A [`JSXFragment`] node.
9863    JSXFragment(JSXFragment<'gc>),
9864    /// A [`JSXOpeningFragment`] node.
9865    JSXOpeningFragment(JSXOpeningFragment<'gc>),
9866    /// A [`JSXClosingFragment`] node.
9867    JSXClosingFragment(JSXClosingFragment<'gc>),
9868    /// A [`ExistsTypeAnnotation`] node.
9869    ExistsTypeAnnotation(ExistsTypeAnnotation<'gc>),
9870    /// A [`EmptyTypeAnnotation`] node.
9871    EmptyTypeAnnotation(EmptyTypeAnnotation<'gc>),
9872    /// A [`StringTypeAnnotation`] node.
9873    StringTypeAnnotation(StringTypeAnnotation<'gc>),
9874    /// A [`NumberTypeAnnotation`] node.
9875    NumberTypeAnnotation(NumberTypeAnnotation<'gc>),
9876    /// A [`StringLiteralTypeAnnotation`] node.
9877    StringLiteralTypeAnnotation(StringLiteralTypeAnnotation<'gc>),
9878    /// A [`NumberLiteralTypeAnnotation`] node.
9879    NumberLiteralTypeAnnotation(NumberLiteralTypeAnnotation<'gc>),
9880    /// A [`BigIntLiteralTypeAnnotation`] node.
9881    BigIntLiteralTypeAnnotation(BigIntLiteralTypeAnnotation<'gc>),
9882    /// A [`BooleanTypeAnnotation`] node.
9883    BooleanTypeAnnotation(BooleanTypeAnnotation<'gc>),
9884    /// A [`BooleanLiteralTypeAnnotation`] node.
9885    BooleanLiteralTypeAnnotation(BooleanLiteralTypeAnnotation<'gc>),
9886    /// A [`NullLiteralTypeAnnotation`] node.
9887    NullLiteralTypeAnnotation(NullLiteralTypeAnnotation<'gc>),
9888    /// A [`SymbolTypeAnnotation`] node.
9889    SymbolTypeAnnotation(SymbolTypeAnnotation<'gc>),
9890    /// A [`AnyTypeAnnotation`] node.
9891    AnyTypeAnnotation(AnyTypeAnnotation<'gc>),
9892    /// A [`MixedTypeAnnotation`] node.
9893    MixedTypeAnnotation(MixedTypeAnnotation<'gc>),
9894    /// A [`BigIntTypeAnnotation`] node.
9895    BigIntTypeAnnotation(BigIntTypeAnnotation<'gc>),
9896    /// A [`VoidTypeAnnotation`] node.
9897    VoidTypeAnnotation(VoidTypeAnnotation<'gc>),
9898    /// A [`NeverTypeAnnotation`] node.
9899    NeverTypeAnnotation(NeverTypeAnnotation<'gc>),
9900    /// A [`UnknownTypeAnnotation`] node.
9901    UnknownTypeAnnotation(UnknownTypeAnnotation<'gc>),
9902    /// A [`UndefinedTypeAnnotation`] node.
9903    UndefinedTypeAnnotation(UndefinedTypeAnnotation<'gc>),
9904    /// A [`FunctionTypeAnnotation`] node.
9905    FunctionTypeAnnotation(FunctionTypeAnnotation<'gc>),
9906    /// A [`HookTypeAnnotation`] node.
9907    HookTypeAnnotation(HookTypeAnnotation<'gc>),
9908    /// A [`FunctionTypeParam`] node.
9909    FunctionTypeParam(FunctionTypeParam<'gc>),
9910    /// A [`ComponentTypeAnnotation`] node.
9911    ComponentTypeAnnotation(ComponentTypeAnnotation<'gc>),
9912    /// A [`ComponentTypeParameter`] node.
9913    ComponentTypeParameter(ComponentTypeParameter<'gc>),
9914    /// A [`NullableTypeAnnotation`] node.
9915    NullableTypeAnnotation(NullableTypeAnnotation<'gc>),
9916    /// A [`QualifiedTypeIdentifier`] node.
9917    QualifiedTypeIdentifier(QualifiedTypeIdentifier<'gc>),
9918    /// A [`TypeofTypeAnnotation`] node.
9919    TypeofTypeAnnotation(TypeofTypeAnnotation<'gc>),
9920    /// A [`KeyofTypeAnnotation`] node.
9921    KeyofTypeAnnotation(KeyofTypeAnnotation<'gc>),
9922    /// A [`TypeOperator`] node.
9923    TypeOperator(TypeOperator<'gc>),
9924    /// A [`QualifiedTypeofIdentifier`] node.
9925    QualifiedTypeofIdentifier(QualifiedTypeofIdentifier<'gc>),
9926    /// A [`TupleTypeAnnotation`] node.
9927    TupleTypeAnnotation(TupleTypeAnnotation<'gc>),
9928    /// A [`TupleTypeSpreadElement`] node.
9929    TupleTypeSpreadElement(TupleTypeSpreadElement<'gc>),
9930    /// A [`TupleTypeLabeledElement`] node.
9931    TupleTypeLabeledElement(TupleTypeLabeledElement<'gc>),
9932    /// A [`ArrayTypeAnnotation`] node.
9933    ArrayTypeAnnotation(ArrayTypeAnnotation<'gc>),
9934    /// A [`InferTypeAnnotation`] node.
9935    InferTypeAnnotation(InferTypeAnnotation<'gc>),
9936    /// A [`UnionTypeAnnotation`] node.
9937    UnionTypeAnnotation(UnionTypeAnnotation<'gc>),
9938    /// A [`IntersectionTypeAnnotation`] node.
9939    IntersectionTypeAnnotation(IntersectionTypeAnnotation<'gc>),
9940    /// A [`GenericTypeAnnotation`] node.
9941    GenericTypeAnnotation(GenericTypeAnnotation<'gc>),
9942    /// A [`IndexedAccessType`] node.
9943    IndexedAccessType(IndexedAccessType<'gc>),
9944    /// A [`OptionalIndexedAccessType`] node.
9945    OptionalIndexedAccessType(OptionalIndexedAccessType<'gc>),
9946    /// A [`ConditionalTypeAnnotation`] node.
9947    ConditionalTypeAnnotation(ConditionalTypeAnnotation<'gc>),
9948    /// A [`TypePredicate`] node.
9949    TypePredicate(TypePredicate<'gc>),
9950    /// A [`InterfaceTypeAnnotation`] node.
9951    InterfaceTypeAnnotation(InterfaceTypeAnnotation<'gc>),
9952    /// A [`TypeAlias`] node.
9953    TypeAlias(TypeAlias<'gc>),
9954    /// A [`OpaqueType`] node.
9955    OpaqueType(OpaqueType<'gc>),
9956    /// A [`InterfaceDeclaration`] node.
9957    InterfaceDeclaration(InterfaceDeclaration<'gc>),
9958    /// A [`DeclareTypeAlias`] node.
9959    DeclareTypeAlias(DeclareTypeAlias<'gc>),
9960    /// A [`DeclareOpaqueType`] node.
9961    DeclareOpaqueType(DeclareOpaqueType<'gc>),
9962    /// A [`DeclareInterface`] node.
9963    DeclareInterface(DeclareInterface<'gc>),
9964    /// A [`DeclareClass`] node.
9965    DeclareClass(DeclareClass<'gc>),
9966    /// A [`DeclareFunction`] node.
9967    DeclareFunction(DeclareFunction<'gc>),
9968    /// A [`DeclareHook`] node.
9969    DeclareHook(DeclareHook<'gc>),
9970    /// A [`DeclareComponent`] node.
9971    DeclareComponent(DeclareComponent<'gc>),
9972    /// A [`DeclareVariable`] node.
9973    DeclareVariable(DeclareVariable<'gc>),
9974    /// A [`DeclareEnum`] node.
9975    DeclareEnum(DeclareEnum<'gc>),
9976    /// A [`DeclareExportDeclaration`] node.
9977    DeclareExportDeclaration(DeclareExportDeclaration<'gc>),
9978    /// A [`DeclareExportAllDeclaration`] node.
9979    DeclareExportAllDeclaration(DeclareExportAllDeclaration<'gc>),
9980    /// A [`DeclareModule`] node.
9981    DeclareModule(DeclareModule<'gc>),
9982    /// A [`DeclareNamespace`] node.
9983    DeclareNamespace(DeclareNamespace<'gc>),
9984    /// A [`DeclareModuleExports`] node.
9985    DeclareModuleExports(DeclareModuleExports<'gc>),
9986    /// A [`InterfaceExtends`] node.
9987    InterfaceExtends(InterfaceExtends<'gc>),
9988    /// A [`ClassImplements`] node.
9989    ClassImplements(ClassImplements<'gc>),
9990    /// A [`TypeAnnotation`] node.
9991    TypeAnnotation(TypeAnnotation<'gc>),
9992    /// A [`ObjectTypeAnnotation`] node.
9993    ObjectTypeAnnotation(ObjectTypeAnnotation<'gc>),
9994    /// A [`ObjectTypeProperty`] node.
9995    ObjectTypeProperty(ObjectTypeProperty<'gc>),
9996    /// A [`ObjectTypeSpreadProperty`] node.
9997    ObjectTypeSpreadProperty(ObjectTypeSpreadProperty<'gc>),
9998    /// A [`ObjectTypeInternalSlot`] node.
9999    ObjectTypeInternalSlot(ObjectTypeInternalSlot<'gc>),
10000    /// A [`ObjectTypeCallProperty`] node.
10001    ObjectTypeCallProperty(ObjectTypeCallProperty<'gc>),
10002    /// A [`ObjectTypeIndexer`] node.
10003    ObjectTypeIndexer(ObjectTypeIndexer<'gc>),
10004    /// A [`ObjectTypeMappedTypeProperty`] node.
10005    ObjectTypeMappedTypeProperty(ObjectTypeMappedTypeProperty<'gc>),
10006    /// A [`Variance`] node.
10007    Variance(Variance<'gc>),
10008    /// A [`TypeParameterDeclaration`] node.
10009    TypeParameterDeclaration(TypeParameterDeclaration<'gc>),
10010    /// A [`TypeParameter`] node.
10011    TypeParameter(TypeParameter<'gc>),
10012    /// A [`TypeParameterInstantiation`] node.
10013    TypeParameterInstantiation(TypeParameterInstantiation<'gc>),
10014    /// A [`TypeCastExpression`] node.
10015    TypeCastExpression(TypeCastExpression<'gc>),
10016    /// A [`AsExpression`] node.
10017    AsExpression(AsExpression<'gc>),
10018    /// A [`AsConstExpression`] node.
10019    AsConstExpression(AsConstExpression<'gc>),
10020    /// A [`InferredPredicate`] node.
10021    InferredPredicate(InferredPredicate<'gc>),
10022    /// A [`DeclaredPredicate`] node.
10023    DeclaredPredicate(DeclaredPredicate<'gc>),
10024    /// A [`EnumDeclaration`] node.
10025    EnumDeclaration(EnumDeclaration<'gc>),
10026    /// A [`EnumStringBody`] node.
10027    EnumStringBody(EnumStringBody<'gc>),
10028    /// A [`EnumNumberBody`] node.
10029    EnumNumberBody(EnumNumberBody<'gc>),
10030    /// A [`EnumBigIntBody`] node.
10031    EnumBigIntBody(EnumBigIntBody<'gc>),
10032    /// A [`EnumBooleanBody`] node.
10033    EnumBooleanBody(EnumBooleanBody<'gc>),
10034    /// A [`EnumSymbolBody`] node.
10035    EnumSymbolBody(EnumSymbolBody<'gc>),
10036    /// A [`EnumDefaultedMember`] node.
10037    EnumDefaultedMember(EnumDefaultedMember<'gc>),
10038    /// A [`EnumStringMember`] node.
10039    EnumStringMember(EnumStringMember<'gc>),
10040    /// A [`EnumNumberMember`] node.
10041    EnumNumberMember(EnumNumberMember<'gc>),
10042    /// A [`EnumBigIntMember`] node.
10043    EnumBigIntMember(EnumBigIntMember<'gc>),
10044    /// A [`EnumBooleanMember`] node.
10045    EnumBooleanMember(EnumBooleanMember<'gc>),
10046    /// A [`ComponentParameter`] node.
10047    ComponentParameter(ComponentParameter<'gc>),
10048    /// A [`RecordDeclaration`] node.
10049    RecordDeclaration(RecordDeclaration<'gc>),
10050    /// A [`RecordDeclarationImplements`] node.
10051    RecordDeclarationImplements(RecordDeclarationImplements<'gc>),
10052    /// A [`RecordDeclarationBody`] node.
10053    RecordDeclarationBody(RecordDeclarationBody<'gc>),
10054    /// A [`RecordDeclarationProperty`] node.
10055    RecordDeclarationProperty(RecordDeclarationProperty<'gc>),
10056    /// A [`RecordDeclarationStaticProperty`] node.
10057    RecordDeclarationStaticProperty(RecordDeclarationStaticProperty<'gc>),
10058    /// A [`RecordExpression`] node.
10059    RecordExpression(RecordExpression<'gc>),
10060    /// A [`RecordExpressionProperties`] node.
10061    RecordExpressionProperties(RecordExpressionProperties<'gc>),
10062    /// A [`TSTypeAnnotation`] node.
10063    TSTypeAnnotation(TSTypeAnnotation<'gc>),
10064    /// A [`TSAnyKeyword`] node.
10065    TSAnyKeyword(TSAnyKeyword<'gc>),
10066    /// A [`TSNumberKeyword`] node.
10067    TSNumberKeyword(TSNumberKeyword<'gc>),
10068    /// A [`TSBooleanKeyword`] node.
10069    TSBooleanKeyword(TSBooleanKeyword<'gc>),
10070    /// A [`TSStringKeyword`] node.
10071    TSStringKeyword(TSStringKeyword<'gc>),
10072    /// A [`TSSymbolKeyword`] node.
10073    TSSymbolKeyword(TSSymbolKeyword<'gc>),
10074    /// A [`TSVoidKeyword`] node.
10075    TSVoidKeyword(TSVoidKeyword<'gc>),
10076    /// A [`TSUndefinedKeyword`] node.
10077    TSUndefinedKeyword(TSUndefinedKeyword<'gc>),
10078    /// A [`TSUnknownKeyword`] node.
10079    TSUnknownKeyword(TSUnknownKeyword<'gc>),
10080    /// A [`TSNeverKeyword`] node.
10081    TSNeverKeyword(TSNeverKeyword<'gc>),
10082    /// A [`TSBigIntKeyword`] node.
10083    TSBigIntKeyword(TSBigIntKeyword<'gc>),
10084    /// A [`TSThisType`] node.
10085    TSThisType(TSThisType<'gc>),
10086    /// A [`TSLiteralType`] node.
10087    TSLiteralType(TSLiteralType<'gc>),
10088    /// A [`TSIndexedAccessType`] node.
10089    TSIndexedAccessType(TSIndexedAccessType<'gc>),
10090    /// A [`TSArrayType`] node.
10091    TSArrayType(TSArrayType<'gc>),
10092    /// A [`TSTypeReference`] node.
10093    TSTypeReference(TSTypeReference<'gc>),
10094    /// A [`TSQualifiedName`] node.
10095    TSQualifiedName(TSQualifiedName<'gc>),
10096    /// A [`TSFunctionType`] node.
10097    TSFunctionType(TSFunctionType<'gc>),
10098    /// A [`TSConstructorType`] node.
10099    TSConstructorType(TSConstructorType<'gc>),
10100    /// A [`TSTypePredicate`] node.
10101    TSTypePredicate(TSTypePredicate<'gc>),
10102    /// A [`TSTupleType`] node.
10103    TSTupleType(TSTupleType<'gc>),
10104    /// A [`TSTypeAssertion`] node.
10105    TSTypeAssertion(TSTypeAssertion<'gc>),
10106    /// A [`TSAsExpression`] node.
10107    TSAsExpression(TSAsExpression<'gc>),
10108    /// A [`TSParameterProperty`] node.
10109    TSParameterProperty(TSParameterProperty<'gc>),
10110    /// A [`TSTypeAliasDeclaration`] node.
10111    TSTypeAliasDeclaration(TSTypeAliasDeclaration<'gc>),
10112    /// A [`TSInterfaceDeclaration`] node.
10113    TSInterfaceDeclaration(TSInterfaceDeclaration<'gc>),
10114    /// A [`TSInterfaceHeritage`] node.
10115    TSInterfaceHeritage(TSInterfaceHeritage<'gc>),
10116    /// A [`TSInterfaceBody`] node.
10117    TSInterfaceBody(TSInterfaceBody<'gc>),
10118    /// A [`TSEnumDeclaration`] node.
10119    TSEnumDeclaration(TSEnumDeclaration<'gc>),
10120    /// A [`TSEnumMember`] node.
10121    TSEnumMember(TSEnumMember<'gc>),
10122    /// A [`TSModuleDeclaration`] node.
10123    TSModuleDeclaration(TSModuleDeclaration<'gc>),
10124    /// A [`TSModuleBlock`] node.
10125    TSModuleBlock(TSModuleBlock<'gc>),
10126    /// A [`TSModuleMember`] node.
10127    TSModuleMember(TSModuleMember<'gc>),
10128    /// A [`TSTypeParameterDeclaration`] node.
10129    TSTypeParameterDeclaration(TSTypeParameterDeclaration<'gc>),
10130    /// A [`TSTypeParameter`] node.
10131    TSTypeParameter(TSTypeParameter<'gc>),
10132    /// A [`TSTypeParameterInstantiation`] node.
10133    TSTypeParameterInstantiation(TSTypeParameterInstantiation<'gc>),
10134    /// A [`TSUnionType`] node.
10135    TSUnionType(TSUnionType<'gc>),
10136    /// A [`TSIntersectionType`] node.
10137    TSIntersectionType(TSIntersectionType<'gc>),
10138    /// A [`TSTypeQuery`] node.
10139    TSTypeQuery(TSTypeQuery<'gc>),
10140    /// A [`TSConditionalType`] node.
10141    TSConditionalType(TSConditionalType<'gc>),
10142    /// A [`TSTypeLiteral`] node.
10143    TSTypeLiteral(TSTypeLiteral<'gc>),
10144    /// A [`TSPropertySignature`] node.
10145    TSPropertySignature(TSPropertySignature<'gc>),
10146    /// A [`TSMethodSignature`] node.
10147    TSMethodSignature(TSMethodSignature<'gc>),
10148    /// A [`TSIndexSignature`] node.
10149    TSIndexSignature(TSIndexSignature<'gc>),
10150    /// A [`TSCallSignatureDeclaration`] node.
10151    TSCallSignatureDeclaration(TSCallSignatureDeclaration<'gc>),
10152    /// A [`TSModifiers`] node.
10153    TSModifiers(TSModifiers<'gc>),
10154    /// A [`CoverEmptyArgs`] node.
10155    CoverEmptyArgs(CoverEmptyArgs<'gc>),
10156    /// A [`CoverTrailingComma`] node.
10157    CoverTrailingComma(CoverTrailingComma<'gc>),
10158    /// A [`CoverInitializer`] node.
10159    CoverInitializer(CoverInitializer<'gc>),
10160    /// A [`CoverRestElement`] node.
10161    CoverRestElement(CoverRestElement<'gc>),
10162    /// A [`CoverTypedIdentifier`] node.
10163    CoverTypedIdentifier(CoverTypedIdentifier<'gc>),
10164    /// A [`SHBuiltin`] node.
10165    SHBuiltin(SHBuiltin<'gc>),
10166    /// A [`ImplicitCheckedCast`] node.
10167    ImplicitCheckedCast(ImplicitCheckedCast<'gc>),
10168}
10169
10170impl<'gc> Node<'gc> {
10171    /// This node's [`NodeKind`].
10172    pub fn kind(&self) -> NodeKind {
10173        match self {
10174            Node::Empty(_) => NodeKind::Empty,
10175            Node::Metadata(_) => NodeKind::Metadata,
10176            Node::Program(_) => NodeKind::Program,
10177            Node::FunctionExpression(_) => NodeKind::FunctionExpression,
10178            Node::ArrowFunctionExpression(_) => NodeKind::ArrowFunctionExpression,
10179            Node::FunctionDeclaration(_) => NodeKind::FunctionDeclaration,
10180            Node::ComponentDeclaration(_) => NodeKind::ComponentDeclaration,
10181            Node::HookDeclaration(_) => NodeKind::HookDeclaration,
10182            Node::MatchStatement(_) => NodeKind::MatchStatement,
10183            Node::WhileStatement(_) => NodeKind::WhileStatement,
10184            Node::DoWhileStatement(_) => NodeKind::DoWhileStatement,
10185            Node::ForInStatement(_) => NodeKind::ForInStatement,
10186            Node::ForOfStatement(_) => NodeKind::ForOfStatement,
10187            Node::ForStatement(_) => NodeKind::ForStatement,
10188            Node::DebuggerStatement(_) => NodeKind::DebuggerStatement,
10189            Node::EmptyStatement(_) => NodeKind::EmptyStatement,
10190            Node::BlockStatement(_) => NodeKind::BlockStatement,
10191            Node::StaticBlock(_) => NodeKind::StaticBlock,
10192            Node::BreakStatement(_) => NodeKind::BreakStatement,
10193            Node::ContinueStatement(_) => NodeKind::ContinueStatement,
10194            Node::ThrowStatement(_) => NodeKind::ThrowStatement,
10195            Node::ReturnStatement(_) => NodeKind::ReturnStatement,
10196            Node::WithStatement(_) => NodeKind::WithStatement,
10197            Node::SwitchStatement(_) => NodeKind::SwitchStatement,
10198            Node::LabeledStatement(_) => NodeKind::LabeledStatement,
10199            Node::ExpressionStatement(_) => NodeKind::ExpressionStatement,
10200            Node::TryStatement(_) => NodeKind::TryStatement,
10201            Node::IfStatement(_) => NodeKind::IfStatement,
10202            Node::NullLiteral(_) => NodeKind::NullLiteral,
10203            Node::BooleanLiteral(_) => NodeKind::BooleanLiteral,
10204            Node::StringLiteral(_) => NodeKind::StringLiteral,
10205            Node::NumericLiteral(_) => NodeKind::NumericLiteral,
10206            Node::RegExpLiteral(_) => NodeKind::RegExpLiteral,
10207            Node::BigIntLiteral(_) => NodeKind::BigIntLiteral,
10208            Node::ThisExpression(_) => NodeKind::ThisExpression,
10209            Node::Super(_) => NodeKind::Super,
10210            Node::SequenceExpression(_) => NodeKind::SequenceExpression,
10211            Node::ObjectExpression(_) => NodeKind::ObjectExpression,
10212            Node::ArrayExpression(_) => NodeKind::ArrayExpression,
10213            Node::SpreadElement(_) => NodeKind::SpreadElement,
10214            Node::NewExpression(_) => NodeKind::NewExpression,
10215            Node::YieldExpression(_) => NodeKind::YieldExpression,
10216            Node::AwaitExpression(_) => NodeKind::AwaitExpression,
10217            Node::ImportExpression(_) => NodeKind::ImportExpression,
10218            Node::CallExpression(_) => NodeKind::CallExpression,
10219            Node::OptionalCallExpression(_) => NodeKind::OptionalCallExpression,
10220            Node::AssignmentExpression(_) => NodeKind::AssignmentExpression,
10221            Node::UnaryExpression(_) => NodeKind::UnaryExpression,
10222            Node::UpdateExpression(_) => NodeKind::UpdateExpression,
10223            Node::MemberExpression(_) => NodeKind::MemberExpression,
10224            Node::OptionalMemberExpression(_) => NodeKind::OptionalMemberExpression,
10225            Node::LogicalExpression(_) => NodeKind::LogicalExpression,
10226            Node::ConditionalExpression(_) => NodeKind::ConditionalExpression,
10227            Node::BinaryExpression(_) => NodeKind::BinaryExpression,
10228            Node::Directive(_) => NodeKind::Directive,
10229            Node::DirectiveLiteral(_) => NodeKind::DirectiveLiteral,
10230            Node::Identifier(_) => NodeKind::Identifier,
10231            Node::PrivateName(_) => NodeKind::PrivateName,
10232            Node::MetaProperty(_) => NodeKind::MetaProperty,
10233            Node::SwitchCase(_) => NodeKind::SwitchCase,
10234            Node::CatchClause(_) => NodeKind::CatchClause,
10235            Node::VariableDeclarator(_) => NodeKind::VariableDeclarator,
10236            Node::VariableDeclaration(_) => NodeKind::VariableDeclaration,
10237            Node::TemplateLiteral(_) => NodeKind::TemplateLiteral,
10238            Node::TaggedTemplateExpression(_) => NodeKind::TaggedTemplateExpression,
10239            Node::TemplateElement(_) => NodeKind::TemplateElement,
10240            Node::Property(_) => NodeKind::Property,
10241            Node::Decorator(_) => NodeKind::Decorator,
10242            Node::ClassDeclaration(_) => NodeKind::ClassDeclaration,
10243            Node::ClassExpression(_) => NodeKind::ClassExpression,
10244            Node::ClassBody(_) => NodeKind::ClassBody,
10245            Node::ClassProperty(_) => NodeKind::ClassProperty,
10246            Node::ClassPrivateProperty(_) => NodeKind::ClassPrivateProperty,
10247            Node::MethodDefinition(_) => NodeKind::MethodDefinition,
10248            Node::ImportDeclaration(_) => NodeKind::ImportDeclaration,
10249            Node::ImportSpecifier(_) => NodeKind::ImportSpecifier,
10250            Node::ImportDefaultSpecifier(_) => NodeKind::ImportDefaultSpecifier,
10251            Node::ImportNamespaceSpecifier(_) => NodeKind::ImportNamespaceSpecifier,
10252            Node::ImportAttribute(_) => NodeKind::ImportAttribute,
10253            Node::ExportNamedDeclaration(_) => NodeKind::ExportNamedDeclaration,
10254            Node::ExportSpecifier(_) => NodeKind::ExportSpecifier,
10255            Node::ExportNamespaceSpecifier(_) => NodeKind::ExportNamespaceSpecifier,
10256            Node::ExportDefaultDeclaration(_) => NodeKind::ExportDefaultDeclaration,
10257            Node::ExportAllDeclaration(_) => NodeKind::ExportAllDeclaration,
10258            Node::ObjectPattern(_) => NodeKind::ObjectPattern,
10259            Node::ArrayPattern(_) => NodeKind::ArrayPattern,
10260            Node::RestElement(_) => NodeKind::RestElement,
10261            Node::AssignmentPattern(_) => NodeKind::AssignmentPattern,
10262            Node::MatchStatementCase(_) => NodeKind::MatchStatementCase,
10263            Node::MatchExpression(_) => NodeKind::MatchExpression,
10264            Node::MatchExpressionCase(_) => NodeKind::MatchExpressionCase,
10265            Node::MatchWildcardPattern(_) => NodeKind::MatchWildcardPattern,
10266            Node::MatchLiteralPattern(_) => NodeKind::MatchLiteralPattern,
10267            Node::MatchUnaryPattern(_) => NodeKind::MatchUnaryPattern,
10268            Node::MatchIdentifierPattern(_) => NodeKind::MatchIdentifierPattern,
10269            Node::MatchBindingPattern(_) => NodeKind::MatchBindingPattern,
10270            Node::MatchObjectPattern(_) => NodeKind::MatchObjectPattern,
10271            Node::MatchArrayPattern(_) => NodeKind::MatchArrayPattern,
10272            Node::MatchOrPattern(_) => NodeKind::MatchOrPattern,
10273            Node::MatchAsPattern(_) => NodeKind::MatchAsPattern,
10274            Node::MatchMemberPattern(_) => NodeKind::MatchMemberPattern,
10275            Node::MatchInstancePattern(_) => NodeKind::MatchInstancePattern,
10276            Node::MatchObjectPatternProperty(_) => NodeKind::MatchObjectPatternProperty,
10277            Node::MatchInstanceObjectPattern(_) => NodeKind::MatchInstanceObjectPattern,
10278            Node::MatchRestPattern(_) => NodeKind::MatchRestPattern,
10279            Node::JSXIdentifier(_) => NodeKind::JSXIdentifier,
10280            Node::JSXMemberExpression(_) => NodeKind::JSXMemberExpression,
10281            Node::JSXNamespacedName(_) => NodeKind::JSXNamespacedName,
10282            Node::JSXEmptyExpression(_) => NodeKind::JSXEmptyExpression,
10283            Node::JSXExpressionContainer(_) => NodeKind::JSXExpressionContainer,
10284            Node::JSXSpreadChild(_) => NodeKind::JSXSpreadChild,
10285            Node::JSXOpeningElement(_) => NodeKind::JSXOpeningElement,
10286            Node::JSXClosingElement(_) => NodeKind::JSXClosingElement,
10287            Node::JSXAttribute(_) => NodeKind::JSXAttribute,
10288            Node::JSXSpreadAttribute(_) => NodeKind::JSXSpreadAttribute,
10289            Node::JSXStringLiteral(_) => NodeKind::JSXStringLiteral,
10290            Node::JSXText(_) => NodeKind::JSXText,
10291            Node::JSXElement(_) => NodeKind::JSXElement,
10292            Node::JSXFragment(_) => NodeKind::JSXFragment,
10293            Node::JSXOpeningFragment(_) => NodeKind::JSXOpeningFragment,
10294            Node::JSXClosingFragment(_) => NodeKind::JSXClosingFragment,
10295            Node::ExistsTypeAnnotation(_) => NodeKind::ExistsTypeAnnotation,
10296            Node::EmptyTypeAnnotation(_) => NodeKind::EmptyTypeAnnotation,
10297            Node::StringTypeAnnotation(_) => NodeKind::StringTypeAnnotation,
10298            Node::NumberTypeAnnotation(_) => NodeKind::NumberTypeAnnotation,
10299            Node::StringLiteralTypeAnnotation(_) => NodeKind::StringLiteralTypeAnnotation,
10300            Node::NumberLiteralTypeAnnotation(_) => NodeKind::NumberLiteralTypeAnnotation,
10301            Node::BigIntLiteralTypeAnnotation(_) => NodeKind::BigIntLiteralTypeAnnotation,
10302            Node::BooleanTypeAnnotation(_) => NodeKind::BooleanTypeAnnotation,
10303            Node::BooleanLiteralTypeAnnotation(_) => NodeKind::BooleanLiteralTypeAnnotation,
10304            Node::NullLiteralTypeAnnotation(_) => NodeKind::NullLiteralTypeAnnotation,
10305            Node::SymbolTypeAnnotation(_) => NodeKind::SymbolTypeAnnotation,
10306            Node::AnyTypeAnnotation(_) => NodeKind::AnyTypeAnnotation,
10307            Node::MixedTypeAnnotation(_) => NodeKind::MixedTypeAnnotation,
10308            Node::BigIntTypeAnnotation(_) => NodeKind::BigIntTypeAnnotation,
10309            Node::VoidTypeAnnotation(_) => NodeKind::VoidTypeAnnotation,
10310            Node::NeverTypeAnnotation(_) => NodeKind::NeverTypeAnnotation,
10311            Node::UnknownTypeAnnotation(_) => NodeKind::UnknownTypeAnnotation,
10312            Node::UndefinedTypeAnnotation(_) => NodeKind::UndefinedTypeAnnotation,
10313            Node::FunctionTypeAnnotation(_) => NodeKind::FunctionTypeAnnotation,
10314            Node::HookTypeAnnotation(_) => NodeKind::HookTypeAnnotation,
10315            Node::FunctionTypeParam(_) => NodeKind::FunctionTypeParam,
10316            Node::ComponentTypeAnnotation(_) => NodeKind::ComponentTypeAnnotation,
10317            Node::ComponentTypeParameter(_) => NodeKind::ComponentTypeParameter,
10318            Node::NullableTypeAnnotation(_) => NodeKind::NullableTypeAnnotation,
10319            Node::QualifiedTypeIdentifier(_) => NodeKind::QualifiedTypeIdentifier,
10320            Node::TypeofTypeAnnotation(_) => NodeKind::TypeofTypeAnnotation,
10321            Node::KeyofTypeAnnotation(_) => NodeKind::KeyofTypeAnnotation,
10322            Node::TypeOperator(_) => NodeKind::TypeOperator,
10323            Node::QualifiedTypeofIdentifier(_) => NodeKind::QualifiedTypeofIdentifier,
10324            Node::TupleTypeAnnotation(_) => NodeKind::TupleTypeAnnotation,
10325            Node::TupleTypeSpreadElement(_) => NodeKind::TupleTypeSpreadElement,
10326            Node::TupleTypeLabeledElement(_) => NodeKind::TupleTypeLabeledElement,
10327            Node::ArrayTypeAnnotation(_) => NodeKind::ArrayTypeAnnotation,
10328            Node::InferTypeAnnotation(_) => NodeKind::InferTypeAnnotation,
10329            Node::UnionTypeAnnotation(_) => NodeKind::UnionTypeAnnotation,
10330            Node::IntersectionTypeAnnotation(_) => NodeKind::IntersectionTypeAnnotation,
10331            Node::GenericTypeAnnotation(_) => NodeKind::GenericTypeAnnotation,
10332            Node::IndexedAccessType(_) => NodeKind::IndexedAccessType,
10333            Node::OptionalIndexedAccessType(_) => NodeKind::OptionalIndexedAccessType,
10334            Node::ConditionalTypeAnnotation(_) => NodeKind::ConditionalTypeAnnotation,
10335            Node::TypePredicate(_) => NodeKind::TypePredicate,
10336            Node::InterfaceTypeAnnotation(_) => NodeKind::InterfaceTypeAnnotation,
10337            Node::TypeAlias(_) => NodeKind::TypeAlias,
10338            Node::OpaqueType(_) => NodeKind::OpaqueType,
10339            Node::InterfaceDeclaration(_) => NodeKind::InterfaceDeclaration,
10340            Node::DeclareTypeAlias(_) => NodeKind::DeclareTypeAlias,
10341            Node::DeclareOpaqueType(_) => NodeKind::DeclareOpaqueType,
10342            Node::DeclareInterface(_) => NodeKind::DeclareInterface,
10343            Node::DeclareClass(_) => NodeKind::DeclareClass,
10344            Node::DeclareFunction(_) => NodeKind::DeclareFunction,
10345            Node::DeclareHook(_) => NodeKind::DeclareHook,
10346            Node::DeclareComponent(_) => NodeKind::DeclareComponent,
10347            Node::DeclareVariable(_) => NodeKind::DeclareVariable,
10348            Node::DeclareEnum(_) => NodeKind::DeclareEnum,
10349            Node::DeclareExportDeclaration(_) => NodeKind::DeclareExportDeclaration,
10350            Node::DeclareExportAllDeclaration(_) => NodeKind::DeclareExportAllDeclaration,
10351            Node::DeclareModule(_) => NodeKind::DeclareModule,
10352            Node::DeclareNamespace(_) => NodeKind::DeclareNamespace,
10353            Node::DeclareModuleExports(_) => NodeKind::DeclareModuleExports,
10354            Node::InterfaceExtends(_) => NodeKind::InterfaceExtends,
10355            Node::ClassImplements(_) => NodeKind::ClassImplements,
10356            Node::TypeAnnotation(_) => NodeKind::TypeAnnotation,
10357            Node::ObjectTypeAnnotation(_) => NodeKind::ObjectTypeAnnotation,
10358            Node::ObjectTypeProperty(_) => NodeKind::ObjectTypeProperty,
10359            Node::ObjectTypeSpreadProperty(_) => NodeKind::ObjectTypeSpreadProperty,
10360            Node::ObjectTypeInternalSlot(_) => NodeKind::ObjectTypeInternalSlot,
10361            Node::ObjectTypeCallProperty(_) => NodeKind::ObjectTypeCallProperty,
10362            Node::ObjectTypeIndexer(_) => NodeKind::ObjectTypeIndexer,
10363            Node::ObjectTypeMappedTypeProperty(_) => NodeKind::ObjectTypeMappedTypeProperty,
10364            Node::Variance(_) => NodeKind::Variance,
10365            Node::TypeParameterDeclaration(_) => NodeKind::TypeParameterDeclaration,
10366            Node::TypeParameter(_) => NodeKind::TypeParameter,
10367            Node::TypeParameterInstantiation(_) => NodeKind::TypeParameterInstantiation,
10368            Node::TypeCastExpression(_) => NodeKind::TypeCastExpression,
10369            Node::AsExpression(_) => NodeKind::AsExpression,
10370            Node::AsConstExpression(_) => NodeKind::AsConstExpression,
10371            Node::InferredPredicate(_) => NodeKind::InferredPredicate,
10372            Node::DeclaredPredicate(_) => NodeKind::DeclaredPredicate,
10373            Node::EnumDeclaration(_) => NodeKind::EnumDeclaration,
10374            Node::EnumStringBody(_) => NodeKind::EnumStringBody,
10375            Node::EnumNumberBody(_) => NodeKind::EnumNumberBody,
10376            Node::EnumBigIntBody(_) => NodeKind::EnumBigIntBody,
10377            Node::EnumBooleanBody(_) => NodeKind::EnumBooleanBody,
10378            Node::EnumSymbolBody(_) => NodeKind::EnumSymbolBody,
10379            Node::EnumDefaultedMember(_) => NodeKind::EnumDefaultedMember,
10380            Node::EnumStringMember(_) => NodeKind::EnumStringMember,
10381            Node::EnumNumberMember(_) => NodeKind::EnumNumberMember,
10382            Node::EnumBigIntMember(_) => NodeKind::EnumBigIntMember,
10383            Node::EnumBooleanMember(_) => NodeKind::EnumBooleanMember,
10384            Node::ComponentParameter(_) => NodeKind::ComponentParameter,
10385            Node::RecordDeclaration(_) => NodeKind::RecordDeclaration,
10386            Node::RecordDeclarationImplements(_) => NodeKind::RecordDeclarationImplements,
10387            Node::RecordDeclarationBody(_) => NodeKind::RecordDeclarationBody,
10388            Node::RecordDeclarationProperty(_) => NodeKind::RecordDeclarationProperty,
10389            Node::RecordDeclarationStaticProperty(_) => NodeKind::RecordDeclarationStaticProperty,
10390            Node::RecordExpression(_) => NodeKind::RecordExpression,
10391            Node::RecordExpressionProperties(_) => NodeKind::RecordExpressionProperties,
10392            Node::TSTypeAnnotation(_) => NodeKind::TSTypeAnnotation,
10393            Node::TSAnyKeyword(_) => NodeKind::TSAnyKeyword,
10394            Node::TSNumberKeyword(_) => NodeKind::TSNumberKeyword,
10395            Node::TSBooleanKeyword(_) => NodeKind::TSBooleanKeyword,
10396            Node::TSStringKeyword(_) => NodeKind::TSStringKeyword,
10397            Node::TSSymbolKeyword(_) => NodeKind::TSSymbolKeyword,
10398            Node::TSVoidKeyword(_) => NodeKind::TSVoidKeyword,
10399            Node::TSUndefinedKeyword(_) => NodeKind::TSUndefinedKeyword,
10400            Node::TSUnknownKeyword(_) => NodeKind::TSUnknownKeyword,
10401            Node::TSNeverKeyword(_) => NodeKind::TSNeverKeyword,
10402            Node::TSBigIntKeyword(_) => NodeKind::TSBigIntKeyword,
10403            Node::TSThisType(_) => NodeKind::TSThisType,
10404            Node::TSLiteralType(_) => NodeKind::TSLiteralType,
10405            Node::TSIndexedAccessType(_) => NodeKind::TSIndexedAccessType,
10406            Node::TSArrayType(_) => NodeKind::TSArrayType,
10407            Node::TSTypeReference(_) => NodeKind::TSTypeReference,
10408            Node::TSQualifiedName(_) => NodeKind::TSQualifiedName,
10409            Node::TSFunctionType(_) => NodeKind::TSFunctionType,
10410            Node::TSConstructorType(_) => NodeKind::TSConstructorType,
10411            Node::TSTypePredicate(_) => NodeKind::TSTypePredicate,
10412            Node::TSTupleType(_) => NodeKind::TSTupleType,
10413            Node::TSTypeAssertion(_) => NodeKind::TSTypeAssertion,
10414            Node::TSAsExpression(_) => NodeKind::TSAsExpression,
10415            Node::TSParameterProperty(_) => NodeKind::TSParameterProperty,
10416            Node::TSTypeAliasDeclaration(_) => NodeKind::TSTypeAliasDeclaration,
10417            Node::TSInterfaceDeclaration(_) => NodeKind::TSInterfaceDeclaration,
10418            Node::TSInterfaceHeritage(_) => NodeKind::TSInterfaceHeritage,
10419            Node::TSInterfaceBody(_) => NodeKind::TSInterfaceBody,
10420            Node::TSEnumDeclaration(_) => NodeKind::TSEnumDeclaration,
10421            Node::TSEnumMember(_) => NodeKind::TSEnumMember,
10422            Node::TSModuleDeclaration(_) => NodeKind::TSModuleDeclaration,
10423            Node::TSModuleBlock(_) => NodeKind::TSModuleBlock,
10424            Node::TSModuleMember(_) => NodeKind::TSModuleMember,
10425            Node::TSTypeParameterDeclaration(_) => NodeKind::TSTypeParameterDeclaration,
10426            Node::TSTypeParameter(_) => NodeKind::TSTypeParameter,
10427            Node::TSTypeParameterInstantiation(_) => NodeKind::TSTypeParameterInstantiation,
10428            Node::TSUnionType(_) => NodeKind::TSUnionType,
10429            Node::TSIntersectionType(_) => NodeKind::TSIntersectionType,
10430            Node::TSTypeQuery(_) => NodeKind::TSTypeQuery,
10431            Node::TSConditionalType(_) => NodeKind::TSConditionalType,
10432            Node::TSTypeLiteral(_) => NodeKind::TSTypeLiteral,
10433            Node::TSPropertySignature(_) => NodeKind::TSPropertySignature,
10434            Node::TSMethodSignature(_) => NodeKind::TSMethodSignature,
10435            Node::TSIndexSignature(_) => NodeKind::TSIndexSignature,
10436            Node::TSCallSignatureDeclaration(_) => NodeKind::TSCallSignatureDeclaration,
10437            Node::TSModifiers(_) => NodeKind::TSModifiers,
10438            Node::CoverEmptyArgs(_) => NodeKind::CoverEmptyArgs,
10439            Node::CoverTrailingComma(_) => NodeKind::CoverTrailingComma,
10440            Node::CoverInitializer(_) => NodeKind::CoverInitializer,
10441            Node::CoverRestElement(_) => NodeKind::CoverRestElement,
10442            Node::CoverTypedIdentifier(_) => NodeKind::CoverTypedIdentifier,
10443            Node::SHBuiltin(_) => NodeKind::SHBuiltin,
10444            Node::ImplicitCheckedCast(_) => NodeKind::ImplicitCheckedCast,
10445        }
10446    }
10447
10448    /// This node's metadata, common to every kind.
10449    pub fn metadata(&self) -> &NodeMetadata<'gc> {
10450        match self {
10451            Node::Empty(n) => &n.metadata,
10452            Node::Metadata(n) => &n.metadata,
10453            Node::Program(n) => &n.metadata,
10454            Node::FunctionExpression(n) => &n.metadata,
10455            Node::ArrowFunctionExpression(n) => &n.metadata,
10456            Node::FunctionDeclaration(n) => &n.metadata,
10457            Node::ComponentDeclaration(n) => &n.metadata,
10458            Node::HookDeclaration(n) => &n.metadata,
10459            Node::MatchStatement(n) => &n.metadata,
10460            Node::WhileStatement(n) => &n.metadata,
10461            Node::DoWhileStatement(n) => &n.metadata,
10462            Node::ForInStatement(n) => &n.metadata,
10463            Node::ForOfStatement(n) => &n.metadata,
10464            Node::ForStatement(n) => &n.metadata,
10465            Node::DebuggerStatement(n) => &n.metadata,
10466            Node::EmptyStatement(n) => &n.metadata,
10467            Node::BlockStatement(n) => &n.metadata,
10468            Node::StaticBlock(n) => &n.metadata,
10469            Node::BreakStatement(n) => &n.metadata,
10470            Node::ContinueStatement(n) => &n.metadata,
10471            Node::ThrowStatement(n) => &n.metadata,
10472            Node::ReturnStatement(n) => &n.metadata,
10473            Node::WithStatement(n) => &n.metadata,
10474            Node::SwitchStatement(n) => &n.metadata,
10475            Node::LabeledStatement(n) => &n.metadata,
10476            Node::ExpressionStatement(n) => &n.metadata,
10477            Node::TryStatement(n) => &n.metadata,
10478            Node::IfStatement(n) => &n.metadata,
10479            Node::NullLiteral(n) => &n.metadata,
10480            Node::BooleanLiteral(n) => &n.metadata,
10481            Node::StringLiteral(n) => &n.metadata,
10482            Node::NumericLiteral(n) => &n.metadata,
10483            Node::RegExpLiteral(n) => &n.metadata,
10484            Node::BigIntLiteral(n) => &n.metadata,
10485            Node::ThisExpression(n) => &n.metadata,
10486            Node::Super(n) => &n.metadata,
10487            Node::SequenceExpression(n) => &n.metadata,
10488            Node::ObjectExpression(n) => &n.metadata,
10489            Node::ArrayExpression(n) => &n.metadata,
10490            Node::SpreadElement(n) => &n.metadata,
10491            Node::NewExpression(n) => &n.metadata,
10492            Node::YieldExpression(n) => &n.metadata,
10493            Node::AwaitExpression(n) => &n.metadata,
10494            Node::ImportExpression(n) => &n.metadata,
10495            Node::CallExpression(n) => &n.metadata,
10496            Node::OptionalCallExpression(n) => &n.metadata,
10497            Node::AssignmentExpression(n) => &n.metadata,
10498            Node::UnaryExpression(n) => &n.metadata,
10499            Node::UpdateExpression(n) => &n.metadata,
10500            Node::MemberExpression(n) => &n.metadata,
10501            Node::OptionalMemberExpression(n) => &n.metadata,
10502            Node::LogicalExpression(n) => &n.metadata,
10503            Node::ConditionalExpression(n) => &n.metadata,
10504            Node::BinaryExpression(n) => &n.metadata,
10505            Node::Directive(n) => &n.metadata,
10506            Node::DirectiveLiteral(n) => &n.metadata,
10507            Node::Identifier(n) => &n.metadata,
10508            Node::PrivateName(n) => &n.metadata,
10509            Node::MetaProperty(n) => &n.metadata,
10510            Node::SwitchCase(n) => &n.metadata,
10511            Node::CatchClause(n) => &n.metadata,
10512            Node::VariableDeclarator(n) => &n.metadata,
10513            Node::VariableDeclaration(n) => &n.metadata,
10514            Node::TemplateLiteral(n) => &n.metadata,
10515            Node::TaggedTemplateExpression(n) => &n.metadata,
10516            Node::TemplateElement(n) => &n.metadata,
10517            Node::Property(n) => &n.metadata,
10518            Node::Decorator(n) => &n.metadata,
10519            Node::ClassDeclaration(n) => &n.metadata,
10520            Node::ClassExpression(n) => &n.metadata,
10521            Node::ClassBody(n) => &n.metadata,
10522            Node::ClassProperty(n) => &n.metadata,
10523            Node::ClassPrivateProperty(n) => &n.metadata,
10524            Node::MethodDefinition(n) => &n.metadata,
10525            Node::ImportDeclaration(n) => &n.metadata,
10526            Node::ImportSpecifier(n) => &n.metadata,
10527            Node::ImportDefaultSpecifier(n) => &n.metadata,
10528            Node::ImportNamespaceSpecifier(n) => &n.metadata,
10529            Node::ImportAttribute(n) => &n.metadata,
10530            Node::ExportNamedDeclaration(n) => &n.metadata,
10531            Node::ExportSpecifier(n) => &n.metadata,
10532            Node::ExportNamespaceSpecifier(n) => &n.metadata,
10533            Node::ExportDefaultDeclaration(n) => &n.metadata,
10534            Node::ExportAllDeclaration(n) => &n.metadata,
10535            Node::ObjectPattern(n) => &n.metadata,
10536            Node::ArrayPattern(n) => &n.metadata,
10537            Node::RestElement(n) => &n.metadata,
10538            Node::AssignmentPattern(n) => &n.metadata,
10539            Node::MatchStatementCase(n) => &n.metadata,
10540            Node::MatchExpression(n) => &n.metadata,
10541            Node::MatchExpressionCase(n) => &n.metadata,
10542            Node::MatchWildcardPattern(n) => &n.metadata,
10543            Node::MatchLiteralPattern(n) => &n.metadata,
10544            Node::MatchUnaryPattern(n) => &n.metadata,
10545            Node::MatchIdentifierPattern(n) => &n.metadata,
10546            Node::MatchBindingPattern(n) => &n.metadata,
10547            Node::MatchObjectPattern(n) => &n.metadata,
10548            Node::MatchArrayPattern(n) => &n.metadata,
10549            Node::MatchOrPattern(n) => &n.metadata,
10550            Node::MatchAsPattern(n) => &n.metadata,
10551            Node::MatchMemberPattern(n) => &n.metadata,
10552            Node::MatchInstancePattern(n) => &n.metadata,
10553            Node::MatchObjectPatternProperty(n) => &n.metadata,
10554            Node::MatchInstanceObjectPattern(n) => &n.metadata,
10555            Node::MatchRestPattern(n) => &n.metadata,
10556            Node::JSXIdentifier(n) => &n.metadata,
10557            Node::JSXMemberExpression(n) => &n.metadata,
10558            Node::JSXNamespacedName(n) => &n.metadata,
10559            Node::JSXEmptyExpression(n) => &n.metadata,
10560            Node::JSXExpressionContainer(n) => &n.metadata,
10561            Node::JSXSpreadChild(n) => &n.metadata,
10562            Node::JSXOpeningElement(n) => &n.metadata,
10563            Node::JSXClosingElement(n) => &n.metadata,
10564            Node::JSXAttribute(n) => &n.metadata,
10565            Node::JSXSpreadAttribute(n) => &n.metadata,
10566            Node::JSXStringLiteral(n) => &n.metadata,
10567            Node::JSXText(n) => &n.metadata,
10568            Node::JSXElement(n) => &n.metadata,
10569            Node::JSXFragment(n) => &n.metadata,
10570            Node::JSXOpeningFragment(n) => &n.metadata,
10571            Node::JSXClosingFragment(n) => &n.metadata,
10572            Node::ExistsTypeAnnotation(n) => &n.metadata,
10573            Node::EmptyTypeAnnotation(n) => &n.metadata,
10574            Node::StringTypeAnnotation(n) => &n.metadata,
10575            Node::NumberTypeAnnotation(n) => &n.metadata,
10576            Node::StringLiteralTypeAnnotation(n) => &n.metadata,
10577            Node::NumberLiteralTypeAnnotation(n) => &n.metadata,
10578            Node::BigIntLiteralTypeAnnotation(n) => &n.metadata,
10579            Node::BooleanTypeAnnotation(n) => &n.metadata,
10580            Node::BooleanLiteralTypeAnnotation(n) => &n.metadata,
10581            Node::NullLiteralTypeAnnotation(n) => &n.metadata,
10582            Node::SymbolTypeAnnotation(n) => &n.metadata,
10583            Node::AnyTypeAnnotation(n) => &n.metadata,
10584            Node::MixedTypeAnnotation(n) => &n.metadata,
10585            Node::BigIntTypeAnnotation(n) => &n.metadata,
10586            Node::VoidTypeAnnotation(n) => &n.metadata,
10587            Node::NeverTypeAnnotation(n) => &n.metadata,
10588            Node::UnknownTypeAnnotation(n) => &n.metadata,
10589            Node::UndefinedTypeAnnotation(n) => &n.metadata,
10590            Node::FunctionTypeAnnotation(n) => &n.metadata,
10591            Node::HookTypeAnnotation(n) => &n.metadata,
10592            Node::FunctionTypeParam(n) => &n.metadata,
10593            Node::ComponentTypeAnnotation(n) => &n.metadata,
10594            Node::ComponentTypeParameter(n) => &n.metadata,
10595            Node::NullableTypeAnnotation(n) => &n.metadata,
10596            Node::QualifiedTypeIdentifier(n) => &n.metadata,
10597            Node::TypeofTypeAnnotation(n) => &n.metadata,
10598            Node::KeyofTypeAnnotation(n) => &n.metadata,
10599            Node::TypeOperator(n) => &n.metadata,
10600            Node::QualifiedTypeofIdentifier(n) => &n.metadata,
10601            Node::TupleTypeAnnotation(n) => &n.metadata,
10602            Node::TupleTypeSpreadElement(n) => &n.metadata,
10603            Node::TupleTypeLabeledElement(n) => &n.metadata,
10604            Node::ArrayTypeAnnotation(n) => &n.metadata,
10605            Node::InferTypeAnnotation(n) => &n.metadata,
10606            Node::UnionTypeAnnotation(n) => &n.metadata,
10607            Node::IntersectionTypeAnnotation(n) => &n.metadata,
10608            Node::GenericTypeAnnotation(n) => &n.metadata,
10609            Node::IndexedAccessType(n) => &n.metadata,
10610            Node::OptionalIndexedAccessType(n) => &n.metadata,
10611            Node::ConditionalTypeAnnotation(n) => &n.metadata,
10612            Node::TypePredicate(n) => &n.metadata,
10613            Node::InterfaceTypeAnnotation(n) => &n.metadata,
10614            Node::TypeAlias(n) => &n.metadata,
10615            Node::OpaqueType(n) => &n.metadata,
10616            Node::InterfaceDeclaration(n) => &n.metadata,
10617            Node::DeclareTypeAlias(n) => &n.metadata,
10618            Node::DeclareOpaqueType(n) => &n.metadata,
10619            Node::DeclareInterface(n) => &n.metadata,
10620            Node::DeclareClass(n) => &n.metadata,
10621            Node::DeclareFunction(n) => &n.metadata,
10622            Node::DeclareHook(n) => &n.metadata,
10623            Node::DeclareComponent(n) => &n.metadata,
10624            Node::DeclareVariable(n) => &n.metadata,
10625            Node::DeclareEnum(n) => &n.metadata,
10626            Node::DeclareExportDeclaration(n) => &n.metadata,
10627            Node::DeclareExportAllDeclaration(n) => &n.metadata,
10628            Node::DeclareModule(n) => &n.metadata,
10629            Node::DeclareNamespace(n) => &n.metadata,
10630            Node::DeclareModuleExports(n) => &n.metadata,
10631            Node::InterfaceExtends(n) => &n.metadata,
10632            Node::ClassImplements(n) => &n.metadata,
10633            Node::TypeAnnotation(n) => &n.metadata,
10634            Node::ObjectTypeAnnotation(n) => &n.metadata,
10635            Node::ObjectTypeProperty(n) => &n.metadata,
10636            Node::ObjectTypeSpreadProperty(n) => &n.metadata,
10637            Node::ObjectTypeInternalSlot(n) => &n.metadata,
10638            Node::ObjectTypeCallProperty(n) => &n.metadata,
10639            Node::ObjectTypeIndexer(n) => &n.metadata,
10640            Node::ObjectTypeMappedTypeProperty(n) => &n.metadata,
10641            Node::Variance(n) => &n.metadata,
10642            Node::TypeParameterDeclaration(n) => &n.metadata,
10643            Node::TypeParameter(n) => &n.metadata,
10644            Node::TypeParameterInstantiation(n) => &n.metadata,
10645            Node::TypeCastExpression(n) => &n.metadata,
10646            Node::AsExpression(n) => &n.metadata,
10647            Node::AsConstExpression(n) => &n.metadata,
10648            Node::InferredPredicate(n) => &n.metadata,
10649            Node::DeclaredPredicate(n) => &n.metadata,
10650            Node::EnumDeclaration(n) => &n.metadata,
10651            Node::EnumStringBody(n) => &n.metadata,
10652            Node::EnumNumberBody(n) => &n.metadata,
10653            Node::EnumBigIntBody(n) => &n.metadata,
10654            Node::EnumBooleanBody(n) => &n.metadata,
10655            Node::EnumSymbolBody(n) => &n.metadata,
10656            Node::EnumDefaultedMember(n) => &n.metadata,
10657            Node::EnumStringMember(n) => &n.metadata,
10658            Node::EnumNumberMember(n) => &n.metadata,
10659            Node::EnumBigIntMember(n) => &n.metadata,
10660            Node::EnumBooleanMember(n) => &n.metadata,
10661            Node::ComponentParameter(n) => &n.metadata,
10662            Node::RecordDeclaration(n) => &n.metadata,
10663            Node::RecordDeclarationImplements(n) => &n.metadata,
10664            Node::RecordDeclarationBody(n) => &n.metadata,
10665            Node::RecordDeclarationProperty(n) => &n.metadata,
10666            Node::RecordDeclarationStaticProperty(n) => &n.metadata,
10667            Node::RecordExpression(n) => &n.metadata,
10668            Node::RecordExpressionProperties(n) => &n.metadata,
10669            Node::TSTypeAnnotation(n) => &n.metadata,
10670            Node::TSAnyKeyword(n) => &n.metadata,
10671            Node::TSNumberKeyword(n) => &n.metadata,
10672            Node::TSBooleanKeyword(n) => &n.metadata,
10673            Node::TSStringKeyword(n) => &n.metadata,
10674            Node::TSSymbolKeyword(n) => &n.metadata,
10675            Node::TSVoidKeyword(n) => &n.metadata,
10676            Node::TSUndefinedKeyword(n) => &n.metadata,
10677            Node::TSUnknownKeyword(n) => &n.metadata,
10678            Node::TSNeverKeyword(n) => &n.metadata,
10679            Node::TSBigIntKeyword(n) => &n.metadata,
10680            Node::TSThisType(n) => &n.metadata,
10681            Node::TSLiteralType(n) => &n.metadata,
10682            Node::TSIndexedAccessType(n) => &n.metadata,
10683            Node::TSArrayType(n) => &n.metadata,
10684            Node::TSTypeReference(n) => &n.metadata,
10685            Node::TSQualifiedName(n) => &n.metadata,
10686            Node::TSFunctionType(n) => &n.metadata,
10687            Node::TSConstructorType(n) => &n.metadata,
10688            Node::TSTypePredicate(n) => &n.metadata,
10689            Node::TSTupleType(n) => &n.metadata,
10690            Node::TSTypeAssertion(n) => &n.metadata,
10691            Node::TSAsExpression(n) => &n.metadata,
10692            Node::TSParameterProperty(n) => &n.metadata,
10693            Node::TSTypeAliasDeclaration(n) => &n.metadata,
10694            Node::TSInterfaceDeclaration(n) => &n.metadata,
10695            Node::TSInterfaceHeritage(n) => &n.metadata,
10696            Node::TSInterfaceBody(n) => &n.metadata,
10697            Node::TSEnumDeclaration(n) => &n.metadata,
10698            Node::TSEnumMember(n) => &n.metadata,
10699            Node::TSModuleDeclaration(n) => &n.metadata,
10700            Node::TSModuleBlock(n) => &n.metadata,
10701            Node::TSModuleMember(n) => &n.metadata,
10702            Node::TSTypeParameterDeclaration(n) => &n.metadata,
10703            Node::TSTypeParameter(n) => &n.metadata,
10704            Node::TSTypeParameterInstantiation(n) => &n.metadata,
10705            Node::TSUnionType(n) => &n.metadata,
10706            Node::TSIntersectionType(n) => &n.metadata,
10707            Node::TSTypeQuery(n) => &n.metadata,
10708            Node::TSConditionalType(n) => &n.metadata,
10709            Node::TSTypeLiteral(n) => &n.metadata,
10710            Node::TSPropertySignature(n) => &n.metadata,
10711            Node::TSMethodSignature(n) => &n.metadata,
10712            Node::TSIndexSignature(n) => &n.metadata,
10713            Node::TSCallSignatureDeclaration(n) => &n.metadata,
10714            Node::TSModifiers(n) => &n.metadata,
10715            Node::CoverEmptyArgs(n) => &n.metadata,
10716            Node::CoverTrailingComma(n) => &n.metadata,
10717            Node::CoverInitializer(n) => &n.metadata,
10718            Node::CoverRestElement(n) => &n.metadata,
10719            Node::CoverTypedIdentifier(n) => &n.metadata,
10720            Node::SHBuiltin(n) => &n.metadata,
10721            Node::ImplicitCheckedCast(n) => &n.metadata,
10722        }
10723    }
10724
10725    /// This node's arena identity (see [`NodeId`]).
10726    pub fn node_id(&self) -> NodeId {
10727        self.metadata().id.get()
10728    }
10729
10730    /// This node's source range.
10731    pub fn range(&self) -> hermes_support::location::SMRange {
10732        self.metadata().range.get()
10733    }
10734
10735    /// Whether this node's kind is in the `FunctionLike` range.
10736    pub fn is_function_like(&self) -> bool {
10737        let k = self.kind() as u32;
10738        (NodeKind::_FunctionLike_First as u32) < k && k < (NodeKind::_FunctionLike_Last as u32)
10739    }
10740
10741    /// Whether this node's kind is in the `Statement` range.
10742    pub fn is_statement(&self) -> bool {
10743        let k = self.kind() as u32;
10744        (NodeKind::_Statement_First as u32) < k && k < (NodeKind::_Statement_Last as u32)
10745    }
10746
10747    /// Whether this node's kind is in the `LoopStatement` range.
10748    pub fn is_loop_statement(&self) -> bool {
10749        let k = self.kind() as u32;
10750        (NodeKind::_LoopStatement_First as u32) < k && k < (NodeKind::_LoopStatement_Last as u32)
10751    }
10752
10753    /// Whether this node's kind is in the `CallExpressionLike` range.
10754    pub fn is_call_expression_like(&self) -> bool {
10755        let k = self.kind() as u32;
10756        (NodeKind::_CallExpressionLike_First as u32) < k && k < (NodeKind::_CallExpressionLike_Last as u32)
10757    }
10758
10759    /// Whether this node's kind is in the `MemberExpressionLike` range.
10760    pub fn is_member_expression_like(&self) -> bool {
10761        let k = self.kind() as u32;
10762        (NodeKind::_MemberExpressionLike_First as u32) < k && k < (NodeKind::_MemberExpressionLike_Last as u32)
10763    }
10764
10765    /// Whether this node's kind is in the `ClassLike` range.
10766    pub fn is_class_like(&self) -> bool {
10767        let k = self.kind() as u32;
10768        (NodeKind::_ClassLike_First as u32) < k && k < (NodeKind::_ClassLike_Last as u32)
10769    }
10770
10771    /// Whether this node's kind is in the `Pattern` range.
10772    pub fn is_pattern(&self) -> bool {
10773        let k = self.kind() as u32;
10774        (NodeKind::_Pattern_First as u32) < k && k < (NodeKind::_Pattern_Last as u32)
10775    }
10776
10777    /// Whether this node's kind is in the `MatchPattern` range.
10778    pub fn is_match_pattern(&self) -> bool {
10779        let k = self.kind() as u32;
10780        (NodeKind::_MatchPattern_First as u32) < k && k < (NodeKind::_MatchPattern_Last as u32)
10781    }
10782
10783    /// Whether this node's kind is in the `JSX` range.
10784    pub fn is_jsx(&self) -> bool {
10785        let k = self.kind() as u32;
10786        (NodeKind::_JSX_First as u32) < k && k < (NodeKind::_JSX_Last as u32)
10787    }
10788
10789    /// Whether this node's kind is in the `Flow` range.
10790    pub fn is_flow(&self) -> bool {
10791        let k = self.kind() as u32;
10792        (NodeKind::_Flow_First as u32) < k && k < (NodeKind::_Flow_Last as u32)
10793    }
10794
10795    /// Whether this node's kind is in the `TS` range.
10796    pub fn is_ts(&self) -> bool {
10797        let k = self.kind() as u32;
10798        (NodeKind::_TS_First as u32) < k && k < (NodeKind::_TS_Last as u32)
10799    }
10800
10801    /// Whether this node's kind is in the `Cover` range.
10802    pub fn is_cover(&self) -> bool {
10803        let k = self.kind() as u32;
10804        (NodeKind::_Cover_First as u32) < k && k < (NodeKind::_Cover_Last as u32)
10805    }
10806
10807    /// The payload if this is a [`Empty`], `None` otherwise.
10808    pub fn as_empty(&self) -> Option<&Empty<'gc>> {
10809        if let Node::Empty(n) = self { Some(n) } else { None }
10810    }
10811
10812    /// The payload if this is a [`Metadata`], `None` otherwise.
10813    pub fn as_metadata(&self) -> Option<&Metadata<'gc>> {
10814        if let Node::Metadata(n) = self { Some(n) } else { None }
10815    }
10816
10817    /// The payload if this is a [`Program`], `None` otherwise.
10818    pub fn as_program(&self) -> Option<&Program<'gc>> {
10819        if let Node::Program(n) = self { Some(n) } else { None }
10820    }
10821
10822    /// The payload if this is a [`FunctionExpression`], `None` otherwise.
10823    pub fn as_function_expression(&self) -> Option<&FunctionExpression<'gc>> {
10824        if let Node::FunctionExpression(n) = self { Some(n) } else { None }
10825    }
10826
10827    /// The payload if this is a [`ArrowFunctionExpression`], `None` otherwise.
10828    pub fn as_arrow_function_expression(&self) -> Option<&ArrowFunctionExpression<'gc>> {
10829        if let Node::ArrowFunctionExpression(n) = self { Some(n) } else { None }
10830    }
10831
10832    /// The payload if this is a [`FunctionDeclaration`], `None` otherwise.
10833    pub fn as_function_declaration(&self) -> Option<&FunctionDeclaration<'gc>> {
10834        if let Node::FunctionDeclaration(n) = self { Some(n) } else { None }
10835    }
10836
10837    /// The payload if this is a [`ComponentDeclaration`], `None` otherwise.
10838    pub fn as_component_declaration(&self) -> Option<&ComponentDeclaration<'gc>> {
10839        if let Node::ComponentDeclaration(n) = self { Some(n) } else { None }
10840    }
10841
10842    /// The payload if this is a [`HookDeclaration`], `None` otherwise.
10843    pub fn as_hook_declaration(&self) -> Option<&HookDeclaration<'gc>> {
10844        if let Node::HookDeclaration(n) = self { Some(n) } else { None }
10845    }
10846
10847    /// The payload if this is a [`MatchStatement`], `None` otherwise.
10848    pub fn as_match_statement(&self) -> Option<&MatchStatement<'gc>> {
10849        if let Node::MatchStatement(n) = self { Some(n) } else { None }
10850    }
10851
10852    /// The payload if this is a [`WhileStatement`], `None` otherwise.
10853    pub fn as_while_statement(&self) -> Option<&WhileStatement<'gc>> {
10854        if let Node::WhileStatement(n) = self { Some(n) } else { None }
10855    }
10856
10857    /// The payload if this is a [`DoWhileStatement`], `None` otherwise.
10858    pub fn as_do_while_statement(&self) -> Option<&DoWhileStatement<'gc>> {
10859        if let Node::DoWhileStatement(n) = self { Some(n) } else { None }
10860    }
10861
10862    /// The payload if this is a [`ForInStatement`], `None` otherwise.
10863    pub fn as_for_in_statement(&self) -> Option<&ForInStatement<'gc>> {
10864        if let Node::ForInStatement(n) = self { Some(n) } else { None }
10865    }
10866
10867    /// The payload if this is a [`ForOfStatement`], `None` otherwise.
10868    pub fn as_for_of_statement(&self) -> Option<&ForOfStatement<'gc>> {
10869        if let Node::ForOfStatement(n) = self { Some(n) } else { None }
10870    }
10871
10872    /// The payload if this is a [`ForStatement`], `None` otherwise.
10873    pub fn as_for_statement(&self) -> Option<&ForStatement<'gc>> {
10874        if let Node::ForStatement(n) = self { Some(n) } else { None }
10875    }
10876
10877    /// The payload if this is a [`DebuggerStatement`], `None` otherwise.
10878    pub fn as_debugger_statement(&self) -> Option<&DebuggerStatement<'gc>> {
10879        if let Node::DebuggerStatement(n) = self { Some(n) } else { None }
10880    }
10881
10882    /// The payload if this is a [`EmptyStatement`], `None` otherwise.
10883    pub fn as_empty_statement(&self) -> Option<&EmptyStatement<'gc>> {
10884        if let Node::EmptyStatement(n) = self { Some(n) } else { None }
10885    }
10886
10887    /// The payload if this is a [`BlockStatement`], `None` otherwise.
10888    pub fn as_block_statement(&self) -> Option<&BlockStatement<'gc>> {
10889        if let Node::BlockStatement(n) = self { Some(n) } else { None }
10890    }
10891
10892    /// The payload if this is a [`StaticBlock`], `None` otherwise.
10893    pub fn as_static_block(&self) -> Option<&StaticBlock<'gc>> {
10894        if let Node::StaticBlock(n) = self { Some(n) } else { None }
10895    }
10896
10897    /// The payload if this is a [`BreakStatement`], `None` otherwise.
10898    pub fn as_break_statement(&self) -> Option<&BreakStatement<'gc>> {
10899        if let Node::BreakStatement(n) = self { Some(n) } else { None }
10900    }
10901
10902    /// The payload if this is a [`ContinueStatement`], `None` otherwise.
10903    pub fn as_continue_statement(&self) -> Option<&ContinueStatement<'gc>> {
10904        if let Node::ContinueStatement(n) = self { Some(n) } else { None }
10905    }
10906
10907    /// The payload if this is a [`ThrowStatement`], `None` otherwise.
10908    pub fn as_throw_statement(&self) -> Option<&ThrowStatement<'gc>> {
10909        if let Node::ThrowStatement(n) = self { Some(n) } else { None }
10910    }
10911
10912    /// The payload if this is a [`ReturnStatement`], `None` otherwise.
10913    pub fn as_return_statement(&self) -> Option<&ReturnStatement<'gc>> {
10914        if let Node::ReturnStatement(n) = self { Some(n) } else { None }
10915    }
10916
10917    /// The payload if this is a [`WithStatement`], `None` otherwise.
10918    pub fn as_with_statement(&self) -> Option<&WithStatement<'gc>> {
10919        if let Node::WithStatement(n) = self { Some(n) } else { None }
10920    }
10921
10922    /// The payload if this is a [`SwitchStatement`], `None` otherwise.
10923    pub fn as_switch_statement(&self) -> Option<&SwitchStatement<'gc>> {
10924        if let Node::SwitchStatement(n) = self { Some(n) } else { None }
10925    }
10926
10927    /// The payload if this is a [`LabeledStatement`], `None` otherwise.
10928    pub fn as_labeled_statement(&self) -> Option<&LabeledStatement<'gc>> {
10929        if let Node::LabeledStatement(n) = self { Some(n) } else { None }
10930    }
10931
10932    /// The payload if this is a [`ExpressionStatement`], `None` otherwise.
10933    pub fn as_expression_statement(&self) -> Option<&ExpressionStatement<'gc>> {
10934        if let Node::ExpressionStatement(n) = self { Some(n) } else { None }
10935    }
10936
10937    /// The payload if this is a [`TryStatement`], `None` otherwise.
10938    pub fn as_try_statement(&self) -> Option<&TryStatement<'gc>> {
10939        if let Node::TryStatement(n) = self { Some(n) } else { None }
10940    }
10941
10942    /// The payload if this is a [`IfStatement`], `None` otherwise.
10943    pub fn as_if_statement(&self) -> Option<&IfStatement<'gc>> {
10944        if let Node::IfStatement(n) = self { Some(n) } else { None }
10945    }
10946
10947    /// The payload if this is a [`NullLiteral`], `None` otherwise.
10948    pub fn as_null_literal(&self) -> Option<&NullLiteral<'gc>> {
10949        if let Node::NullLiteral(n) = self { Some(n) } else { None }
10950    }
10951
10952    /// The payload if this is a [`BooleanLiteral`], `None` otherwise.
10953    pub fn as_boolean_literal(&self) -> Option<&BooleanLiteral<'gc>> {
10954        if let Node::BooleanLiteral(n) = self { Some(n) } else { None }
10955    }
10956
10957    /// The payload if this is a [`StringLiteral`], `None` otherwise.
10958    pub fn as_string_literal(&self) -> Option<&StringLiteral<'gc>> {
10959        if let Node::StringLiteral(n) = self { Some(n) } else { None }
10960    }
10961
10962    /// The payload if this is a [`NumericLiteral`], `None` otherwise.
10963    pub fn as_numeric_literal(&self) -> Option<&NumericLiteral<'gc>> {
10964        if let Node::NumericLiteral(n) = self { Some(n) } else { None }
10965    }
10966
10967    /// The payload if this is a [`RegExpLiteral`], `None` otherwise.
10968    pub fn as_reg_exp_literal(&self) -> Option<&RegExpLiteral<'gc>> {
10969        if let Node::RegExpLiteral(n) = self { Some(n) } else { None }
10970    }
10971
10972    /// The payload if this is a [`BigIntLiteral`], `None` otherwise.
10973    pub fn as_big_int_literal(&self) -> Option<&BigIntLiteral<'gc>> {
10974        if let Node::BigIntLiteral(n) = self { Some(n) } else { None }
10975    }
10976
10977    /// The payload if this is a [`ThisExpression`], `None` otherwise.
10978    pub fn as_this_expression(&self) -> Option<&ThisExpression<'gc>> {
10979        if let Node::ThisExpression(n) = self { Some(n) } else { None }
10980    }
10981
10982    /// The payload if this is a [`Super`], `None` otherwise.
10983    pub fn as_super(&self) -> Option<&Super<'gc>> {
10984        if let Node::Super(n) = self { Some(n) } else { None }
10985    }
10986
10987    /// The payload if this is a [`SequenceExpression`], `None` otherwise.
10988    pub fn as_sequence_expression(&self) -> Option<&SequenceExpression<'gc>> {
10989        if let Node::SequenceExpression(n) = self { Some(n) } else { None }
10990    }
10991
10992    /// The payload if this is a [`ObjectExpression`], `None` otherwise.
10993    pub fn as_object_expression(&self) -> Option<&ObjectExpression<'gc>> {
10994        if let Node::ObjectExpression(n) = self { Some(n) } else { None }
10995    }
10996
10997    /// The payload if this is a [`ArrayExpression`], `None` otherwise.
10998    pub fn as_array_expression(&self) -> Option<&ArrayExpression<'gc>> {
10999        if let Node::ArrayExpression(n) = self { Some(n) } else { None }
11000    }
11001
11002    /// The payload if this is a [`SpreadElement`], `None` otherwise.
11003    pub fn as_spread_element(&self) -> Option<&SpreadElement<'gc>> {
11004        if let Node::SpreadElement(n) = self { Some(n) } else { None }
11005    }
11006
11007    /// The payload if this is a [`NewExpression`], `None` otherwise.
11008    pub fn as_new_expression(&self) -> Option<&NewExpression<'gc>> {
11009        if let Node::NewExpression(n) = self { Some(n) } else { None }
11010    }
11011
11012    /// The payload if this is a [`YieldExpression`], `None` otherwise.
11013    pub fn as_yield_expression(&self) -> Option<&YieldExpression<'gc>> {
11014        if let Node::YieldExpression(n) = self { Some(n) } else { None }
11015    }
11016
11017    /// The payload if this is a [`AwaitExpression`], `None` otherwise.
11018    pub fn as_await_expression(&self) -> Option<&AwaitExpression<'gc>> {
11019        if let Node::AwaitExpression(n) = self { Some(n) } else { None }
11020    }
11021
11022    /// The payload if this is a [`ImportExpression`], `None` otherwise.
11023    pub fn as_import_expression(&self) -> Option<&ImportExpression<'gc>> {
11024        if let Node::ImportExpression(n) = self { Some(n) } else { None }
11025    }
11026
11027    /// The payload if this is a [`CallExpression`], `None` otherwise.
11028    pub fn as_call_expression(&self) -> Option<&CallExpression<'gc>> {
11029        if let Node::CallExpression(n) = self { Some(n) } else { None }
11030    }
11031
11032    /// The payload if this is a [`OptionalCallExpression`], `None` otherwise.
11033    pub fn as_optional_call_expression(&self) -> Option<&OptionalCallExpression<'gc>> {
11034        if let Node::OptionalCallExpression(n) = self { Some(n) } else { None }
11035    }
11036
11037    /// The payload if this is a [`AssignmentExpression`], `None` otherwise.
11038    pub fn as_assignment_expression(&self) -> Option<&AssignmentExpression<'gc>> {
11039        if let Node::AssignmentExpression(n) = self { Some(n) } else { None }
11040    }
11041
11042    /// The payload if this is a [`UnaryExpression`], `None` otherwise.
11043    pub fn as_unary_expression(&self) -> Option<&UnaryExpression<'gc>> {
11044        if let Node::UnaryExpression(n) = self { Some(n) } else { None }
11045    }
11046
11047    /// The payload if this is a [`UpdateExpression`], `None` otherwise.
11048    pub fn as_update_expression(&self) -> Option<&UpdateExpression<'gc>> {
11049        if let Node::UpdateExpression(n) = self { Some(n) } else { None }
11050    }
11051
11052    /// The payload if this is a [`MemberExpression`], `None` otherwise.
11053    pub fn as_member_expression(&self) -> Option<&MemberExpression<'gc>> {
11054        if let Node::MemberExpression(n) = self { Some(n) } else { None }
11055    }
11056
11057    /// The payload if this is a [`OptionalMemberExpression`], `None` otherwise.
11058    pub fn as_optional_member_expression(&self) -> Option<&OptionalMemberExpression<'gc>> {
11059        if let Node::OptionalMemberExpression(n) = self { Some(n) } else { None }
11060    }
11061
11062    /// The payload if this is a [`LogicalExpression`], `None` otherwise.
11063    pub fn as_logical_expression(&self) -> Option<&LogicalExpression<'gc>> {
11064        if let Node::LogicalExpression(n) = self { Some(n) } else { None }
11065    }
11066
11067    /// The payload if this is a [`ConditionalExpression`], `None` otherwise.
11068    pub fn as_conditional_expression(&self) -> Option<&ConditionalExpression<'gc>> {
11069        if let Node::ConditionalExpression(n) = self { Some(n) } else { None }
11070    }
11071
11072    /// The payload if this is a [`BinaryExpression`], `None` otherwise.
11073    pub fn as_binary_expression(&self) -> Option<&BinaryExpression<'gc>> {
11074        if let Node::BinaryExpression(n) = self { Some(n) } else { None }
11075    }
11076
11077    /// The payload if this is a [`Directive`], `None` otherwise.
11078    pub fn as_directive(&self) -> Option<&Directive<'gc>> {
11079        if let Node::Directive(n) = self { Some(n) } else { None }
11080    }
11081
11082    /// The payload if this is a [`DirectiveLiteral`], `None` otherwise.
11083    pub fn as_directive_literal(&self) -> Option<&DirectiveLiteral<'gc>> {
11084        if let Node::DirectiveLiteral(n) = self { Some(n) } else { None }
11085    }
11086
11087    /// The payload if this is a [`Identifier`], `None` otherwise.
11088    pub fn as_identifier(&self) -> Option<&Identifier<'gc>> {
11089        if let Node::Identifier(n) = self { Some(n) } else { None }
11090    }
11091
11092    /// The payload if this is a [`PrivateName`], `None` otherwise.
11093    pub fn as_private_name(&self) -> Option<&PrivateName<'gc>> {
11094        if let Node::PrivateName(n) = self { Some(n) } else { None }
11095    }
11096
11097    /// The payload if this is a [`MetaProperty`], `None` otherwise.
11098    pub fn as_meta_property(&self) -> Option<&MetaProperty<'gc>> {
11099        if let Node::MetaProperty(n) = self { Some(n) } else { None }
11100    }
11101
11102    /// The payload if this is a [`SwitchCase`], `None` otherwise.
11103    pub fn as_switch_case(&self) -> Option<&SwitchCase<'gc>> {
11104        if let Node::SwitchCase(n) = self { Some(n) } else { None }
11105    }
11106
11107    /// The payload if this is a [`CatchClause`], `None` otherwise.
11108    pub fn as_catch_clause(&self) -> Option<&CatchClause<'gc>> {
11109        if let Node::CatchClause(n) = self { Some(n) } else { None }
11110    }
11111
11112    /// The payload if this is a [`VariableDeclarator`], `None` otherwise.
11113    pub fn as_variable_declarator(&self) -> Option<&VariableDeclarator<'gc>> {
11114        if let Node::VariableDeclarator(n) = self { Some(n) } else { None }
11115    }
11116
11117    /// The payload if this is a [`VariableDeclaration`], `None` otherwise.
11118    pub fn as_variable_declaration(&self) -> Option<&VariableDeclaration<'gc>> {
11119        if let Node::VariableDeclaration(n) = self { Some(n) } else { None }
11120    }
11121
11122    /// The payload if this is a [`TemplateLiteral`], `None` otherwise.
11123    pub fn as_template_literal(&self) -> Option<&TemplateLiteral<'gc>> {
11124        if let Node::TemplateLiteral(n) = self { Some(n) } else { None }
11125    }
11126
11127    /// The payload if this is a [`TaggedTemplateExpression`], `None` otherwise.
11128    pub fn as_tagged_template_expression(&self) -> Option<&TaggedTemplateExpression<'gc>> {
11129        if let Node::TaggedTemplateExpression(n) = self { Some(n) } else { None }
11130    }
11131
11132    /// The payload if this is a [`TemplateElement`], `None` otherwise.
11133    pub fn as_template_element(&self) -> Option<&TemplateElement<'gc>> {
11134        if let Node::TemplateElement(n) = self { Some(n) } else { None }
11135    }
11136
11137    /// The payload if this is a [`Property`], `None` otherwise.
11138    pub fn as_property(&self) -> Option<&Property<'gc>> {
11139        if let Node::Property(n) = self { Some(n) } else { None }
11140    }
11141
11142    /// The payload if this is a [`Decorator`], `None` otherwise.
11143    pub fn as_decorator(&self) -> Option<&Decorator<'gc>> {
11144        if let Node::Decorator(n) = self { Some(n) } else { None }
11145    }
11146
11147    /// The payload if this is a [`ClassDeclaration`], `None` otherwise.
11148    pub fn as_class_declaration(&self) -> Option<&ClassDeclaration<'gc>> {
11149        if let Node::ClassDeclaration(n) = self { Some(n) } else { None }
11150    }
11151
11152    /// The payload if this is a [`ClassExpression`], `None` otherwise.
11153    pub fn as_class_expression(&self) -> Option<&ClassExpression<'gc>> {
11154        if let Node::ClassExpression(n) = self { Some(n) } else { None }
11155    }
11156
11157    /// The payload if this is a [`ClassBody`], `None` otherwise.
11158    pub fn as_class_body(&self) -> Option<&ClassBody<'gc>> {
11159        if let Node::ClassBody(n) = self { Some(n) } else { None }
11160    }
11161
11162    /// The payload if this is a [`ClassProperty`], `None` otherwise.
11163    pub fn as_class_property(&self) -> Option<&ClassProperty<'gc>> {
11164        if let Node::ClassProperty(n) = self { Some(n) } else { None }
11165    }
11166
11167    /// The payload if this is a [`ClassPrivateProperty`], `None` otherwise.
11168    pub fn as_class_private_property(&self) -> Option<&ClassPrivateProperty<'gc>> {
11169        if let Node::ClassPrivateProperty(n) = self { Some(n) } else { None }
11170    }
11171
11172    /// The payload if this is a [`MethodDefinition`], `None` otherwise.
11173    pub fn as_method_definition(&self) -> Option<&MethodDefinition<'gc>> {
11174        if let Node::MethodDefinition(n) = self { Some(n) } else { None }
11175    }
11176
11177    /// The payload if this is a [`ImportDeclaration`], `None` otherwise.
11178    pub fn as_import_declaration(&self) -> Option<&ImportDeclaration<'gc>> {
11179        if let Node::ImportDeclaration(n) = self { Some(n) } else { None }
11180    }
11181
11182    /// The payload if this is a [`ImportSpecifier`], `None` otherwise.
11183    pub fn as_import_specifier(&self) -> Option<&ImportSpecifier<'gc>> {
11184        if let Node::ImportSpecifier(n) = self { Some(n) } else { None }
11185    }
11186
11187    /// The payload if this is a [`ImportDefaultSpecifier`], `None` otherwise.
11188    pub fn as_import_default_specifier(&self) -> Option<&ImportDefaultSpecifier<'gc>> {
11189        if let Node::ImportDefaultSpecifier(n) = self { Some(n) } else { None }
11190    }
11191
11192    /// The payload if this is a [`ImportNamespaceSpecifier`], `None` otherwise.
11193    pub fn as_import_namespace_specifier(&self) -> Option<&ImportNamespaceSpecifier<'gc>> {
11194        if let Node::ImportNamespaceSpecifier(n) = self { Some(n) } else { None }
11195    }
11196
11197    /// The payload if this is a [`ImportAttribute`], `None` otherwise.
11198    pub fn as_import_attribute(&self) -> Option<&ImportAttribute<'gc>> {
11199        if let Node::ImportAttribute(n) = self { Some(n) } else { None }
11200    }
11201
11202    /// The payload if this is a [`ExportNamedDeclaration`], `None` otherwise.
11203    pub fn as_export_named_declaration(&self) -> Option<&ExportNamedDeclaration<'gc>> {
11204        if let Node::ExportNamedDeclaration(n) = self { Some(n) } else { None }
11205    }
11206
11207    /// The payload if this is a [`ExportSpecifier`], `None` otherwise.
11208    pub fn as_export_specifier(&self) -> Option<&ExportSpecifier<'gc>> {
11209        if let Node::ExportSpecifier(n) = self { Some(n) } else { None }
11210    }
11211
11212    /// The payload if this is a [`ExportNamespaceSpecifier`], `None` otherwise.
11213    pub fn as_export_namespace_specifier(&self) -> Option<&ExportNamespaceSpecifier<'gc>> {
11214        if let Node::ExportNamespaceSpecifier(n) = self { Some(n) } else { None }
11215    }
11216
11217    /// The payload if this is a [`ExportDefaultDeclaration`], `None` otherwise.
11218    pub fn as_export_default_declaration(&self) -> Option<&ExportDefaultDeclaration<'gc>> {
11219        if let Node::ExportDefaultDeclaration(n) = self { Some(n) } else { None }
11220    }
11221
11222    /// The payload if this is a [`ExportAllDeclaration`], `None` otherwise.
11223    pub fn as_export_all_declaration(&self) -> Option<&ExportAllDeclaration<'gc>> {
11224        if let Node::ExportAllDeclaration(n) = self { Some(n) } else { None }
11225    }
11226
11227    /// The payload if this is a [`ObjectPattern`], `None` otherwise.
11228    pub fn as_object_pattern(&self) -> Option<&ObjectPattern<'gc>> {
11229        if let Node::ObjectPattern(n) = self { Some(n) } else { None }
11230    }
11231
11232    /// The payload if this is a [`ArrayPattern`], `None` otherwise.
11233    pub fn as_array_pattern(&self) -> Option<&ArrayPattern<'gc>> {
11234        if let Node::ArrayPattern(n) = self { Some(n) } else { None }
11235    }
11236
11237    /// The payload if this is a [`RestElement`], `None` otherwise.
11238    pub fn as_rest_element(&self) -> Option<&RestElement<'gc>> {
11239        if let Node::RestElement(n) = self { Some(n) } else { None }
11240    }
11241
11242    /// The payload if this is a [`AssignmentPattern`], `None` otherwise.
11243    pub fn as_assignment_pattern(&self) -> Option<&AssignmentPattern<'gc>> {
11244        if let Node::AssignmentPattern(n) = self { Some(n) } else { None }
11245    }
11246
11247    /// The payload if this is a [`MatchStatementCase`], `None` otherwise.
11248    pub fn as_match_statement_case(&self) -> Option<&MatchStatementCase<'gc>> {
11249        if let Node::MatchStatementCase(n) = self { Some(n) } else { None }
11250    }
11251
11252    /// The payload if this is a [`MatchExpression`], `None` otherwise.
11253    pub fn as_match_expression(&self) -> Option<&MatchExpression<'gc>> {
11254        if let Node::MatchExpression(n) = self { Some(n) } else { None }
11255    }
11256
11257    /// The payload if this is a [`MatchExpressionCase`], `None` otherwise.
11258    pub fn as_match_expression_case(&self) -> Option<&MatchExpressionCase<'gc>> {
11259        if let Node::MatchExpressionCase(n) = self { Some(n) } else { None }
11260    }
11261
11262    /// The payload if this is a [`MatchWildcardPattern`], `None` otherwise.
11263    pub fn as_match_wildcard_pattern(&self) -> Option<&MatchWildcardPattern<'gc>> {
11264        if let Node::MatchWildcardPattern(n) = self { Some(n) } else { None }
11265    }
11266
11267    /// The payload if this is a [`MatchLiteralPattern`], `None` otherwise.
11268    pub fn as_match_literal_pattern(&self) -> Option<&MatchLiteralPattern<'gc>> {
11269        if let Node::MatchLiteralPattern(n) = self { Some(n) } else { None }
11270    }
11271
11272    /// The payload if this is a [`MatchUnaryPattern`], `None` otherwise.
11273    pub fn as_match_unary_pattern(&self) -> Option<&MatchUnaryPattern<'gc>> {
11274        if let Node::MatchUnaryPattern(n) = self { Some(n) } else { None }
11275    }
11276
11277    /// The payload if this is a [`MatchIdentifierPattern`], `None` otherwise.
11278    pub fn as_match_identifier_pattern(&self) -> Option<&MatchIdentifierPattern<'gc>> {
11279        if let Node::MatchIdentifierPattern(n) = self { Some(n) } else { None }
11280    }
11281
11282    /// The payload if this is a [`MatchBindingPattern`], `None` otherwise.
11283    pub fn as_match_binding_pattern(&self) -> Option<&MatchBindingPattern<'gc>> {
11284        if let Node::MatchBindingPattern(n) = self { Some(n) } else { None }
11285    }
11286
11287    /// The payload if this is a [`MatchObjectPattern`], `None` otherwise.
11288    pub fn as_match_object_pattern(&self) -> Option<&MatchObjectPattern<'gc>> {
11289        if let Node::MatchObjectPattern(n) = self { Some(n) } else { None }
11290    }
11291
11292    /// The payload if this is a [`MatchArrayPattern`], `None` otherwise.
11293    pub fn as_match_array_pattern(&self) -> Option<&MatchArrayPattern<'gc>> {
11294        if let Node::MatchArrayPattern(n) = self { Some(n) } else { None }
11295    }
11296
11297    /// The payload if this is a [`MatchOrPattern`], `None` otherwise.
11298    pub fn as_match_or_pattern(&self) -> Option<&MatchOrPattern<'gc>> {
11299        if let Node::MatchOrPattern(n) = self { Some(n) } else { None }
11300    }
11301
11302    /// The payload if this is a [`MatchAsPattern`], `None` otherwise.
11303    pub fn as_match_as_pattern(&self) -> Option<&MatchAsPattern<'gc>> {
11304        if let Node::MatchAsPattern(n) = self { Some(n) } else { None }
11305    }
11306
11307    /// The payload if this is a [`MatchMemberPattern`], `None` otherwise.
11308    pub fn as_match_member_pattern(&self) -> Option<&MatchMemberPattern<'gc>> {
11309        if let Node::MatchMemberPattern(n) = self { Some(n) } else { None }
11310    }
11311
11312    /// The payload if this is a [`MatchInstancePattern`], `None` otherwise.
11313    pub fn as_match_instance_pattern(&self) -> Option<&MatchInstancePattern<'gc>> {
11314        if let Node::MatchInstancePattern(n) = self { Some(n) } else { None }
11315    }
11316
11317    /// The payload if this is a [`MatchObjectPatternProperty`], `None`
11318    /// otherwise.
11319    pub fn as_match_object_pattern_property(&self) -> Option<&MatchObjectPatternProperty<'gc>> {
11320        if let Node::MatchObjectPatternProperty(n) = self { Some(n) } else { None }
11321    }
11322
11323    /// The payload if this is a [`MatchInstanceObjectPattern`], `None`
11324    /// otherwise.
11325    pub fn as_match_instance_object_pattern(&self) -> Option<&MatchInstanceObjectPattern<'gc>> {
11326        if let Node::MatchInstanceObjectPattern(n) = self { Some(n) } else { None }
11327    }
11328
11329    /// The payload if this is a [`MatchRestPattern`], `None` otherwise.
11330    pub fn as_match_rest_pattern(&self) -> Option<&MatchRestPattern<'gc>> {
11331        if let Node::MatchRestPattern(n) = self { Some(n) } else { None }
11332    }
11333
11334    /// The payload if this is a [`JSXIdentifier`], `None` otherwise.
11335    pub fn as_jsx_identifier(&self) -> Option<&JSXIdentifier<'gc>> {
11336        if let Node::JSXIdentifier(n) = self { Some(n) } else { None }
11337    }
11338
11339    /// The payload if this is a [`JSXMemberExpression`], `None` otherwise.
11340    pub fn as_jsx_member_expression(&self) -> Option<&JSXMemberExpression<'gc>> {
11341        if let Node::JSXMemberExpression(n) = self { Some(n) } else { None }
11342    }
11343
11344    /// The payload if this is a [`JSXNamespacedName`], `None` otherwise.
11345    pub fn as_jsx_namespaced_name(&self) -> Option<&JSXNamespacedName<'gc>> {
11346        if let Node::JSXNamespacedName(n) = self { Some(n) } else { None }
11347    }
11348
11349    /// The payload if this is a [`JSXEmptyExpression`], `None` otherwise.
11350    pub fn as_jsx_empty_expression(&self) -> Option<&JSXEmptyExpression<'gc>> {
11351        if let Node::JSXEmptyExpression(n) = self { Some(n) } else { None }
11352    }
11353
11354    /// The payload if this is a [`JSXExpressionContainer`], `None` otherwise.
11355    pub fn as_jsx_expression_container(&self) -> Option<&JSXExpressionContainer<'gc>> {
11356        if let Node::JSXExpressionContainer(n) = self { Some(n) } else { None }
11357    }
11358
11359    /// The payload if this is a [`JSXSpreadChild`], `None` otherwise.
11360    pub fn as_jsx_spread_child(&self) -> Option<&JSXSpreadChild<'gc>> {
11361        if let Node::JSXSpreadChild(n) = self { Some(n) } else { None }
11362    }
11363
11364    /// The payload if this is a [`JSXOpeningElement`], `None` otherwise.
11365    pub fn as_jsx_opening_element(&self) -> Option<&JSXOpeningElement<'gc>> {
11366        if let Node::JSXOpeningElement(n) = self { Some(n) } else { None }
11367    }
11368
11369    /// The payload if this is a [`JSXClosingElement`], `None` otherwise.
11370    pub fn as_jsx_closing_element(&self) -> Option<&JSXClosingElement<'gc>> {
11371        if let Node::JSXClosingElement(n) = self { Some(n) } else { None }
11372    }
11373
11374    /// The payload if this is a [`JSXAttribute`], `None` otherwise.
11375    pub fn as_jsx_attribute(&self) -> Option<&JSXAttribute<'gc>> {
11376        if let Node::JSXAttribute(n) = self { Some(n) } else { None }
11377    }
11378
11379    /// The payload if this is a [`JSXSpreadAttribute`], `None` otherwise.
11380    pub fn as_jsx_spread_attribute(&self) -> Option<&JSXSpreadAttribute<'gc>> {
11381        if let Node::JSXSpreadAttribute(n) = self { Some(n) } else { None }
11382    }
11383
11384    /// The payload if this is a [`JSXStringLiteral`], `None` otherwise.
11385    pub fn as_jsx_string_literal(&self) -> Option<&JSXStringLiteral<'gc>> {
11386        if let Node::JSXStringLiteral(n) = self { Some(n) } else { None }
11387    }
11388
11389    /// The payload if this is a [`JSXText`], `None` otherwise.
11390    pub fn as_jsx_text(&self) -> Option<&JSXText<'gc>> {
11391        if let Node::JSXText(n) = self { Some(n) } else { None }
11392    }
11393
11394    /// The payload if this is a [`JSXElement`], `None` otherwise.
11395    pub fn as_jsx_element(&self) -> Option<&JSXElement<'gc>> {
11396        if let Node::JSXElement(n) = self { Some(n) } else { None }
11397    }
11398
11399    /// The payload if this is a [`JSXFragment`], `None` otherwise.
11400    pub fn as_jsx_fragment(&self) -> Option<&JSXFragment<'gc>> {
11401        if let Node::JSXFragment(n) = self { Some(n) } else { None }
11402    }
11403
11404    /// The payload if this is a [`JSXOpeningFragment`], `None` otherwise.
11405    pub fn as_jsx_opening_fragment(&self) -> Option<&JSXOpeningFragment<'gc>> {
11406        if let Node::JSXOpeningFragment(n) = self { Some(n) } else { None }
11407    }
11408
11409    /// The payload if this is a [`JSXClosingFragment`], `None` otherwise.
11410    pub fn as_jsx_closing_fragment(&self) -> Option<&JSXClosingFragment<'gc>> {
11411        if let Node::JSXClosingFragment(n) = self { Some(n) } else { None }
11412    }
11413
11414    /// The payload if this is a [`ExistsTypeAnnotation`], `None` otherwise.
11415    pub fn as_exists_type_annotation(&self) -> Option<&ExistsTypeAnnotation<'gc>> {
11416        if let Node::ExistsTypeAnnotation(n) = self { Some(n) } else { None }
11417    }
11418
11419    /// The payload if this is a [`EmptyTypeAnnotation`], `None` otherwise.
11420    pub fn as_empty_type_annotation(&self) -> Option<&EmptyTypeAnnotation<'gc>> {
11421        if let Node::EmptyTypeAnnotation(n) = self { Some(n) } else { None }
11422    }
11423
11424    /// The payload if this is a [`StringTypeAnnotation`], `None` otherwise.
11425    pub fn as_string_type_annotation(&self) -> Option<&StringTypeAnnotation<'gc>> {
11426        if let Node::StringTypeAnnotation(n) = self { Some(n) } else { None }
11427    }
11428
11429    /// The payload if this is a [`NumberTypeAnnotation`], `None` otherwise.
11430    pub fn as_number_type_annotation(&self) -> Option<&NumberTypeAnnotation<'gc>> {
11431        if let Node::NumberTypeAnnotation(n) = self { Some(n) } else { None }
11432    }
11433
11434    /// The payload if this is a [`StringLiteralTypeAnnotation`], `None`
11435    /// otherwise.
11436    pub fn as_string_literal_type_annotation(&self) -> Option<&StringLiteralTypeAnnotation<'gc>> {
11437        if let Node::StringLiteralTypeAnnotation(n) = self { Some(n) } else { None }
11438    }
11439
11440    /// The payload if this is a [`NumberLiteralTypeAnnotation`], `None`
11441    /// otherwise.
11442    pub fn as_number_literal_type_annotation(&self) -> Option<&NumberLiteralTypeAnnotation<'gc>> {
11443        if let Node::NumberLiteralTypeAnnotation(n) = self { Some(n) } else { None }
11444    }
11445
11446    /// The payload if this is a [`BigIntLiteralTypeAnnotation`], `None`
11447    /// otherwise.
11448    pub fn as_big_int_literal_type_annotation(&self) -> Option<&BigIntLiteralTypeAnnotation<'gc>> {
11449        if let Node::BigIntLiteralTypeAnnotation(n) = self { Some(n) } else { None }
11450    }
11451
11452    /// The payload if this is a [`BooleanTypeAnnotation`], `None` otherwise.
11453    pub fn as_boolean_type_annotation(&self) -> Option<&BooleanTypeAnnotation<'gc>> {
11454        if let Node::BooleanTypeAnnotation(n) = self { Some(n) } else { None }
11455    }
11456
11457    /// The payload if this is a [`BooleanLiteralTypeAnnotation`], `None`
11458    /// otherwise.
11459    pub fn as_boolean_literal_type_annotation(&self) -> Option<&BooleanLiteralTypeAnnotation<'gc>> {
11460        if let Node::BooleanLiteralTypeAnnotation(n) = self { Some(n) } else { None }
11461    }
11462
11463    /// The payload if this is a [`NullLiteralTypeAnnotation`], `None`
11464    /// otherwise.
11465    pub fn as_null_literal_type_annotation(&self) -> Option<&NullLiteralTypeAnnotation<'gc>> {
11466        if let Node::NullLiteralTypeAnnotation(n) = self { Some(n) } else { None }
11467    }
11468
11469    /// The payload if this is a [`SymbolTypeAnnotation`], `None` otherwise.
11470    pub fn as_symbol_type_annotation(&self) -> Option<&SymbolTypeAnnotation<'gc>> {
11471        if let Node::SymbolTypeAnnotation(n) = self { Some(n) } else { None }
11472    }
11473
11474    /// The payload if this is a [`AnyTypeAnnotation`], `None` otherwise.
11475    pub fn as_any_type_annotation(&self) -> Option<&AnyTypeAnnotation<'gc>> {
11476        if let Node::AnyTypeAnnotation(n) = self { Some(n) } else { None }
11477    }
11478
11479    /// The payload if this is a [`MixedTypeAnnotation`], `None` otherwise.
11480    pub fn as_mixed_type_annotation(&self) -> Option<&MixedTypeAnnotation<'gc>> {
11481        if let Node::MixedTypeAnnotation(n) = self { Some(n) } else { None }
11482    }
11483
11484    /// The payload if this is a [`BigIntTypeAnnotation`], `None` otherwise.
11485    pub fn as_big_int_type_annotation(&self) -> Option<&BigIntTypeAnnotation<'gc>> {
11486        if let Node::BigIntTypeAnnotation(n) = self { Some(n) } else { None }
11487    }
11488
11489    /// The payload if this is a [`VoidTypeAnnotation`], `None` otherwise.
11490    pub fn as_void_type_annotation(&self) -> Option<&VoidTypeAnnotation<'gc>> {
11491        if let Node::VoidTypeAnnotation(n) = self { Some(n) } else { None }
11492    }
11493
11494    /// The payload if this is a [`NeverTypeAnnotation`], `None` otherwise.
11495    pub fn as_never_type_annotation(&self) -> Option<&NeverTypeAnnotation<'gc>> {
11496        if let Node::NeverTypeAnnotation(n) = self { Some(n) } else { None }
11497    }
11498
11499    /// The payload if this is a [`UnknownTypeAnnotation`], `None` otherwise.
11500    pub fn as_unknown_type_annotation(&self) -> Option<&UnknownTypeAnnotation<'gc>> {
11501        if let Node::UnknownTypeAnnotation(n) = self { Some(n) } else { None }
11502    }
11503
11504    /// The payload if this is a [`UndefinedTypeAnnotation`], `None` otherwise.
11505    pub fn as_undefined_type_annotation(&self) -> Option<&UndefinedTypeAnnotation<'gc>> {
11506        if let Node::UndefinedTypeAnnotation(n) = self { Some(n) } else { None }
11507    }
11508
11509    /// The payload if this is a [`FunctionTypeAnnotation`], `None` otherwise.
11510    pub fn as_function_type_annotation(&self) -> Option<&FunctionTypeAnnotation<'gc>> {
11511        if let Node::FunctionTypeAnnotation(n) = self { Some(n) } else { None }
11512    }
11513
11514    /// The payload if this is a [`HookTypeAnnotation`], `None` otherwise.
11515    pub fn as_hook_type_annotation(&self) -> Option<&HookTypeAnnotation<'gc>> {
11516        if let Node::HookTypeAnnotation(n) = self { Some(n) } else { None }
11517    }
11518
11519    /// The payload if this is a [`FunctionTypeParam`], `None` otherwise.
11520    pub fn as_function_type_param(&self) -> Option<&FunctionTypeParam<'gc>> {
11521        if let Node::FunctionTypeParam(n) = self { Some(n) } else { None }
11522    }
11523
11524    /// The payload if this is a [`ComponentTypeAnnotation`], `None` otherwise.
11525    pub fn as_component_type_annotation(&self) -> Option<&ComponentTypeAnnotation<'gc>> {
11526        if let Node::ComponentTypeAnnotation(n) = self { Some(n) } else { None }
11527    }
11528
11529    /// The payload if this is a [`ComponentTypeParameter`], `None` otherwise.
11530    pub fn as_component_type_parameter(&self) -> Option<&ComponentTypeParameter<'gc>> {
11531        if let Node::ComponentTypeParameter(n) = self { Some(n) } else { None }
11532    }
11533
11534    /// The payload if this is a [`NullableTypeAnnotation`], `None` otherwise.
11535    pub fn as_nullable_type_annotation(&self) -> Option<&NullableTypeAnnotation<'gc>> {
11536        if let Node::NullableTypeAnnotation(n) = self { Some(n) } else { None }
11537    }
11538
11539    /// The payload if this is a [`QualifiedTypeIdentifier`], `None` otherwise.
11540    pub fn as_qualified_type_identifier(&self) -> Option<&QualifiedTypeIdentifier<'gc>> {
11541        if let Node::QualifiedTypeIdentifier(n) = self { Some(n) } else { None }
11542    }
11543
11544    /// The payload if this is a [`TypeofTypeAnnotation`], `None` otherwise.
11545    pub fn as_typeof_type_annotation(&self) -> Option<&TypeofTypeAnnotation<'gc>> {
11546        if let Node::TypeofTypeAnnotation(n) = self { Some(n) } else { None }
11547    }
11548
11549    /// The payload if this is a [`KeyofTypeAnnotation`], `None` otherwise.
11550    pub fn as_keyof_type_annotation(&self) -> Option<&KeyofTypeAnnotation<'gc>> {
11551        if let Node::KeyofTypeAnnotation(n) = self { Some(n) } else { None }
11552    }
11553
11554    /// The payload if this is a [`TypeOperator`], `None` otherwise.
11555    pub fn as_type_operator(&self) -> Option<&TypeOperator<'gc>> {
11556        if let Node::TypeOperator(n) = self { Some(n) } else { None }
11557    }
11558
11559    /// The payload if this is a [`QualifiedTypeofIdentifier`], `None`
11560    /// otherwise.
11561    pub fn as_qualified_typeof_identifier(&self) -> Option<&QualifiedTypeofIdentifier<'gc>> {
11562        if let Node::QualifiedTypeofIdentifier(n) = self { Some(n) } else { None }
11563    }
11564
11565    /// The payload if this is a [`TupleTypeAnnotation`], `None` otherwise.
11566    pub fn as_tuple_type_annotation(&self) -> Option<&TupleTypeAnnotation<'gc>> {
11567        if let Node::TupleTypeAnnotation(n) = self { Some(n) } else { None }
11568    }
11569
11570    /// The payload if this is a [`TupleTypeSpreadElement`], `None` otherwise.
11571    pub fn as_tuple_type_spread_element(&self) -> Option<&TupleTypeSpreadElement<'gc>> {
11572        if let Node::TupleTypeSpreadElement(n) = self { Some(n) } else { None }
11573    }
11574
11575    /// The payload if this is a [`TupleTypeLabeledElement`], `None` otherwise.
11576    pub fn as_tuple_type_labeled_element(&self) -> Option<&TupleTypeLabeledElement<'gc>> {
11577        if let Node::TupleTypeLabeledElement(n) = self { Some(n) } else { None }
11578    }
11579
11580    /// The payload if this is a [`ArrayTypeAnnotation`], `None` otherwise.
11581    pub fn as_array_type_annotation(&self) -> Option<&ArrayTypeAnnotation<'gc>> {
11582        if let Node::ArrayTypeAnnotation(n) = self { Some(n) } else { None }
11583    }
11584
11585    /// The payload if this is a [`InferTypeAnnotation`], `None` otherwise.
11586    pub fn as_infer_type_annotation(&self) -> Option<&InferTypeAnnotation<'gc>> {
11587        if let Node::InferTypeAnnotation(n) = self { Some(n) } else { None }
11588    }
11589
11590    /// The payload if this is a [`UnionTypeAnnotation`], `None` otherwise.
11591    pub fn as_union_type_annotation(&self) -> Option<&UnionTypeAnnotation<'gc>> {
11592        if let Node::UnionTypeAnnotation(n) = self { Some(n) } else { None }
11593    }
11594
11595    /// The payload if this is a [`IntersectionTypeAnnotation`], `None`
11596    /// otherwise.
11597    pub fn as_intersection_type_annotation(&self) -> Option<&IntersectionTypeAnnotation<'gc>> {
11598        if let Node::IntersectionTypeAnnotation(n) = self { Some(n) } else { None }
11599    }
11600
11601    /// The payload if this is a [`GenericTypeAnnotation`], `None` otherwise.
11602    pub fn as_generic_type_annotation(&self) -> Option<&GenericTypeAnnotation<'gc>> {
11603        if let Node::GenericTypeAnnotation(n) = self { Some(n) } else { None }
11604    }
11605
11606    /// The payload if this is a [`IndexedAccessType`], `None` otherwise.
11607    pub fn as_indexed_access_type(&self) -> Option<&IndexedAccessType<'gc>> {
11608        if let Node::IndexedAccessType(n) = self { Some(n) } else { None }
11609    }
11610
11611    /// The payload if this is a [`OptionalIndexedAccessType`], `None`
11612    /// otherwise.
11613    pub fn as_optional_indexed_access_type(&self) -> Option<&OptionalIndexedAccessType<'gc>> {
11614        if let Node::OptionalIndexedAccessType(n) = self { Some(n) } else { None }
11615    }
11616
11617    /// The payload if this is a [`ConditionalTypeAnnotation`], `None`
11618    /// otherwise.
11619    pub fn as_conditional_type_annotation(&self) -> Option<&ConditionalTypeAnnotation<'gc>> {
11620        if let Node::ConditionalTypeAnnotation(n) = self { Some(n) } else { None }
11621    }
11622
11623    /// The payload if this is a [`TypePredicate`], `None` otherwise.
11624    pub fn as_type_predicate(&self) -> Option<&TypePredicate<'gc>> {
11625        if let Node::TypePredicate(n) = self { Some(n) } else { None }
11626    }
11627
11628    /// The payload if this is a [`InterfaceTypeAnnotation`], `None` otherwise.
11629    pub fn as_interface_type_annotation(&self) -> Option<&InterfaceTypeAnnotation<'gc>> {
11630        if let Node::InterfaceTypeAnnotation(n) = self { Some(n) } else { None }
11631    }
11632
11633    /// The payload if this is a [`TypeAlias`], `None` otherwise.
11634    pub fn as_type_alias(&self) -> Option<&TypeAlias<'gc>> {
11635        if let Node::TypeAlias(n) = self { Some(n) } else { None }
11636    }
11637
11638    /// The payload if this is a [`OpaqueType`], `None` otherwise.
11639    pub fn as_opaque_type(&self) -> Option<&OpaqueType<'gc>> {
11640        if let Node::OpaqueType(n) = self { Some(n) } else { None }
11641    }
11642
11643    /// The payload if this is a [`InterfaceDeclaration`], `None` otherwise.
11644    pub fn as_interface_declaration(&self) -> Option<&InterfaceDeclaration<'gc>> {
11645        if let Node::InterfaceDeclaration(n) = self { Some(n) } else { None }
11646    }
11647
11648    /// The payload if this is a [`DeclareTypeAlias`], `None` otherwise.
11649    pub fn as_declare_type_alias(&self) -> Option<&DeclareTypeAlias<'gc>> {
11650        if let Node::DeclareTypeAlias(n) = self { Some(n) } else { None }
11651    }
11652
11653    /// The payload if this is a [`DeclareOpaqueType`], `None` otherwise.
11654    pub fn as_declare_opaque_type(&self) -> Option<&DeclareOpaqueType<'gc>> {
11655        if let Node::DeclareOpaqueType(n) = self { Some(n) } else { None }
11656    }
11657
11658    /// The payload if this is a [`DeclareInterface`], `None` otherwise.
11659    pub fn as_declare_interface(&self) -> Option<&DeclareInterface<'gc>> {
11660        if let Node::DeclareInterface(n) = self { Some(n) } else { None }
11661    }
11662
11663    /// The payload if this is a [`DeclareClass`], `None` otherwise.
11664    pub fn as_declare_class(&self) -> Option<&DeclareClass<'gc>> {
11665        if let Node::DeclareClass(n) = self { Some(n) } else { None }
11666    }
11667
11668    /// The payload if this is a [`DeclareFunction`], `None` otherwise.
11669    pub fn as_declare_function(&self) -> Option<&DeclareFunction<'gc>> {
11670        if let Node::DeclareFunction(n) = self { Some(n) } else { None }
11671    }
11672
11673    /// The payload if this is a [`DeclareHook`], `None` otherwise.
11674    pub fn as_declare_hook(&self) -> Option<&DeclareHook<'gc>> {
11675        if let Node::DeclareHook(n) = self { Some(n) } else { None }
11676    }
11677
11678    /// The payload if this is a [`DeclareComponent`], `None` otherwise.
11679    pub fn as_declare_component(&self) -> Option<&DeclareComponent<'gc>> {
11680        if let Node::DeclareComponent(n) = self { Some(n) } else { None }
11681    }
11682
11683    /// The payload if this is a [`DeclareVariable`], `None` otherwise.
11684    pub fn as_declare_variable(&self) -> Option<&DeclareVariable<'gc>> {
11685        if let Node::DeclareVariable(n) = self { Some(n) } else { None }
11686    }
11687
11688    /// The payload if this is a [`DeclareEnum`], `None` otherwise.
11689    pub fn as_declare_enum(&self) -> Option<&DeclareEnum<'gc>> {
11690        if let Node::DeclareEnum(n) = self { Some(n) } else { None }
11691    }
11692
11693    /// The payload if this is a [`DeclareExportDeclaration`], `None` otherwise.
11694    pub fn as_declare_export_declaration(&self) -> Option<&DeclareExportDeclaration<'gc>> {
11695        if let Node::DeclareExportDeclaration(n) = self { Some(n) } else { None }
11696    }
11697
11698    /// The payload if this is a [`DeclareExportAllDeclaration`], `None`
11699    /// otherwise.
11700    pub fn as_declare_export_all_declaration(&self) -> Option<&DeclareExportAllDeclaration<'gc>> {
11701        if let Node::DeclareExportAllDeclaration(n) = self { Some(n) } else { None }
11702    }
11703
11704    /// The payload if this is a [`DeclareModule`], `None` otherwise.
11705    pub fn as_declare_module(&self) -> Option<&DeclareModule<'gc>> {
11706        if let Node::DeclareModule(n) = self { Some(n) } else { None }
11707    }
11708
11709    /// The payload if this is a [`DeclareNamespace`], `None` otherwise.
11710    pub fn as_declare_namespace(&self) -> Option<&DeclareNamespace<'gc>> {
11711        if let Node::DeclareNamespace(n) = self { Some(n) } else { None }
11712    }
11713
11714    /// The payload if this is a [`DeclareModuleExports`], `None` otherwise.
11715    pub fn as_declare_module_exports(&self) -> Option<&DeclareModuleExports<'gc>> {
11716        if let Node::DeclareModuleExports(n) = self { Some(n) } else { None }
11717    }
11718
11719    /// The payload if this is a [`InterfaceExtends`], `None` otherwise.
11720    pub fn as_interface_extends(&self) -> Option<&InterfaceExtends<'gc>> {
11721        if let Node::InterfaceExtends(n) = self { Some(n) } else { None }
11722    }
11723
11724    /// The payload if this is a [`ClassImplements`], `None` otherwise.
11725    pub fn as_class_implements(&self) -> Option<&ClassImplements<'gc>> {
11726        if let Node::ClassImplements(n) = self { Some(n) } else { None }
11727    }
11728
11729    /// The payload if this is a [`TypeAnnotation`], `None` otherwise.
11730    pub fn as_type_annotation(&self) -> Option<&TypeAnnotation<'gc>> {
11731        if let Node::TypeAnnotation(n) = self { Some(n) } else { None }
11732    }
11733
11734    /// The payload if this is a [`ObjectTypeAnnotation`], `None` otherwise.
11735    pub fn as_object_type_annotation(&self) -> Option<&ObjectTypeAnnotation<'gc>> {
11736        if let Node::ObjectTypeAnnotation(n) = self { Some(n) } else { None }
11737    }
11738
11739    /// The payload if this is a [`ObjectTypeProperty`], `None` otherwise.
11740    pub fn as_object_type_property(&self) -> Option<&ObjectTypeProperty<'gc>> {
11741        if let Node::ObjectTypeProperty(n) = self { Some(n) } else { None }
11742    }
11743
11744    /// The payload if this is a [`ObjectTypeSpreadProperty`], `None` otherwise.
11745    pub fn as_object_type_spread_property(&self) -> Option<&ObjectTypeSpreadProperty<'gc>> {
11746        if let Node::ObjectTypeSpreadProperty(n) = self { Some(n) } else { None }
11747    }
11748
11749    /// The payload if this is a [`ObjectTypeInternalSlot`], `None` otherwise.
11750    pub fn as_object_type_internal_slot(&self) -> Option<&ObjectTypeInternalSlot<'gc>> {
11751        if let Node::ObjectTypeInternalSlot(n) = self { Some(n) } else { None }
11752    }
11753
11754    /// The payload if this is a [`ObjectTypeCallProperty`], `None` otherwise.
11755    pub fn as_object_type_call_property(&self) -> Option<&ObjectTypeCallProperty<'gc>> {
11756        if let Node::ObjectTypeCallProperty(n) = self { Some(n) } else { None }
11757    }
11758
11759    /// The payload if this is a [`ObjectTypeIndexer`], `None` otherwise.
11760    pub fn as_object_type_indexer(&self) -> Option<&ObjectTypeIndexer<'gc>> {
11761        if let Node::ObjectTypeIndexer(n) = self { Some(n) } else { None }
11762    }
11763
11764    /// The payload if this is a [`ObjectTypeMappedTypeProperty`], `None`
11765    /// otherwise.
11766    pub fn as_object_type_mapped_type_property(&self) -> Option<&ObjectTypeMappedTypeProperty<'gc>> {
11767        if let Node::ObjectTypeMappedTypeProperty(n) = self { Some(n) } else { None }
11768    }
11769
11770    /// The payload if this is a [`Variance`], `None` otherwise.
11771    pub fn as_variance(&self) -> Option<&Variance<'gc>> {
11772        if let Node::Variance(n) = self { Some(n) } else { None }
11773    }
11774
11775    /// The payload if this is a [`TypeParameterDeclaration`], `None` otherwise.
11776    pub fn as_type_parameter_declaration(&self) -> Option<&TypeParameterDeclaration<'gc>> {
11777        if let Node::TypeParameterDeclaration(n) = self { Some(n) } else { None }
11778    }
11779
11780    /// The payload if this is a [`TypeParameter`], `None` otherwise.
11781    pub fn as_type_parameter(&self) -> Option<&TypeParameter<'gc>> {
11782        if let Node::TypeParameter(n) = self { Some(n) } else { None }
11783    }
11784
11785    /// The payload if this is a [`TypeParameterInstantiation`], `None`
11786    /// otherwise.
11787    pub fn as_type_parameter_instantiation(&self) -> Option<&TypeParameterInstantiation<'gc>> {
11788        if let Node::TypeParameterInstantiation(n) = self { Some(n) } else { None }
11789    }
11790
11791    /// The payload if this is a [`TypeCastExpression`], `None` otherwise.
11792    pub fn as_type_cast_expression(&self) -> Option<&TypeCastExpression<'gc>> {
11793        if let Node::TypeCastExpression(n) = self { Some(n) } else { None }
11794    }
11795
11796    /// The payload if this is a [`AsExpression`], `None` otherwise.
11797    pub fn as_as_expression(&self) -> Option<&AsExpression<'gc>> {
11798        if let Node::AsExpression(n) = self { Some(n) } else { None }
11799    }
11800
11801    /// The payload if this is a [`AsConstExpression`], `None` otherwise.
11802    pub fn as_as_const_expression(&self) -> Option<&AsConstExpression<'gc>> {
11803        if let Node::AsConstExpression(n) = self { Some(n) } else { None }
11804    }
11805
11806    /// The payload if this is a [`InferredPredicate`], `None` otherwise.
11807    pub fn as_inferred_predicate(&self) -> Option<&InferredPredicate<'gc>> {
11808        if let Node::InferredPredicate(n) = self { Some(n) } else { None }
11809    }
11810
11811    /// The payload if this is a [`DeclaredPredicate`], `None` otherwise.
11812    pub fn as_declared_predicate(&self) -> Option<&DeclaredPredicate<'gc>> {
11813        if let Node::DeclaredPredicate(n) = self { Some(n) } else { None }
11814    }
11815
11816    /// The payload if this is a [`EnumDeclaration`], `None` otherwise.
11817    pub fn as_enum_declaration(&self) -> Option<&EnumDeclaration<'gc>> {
11818        if let Node::EnumDeclaration(n) = self { Some(n) } else { None }
11819    }
11820
11821    /// The payload if this is a [`EnumStringBody`], `None` otherwise.
11822    pub fn as_enum_string_body(&self) -> Option<&EnumStringBody<'gc>> {
11823        if let Node::EnumStringBody(n) = self { Some(n) } else { None }
11824    }
11825
11826    /// The payload if this is a [`EnumNumberBody`], `None` otherwise.
11827    pub fn as_enum_number_body(&self) -> Option<&EnumNumberBody<'gc>> {
11828        if let Node::EnumNumberBody(n) = self { Some(n) } else { None }
11829    }
11830
11831    /// The payload if this is a [`EnumBigIntBody`], `None` otherwise.
11832    pub fn as_enum_big_int_body(&self) -> Option<&EnumBigIntBody<'gc>> {
11833        if let Node::EnumBigIntBody(n) = self { Some(n) } else { None }
11834    }
11835
11836    /// The payload if this is a [`EnumBooleanBody`], `None` otherwise.
11837    pub fn as_enum_boolean_body(&self) -> Option<&EnumBooleanBody<'gc>> {
11838        if let Node::EnumBooleanBody(n) = self { Some(n) } else { None }
11839    }
11840
11841    /// The payload if this is a [`EnumSymbolBody`], `None` otherwise.
11842    pub fn as_enum_symbol_body(&self) -> Option<&EnumSymbolBody<'gc>> {
11843        if let Node::EnumSymbolBody(n) = self { Some(n) } else { None }
11844    }
11845
11846    /// The payload if this is a [`EnumDefaultedMember`], `None` otherwise.
11847    pub fn as_enum_defaulted_member(&self) -> Option<&EnumDefaultedMember<'gc>> {
11848        if let Node::EnumDefaultedMember(n) = self { Some(n) } else { None }
11849    }
11850
11851    /// The payload if this is a [`EnumStringMember`], `None` otherwise.
11852    pub fn as_enum_string_member(&self) -> Option<&EnumStringMember<'gc>> {
11853        if let Node::EnumStringMember(n) = self { Some(n) } else { None }
11854    }
11855
11856    /// The payload if this is a [`EnumNumberMember`], `None` otherwise.
11857    pub fn as_enum_number_member(&self) -> Option<&EnumNumberMember<'gc>> {
11858        if let Node::EnumNumberMember(n) = self { Some(n) } else { None }
11859    }
11860
11861    /// The payload if this is a [`EnumBigIntMember`], `None` otherwise.
11862    pub fn as_enum_big_int_member(&self) -> Option<&EnumBigIntMember<'gc>> {
11863        if let Node::EnumBigIntMember(n) = self { Some(n) } else { None }
11864    }
11865
11866    /// The payload if this is a [`EnumBooleanMember`], `None` otherwise.
11867    pub fn as_enum_boolean_member(&self) -> Option<&EnumBooleanMember<'gc>> {
11868        if let Node::EnumBooleanMember(n) = self { Some(n) } else { None }
11869    }
11870
11871    /// The payload if this is a [`ComponentParameter`], `None` otherwise.
11872    pub fn as_component_parameter(&self) -> Option<&ComponentParameter<'gc>> {
11873        if let Node::ComponentParameter(n) = self { Some(n) } else { None }
11874    }
11875
11876    /// The payload if this is a [`RecordDeclaration`], `None` otherwise.
11877    pub fn as_record_declaration(&self) -> Option<&RecordDeclaration<'gc>> {
11878        if let Node::RecordDeclaration(n) = self { Some(n) } else { None }
11879    }
11880
11881    /// The payload if this is a [`RecordDeclarationImplements`], `None`
11882    /// otherwise.
11883    pub fn as_record_declaration_implements(&self) -> Option<&RecordDeclarationImplements<'gc>> {
11884        if let Node::RecordDeclarationImplements(n) = self { Some(n) } else { None }
11885    }
11886
11887    /// The payload if this is a [`RecordDeclarationBody`], `None` otherwise.
11888    pub fn as_record_declaration_body(&self) -> Option<&RecordDeclarationBody<'gc>> {
11889        if let Node::RecordDeclarationBody(n) = self { Some(n) } else { None }
11890    }
11891
11892    /// The payload if this is a [`RecordDeclarationProperty`], `None`
11893    /// otherwise.
11894    pub fn as_record_declaration_property(&self) -> Option<&RecordDeclarationProperty<'gc>> {
11895        if let Node::RecordDeclarationProperty(n) = self { Some(n) } else { None }
11896    }
11897
11898    /// The payload if this is a [`RecordDeclarationStaticProperty`], `None`
11899    /// otherwise.
11900    pub fn as_record_declaration_static_property(&self) -> Option<&RecordDeclarationStaticProperty<'gc>> {
11901        if let Node::RecordDeclarationStaticProperty(n) = self { Some(n) } else { None }
11902    }
11903
11904    /// The payload if this is a [`RecordExpression`], `None` otherwise.
11905    pub fn as_record_expression(&self) -> Option<&RecordExpression<'gc>> {
11906        if let Node::RecordExpression(n) = self { Some(n) } else { None }
11907    }
11908
11909    /// The payload if this is a [`RecordExpressionProperties`], `None`
11910    /// otherwise.
11911    pub fn as_record_expression_properties(&self) -> Option<&RecordExpressionProperties<'gc>> {
11912        if let Node::RecordExpressionProperties(n) = self { Some(n) } else { None }
11913    }
11914
11915    /// The payload if this is a [`TSTypeAnnotation`], `None` otherwise.
11916    pub fn as_ts_type_annotation(&self) -> Option<&TSTypeAnnotation<'gc>> {
11917        if let Node::TSTypeAnnotation(n) = self { Some(n) } else { None }
11918    }
11919
11920    /// The payload if this is a [`TSAnyKeyword`], `None` otherwise.
11921    pub fn as_ts_any_keyword(&self) -> Option<&TSAnyKeyword<'gc>> {
11922        if let Node::TSAnyKeyword(n) = self { Some(n) } else { None }
11923    }
11924
11925    /// The payload if this is a [`TSNumberKeyword`], `None` otherwise.
11926    pub fn as_ts_number_keyword(&self) -> Option<&TSNumberKeyword<'gc>> {
11927        if let Node::TSNumberKeyword(n) = self { Some(n) } else { None }
11928    }
11929
11930    /// The payload if this is a [`TSBooleanKeyword`], `None` otherwise.
11931    pub fn as_ts_boolean_keyword(&self) -> Option<&TSBooleanKeyword<'gc>> {
11932        if let Node::TSBooleanKeyword(n) = self { Some(n) } else { None }
11933    }
11934
11935    /// The payload if this is a [`TSStringKeyword`], `None` otherwise.
11936    pub fn as_ts_string_keyword(&self) -> Option<&TSStringKeyword<'gc>> {
11937        if let Node::TSStringKeyword(n) = self { Some(n) } else { None }
11938    }
11939
11940    /// The payload if this is a [`TSSymbolKeyword`], `None` otherwise.
11941    pub fn as_ts_symbol_keyword(&self) -> Option<&TSSymbolKeyword<'gc>> {
11942        if let Node::TSSymbolKeyword(n) = self { Some(n) } else { None }
11943    }
11944
11945    /// The payload if this is a [`TSVoidKeyword`], `None` otherwise.
11946    pub fn as_ts_void_keyword(&self) -> Option<&TSVoidKeyword<'gc>> {
11947        if let Node::TSVoidKeyword(n) = self { Some(n) } else { None }
11948    }
11949
11950    /// The payload if this is a [`TSUndefinedKeyword`], `None` otherwise.
11951    pub fn as_ts_undefined_keyword(&self) -> Option<&TSUndefinedKeyword<'gc>> {
11952        if let Node::TSUndefinedKeyword(n) = self { Some(n) } else { None }
11953    }
11954
11955    /// The payload if this is a [`TSUnknownKeyword`], `None` otherwise.
11956    pub fn as_ts_unknown_keyword(&self) -> Option<&TSUnknownKeyword<'gc>> {
11957        if let Node::TSUnknownKeyword(n) = self { Some(n) } else { None }
11958    }
11959
11960    /// The payload if this is a [`TSNeverKeyword`], `None` otherwise.
11961    pub fn as_ts_never_keyword(&self) -> Option<&TSNeverKeyword<'gc>> {
11962        if let Node::TSNeverKeyword(n) = self { Some(n) } else { None }
11963    }
11964
11965    /// The payload if this is a [`TSBigIntKeyword`], `None` otherwise.
11966    pub fn as_ts_big_int_keyword(&self) -> Option<&TSBigIntKeyword<'gc>> {
11967        if let Node::TSBigIntKeyword(n) = self { Some(n) } else { None }
11968    }
11969
11970    /// The payload if this is a [`TSThisType`], `None` otherwise.
11971    pub fn as_ts_this_type(&self) -> Option<&TSThisType<'gc>> {
11972        if let Node::TSThisType(n) = self { Some(n) } else { None }
11973    }
11974
11975    /// The payload if this is a [`TSLiteralType`], `None` otherwise.
11976    pub fn as_ts_literal_type(&self) -> Option<&TSLiteralType<'gc>> {
11977        if let Node::TSLiteralType(n) = self { Some(n) } else { None }
11978    }
11979
11980    /// The payload if this is a [`TSIndexedAccessType`], `None` otherwise.
11981    pub fn as_ts_indexed_access_type(&self) -> Option<&TSIndexedAccessType<'gc>> {
11982        if let Node::TSIndexedAccessType(n) = self { Some(n) } else { None }
11983    }
11984
11985    /// The payload if this is a [`TSArrayType`], `None` otherwise.
11986    pub fn as_ts_array_type(&self) -> Option<&TSArrayType<'gc>> {
11987        if let Node::TSArrayType(n) = self { Some(n) } else { None }
11988    }
11989
11990    /// The payload if this is a [`TSTypeReference`], `None` otherwise.
11991    pub fn as_ts_type_reference(&self) -> Option<&TSTypeReference<'gc>> {
11992        if let Node::TSTypeReference(n) = self { Some(n) } else { None }
11993    }
11994
11995    /// The payload if this is a [`TSQualifiedName`], `None` otherwise.
11996    pub fn as_ts_qualified_name(&self) -> Option<&TSQualifiedName<'gc>> {
11997        if let Node::TSQualifiedName(n) = self { Some(n) } else { None }
11998    }
11999
12000    /// The payload if this is a [`TSFunctionType`], `None` otherwise.
12001    pub fn as_ts_function_type(&self) -> Option<&TSFunctionType<'gc>> {
12002        if let Node::TSFunctionType(n) = self { Some(n) } else { None }
12003    }
12004
12005    /// The payload if this is a [`TSConstructorType`], `None` otherwise.
12006    pub fn as_ts_constructor_type(&self) -> Option<&TSConstructorType<'gc>> {
12007        if let Node::TSConstructorType(n) = self { Some(n) } else { None }
12008    }
12009
12010    /// The payload if this is a [`TSTypePredicate`], `None` otherwise.
12011    pub fn as_ts_type_predicate(&self) -> Option<&TSTypePredicate<'gc>> {
12012        if let Node::TSTypePredicate(n) = self { Some(n) } else { None }
12013    }
12014
12015    /// The payload if this is a [`TSTupleType`], `None` otherwise.
12016    pub fn as_ts_tuple_type(&self) -> Option<&TSTupleType<'gc>> {
12017        if let Node::TSTupleType(n) = self { Some(n) } else { None }
12018    }
12019
12020    /// The payload if this is a [`TSTypeAssertion`], `None` otherwise.
12021    pub fn as_ts_type_assertion(&self) -> Option<&TSTypeAssertion<'gc>> {
12022        if let Node::TSTypeAssertion(n) = self { Some(n) } else { None }
12023    }
12024
12025    /// The payload if this is a [`TSAsExpression`], `None` otherwise.
12026    pub fn as_ts_as_expression(&self) -> Option<&TSAsExpression<'gc>> {
12027        if let Node::TSAsExpression(n) = self { Some(n) } else { None }
12028    }
12029
12030    /// The payload if this is a [`TSParameterProperty`], `None` otherwise.
12031    pub fn as_ts_parameter_property(&self) -> Option<&TSParameterProperty<'gc>> {
12032        if let Node::TSParameterProperty(n) = self { Some(n) } else { None }
12033    }
12034
12035    /// The payload if this is a [`TSTypeAliasDeclaration`], `None` otherwise.
12036    pub fn as_ts_type_alias_declaration(&self) -> Option<&TSTypeAliasDeclaration<'gc>> {
12037        if let Node::TSTypeAliasDeclaration(n) = self { Some(n) } else { None }
12038    }
12039
12040    /// The payload if this is a [`TSInterfaceDeclaration`], `None` otherwise.
12041    pub fn as_ts_interface_declaration(&self) -> Option<&TSInterfaceDeclaration<'gc>> {
12042        if let Node::TSInterfaceDeclaration(n) = self { Some(n) } else { None }
12043    }
12044
12045    /// The payload if this is a [`TSInterfaceHeritage`], `None` otherwise.
12046    pub fn as_ts_interface_heritage(&self) -> Option<&TSInterfaceHeritage<'gc>> {
12047        if let Node::TSInterfaceHeritage(n) = self { Some(n) } else { None }
12048    }
12049
12050    /// The payload if this is a [`TSInterfaceBody`], `None` otherwise.
12051    pub fn as_ts_interface_body(&self) -> Option<&TSInterfaceBody<'gc>> {
12052        if let Node::TSInterfaceBody(n) = self { Some(n) } else { None }
12053    }
12054
12055    /// The payload if this is a [`TSEnumDeclaration`], `None` otherwise.
12056    pub fn as_ts_enum_declaration(&self) -> Option<&TSEnumDeclaration<'gc>> {
12057        if let Node::TSEnumDeclaration(n) = self { Some(n) } else { None }
12058    }
12059
12060    /// The payload if this is a [`TSEnumMember`], `None` otherwise.
12061    pub fn as_ts_enum_member(&self) -> Option<&TSEnumMember<'gc>> {
12062        if let Node::TSEnumMember(n) = self { Some(n) } else { None }
12063    }
12064
12065    /// The payload if this is a [`TSModuleDeclaration`], `None` otherwise.
12066    pub fn as_ts_module_declaration(&self) -> Option<&TSModuleDeclaration<'gc>> {
12067        if let Node::TSModuleDeclaration(n) = self { Some(n) } else { None }
12068    }
12069
12070    /// The payload if this is a [`TSModuleBlock`], `None` otherwise.
12071    pub fn as_ts_module_block(&self) -> Option<&TSModuleBlock<'gc>> {
12072        if let Node::TSModuleBlock(n) = self { Some(n) } else { None }
12073    }
12074
12075    /// The payload if this is a [`TSModuleMember`], `None` otherwise.
12076    pub fn as_ts_module_member(&self) -> Option<&TSModuleMember<'gc>> {
12077        if let Node::TSModuleMember(n) = self { Some(n) } else { None }
12078    }
12079
12080    /// The payload if this is a [`TSTypeParameterDeclaration`], `None`
12081    /// otherwise.
12082    pub fn as_ts_type_parameter_declaration(&self) -> Option<&TSTypeParameterDeclaration<'gc>> {
12083        if let Node::TSTypeParameterDeclaration(n) = self { Some(n) } else { None }
12084    }
12085
12086    /// The payload if this is a [`TSTypeParameter`], `None` otherwise.
12087    pub fn as_ts_type_parameter(&self) -> Option<&TSTypeParameter<'gc>> {
12088        if let Node::TSTypeParameter(n) = self { Some(n) } else { None }
12089    }
12090
12091    /// The payload if this is a [`TSTypeParameterInstantiation`], `None`
12092    /// otherwise.
12093    pub fn as_ts_type_parameter_instantiation(&self) -> Option<&TSTypeParameterInstantiation<'gc>> {
12094        if let Node::TSTypeParameterInstantiation(n) = self { Some(n) } else { None }
12095    }
12096
12097    /// The payload if this is a [`TSUnionType`], `None` otherwise.
12098    pub fn as_ts_union_type(&self) -> Option<&TSUnionType<'gc>> {
12099        if let Node::TSUnionType(n) = self { Some(n) } else { None }
12100    }
12101
12102    /// The payload if this is a [`TSIntersectionType`], `None` otherwise.
12103    pub fn as_ts_intersection_type(&self) -> Option<&TSIntersectionType<'gc>> {
12104        if let Node::TSIntersectionType(n) = self { Some(n) } else { None }
12105    }
12106
12107    /// The payload if this is a [`TSTypeQuery`], `None` otherwise.
12108    pub fn as_ts_type_query(&self) -> Option<&TSTypeQuery<'gc>> {
12109        if let Node::TSTypeQuery(n) = self { Some(n) } else { None }
12110    }
12111
12112    /// The payload if this is a [`TSConditionalType`], `None` otherwise.
12113    pub fn as_ts_conditional_type(&self) -> Option<&TSConditionalType<'gc>> {
12114        if let Node::TSConditionalType(n) = self { Some(n) } else { None }
12115    }
12116
12117    /// The payload if this is a [`TSTypeLiteral`], `None` otherwise.
12118    pub fn as_ts_type_literal(&self) -> Option<&TSTypeLiteral<'gc>> {
12119        if let Node::TSTypeLiteral(n) = self { Some(n) } else { None }
12120    }
12121
12122    /// The payload if this is a [`TSPropertySignature`], `None` otherwise.
12123    pub fn as_ts_property_signature(&self) -> Option<&TSPropertySignature<'gc>> {
12124        if let Node::TSPropertySignature(n) = self { Some(n) } else { None }
12125    }
12126
12127    /// The payload if this is a [`TSMethodSignature`], `None` otherwise.
12128    pub fn as_ts_method_signature(&self) -> Option<&TSMethodSignature<'gc>> {
12129        if let Node::TSMethodSignature(n) = self { Some(n) } else { None }
12130    }
12131
12132    /// The payload if this is a [`TSIndexSignature`], `None` otherwise.
12133    pub fn as_ts_index_signature(&self) -> Option<&TSIndexSignature<'gc>> {
12134        if let Node::TSIndexSignature(n) = self { Some(n) } else { None }
12135    }
12136
12137    /// The payload if this is a [`TSCallSignatureDeclaration`], `None`
12138    /// otherwise.
12139    pub fn as_ts_call_signature_declaration(&self) -> Option<&TSCallSignatureDeclaration<'gc>> {
12140        if let Node::TSCallSignatureDeclaration(n) = self { Some(n) } else { None }
12141    }
12142
12143    /// The payload if this is a [`TSModifiers`], `None` otherwise.
12144    pub fn as_ts_modifiers(&self) -> Option<&TSModifiers<'gc>> {
12145        if let Node::TSModifiers(n) = self { Some(n) } else { None }
12146    }
12147
12148    /// The payload if this is a [`CoverEmptyArgs`], `None` otherwise.
12149    pub fn as_cover_empty_args(&self) -> Option<&CoverEmptyArgs<'gc>> {
12150        if let Node::CoverEmptyArgs(n) = self { Some(n) } else { None }
12151    }
12152
12153    /// The payload if this is a [`CoverTrailingComma`], `None` otherwise.
12154    pub fn as_cover_trailing_comma(&self) -> Option<&CoverTrailingComma<'gc>> {
12155        if let Node::CoverTrailingComma(n) = self { Some(n) } else { None }
12156    }
12157
12158    /// The payload if this is a [`CoverInitializer`], `None` otherwise.
12159    pub fn as_cover_initializer(&self) -> Option<&CoverInitializer<'gc>> {
12160        if let Node::CoverInitializer(n) = self { Some(n) } else { None }
12161    }
12162
12163    /// The payload if this is a [`CoverRestElement`], `None` otherwise.
12164    pub fn as_cover_rest_element(&self) -> Option<&CoverRestElement<'gc>> {
12165        if let Node::CoverRestElement(n) = self { Some(n) } else { None }
12166    }
12167
12168    /// The payload if this is a [`CoverTypedIdentifier`], `None` otherwise.
12169    pub fn as_cover_typed_identifier(&self) -> Option<&CoverTypedIdentifier<'gc>> {
12170        if let Node::CoverTypedIdentifier(n) = self { Some(n) } else { None }
12171    }
12172
12173    /// The payload if this is a [`SHBuiltin`], `None` otherwise.
12174    pub fn as_sh_builtin(&self) -> Option<&SHBuiltin<'gc>> {
12175        if let Node::SHBuiltin(n) = self { Some(n) } else { None }
12176    }
12177
12178    /// The payload if this is a [`ImplicitCheckedCast`], `None` otherwise.
12179    pub fn as_implicit_checked_cast(&self) -> Option<&ImplicitCheckedCast<'gc>> {
12180        if let Node::ImplicitCheckedCast(n) = self { Some(n) } else { None }
12181    }
12182
12183    /// Visit every child node in declared order: the `ESTree.def`
12184    /// fields plus the decoration lists the GC marker must trace.
12185    pub fn visit_children<V: Visitor<'gc> + ?Sized>(&'gc self, v: &mut V) {
12186        match self {
12187            Node::Empty(_) => {}
12188            Node::Metadata(_) => {}
12189            Node::Program(n) => {
12190                for c in n.body.iter() { v.visit_node(c); }
12191                for c in n.decorations.get().iter() { v.visit_node(c); }
12192                for c in n.dummy_param_list.get().iter() { v.visit_node(c); }
12193            }
12194            Node::FunctionExpression(n) => {
12195                if let Some(c) = n.id { v.visit_node(c); }
12196                for c in n.params.iter() { v.visit_node(c); }
12197                v.visit_node(n.body);
12198                if let Some(c) = n.type_parameters { v.visit_node(c); }
12199                if let Some(c) = n.return_type { v.visit_node(c); }
12200                if let Some(c) = n.predicate { v.visit_node(c); }
12201                for c in n.decorations.get().iter() { v.visit_node(c); }
12202            }
12203            Node::ArrowFunctionExpression(n) => {
12204                for c in n.params.iter() { v.visit_node(c); }
12205                v.visit_node(n.body);
12206                if let Some(c) = n.type_parameters { v.visit_node(c); }
12207                if let Some(c) = n.return_type { v.visit_node(c); }
12208                if let Some(c) = n.predicate { v.visit_node(c); }
12209                for c in n.decorations.get().iter() { v.visit_node(c); }
12210            }
12211            Node::FunctionDeclaration(n) => {
12212                if let Some(c) = n.id { v.visit_node(c); }
12213                for c in n.params.iter() { v.visit_node(c); }
12214                v.visit_node(n.body);
12215                if let Some(c) = n.type_parameters { v.visit_node(c); }
12216                if let Some(c) = n.return_type { v.visit_node(c); }
12217                if let Some(c) = n.predicate { v.visit_node(c); }
12218                for c in n.decorations.get().iter() { v.visit_node(c); }
12219            }
12220            Node::ComponentDeclaration(n) => {
12221                v.visit_node(n.id);
12222                for c in n.params.iter() { v.visit_node(c); }
12223                v.visit_node(n.body);
12224                if let Some(c) = n.type_parameters { v.visit_node(c); }
12225                if let Some(c) = n.renders_type { v.visit_node(c); }
12226                for c in n.decorations.get().iter() { v.visit_node(c); }
12227            }
12228            Node::HookDeclaration(n) => {
12229                v.visit_node(n.id);
12230                for c in n.params.iter() { v.visit_node(c); }
12231                v.visit_node(n.body);
12232                if let Some(c) = n.type_parameters { v.visit_node(c); }
12233                if let Some(c) = n.return_type { v.visit_node(c); }
12234                for c in n.decorations.get().iter() { v.visit_node(c); }
12235            }
12236            Node::MatchStatement(n) => {
12237                v.visit_node(n.argument);
12238                for c in n.cases.iter() { v.visit_node(c); }
12239            }
12240            Node::WhileStatement(n) => {
12241                v.visit_node(n.body);
12242                v.visit_node(n.test);
12243            }
12244            Node::DoWhileStatement(n) => {
12245                v.visit_node(n.body);
12246                v.visit_node(n.test);
12247            }
12248            Node::ForInStatement(n) => {
12249                v.visit_node(n.left);
12250                v.visit_node(n.right);
12251                v.visit_node(n.body);
12252            }
12253            Node::ForOfStatement(n) => {
12254                v.visit_node(n.left);
12255                v.visit_node(n.right);
12256                v.visit_node(n.body);
12257            }
12258            Node::ForStatement(n) => {
12259                if let Some(c) = n.init { v.visit_node(c); }
12260                if let Some(c) = n.test { v.visit_node(c); }
12261                if let Some(c) = n.update { v.visit_node(c); }
12262                v.visit_node(n.body);
12263            }
12264            Node::DebuggerStatement(_) => {}
12265            Node::EmptyStatement(_) => {}
12266            Node::BlockStatement(n) => {
12267                for c in n.body.iter() { v.visit_node(c); }
12268            }
12269            Node::StaticBlock(n) => {
12270                for c in n.body.iter() { v.visit_node(c); }
12271            }
12272            Node::BreakStatement(n) => {
12273                if let Some(c) = n.label { v.visit_node(c); }
12274            }
12275            Node::ContinueStatement(n) => {
12276                if let Some(c) = n.label { v.visit_node(c); }
12277            }
12278            Node::ThrowStatement(n) => {
12279                v.visit_node(n.argument);
12280            }
12281            Node::ReturnStatement(n) => {
12282                if let Some(c) = n.argument { v.visit_node(c); }
12283            }
12284            Node::WithStatement(n) => {
12285                v.visit_node(n.object);
12286                v.visit_node(n.body);
12287            }
12288            Node::SwitchStatement(n) => {
12289                v.visit_node(n.discriminant);
12290                for c in n.cases.iter() { v.visit_node(c); }
12291            }
12292            Node::LabeledStatement(n) => {
12293                v.visit_node(n.label);
12294                v.visit_node(n.body);
12295            }
12296            Node::ExpressionStatement(n) => {
12297                v.visit_node(n.expression);
12298            }
12299            Node::TryStatement(n) => {
12300                v.visit_node(n.block);
12301                if let Some(c) = n.handler { v.visit_node(c); }
12302                if let Some(c) = n.finalizer { v.visit_node(c); }
12303            }
12304            Node::IfStatement(n) => {
12305                v.visit_node(n.test);
12306                v.visit_node(n.consequent);
12307                if let Some(c) = n.alternate { v.visit_node(c); }
12308            }
12309            Node::NullLiteral(_) => {}
12310            Node::BooleanLiteral(_) => {}
12311            Node::StringLiteral(_) => {}
12312            Node::NumericLiteral(_) => {}
12313            Node::RegExpLiteral(_) => {}
12314            Node::BigIntLiteral(_) => {}
12315            Node::ThisExpression(_) => {}
12316            Node::Super(_) => {}
12317            Node::SequenceExpression(n) => {
12318                for c in n.expressions.iter() { v.visit_node(c); }
12319            }
12320            Node::ObjectExpression(n) => {
12321                for c in n.properties.iter() { v.visit_node(c); }
12322            }
12323            Node::ArrayExpression(n) => {
12324                for c in n.elements.iter() { v.visit_node(c); }
12325            }
12326            Node::SpreadElement(n) => {
12327                v.visit_node(n.argument);
12328            }
12329            Node::NewExpression(n) => {
12330                v.visit_node(n.callee);
12331                if let Some(c) = n.type_arguments { v.visit_node(c); }
12332                for c in n.arguments.iter() { v.visit_node(c); }
12333            }
12334            Node::YieldExpression(n) => {
12335                if let Some(c) = n.argument { v.visit_node(c); }
12336            }
12337            Node::AwaitExpression(n) => {
12338                v.visit_node(n.argument);
12339            }
12340            Node::ImportExpression(n) => {
12341                v.visit_node(n.source);
12342                if let Some(c) = n.options { v.visit_node(c); }
12343            }
12344            Node::CallExpression(n) => {
12345                v.visit_node(n.callee);
12346                if let Some(c) = n.type_arguments { v.visit_node(c); }
12347                for c in n.arguments.iter() { v.visit_node(c); }
12348            }
12349            Node::OptionalCallExpression(n) => {
12350                v.visit_node(n.callee);
12351                if let Some(c) = n.type_arguments { v.visit_node(c); }
12352                for c in n.arguments.iter() { v.visit_node(c); }
12353            }
12354            Node::AssignmentExpression(n) => {
12355                v.visit_node(n.left);
12356                v.visit_node(n.right);
12357            }
12358            Node::UnaryExpression(n) => {
12359                v.visit_node(n.argument);
12360            }
12361            Node::UpdateExpression(n) => {
12362                v.visit_node(n.argument);
12363            }
12364            Node::MemberExpression(n) => {
12365                v.visit_node(n.object);
12366                v.visit_node(n.property);
12367            }
12368            Node::OptionalMemberExpression(n) => {
12369                v.visit_node(n.object);
12370                v.visit_node(n.property);
12371            }
12372            Node::LogicalExpression(n) => {
12373                v.visit_node(n.left);
12374                v.visit_node(n.right);
12375            }
12376            Node::ConditionalExpression(n) => {
12377                v.visit_node(n.test);
12378                v.visit_node(n.alternate);
12379                v.visit_node(n.consequent);
12380            }
12381            Node::BinaryExpression(n) => {
12382                v.visit_node(n.left);
12383                v.visit_node(n.right);
12384            }
12385            Node::Directive(n) => {
12386                v.visit_node(n.value);
12387            }
12388            Node::DirectiveLiteral(_) => {}
12389            Node::Identifier(n) => {
12390                if let Some(c) = n.type_annotation { v.visit_node(c); }
12391            }
12392            Node::PrivateName(n) => {
12393                v.visit_node(n.id);
12394            }
12395            Node::MetaProperty(n) => {
12396                v.visit_node(n.meta);
12397                v.visit_node(n.property);
12398            }
12399            Node::SwitchCase(n) => {
12400                if let Some(c) = n.test { v.visit_node(c); }
12401                for c in n.consequent.iter() { v.visit_node(c); }
12402            }
12403            Node::CatchClause(n) => {
12404                if let Some(c) = n.param { v.visit_node(c); }
12405                v.visit_node(n.body);
12406            }
12407            Node::VariableDeclarator(n) => {
12408                if let Some(c) = n.init { v.visit_node(c); }
12409                v.visit_node(n.id);
12410            }
12411            Node::VariableDeclaration(n) => {
12412                for c in n.declarations.iter() { v.visit_node(c); }
12413            }
12414            Node::TemplateLiteral(n) => {
12415                for c in n.quasis.iter() { v.visit_node(c); }
12416                for c in n.expressions.iter() { v.visit_node(c); }
12417            }
12418            Node::TaggedTemplateExpression(n) => {
12419                v.visit_node(n.tag);
12420                v.visit_node(n.quasi);
12421            }
12422            Node::TemplateElement(_) => {}
12423            Node::Property(n) => {
12424                v.visit_node(n.key);
12425                v.visit_node(n.value);
12426            }
12427            Node::Decorator(n) => {
12428                v.visit_node(n.expression);
12429            }
12430            Node::ClassDeclaration(n) => {
12431                if let Some(c) = n.id { v.visit_node(c); }
12432                if let Some(c) = n.type_parameters { v.visit_node(c); }
12433                if let Some(c) = n.super_class { v.visit_node(c); }
12434                if let Some(c) = n.super_type_arguments { v.visit_node(c); }
12435                for c in n.implements.iter() { v.visit_node(c); }
12436                for c in n.decorators.iter() { v.visit_node(c); }
12437                v.visit_node(n.body);
12438            }
12439            Node::ClassExpression(n) => {
12440                if let Some(c) = n.id { v.visit_node(c); }
12441                if let Some(c) = n.type_parameters { v.visit_node(c); }
12442                if let Some(c) = n.super_class { v.visit_node(c); }
12443                if let Some(c) = n.super_type_arguments { v.visit_node(c); }
12444                for c in n.implements.iter() { v.visit_node(c); }
12445                for c in n.decorators.iter() { v.visit_node(c); }
12446                v.visit_node(n.body);
12447            }
12448            Node::ClassBody(n) => {
12449                for c in n.body.iter() { v.visit_node(c); }
12450            }
12451            Node::ClassProperty(n) => {
12452                v.visit_node(n.key);
12453                if let Some(c) = n.value { v.visit_node(c); }
12454                for c in n.decorators.iter() { v.visit_node(c); }
12455                if let Some(c) = n.variance { v.visit_node(c); }
12456                if let Some(c) = n.type_annotation { v.visit_node(c); }
12457                if let Some(c) = n.ts_modifiers { v.visit_node(c); }
12458            }
12459            Node::ClassPrivateProperty(n) => {
12460                v.visit_node(n.key);
12461                if let Some(c) = n.value { v.visit_node(c); }
12462                for c in n.decorators.iter() { v.visit_node(c); }
12463                if let Some(c) = n.variance { v.visit_node(c); }
12464                if let Some(c) = n.type_annotation { v.visit_node(c); }
12465                if let Some(c) = n.ts_modifiers { v.visit_node(c); }
12466            }
12467            Node::MethodDefinition(n) => {
12468                v.visit_node(n.key);
12469                v.visit_node(n.value);
12470                for c in n.decorators.iter() { v.visit_node(c); }
12471            }
12472            Node::ImportDeclaration(n) => {
12473                for c in n.specifiers.iter() { v.visit_node(c); }
12474                v.visit_node(n.source);
12475                for c in n.attributes.iter() { v.visit_node(c); }
12476            }
12477            Node::ImportSpecifier(n) => {
12478                v.visit_node(n.imported);
12479                v.visit_node(n.local);
12480            }
12481            Node::ImportDefaultSpecifier(n) => {
12482                v.visit_node(n.local);
12483            }
12484            Node::ImportNamespaceSpecifier(n) => {
12485                v.visit_node(n.local);
12486            }
12487            Node::ImportAttribute(n) => {
12488                v.visit_node(n.key);
12489                v.visit_node(n.value);
12490            }
12491            Node::ExportNamedDeclaration(n) => {
12492                if let Some(c) = n.declaration { v.visit_node(c); }
12493                for c in n.specifiers.iter() { v.visit_node(c); }
12494                if let Some(c) = n.source { v.visit_node(c); }
12495            }
12496            Node::ExportSpecifier(n) => {
12497                v.visit_node(n.exported);
12498                v.visit_node(n.local);
12499            }
12500            Node::ExportNamespaceSpecifier(n) => {
12501                v.visit_node(n.exported);
12502            }
12503            Node::ExportDefaultDeclaration(n) => {
12504                v.visit_node(n.declaration);
12505            }
12506            Node::ExportAllDeclaration(n) => {
12507                v.visit_node(n.source);
12508            }
12509            Node::ObjectPattern(n) => {
12510                for c in n.properties.iter() { v.visit_node(c); }
12511                if let Some(c) = n.type_annotation { v.visit_node(c); }
12512            }
12513            Node::ArrayPattern(n) => {
12514                for c in n.elements.iter() { v.visit_node(c); }
12515                if let Some(c) = n.type_annotation { v.visit_node(c); }
12516            }
12517            Node::RestElement(n) => {
12518                v.visit_node(n.argument);
12519            }
12520            Node::AssignmentPattern(n) => {
12521                v.visit_node(n.left);
12522                v.visit_node(n.right);
12523            }
12524            Node::MatchStatementCase(n) => {
12525                v.visit_node(n.pattern);
12526                v.visit_node(n.body);
12527                if let Some(c) = n.guard { v.visit_node(c); }
12528            }
12529            Node::MatchExpression(n) => {
12530                v.visit_node(n.argument);
12531                for c in n.cases.iter() { v.visit_node(c); }
12532            }
12533            Node::MatchExpressionCase(n) => {
12534                v.visit_node(n.pattern);
12535                v.visit_node(n.body);
12536                if let Some(c) = n.guard { v.visit_node(c); }
12537            }
12538            Node::MatchWildcardPattern(_) => {}
12539            Node::MatchLiteralPattern(n) => {
12540                v.visit_node(n.literal);
12541            }
12542            Node::MatchUnaryPattern(n) => {
12543                v.visit_node(n.argument);
12544            }
12545            Node::MatchIdentifierPattern(n) => {
12546                v.visit_node(n.id);
12547            }
12548            Node::MatchBindingPattern(n) => {
12549                v.visit_node(n.id);
12550            }
12551            Node::MatchObjectPattern(n) => {
12552                for c in n.properties.iter() { v.visit_node(c); }
12553                if let Some(c) = n.rest { v.visit_node(c); }
12554            }
12555            Node::MatchArrayPattern(n) => {
12556                for c in n.elements.iter() { v.visit_node(c); }
12557                if let Some(c) = n.rest { v.visit_node(c); }
12558            }
12559            Node::MatchOrPattern(n) => {
12560                for c in n.patterns.iter() { v.visit_node(c); }
12561            }
12562            Node::MatchAsPattern(n) => {
12563                v.visit_node(n.pattern);
12564                v.visit_node(n.target);
12565            }
12566            Node::MatchMemberPattern(n) => {
12567                v.visit_node(n.base);
12568                v.visit_node(n.property);
12569            }
12570            Node::MatchInstancePattern(n) => {
12571                v.visit_node(n.target_constructor);
12572                v.visit_node(n.properties);
12573            }
12574            Node::MatchObjectPatternProperty(n) => {
12575                v.visit_node(n.key);
12576                v.visit_node(n.pattern);
12577            }
12578            Node::MatchInstanceObjectPattern(n) => {
12579                for c in n.properties.iter() { v.visit_node(c); }
12580                if let Some(c) = n.rest { v.visit_node(c); }
12581            }
12582            Node::MatchRestPattern(n) => {
12583                if let Some(c) = n.argument { v.visit_node(c); }
12584            }
12585            Node::JSXIdentifier(_) => {}
12586            Node::JSXMemberExpression(n) => {
12587                v.visit_node(n.object);
12588                v.visit_node(n.property);
12589            }
12590            Node::JSXNamespacedName(n) => {
12591                v.visit_node(n.namespace);
12592                v.visit_node(n.name);
12593            }
12594            Node::JSXEmptyExpression(_) => {}
12595            Node::JSXExpressionContainer(n) => {
12596                v.visit_node(n.expression);
12597            }
12598            Node::JSXSpreadChild(n) => {
12599                v.visit_node(n.expression);
12600            }
12601            Node::JSXOpeningElement(n) => {
12602                v.visit_node(n.name);
12603                for c in n.attributes.iter() { v.visit_node(c); }
12604                if let Some(c) = n.type_arguments { v.visit_node(c); }
12605            }
12606            Node::JSXClosingElement(n) => {
12607                v.visit_node(n.name);
12608            }
12609            Node::JSXAttribute(n) => {
12610                v.visit_node(n.name);
12611                if let Some(c) = n.value { v.visit_node(c); }
12612            }
12613            Node::JSXSpreadAttribute(n) => {
12614                v.visit_node(n.argument);
12615            }
12616            Node::JSXStringLiteral(_) => {}
12617            Node::JSXText(_) => {}
12618            Node::JSXElement(n) => {
12619                v.visit_node(n.opening_element);
12620                for c in n.children.iter() { v.visit_node(c); }
12621                if let Some(c) = n.closing_element { v.visit_node(c); }
12622            }
12623            Node::JSXFragment(n) => {
12624                v.visit_node(n.opening_fragment);
12625                for c in n.children.iter() { v.visit_node(c); }
12626                v.visit_node(n.closing_fragment);
12627            }
12628            Node::JSXOpeningFragment(_) => {}
12629            Node::JSXClosingFragment(_) => {}
12630            Node::ExistsTypeAnnotation(_) => {}
12631            Node::EmptyTypeAnnotation(_) => {}
12632            Node::StringTypeAnnotation(_) => {}
12633            Node::NumberTypeAnnotation(_) => {}
12634            Node::StringLiteralTypeAnnotation(_) => {}
12635            Node::NumberLiteralTypeAnnotation(_) => {}
12636            Node::BigIntLiteralTypeAnnotation(_) => {}
12637            Node::BooleanTypeAnnotation(_) => {}
12638            Node::BooleanLiteralTypeAnnotation(_) => {}
12639            Node::NullLiteralTypeAnnotation(_) => {}
12640            Node::SymbolTypeAnnotation(_) => {}
12641            Node::AnyTypeAnnotation(_) => {}
12642            Node::MixedTypeAnnotation(_) => {}
12643            Node::BigIntTypeAnnotation(_) => {}
12644            Node::VoidTypeAnnotation(_) => {}
12645            Node::NeverTypeAnnotation(_) => {}
12646            Node::UnknownTypeAnnotation(_) => {}
12647            Node::UndefinedTypeAnnotation(_) => {}
12648            Node::FunctionTypeAnnotation(n) => {
12649                for c in n.params.iter() { v.visit_node(c); }
12650                if let Some(c) = n.this { v.visit_node(c); }
12651                v.visit_node(n.return_type);
12652                if let Some(c) = n.rest { v.visit_node(c); }
12653                if let Some(c) = n.type_parameters { v.visit_node(c); }
12654            }
12655            Node::HookTypeAnnotation(n) => {
12656                for c in n.params.iter() { v.visit_node(c); }
12657                v.visit_node(n.return_type);
12658                if let Some(c) = n.rest { v.visit_node(c); }
12659                if let Some(c) = n.type_parameters { v.visit_node(c); }
12660            }
12661            Node::FunctionTypeParam(n) => {
12662                if let Some(c) = n.name { v.visit_node(c); }
12663                v.visit_node(n.type_annotation);
12664            }
12665            Node::ComponentTypeAnnotation(n) => {
12666                for c in n.params.iter() { v.visit_node(c); }
12667                if let Some(c) = n.rest { v.visit_node(c); }
12668                if let Some(c) = n.type_parameters { v.visit_node(c); }
12669                if let Some(c) = n.renders_type { v.visit_node(c); }
12670            }
12671            Node::ComponentTypeParameter(n) => {
12672                if let Some(c) = n.name { v.visit_node(c); }
12673                v.visit_node(n.type_annotation);
12674            }
12675            Node::NullableTypeAnnotation(n) => {
12676                v.visit_node(n.type_annotation);
12677            }
12678            Node::QualifiedTypeIdentifier(n) => {
12679                v.visit_node(n.qualification);
12680                v.visit_node(n.id);
12681            }
12682            Node::TypeofTypeAnnotation(n) => {
12683                v.visit_node(n.argument);
12684                if let Some(c) = n.type_arguments { v.visit_node(c); }
12685            }
12686            Node::KeyofTypeAnnotation(n) => {
12687                v.visit_node(n.argument);
12688            }
12689            Node::TypeOperator(n) => {
12690                v.visit_node(n.type_annotation);
12691            }
12692            Node::QualifiedTypeofIdentifier(n) => {
12693                v.visit_node(n.qualification);
12694                v.visit_node(n.id);
12695            }
12696            Node::TupleTypeAnnotation(n) => {
12697                for c in n.element_types.iter() { v.visit_node(c); }
12698            }
12699            Node::TupleTypeSpreadElement(n) => {
12700                if let Some(c) = n.label { v.visit_node(c); }
12701                v.visit_node(n.type_annotation);
12702            }
12703            Node::TupleTypeLabeledElement(n) => {
12704                v.visit_node(n.label);
12705                v.visit_node(n.element_type);
12706                if let Some(c) = n.variance { v.visit_node(c); }
12707            }
12708            Node::ArrayTypeAnnotation(n) => {
12709                v.visit_node(n.element_type);
12710            }
12711            Node::InferTypeAnnotation(n) => {
12712                v.visit_node(n.type_parameter);
12713            }
12714            Node::UnionTypeAnnotation(n) => {
12715                for c in n.types.iter() { v.visit_node(c); }
12716            }
12717            Node::IntersectionTypeAnnotation(n) => {
12718                for c in n.types.iter() { v.visit_node(c); }
12719            }
12720            Node::GenericTypeAnnotation(n) => {
12721                v.visit_node(n.id);
12722                if let Some(c) = n.type_parameters { v.visit_node(c); }
12723            }
12724            Node::IndexedAccessType(n) => {
12725                v.visit_node(n.object_type);
12726                v.visit_node(n.index_type);
12727            }
12728            Node::OptionalIndexedAccessType(n) => {
12729                v.visit_node(n.object_type);
12730                v.visit_node(n.index_type);
12731            }
12732            Node::ConditionalTypeAnnotation(n) => {
12733                v.visit_node(n.check_type);
12734                v.visit_node(n.extends_type);
12735                v.visit_node(n.true_type);
12736                v.visit_node(n.false_type);
12737            }
12738            Node::TypePredicate(n) => {
12739                v.visit_node(n.parameter_name);
12740                if let Some(c) = n.type_annotation { v.visit_node(c); }
12741            }
12742            Node::InterfaceTypeAnnotation(n) => {
12743                for c in n.extends.iter() { v.visit_node(c); }
12744                if let Some(c) = n.body { v.visit_node(c); }
12745            }
12746            Node::TypeAlias(n) => {
12747                v.visit_node(n.id);
12748                if let Some(c) = n.type_parameters { v.visit_node(c); }
12749                v.visit_node(n.right);
12750            }
12751            Node::OpaqueType(n) => {
12752                v.visit_node(n.id);
12753                if let Some(c) = n.type_parameters { v.visit_node(c); }
12754                v.visit_node(n.impltype);
12755                if let Some(c) = n.lower_bound { v.visit_node(c); }
12756                if let Some(c) = n.upper_bound { v.visit_node(c); }
12757                if let Some(c) = n.supertype { v.visit_node(c); }
12758            }
12759            Node::InterfaceDeclaration(n) => {
12760                v.visit_node(n.id);
12761                if let Some(c) = n.type_parameters { v.visit_node(c); }
12762                for c in n.extends.iter() { v.visit_node(c); }
12763                v.visit_node(n.body);
12764            }
12765            Node::DeclareTypeAlias(n) => {
12766                v.visit_node(n.id);
12767                if let Some(c) = n.type_parameters { v.visit_node(c); }
12768                v.visit_node(n.right);
12769            }
12770            Node::DeclareOpaqueType(n) => {
12771                v.visit_node(n.id);
12772                if let Some(c) = n.type_parameters { v.visit_node(c); }
12773                if let Some(c) = n.impltype { v.visit_node(c); }
12774                if let Some(c) = n.lower_bound { v.visit_node(c); }
12775                if let Some(c) = n.upper_bound { v.visit_node(c); }
12776                if let Some(c) = n.supertype { v.visit_node(c); }
12777            }
12778            Node::DeclareInterface(n) => {
12779                v.visit_node(n.id);
12780                if let Some(c) = n.type_parameters { v.visit_node(c); }
12781                for c in n.extends.iter() { v.visit_node(c); }
12782                v.visit_node(n.body);
12783            }
12784            Node::DeclareClass(n) => {
12785                v.visit_node(n.id);
12786                if let Some(c) = n.type_parameters { v.visit_node(c); }
12787                for c in n.extends.iter() { v.visit_node(c); }
12788                for c in n.implements.iter() { v.visit_node(c); }
12789                for c in n.mixins.iter() { v.visit_node(c); }
12790                v.visit_node(n.body);
12791            }
12792            Node::DeclareFunction(n) => {
12793                v.visit_node(n.id);
12794                if let Some(c) = n.predicate { v.visit_node(c); }
12795            }
12796            Node::DeclareHook(n) => {
12797                v.visit_node(n.id);
12798            }
12799            Node::DeclareComponent(n) => {
12800                v.visit_node(n.id);
12801                for c in n.params.iter() { v.visit_node(c); }
12802                if let Some(c) = n.rest { v.visit_node(c); }
12803                if let Some(c) = n.type_parameters { v.visit_node(c); }
12804                if let Some(c) = n.renders_type { v.visit_node(c); }
12805            }
12806            Node::DeclareVariable(n) => {
12807                v.visit_node(n.id);
12808            }
12809            Node::DeclareEnum(n) => {
12810                v.visit_node(n.id);
12811                v.visit_node(n.body);
12812            }
12813            Node::DeclareExportDeclaration(n) => {
12814                if let Some(c) = n.declaration { v.visit_node(c); }
12815                for c in n.specifiers.iter() { v.visit_node(c); }
12816                if let Some(c) = n.source { v.visit_node(c); }
12817            }
12818            Node::DeclareExportAllDeclaration(n) => {
12819                v.visit_node(n.source);
12820            }
12821            Node::DeclareModule(n) => {
12822                v.visit_node(n.id);
12823                v.visit_node(n.body);
12824            }
12825            Node::DeclareNamespace(n) => {
12826                v.visit_node(n.id);
12827                v.visit_node(n.body);
12828            }
12829            Node::DeclareModuleExports(n) => {
12830                v.visit_node(n.type_annotation);
12831            }
12832            Node::InterfaceExtends(n) => {
12833                v.visit_node(n.id);
12834                if let Some(c) = n.type_parameters { v.visit_node(c); }
12835            }
12836            Node::ClassImplements(n) => {
12837                v.visit_node(n.id);
12838                if let Some(c) = n.type_parameters { v.visit_node(c); }
12839            }
12840            Node::TypeAnnotation(n) => {
12841                v.visit_node(n.type_annotation);
12842            }
12843            Node::ObjectTypeAnnotation(n) => {
12844                for c in n.properties.iter() { v.visit_node(c); }
12845                for c in n.indexers.iter() { v.visit_node(c); }
12846                for c in n.call_properties.iter() { v.visit_node(c); }
12847                for c in n.internal_slots.iter() { v.visit_node(c); }
12848            }
12849            Node::ObjectTypeProperty(n) => {
12850                v.visit_node(n.key);
12851                v.visit_node(n.value);
12852                if let Some(c) = n.variance { v.visit_node(c); }
12853            }
12854            Node::ObjectTypeSpreadProperty(n) => {
12855                v.visit_node(n.argument);
12856            }
12857            Node::ObjectTypeInternalSlot(n) => {
12858                v.visit_node(n.id);
12859                v.visit_node(n.value);
12860            }
12861            Node::ObjectTypeCallProperty(n) => {
12862                v.visit_node(n.value);
12863            }
12864            Node::ObjectTypeIndexer(n) => {
12865                if let Some(c) = n.id { v.visit_node(c); }
12866                v.visit_node(n.key);
12867                v.visit_node(n.value);
12868                if let Some(c) = n.variance { v.visit_node(c); }
12869            }
12870            Node::ObjectTypeMappedTypeProperty(n) => {
12871                v.visit_node(n.key_tparam);
12872                v.visit_node(n.prop_type);
12873                v.visit_node(n.source_type);
12874                if let Some(c) = n.variance { v.visit_node(c); }
12875            }
12876            Node::Variance(_) => {}
12877            Node::TypeParameterDeclaration(n) => {
12878                for c in n.params.iter() { v.visit_node(c); }
12879            }
12880            Node::TypeParameter(n) => {
12881                if let Some(c) = n.bound { v.visit_node(c); }
12882                if let Some(c) = n.variance { v.visit_node(c); }
12883                if let Some(c) = n.default { v.visit_node(c); }
12884            }
12885            Node::TypeParameterInstantiation(n) => {
12886                for c in n.params.iter() { v.visit_node(c); }
12887            }
12888            Node::TypeCastExpression(n) => {
12889                v.visit_node(n.expression);
12890                v.visit_node(n.type_annotation);
12891            }
12892            Node::AsExpression(n) => {
12893                v.visit_node(n.expression);
12894                v.visit_node(n.type_annotation);
12895            }
12896            Node::AsConstExpression(n) => {
12897                v.visit_node(n.expression);
12898            }
12899            Node::InferredPredicate(_) => {}
12900            Node::DeclaredPredicate(n) => {
12901                v.visit_node(n.value);
12902            }
12903            Node::EnumDeclaration(n) => {
12904                v.visit_node(n.id);
12905                v.visit_node(n.body);
12906            }
12907            Node::EnumStringBody(n) => {
12908                for c in n.members.iter() { v.visit_node(c); }
12909            }
12910            Node::EnumNumberBody(n) => {
12911                for c in n.members.iter() { v.visit_node(c); }
12912            }
12913            Node::EnumBigIntBody(n) => {
12914                for c in n.members.iter() { v.visit_node(c); }
12915            }
12916            Node::EnumBooleanBody(n) => {
12917                for c in n.members.iter() { v.visit_node(c); }
12918            }
12919            Node::EnumSymbolBody(n) => {
12920                for c in n.members.iter() { v.visit_node(c); }
12921            }
12922            Node::EnumDefaultedMember(n) => {
12923                v.visit_node(n.id);
12924            }
12925            Node::EnumStringMember(n) => {
12926                v.visit_node(n.id);
12927                v.visit_node(n.init);
12928            }
12929            Node::EnumNumberMember(n) => {
12930                v.visit_node(n.id);
12931                v.visit_node(n.init);
12932            }
12933            Node::EnumBigIntMember(n) => {
12934                v.visit_node(n.id);
12935                v.visit_node(n.init);
12936            }
12937            Node::EnumBooleanMember(n) => {
12938                v.visit_node(n.id);
12939                v.visit_node(n.init);
12940            }
12941            Node::ComponentParameter(n) => {
12942                v.visit_node(n.name);
12943                v.visit_node(n.local);
12944            }
12945            Node::RecordDeclaration(n) => {
12946                v.visit_node(n.id);
12947                if let Some(c) = n.type_parameters { v.visit_node(c); }
12948                for c in n.implements.iter() { v.visit_node(c); }
12949                v.visit_node(n.body);
12950            }
12951            Node::RecordDeclarationImplements(n) => {
12952                v.visit_node(n.id);
12953                if let Some(c) = n.type_arguments { v.visit_node(c); }
12954            }
12955            Node::RecordDeclarationBody(n) => {
12956                for c in n.elements.iter() { v.visit_node(c); }
12957            }
12958            Node::RecordDeclarationProperty(n) => {
12959                v.visit_node(n.key);
12960                v.visit_node(n.type_annotation);
12961                if let Some(c) = n.default_value { v.visit_node(c); }
12962            }
12963            Node::RecordDeclarationStaticProperty(n) => {
12964                v.visit_node(n.key);
12965                v.visit_node(n.type_annotation);
12966                v.visit_node(n.value);
12967            }
12968            Node::RecordExpression(n) => {
12969                v.visit_node(n.record_constructor);
12970                if let Some(c) = n.type_arguments { v.visit_node(c); }
12971                v.visit_node(n.properties);
12972            }
12973            Node::RecordExpressionProperties(n) => {
12974                for c in n.properties.iter() { v.visit_node(c); }
12975            }
12976            Node::TSTypeAnnotation(n) => {
12977                v.visit_node(n.type_annotation);
12978            }
12979            Node::TSAnyKeyword(_) => {}
12980            Node::TSNumberKeyword(_) => {}
12981            Node::TSBooleanKeyword(_) => {}
12982            Node::TSStringKeyword(_) => {}
12983            Node::TSSymbolKeyword(_) => {}
12984            Node::TSVoidKeyword(_) => {}
12985            Node::TSUndefinedKeyword(_) => {}
12986            Node::TSUnknownKeyword(_) => {}
12987            Node::TSNeverKeyword(_) => {}
12988            Node::TSBigIntKeyword(_) => {}
12989            Node::TSThisType(_) => {}
12990            Node::TSLiteralType(n) => {
12991                v.visit_node(n.literal);
12992            }
12993            Node::TSIndexedAccessType(n) => {
12994                v.visit_node(n.object_type);
12995                v.visit_node(n.index_type);
12996            }
12997            Node::TSArrayType(n) => {
12998                v.visit_node(n.element_type);
12999            }
13000            Node::TSTypeReference(n) => {
13001                v.visit_node(n.type_name);
13002                if let Some(c) = n.type_parameters { v.visit_node(c); }
13003            }
13004            Node::TSQualifiedName(n) => {
13005                v.visit_node(n.left);
13006                if let Some(c) = n.right { v.visit_node(c); }
13007            }
13008            Node::TSFunctionType(n) => {
13009                for c in n.params.iter() { v.visit_node(c); }
13010                v.visit_node(n.return_type);
13011                if let Some(c) = n.type_parameters { v.visit_node(c); }
13012            }
13013            Node::TSConstructorType(n) => {
13014                for c in n.params.iter() { v.visit_node(c); }
13015                v.visit_node(n.return_type);
13016                if let Some(c) = n.type_parameters { v.visit_node(c); }
13017            }
13018            Node::TSTypePredicate(n) => {
13019                v.visit_node(n.parameter_name);
13020                v.visit_node(n.type_annotation);
13021            }
13022            Node::TSTupleType(n) => {
13023                for c in n.element_types.iter() { v.visit_node(c); }
13024            }
13025            Node::TSTypeAssertion(n) => {
13026                v.visit_node(n.type_annotation);
13027                v.visit_node(n.expression);
13028            }
13029            Node::TSAsExpression(n) => {
13030                v.visit_node(n.expression);
13031                v.visit_node(n.type_annotation);
13032            }
13033            Node::TSParameterProperty(n) => {
13034                v.visit_node(n.parameter);
13035            }
13036            Node::TSTypeAliasDeclaration(n) => {
13037                v.visit_node(n.id);
13038                if let Some(c) = n.type_parameters { v.visit_node(c); }
13039                v.visit_node(n.type_annotation);
13040            }
13041            Node::TSInterfaceDeclaration(n) => {
13042                v.visit_node(n.id);
13043                v.visit_node(n.body);
13044                for c in n.extends.iter() { v.visit_node(c); }
13045                if let Some(c) = n.type_parameters { v.visit_node(c); }
13046            }
13047            Node::TSInterfaceHeritage(n) => {
13048                v.visit_node(n.expression);
13049                if let Some(c) = n.type_parameters { v.visit_node(c); }
13050            }
13051            Node::TSInterfaceBody(n) => {
13052                for c in n.body.iter() { v.visit_node(c); }
13053            }
13054            Node::TSEnumDeclaration(n) => {
13055                v.visit_node(n.id);
13056                for c in n.members.iter() { v.visit_node(c); }
13057            }
13058            Node::TSEnumMember(n) => {
13059                v.visit_node(n.id);
13060                if let Some(c) = n.initializer { v.visit_node(c); }
13061            }
13062            Node::TSModuleDeclaration(n) => {
13063                v.visit_node(n.id);
13064                v.visit_node(n.body);
13065            }
13066            Node::TSModuleBlock(n) => {
13067                for c in n.body.iter() { v.visit_node(c); }
13068            }
13069            Node::TSModuleMember(n) => {
13070                v.visit_node(n.id);
13071                if let Some(c) = n.initializer { v.visit_node(c); }
13072            }
13073            Node::TSTypeParameterDeclaration(n) => {
13074                for c in n.params.iter() { v.visit_node(c); }
13075            }
13076            Node::TSTypeParameter(n) => {
13077                v.visit_node(n.name);
13078                if let Some(c) = n.constraint { v.visit_node(c); }
13079                if let Some(c) = n.default { v.visit_node(c); }
13080            }
13081            Node::TSTypeParameterInstantiation(n) => {
13082                for c in n.params.iter() { v.visit_node(c); }
13083            }
13084            Node::TSUnionType(n) => {
13085                for c in n.types.iter() { v.visit_node(c); }
13086            }
13087            Node::TSIntersectionType(n) => {
13088                for c in n.types.iter() { v.visit_node(c); }
13089            }
13090            Node::TSTypeQuery(n) => {
13091                v.visit_node(n.expr_name);
13092            }
13093            Node::TSConditionalType(n) => {
13094                v.visit_node(n.check_type);
13095                v.visit_node(n.extends_type);
13096                v.visit_node(n.true_type);
13097                v.visit_node(n.false_type);
13098            }
13099            Node::TSTypeLiteral(n) => {
13100                for c in n.members.iter() { v.visit_node(c); }
13101            }
13102            Node::TSPropertySignature(n) => {
13103                v.visit_node(n.key);
13104                if let Some(c) = n.type_annotation { v.visit_node(c); }
13105                if let Some(c) = n.initializer { v.visit_node(c); }
13106            }
13107            Node::TSMethodSignature(n) => {
13108                v.visit_node(n.key);
13109                for c in n.params.iter() { v.visit_node(c); }
13110                if let Some(c) = n.return_type { v.visit_node(c); }
13111            }
13112            Node::TSIndexSignature(n) => {
13113                for c in n.parameters.iter() { v.visit_node(c); }
13114                if let Some(c) = n.type_annotation { v.visit_node(c); }
13115            }
13116            Node::TSCallSignatureDeclaration(n) => {
13117                for c in n.params.iter() { v.visit_node(c); }
13118                if let Some(c) = n.return_type { v.visit_node(c); }
13119            }
13120            Node::TSModifiers(_) => {}
13121            Node::CoverEmptyArgs(_) => {}
13122            Node::CoverTrailingComma(_) => {}
13123            Node::CoverInitializer(n) => {
13124                v.visit_node(n.init);
13125            }
13126            Node::CoverRestElement(n) => {
13127                v.visit_node(n.rest);
13128            }
13129            Node::CoverTypedIdentifier(n) => {
13130                v.visit_node(n.left);
13131                if let Some(c) = n.right { v.visit_node(c); }
13132            }
13133            Node::SHBuiltin(_) => {}
13134            Node::ImplicitCheckedCast(n) => {
13135                v.visit_node(n.argument);
13136            }
13137        }
13138    }
13139
13140    /// Transform this node's children with `visitor`, rebuilding it only if
13141    /// a child changed. `self` is the original parent.
13142    pub fn visit_children_mut<V: VisitorMut<'gc>>(
13143        &'gc self,
13144        ctx: &'gc crate::context::GCLock<'_, '_>,
13145        visitor: &mut V,
13146    ) -> TransformResult<&'gc Node<'gc>> {
13147        let builder = builder::Builder::from_node(self);
13148        #[allow(unused_mut)]
13149        match builder {
13150            builder::Builder::Empty(mut b) => b.build(ctx),
13151            builder::Builder::Metadata(mut b) => b.build(ctx),
13152            builder::Builder::Program(mut b) => {
13153                if let TransformResult::Changed(v) =
13154                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13155                    b.body(v);
13156                }
13157                b.build(ctx)
13158            }
13159            builder::Builder::FunctionExpression(mut b) => {
13160                if let TransformResult::Changed(v) =
13161                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13162                    b.id(v);
13163                }
13164                if let TransformResult::Changed(v) =
13165                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13166                    b.params(v);
13167                }
13168                if let TransformResult::Changed(v) =
13169                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13170                    b.body(v);
13171                }
13172                if let TransformResult::Changed(v) =
13173                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13174                    b.type_parameters(v);
13175                }
13176                if let TransformResult::Changed(v) =
13177                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
13178                    b.return_type(v);
13179                }
13180                if let TransformResult::Changed(v) =
13181                    b.inner.predicate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::predicate)) {
13182                    b.predicate(v);
13183                }
13184                b.build(ctx)
13185            }
13186            builder::Builder::ArrowFunctionExpression(mut b) => {
13187                if let TransformResult::Changed(v) =
13188                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13189                    b.params(v);
13190                }
13191                if let TransformResult::Changed(v) =
13192                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13193                    b.body(v);
13194                }
13195                if let TransformResult::Changed(v) =
13196                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13197                    b.type_parameters(v);
13198                }
13199                if let TransformResult::Changed(v) =
13200                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
13201                    b.return_type(v);
13202                }
13203                if let TransformResult::Changed(v) =
13204                    b.inner.predicate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::predicate)) {
13205                    b.predicate(v);
13206                }
13207                b.build(ctx)
13208            }
13209            builder::Builder::FunctionDeclaration(mut b) => {
13210                if let TransformResult::Changed(v) =
13211                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13212                    b.id(v);
13213                }
13214                if let TransformResult::Changed(v) =
13215                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13216                    b.params(v);
13217                }
13218                if let TransformResult::Changed(v) =
13219                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13220                    b.body(v);
13221                }
13222                if let TransformResult::Changed(v) =
13223                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13224                    b.type_parameters(v);
13225                }
13226                if let TransformResult::Changed(v) =
13227                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
13228                    b.return_type(v);
13229                }
13230                if let TransformResult::Changed(v) =
13231                    b.inner.predicate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::predicate)) {
13232                    b.predicate(v);
13233                }
13234                b.build(ctx)
13235            }
13236            builder::Builder::ComponentDeclaration(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.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13243                    b.params(v);
13244                }
13245                if let TransformResult::Changed(v) =
13246                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13247                    b.body(v);
13248                }
13249                if let TransformResult::Changed(v) =
13250                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13251                    b.type_parameters(v);
13252                }
13253                if let TransformResult::Changed(v) =
13254                    b.inner.renders_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::renders_type)) {
13255                    b.renders_type(v);
13256                }
13257                b.build(ctx)
13258            }
13259            builder::Builder::HookDeclaration(mut b) => {
13260                if let TransformResult::Changed(v) =
13261                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13262                    b.id(v);
13263                }
13264                if let TransformResult::Changed(v) =
13265                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
13266                    b.params(v);
13267                }
13268                if let TransformResult::Changed(v) =
13269                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13270                    b.body(v);
13271                }
13272                if let TransformResult::Changed(v) =
13273                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13274                    b.type_parameters(v);
13275                }
13276                if let TransformResult::Changed(v) =
13277                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
13278                    b.return_type(v);
13279                }
13280                b.build(ctx)
13281            }
13282            builder::Builder::MatchStatement(mut b) => {
13283                if let TransformResult::Changed(v) =
13284                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13285                    b.argument(v);
13286                }
13287                if let TransformResult::Changed(v) =
13288                    b.inner.cases.visit_child_mut(ctx, visitor, Path::new(self, NodeField::cases)) {
13289                    b.cases(v);
13290                }
13291                b.build(ctx)
13292            }
13293            builder::Builder::WhileStatement(mut b) => {
13294                if let TransformResult::Changed(v) =
13295                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13296                    b.body(v);
13297                }
13298                if let TransformResult::Changed(v) =
13299                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
13300                    b.test(v);
13301                }
13302                b.build(ctx)
13303            }
13304            builder::Builder::DoWhileStatement(mut b) => {
13305                if let TransformResult::Changed(v) =
13306                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13307                    b.body(v);
13308                }
13309                if let TransformResult::Changed(v) =
13310                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
13311                    b.test(v);
13312                }
13313                b.build(ctx)
13314            }
13315            builder::Builder::ForInStatement(mut b) => {
13316                if let TransformResult::Changed(v) =
13317                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
13318                    b.left(v);
13319                }
13320                if let TransformResult::Changed(v) =
13321                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
13322                    b.right(v);
13323                }
13324                if let TransformResult::Changed(v) =
13325                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13326                    b.body(v);
13327                }
13328                b.build(ctx)
13329            }
13330            builder::Builder::ForOfStatement(mut b) => {
13331                if let TransformResult::Changed(v) =
13332                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
13333                    b.left(v);
13334                }
13335                if let TransformResult::Changed(v) =
13336                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
13337                    b.right(v);
13338                }
13339                if let TransformResult::Changed(v) =
13340                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13341                    b.body(v);
13342                }
13343                b.build(ctx)
13344            }
13345            builder::Builder::ForStatement(mut b) => {
13346                if let TransformResult::Changed(v) =
13347                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
13348                    b.init(v);
13349                }
13350                if let TransformResult::Changed(v) =
13351                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
13352                    b.test(v);
13353                }
13354                if let TransformResult::Changed(v) =
13355                    b.inner.update.visit_child_mut(ctx, visitor, Path::new(self, NodeField::update)) {
13356                    b.update(v);
13357                }
13358                if let TransformResult::Changed(v) =
13359                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13360                    b.body(v);
13361                }
13362                b.build(ctx)
13363            }
13364            builder::Builder::DebuggerStatement(mut b) => b.build(ctx),
13365            builder::Builder::EmptyStatement(mut b) => b.build(ctx),
13366            builder::Builder::BlockStatement(mut b) => {
13367                if let TransformResult::Changed(v) =
13368                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13369                    b.body(v);
13370                }
13371                b.build(ctx)
13372            }
13373            builder::Builder::StaticBlock(mut b) => {
13374                if let TransformResult::Changed(v) =
13375                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13376                    b.body(v);
13377                }
13378                b.build(ctx)
13379            }
13380            builder::Builder::BreakStatement(mut b) => {
13381                if let TransformResult::Changed(v) =
13382                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
13383                    b.label(v);
13384                }
13385                b.build(ctx)
13386            }
13387            builder::Builder::ContinueStatement(mut b) => {
13388                if let TransformResult::Changed(v) =
13389                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
13390                    b.label(v);
13391                }
13392                b.build(ctx)
13393            }
13394            builder::Builder::ThrowStatement(mut b) => {
13395                if let TransformResult::Changed(v) =
13396                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13397                    b.argument(v);
13398                }
13399                b.build(ctx)
13400            }
13401            builder::Builder::ReturnStatement(mut b) => {
13402                if let TransformResult::Changed(v) =
13403                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13404                    b.argument(v);
13405                }
13406                b.build(ctx)
13407            }
13408            builder::Builder::WithStatement(mut b) => {
13409                if let TransformResult::Changed(v) =
13410                    b.inner.object.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object)) {
13411                    b.object(v);
13412                }
13413                if let TransformResult::Changed(v) =
13414                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13415                    b.body(v);
13416                }
13417                b.build(ctx)
13418            }
13419            builder::Builder::SwitchStatement(mut b) => {
13420                if let TransformResult::Changed(v) =
13421                    b.inner.discriminant.visit_child_mut(ctx, visitor, Path::new(self, NodeField::discriminant)) {
13422                    b.discriminant(v);
13423                }
13424                if let TransformResult::Changed(v) =
13425                    b.inner.cases.visit_child_mut(ctx, visitor, Path::new(self, NodeField::cases)) {
13426                    b.cases(v);
13427                }
13428                b.build(ctx)
13429            }
13430            builder::Builder::LabeledStatement(mut b) => {
13431                if let TransformResult::Changed(v) =
13432                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
13433                    b.label(v);
13434                }
13435                if let TransformResult::Changed(v) =
13436                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13437                    b.body(v);
13438                }
13439                b.build(ctx)
13440            }
13441            builder::Builder::ExpressionStatement(mut b) => {
13442                if let TransformResult::Changed(v) =
13443                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
13444                    b.expression(v);
13445                }
13446                b.build(ctx)
13447            }
13448            builder::Builder::TryStatement(mut b) => {
13449                if let TransformResult::Changed(v) =
13450                    b.inner.block.visit_child_mut(ctx, visitor, Path::new(self, NodeField::block)) {
13451                    b.block(v);
13452                }
13453                if let TransformResult::Changed(v) =
13454                    b.inner.handler.visit_child_mut(ctx, visitor, Path::new(self, NodeField::handler)) {
13455                    b.handler(v);
13456                }
13457                if let TransformResult::Changed(v) =
13458                    b.inner.finalizer.visit_child_mut(ctx, visitor, Path::new(self, NodeField::finalizer)) {
13459                    b.finalizer(v);
13460                }
13461                b.build(ctx)
13462            }
13463            builder::Builder::IfStatement(mut b) => {
13464                if let TransformResult::Changed(v) =
13465                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
13466                    b.test(v);
13467                }
13468                if let TransformResult::Changed(v) =
13469                    b.inner.consequent.visit_child_mut(ctx, visitor, Path::new(self, NodeField::consequent)) {
13470                    b.consequent(v);
13471                }
13472                if let TransformResult::Changed(v) =
13473                    b.inner.alternate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::alternate)) {
13474                    b.alternate(v);
13475                }
13476                b.build(ctx)
13477            }
13478            builder::Builder::NullLiteral(mut b) => b.build(ctx),
13479            builder::Builder::BooleanLiteral(mut b) => b.build(ctx),
13480            builder::Builder::StringLiteral(mut b) => b.build(ctx),
13481            builder::Builder::NumericLiteral(mut b) => b.build(ctx),
13482            builder::Builder::RegExpLiteral(mut b) => b.build(ctx),
13483            builder::Builder::BigIntLiteral(mut b) => b.build(ctx),
13484            builder::Builder::ThisExpression(mut b) => b.build(ctx),
13485            builder::Builder::Super(mut b) => b.build(ctx),
13486            builder::Builder::SequenceExpression(mut b) => {
13487                if let TransformResult::Changed(v) =
13488                    b.inner.expressions.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expressions)) {
13489                    b.expressions(v);
13490                }
13491                b.build(ctx)
13492            }
13493            builder::Builder::ObjectExpression(mut b) => {
13494                if let TransformResult::Changed(v) =
13495                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
13496                    b.properties(v);
13497                }
13498                b.build(ctx)
13499            }
13500            builder::Builder::ArrayExpression(mut b) => {
13501                if let TransformResult::Changed(v) =
13502                    b.inner.elements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::elements)) {
13503                    b.elements(v);
13504                }
13505                b.build(ctx)
13506            }
13507            builder::Builder::SpreadElement(mut b) => {
13508                if let TransformResult::Changed(v) =
13509                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13510                    b.argument(v);
13511                }
13512                b.build(ctx)
13513            }
13514            builder::Builder::NewExpression(mut b) => {
13515                if let TransformResult::Changed(v) =
13516                    b.inner.callee.visit_child_mut(ctx, visitor, Path::new(self, NodeField::callee)) {
13517                    b.callee(v);
13518                }
13519                if let TransformResult::Changed(v) =
13520                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
13521                    b.type_arguments(v);
13522                }
13523                if let TransformResult::Changed(v) =
13524                    b.inner.arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::arguments)) {
13525                    b.arguments(v);
13526                }
13527                b.build(ctx)
13528            }
13529            builder::Builder::YieldExpression(mut b) => {
13530                if let TransformResult::Changed(v) =
13531                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13532                    b.argument(v);
13533                }
13534                b.build(ctx)
13535            }
13536            builder::Builder::AwaitExpression(mut b) => {
13537                if let TransformResult::Changed(v) =
13538                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13539                    b.argument(v);
13540                }
13541                b.build(ctx)
13542            }
13543            builder::Builder::ImportExpression(mut b) => {
13544                if let TransformResult::Changed(v) =
13545                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
13546                    b.source(v);
13547                }
13548                if let TransformResult::Changed(v) =
13549                    b.inner.options.visit_child_mut(ctx, visitor, Path::new(self, NodeField::options)) {
13550                    b.options(v);
13551                }
13552                b.build(ctx)
13553            }
13554            builder::Builder::CallExpression(mut b) => {
13555                if let TransformResult::Changed(v) =
13556                    b.inner.callee.visit_child_mut(ctx, visitor, Path::new(self, NodeField::callee)) {
13557                    b.callee(v);
13558                }
13559                if let TransformResult::Changed(v) =
13560                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
13561                    b.type_arguments(v);
13562                }
13563                if let TransformResult::Changed(v) =
13564                    b.inner.arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::arguments)) {
13565                    b.arguments(v);
13566                }
13567                b.build(ctx)
13568            }
13569            builder::Builder::OptionalCallExpression(mut b) => {
13570                if let TransformResult::Changed(v) =
13571                    b.inner.callee.visit_child_mut(ctx, visitor, Path::new(self, NodeField::callee)) {
13572                    b.callee(v);
13573                }
13574                if let TransformResult::Changed(v) =
13575                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
13576                    b.type_arguments(v);
13577                }
13578                if let TransformResult::Changed(v) =
13579                    b.inner.arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::arguments)) {
13580                    b.arguments(v);
13581                }
13582                b.build(ctx)
13583            }
13584            builder::Builder::AssignmentExpression(mut b) => {
13585                if let TransformResult::Changed(v) =
13586                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
13587                    b.left(v);
13588                }
13589                if let TransformResult::Changed(v) =
13590                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
13591                    b.right(v);
13592                }
13593                b.build(ctx)
13594            }
13595            builder::Builder::UnaryExpression(mut b) => {
13596                if let TransformResult::Changed(v) =
13597                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13598                    b.argument(v);
13599                }
13600                b.build(ctx)
13601            }
13602            builder::Builder::UpdateExpression(mut b) => {
13603                if let TransformResult::Changed(v) =
13604                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
13605                    b.argument(v);
13606                }
13607                b.build(ctx)
13608            }
13609            builder::Builder::MemberExpression(mut b) => {
13610                if let TransformResult::Changed(v) =
13611                    b.inner.object.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object)) {
13612                    b.object(v);
13613                }
13614                if let TransformResult::Changed(v) =
13615                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
13616                    b.property(v);
13617                }
13618                b.build(ctx)
13619            }
13620            builder::Builder::OptionalMemberExpression(mut b) => {
13621                if let TransformResult::Changed(v) =
13622                    b.inner.object.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object)) {
13623                    b.object(v);
13624                }
13625                if let TransformResult::Changed(v) =
13626                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
13627                    b.property(v);
13628                }
13629                b.build(ctx)
13630            }
13631            builder::Builder::LogicalExpression(mut b) => {
13632                if let TransformResult::Changed(v) =
13633                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
13634                    b.left(v);
13635                }
13636                if let TransformResult::Changed(v) =
13637                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
13638                    b.right(v);
13639                }
13640                b.build(ctx)
13641            }
13642            builder::Builder::ConditionalExpression(mut b) => {
13643                if let TransformResult::Changed(v) =
13644                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
13645                    b.test(v);
13646                }
13647                if let TransformResult::Changed(v) =
13648                    b.inner.alternate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::alternate)) {
13649                    b.alternate(v);
13650                }
13651                if let TransformResult::Changed(v) =
13652                    b.inner.consequent.visit_child_mut(ctx, visitor, Path::new(self, NodeField::consequent)) {
13653                    b.consequent(v);
13654                }
13655                b.build(ctx)
13656            }
13657            builder::Builder::BinaryExpression(mut b) => {
13658                if let TransformResult::Changed(v) =
13659                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
13660                    b.left(v);
13661                }
13662                if let TransformResult::Changed(v) =
13663                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
13664                    b.right(v);
13665                }
13666                b.build(ctx)
13667            }
13668            builder::Builder::Directive(mut b) => {
13669                if let TransformResult::Changed(v) =
13670                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13671                    b.value(v);
13672                }
13673                b.build(ctx)
13674            }
13675            builder::Builder::DirectiveLiteral(mut b) => b.build(ctx),
13676            builder::Builder::Identifier(mut b) => {
13677                if let TransformResult::Changed(v) =
13678                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13679                    b.type_annotation(v);
13680                }
13681                b.build(ctx)
13682            }
13683            builder::Builder::PrivateName(mut b) => {
13684                if let TransformResult::Changed(v) =
13685                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13686                    b.id(v);
13687                }
13688                b.build(ctx)
13689            }
13690            builder::Builder::MetaProperty(mut b) => {
13691                if let TransformResult::Changed(v) =
13692                    b.inner.meta.visit_child_mut(ctx, visitor, Path::new(self, NodeField::meta)) {
13693                    b.meta(v);
13694                }
13695                if let TransformResult::Changed(v) =
13696                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
13697                    b.property(v);
13698                }
13699                b.build(ctx)
13700            }
13701            builder::Builder::SwitchCase(mut b) => {
13702                if let TransformResult::Changed(v) =
13703                    b.inner.test.visit_child_mut(ctx, visitor, Path::new(self, NodeField::test)) {
13704                    b.test(v);
13705                }
13706                if let TransformResult::Changed(v) =
13707                    b.inner.consequent.visit_child_mut(ctx, visitor, Path::new(self, NodeField::consequent)) {
13708                    b.consequent(v);
13709                }
13710                b.build(ctx)
13711            }
13712            builder::Builder::CatchClause(mut b) => {
13713                if let TransformResult::Changed(v) =
13714                    b.inner.param.visit_child_mut(ctx, visitor, Path::new(self, NodeField::param)) {
13715                    b.param(v);
13716                }
13717                if let TransformResult::Changed(v) =
13718                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13719                    b.body(v);
13720                }
13721                b.build(ctx)
13722            }
13723            builder::Builder::VariableDeclarator(mut b) => {
13724                if let TransformResult::Changed(v) =
13725                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
13726                    b.init(v);
13727                }
13728                if let TransformResult::Changed(v) =
13729                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13730                    b.id(v);
13731                }
13732                b.build(ctx)
13733            }
13734            builder::Builder::VariableDeclaration(mut b) => {
13735                if let TransformResult::Changed(v) =
13736                    b.inner.declarations.visit_child_mut(ctx, visitor, Path::new(self, NodeField::declarations)) {
13737                    b.declarations(v);
13738                }
13739                b.build(ctx)
13740            }
13741            builder::Builder::TemplateLiteral(mut b) => {
13742                if let TransformResult::Changed(v) =
13743                    b.inner.quasis.visit_child_mut(ctx, visitor, Path::new(self, NodeField::quasis)) {
13744                    b.quasis(v);
13745                }
13746                if let TransformResult::Changed(v) =
13747                    b.inner.expressions.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expressions)) {
13748                    b.expressions(v);
13749                }
13750                b.build(ctx)
13751            }
13752            builder::Builder::TaggedTemplateExpression(mut b) => {
13753                if let TransformResult::Changed(v) =
13754                    b.inner.tag.visit_child_mut(ctx, visitor, Path::new(self, NodeField::tag)) {
13755                    b.tag(v);
13756                }
13757                if let TransformResult::Changed(v) =
13758                    b.inner.quasi.visit_child_mut(ctx, visitor, Path::new(self, NodeField::quasi)) {
13759                    b.quasi(v);
13760                }
13761                b.build(ctx)
13762            }
13763            builder::Builder::TemplateElement(mut b) => b.build(ctx),
13764            builder::Builder::Property(mut b) => {
13765                if let TransformResult::Changed(v) =
13766                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
13767                    b.key(v);
13768                }
13769                if let TransformResult::Changed(v) =
13770                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13771                    b.value(v);
13772                }
13773                b.build(ctx)
13774            }
13775            builder::Builder::Decorator(mut b) => {
13776                if let TransformResult::Changed(v) =
13777                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
13778                    b.expression(v);
13779                }
13780                b.build(ctx)
13781            }
13782            builder::Builder::ClassDeclaration(mut b) => {
13783                if let TransformResult::Changed(v) =
13784                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13785                    b.id(v);
13786                }
13787                if let TransformResult::Changed(v) =
13788                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13789                    b.type_parameters(v);
13790                }
13791                if let TransformResult::Changed(v) =
13792                    b.inner.super_class.visit_child_mut(ctx, visitor, Path::new(self, NodeField::super_class)) {
13793                    b.super_class(v);
13794                }
13795                if let TransformResult::Changed(v) =
13796                    b.inner.super_type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::super_type_arguments)) {
13797                    b.super_type_arguments(v);
13798                }
13799                if let TransformResult::Changed(v) =
13800                    b.inner.implements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::implements)) {
13801                    b.implements(v);
13802                }
13803                if let TransformResult::Changed(v) =
13804                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
13805                    b.decorators(v);
13806                }
13807                if let TransformResult::Changed(v) =
13808                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13809                    b.body(v);
13810                }
13811                b.build(ctx)
13812            }
13813            builder::Builder::ClassExpression(mut b) => {
13814                if let TransformResult::Changed(v) =
13815                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
13816                    b.id(v);
13817                }
13818                if let TransformResult::Changed(v) =
13819                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
13820                    b.type_parameters(v);
13821                }
13822                if let TransformResult::Changed(v) =
13823                    b.inner.super_class.visit_child_mut(ctx, visitor, Path::new(self, NodeField::super_class)) {
13824                    b.super_class(v);
13825                }
13826                if let TransformResult::Changed(v) =
13827                    b.inner.super_type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::super_type_arguments)) {
13828                    b.super_type_arguments(v);
13829                }
13830                if let TransformResult::Changed(v) =
13831                    b.inner.implements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::implements)) {
13832                    b.implements(v);
13833                }
13834                if let TransformResult::Changed(v) =
13835                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
13836                    b.decorators(v);
13837                }
13838                if let TransformResult::Changed(v) =
13839                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13840                    b.body(v);
13841                }
13842                b.build(ctx)
13843            }
13844            builder::Builder::ClassBody(mut b) => {
13845                if let TransformResult::Changed(v) =
13846                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
13847                    b.body(v);
13848                }
13849                b.build(ctx)
13850            }
13851            builder::Builder::ClassProperty(mut b) => {
13852                if let TransformResult::Changed(v) =
13853                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
13854                    b.key(v);
13855                }
13856                if let TransformResult::Changed(v) =
13857                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13858                    b.value(v);
13859                }
13860                if let TransformResult::Changed(v) =
13861                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
13862                    b.decorators(v);
13863                }
13864                if let TransformResult::Changed(v) =
13865                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
13866                    b.variance(v);
13867                }
13868                if let TransformResult::Changed(v) =
13869                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13870                    b.type_annotation(v);
13871                }
13872                if let TransformResult::Changed(v) =
13873                    b.inner.ts_modifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::ts_modifiers)) {
13874                    b.ts_modifiers(v);
13875                }
13876                b.build(ctx)
13877            }
13878            builder::Builder::ClassPrivateProperty(mut b) => {
13879                if let TransformResult::Changed(v) =
13880                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
13881                    b.key(v);
13882                }
13883                if let TransformResult::Changed(v) =
13884                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13885                    b.value(v);
13886                }
13887                if let TransformResult::Changed(v) =
13888                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
13889                    b.decorators(v);
13890                }
13891                if let TransformResult::Changed(v) =
13892                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
13893                    b.variance(v);
13894                }
13895                if let TransformResult::Changed(v) =
13896                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
13897                    b.type_annotation(v);
13898                }
13899                if let TransformResult::Changed(v) =
13900                    b.inner.ts_modifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::ts_modifiers)) {
13901                    b.ts_modifiers(v);
13902                }
13903                b.build(ctx)
13904            }
13905            builder::Builder::MethodDefinition(mut b) => {
13906                if let TransformResult::Changed(v) =
13907                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
13908                    b.key(v);
13909                }
13910                if let TransformResult::Changed(v) =
13911                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13912                    b.value(v);
13913                }
13914                if let TransformResult::Changed(v) =
13915                    b.inner.decorators.visit_child_mut(ctx, visitor, Path::new(self, NodeField::decorators)) {
13916                    b.decorators(v);
13917                }
13918                b.build(ctx)
13919            }
13920            builder::Builder::ImportDeclaration(mut b) => {
13921                if let TransformResult::Changed(v) =
13922                    b.inner.specifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::specifiers)) {
13923                    b.specifiers(v);
13924                }
13925                if let TransformResult::Changed(v) =
13926                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
13927                    b.source(v);
13928                }
13929                if let TransformResult::Changed(v) =
13930                    b.inner.attributes.visit_child_mut(ctx, visitor, Path::new(self, NodeField::attributes)) {
13931                    b.attributes(v);
13932                }
13933                b.build(ctx)
13934            }
13935            builder::Builder::ImportSpecifier(mut b) => {
13936                if let TransformResult::Changed(v) =
13937                    b.inner.imported.visit_child_mut(ctx, visitor, Path::new(self, NodeField::imported)) {
13938                    b.imported(v);
13939                }
13940                if let TransformResult::Changed(v) =
13941                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
13942                    b.local(v);
13943                }
13944                b.build(ctx)
13945            }
13946            builder::Builder::ImportDefaultSpecifier(mut b) => {
13947                if let TransformResult::Changed(v) =
13948                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
13949                    b.local(v);
13950                }
13951                b.build(ctx)
13952            }
13953            builder::Builder::ImportNamespaceSpecifier(mut b) => {
13954                if let TransformResult::Changed(v) =
13955                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
13956                    b.local(v);
13957                }
13958                b.build(ctx)
13959            }
13960            builder::Builder::ImportAttribute(mut b) => {
13961                if let TransformResult::Changed(v) =
13962                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
13963                    b.key(v);
13964                }
13965                if let TransformResult::Changed(v) =
13966                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
13967                    b.value(v);
13968                }
13969                b.build(ctx)
13970            }
13971            builder::Builder::ExportNamedDeclaration(mut b) => {
13972                if let TransformResult::Changed(v) =
13973                    b.inner.declaration.visit_child_mut(ctx, visitor, Path::new(self, NodeField::declaration)) {
13974                    b.declaration(v);
13975                }
13976                if let TransformResult::Changed(v) =
13977                    b.inner.specifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::specifiers)) {
13978                    b.specifiers(v);
13979                }
13980                if let TransformResult::Changed(v) =
13981                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
13982                    b.source(v);
13983                }
13984                b.build(ctx)
13985            }
13986            builder::Builder::ExportSpecifier(mut b) => {
13987                if let TransformResult::Changed(v) =
13988                    b.inner.exported.visit_child_mut(ctx, visitor, Path::new(self, NodeField::exported)) {
13989                    b.exported(v);
13990                }
13991                if let TransformResult::Changed(v) =
13992                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
13993                    b.local(v);
13994                }
13995                b.build(ctx)
13996            }
13997            builder::Builder::ExportNamespaceSpecifier(mut b) => {
13998                if let TransformResult::Changed(v) =
13999                    b.inner.exported.visit_child_mut(ctx, visitor, Path::new(self, NodeField::exported)) {
14000                    b.exported(v);
14001                }
14002                b.build(ctx)
14003            }
14004            builder::Builder::ExportDefaultDeclaration(mut b) => {
14005                if let TransformResult::Changed(v) =
14006                    b.inner.declaration.visit_child_mut(ctx, visitor, Path::new(self, NodeField::declaration)) {
14007                    b.declaration(v);
14008                }
14009                b.build(ctx)
14010            }
14011            builder::Builder::ExportAllDeclaration(mut b) => {
14012                if let TransformResult::Changed(v) =
14013                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
14014                    b.source(v);
14015                }
14016                b.build(ctx)
14017            }
14018            builder::Builder::ObjectPattern(mut b) => {
14019                if let TransformResult::Changed(v) =
14020                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
14021                    b.properties(v);
14022                }
14023                if let TransformResult::Changed(v) =
14024                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14025                    b.type_annotation(v);
14026                }
14027                b.build(ctx)
14028            }
14029            builder::Builder::ArrayPattern(mut b) => {
14030                if let TransformResult::Changed(v) =
14031                    b.inner.elements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::elements)) {
14032                    b.elements(v);
14033                }
14034                if let TransformResult::Changed(v) =
14035                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14036                    b.type_annotation(v);
14037                }
14038                b.build(ctx)
14039            }
14040            builder::Builder::RestElement(mut b) => {
14041                if let TransformResult::Changed(v) =
14042                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
14043                    b.argument(v);
14044                }
14045                b.build(ctx)
14046            }
14047            builder::Builder::AssignmentPattern(mut b) => {
14048                if let TransformResult::Changed(v) =
14049                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
14050                    b.left(v);
14051                }
14052                if let TransformResult::Changed(v) =
14053                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
14054                    b.right(v);
14055                }
14056                b.build(ctx)
14057            }
14058            builder::Builder::MatchStatementCase(mut b) => {
14059                if let TransformResult::Changed(v) =
14060                    b.inner.pattern.visit_child_mut(ctx, visitor, Path::new(self, NodeField::pattern)) {
14061                    b.pattern(v);
14062                }
14063                if let TransformResult::Changed(v) =
14064                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14065                    b.body(v);
14066                }
14067                if let TransformResult::Changed(v) =
14068                    b.inner.guard.visit_child_mut(ctx, visitor, Path::new(self, NodeField::guard)) {
14069                    b.guard(v);
14070                }
14071                b.build(ctx)
14072            }
14073            builder::Builder::MatchExpression(mut b) => {
14074                if let TransformResult::Changed(v) =
14075                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
14076                    b.argument(v);
14077                }
14078                if let TransformResult::Changed(v) =
14079                    b.inner.cases.visit_child_mut(ctx, visitor, Path::new(self, NodeField::cases)) {
14080                    b.cases(v);
14081                }
14082                b.build(ctx)
14083            }
14084            builder::Builder::MatchExpressionCase(mut b) => {
14085                if let TransformResult::Changed(v) =
14086                    b.inner.pattern.visit_child_mut(ctx, visitor, Path::new(self, NodeField::pattern)) {
14087                    b.pattern(v);
14088                }
14089                if let TransformResult::Changed(v) =
14090                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14091                    b.body(v);
14092                }
14093                if let TransformResult::Changed(v) =
14094                    b.inner.guard.visit_child_mut(ctx, visitor, Path::new(self, NodeField::guard)) {
14095                    b.guard(v);
14096                }
14097                b.build(ctx)
14098            }
14099            builder::Builder::MatchWildcardPattern(mut b) => b.build(ctx),
14100            builder::Builder::MatchLiteralPattern(mut b) => {
14101                if let TransformResult::Changed(v) =
14102                    b.inner.literal.visit_child_mut(ctx, visitor, Path::new(self, NodeField::literal)) {
14103                    b.literal(v);
14104                }
14105                b.build(ctx)
14106            }
14107            builder::Builder::MatchUnaryPattern(mut b) => {
14108                if let TransformResult::Changed(v) =
14109                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
14110                    b.argument(v);
14111                }
14112                b.build(ctx)
14113            }
14114            builder::Builder::MatchIdentifierPattern(mut b) => {
14115                if let TransformResult::Changed(v) =
14116                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14117                    b.id(v);
14118                }
14119                b.build(ctx)
14120            }
14121            builder::Builder::MatchBindingPattern(mut b) => {
14122                if let TransformResult::Changed(v) =
14123                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14124                    b.id(v);
14125                }
14126                b.build(ctx)
14127            }
14128            builder::Builder::MatchObjectPattern(mut b) => {
14129                if let TransformResult::Changed(v) =
14130                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
14131                    b.properties(v);
14132                }
14133                if let TransformResult::Changed(v) =
14134                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
14135                    b.rest(v);
14136                }
14137                b.build(ctx)
14138            }
14139            builder::Builder::MatchArrayPattern(mut b) => {
14140                if let TransformResult::Changed(v) =
14141                    b.inner.elements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::elements)) {
14142                    b.elements(v);
14143                }
14144                if let TransformResult::Changed(v) =
14145                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
14146                    b.rest(v);
14147                }
14148                b.build(ctx)
14149            }
14150            builder::Builder::MatchOrPattern(mut b) => {
14151                if let TransformResult::Changed(v) =
14152                    b.inner.patterns.visit_child_mut(ctx, visitor, Path::new(self, NodeField::patterns)) {
14153                    b.patterns(v);
14154                }
14155                b.build(ctx)
14156            }
14157            builder::Builder::MatchAsPattern(mut b) => {
14158                if let TransformResult::Changed(v) =
14159                    b.inner.pattern.visit_child_mut(ctx, visitor, Path::new(self, NodeField::pattern)) {
14160                    b.pattern(v);
14161                }
14162                if let TransformResult::Changed(v) =
14163                    b.inner.target.visit_child_mut(ctx, visitor, Path::new(self, NodeField::target)) {
14164                    b.target(v);
14165                }
14166                b.build(ctx)
14167            }
14168            builder::Builder::MatchMemberPattern(mut b) => {
14169                if let TransformResult::Changed(v) =
14170                    b.inner.base.visit_child_mut(ctx, visitor, Path::new(self, NodeField::base)) {
14171                    b.base(v);
14172                }
14173                if let TransformResult::Changed(v) =
14174                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
14175                    b.property(v);
14176                }
14177                b.build(ctx)
14178            }
14179            builder::Builder::MatchInstancePattern(mut b) => {
14180                if let TransformResult::Changed(v) =
14181                    b.inner.target_constructor.visit_child_mut(ctx, visitor, Path::new(self, NodeField::target_constructor)) {
14182                    b.target_constructor(v);
14183                }
14184                if let TransformResult::Changed(v) =
14185                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
14186                    b.properties(v);
14187                }
14188                b.build(ctx)
14189            }
14190            builder::Builder::MatchObjectPatternProperty(mut b) => {
14191                if let TransformResult::Changed(v) =
14192                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
14193                    b.key(v);
14194                }
14195                if let TransformResult::Changed(v) =
14196                    b.inner.pattern.visit_child_mut(ctx, visitor, Path::new(self, NodeField::pattern)) {
14197                    b.pattern(v);
14198                }
14199                b.build(ctx)
14200            }
14201            builder::Builder::MatchInstanceObjectPattern(mut b) => {
14202                if let TransformResult::Changed(v) =
14203                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
14204                    b.properties(v);
14205                }
14206                if let TransformResult::Changed(v) =
14207                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
14208                    b.rest(v);
14209                }
14210                b.build(ctx)
14211            }
14212            builder::Builder::MatchRestPattern(mut b) => {
14213                if let TransformResult::Changed(v) =
14214                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
14215                    b.argument(v);
14216                }
14217                b.build(ctx)
14218            }
14219            builder::Builder::JSXIdentifier(mut b) => b.build(ctx),
14220            builder::Builder::JSXMemberExpression(mut b) => {
14221                if let TransformResult::Changed(v) =
14222                    b.inner.object.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object)) {
14223                    b.object(v);
14224                }
14225                if let TransformResult::Changed(v) =
14226                    b.inner.property.visit_child_mut(ctx, visitor, Path::new(self, NodeField::property)) {
14227                    b.property(v);
14228                }
14229                b.build(ctx)
14230            }
14231            builder::Builder::JSXNamespacedName(mut b) => {
14232                if let TransformResult::Changed(v) =
14233                    b.inner.namespace.visit_child_mut(ctx, visitor, Path::new(self, NodeField::namespace)) {
14234                    b.namespace(v);
14235                }
14236                if let TransformResult::Changed(v) =
14237                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
14238                    b.name(v);
14239                }
14240                b.build(ctx)
14241            }
14242            builder::Builder::JSXEmptyExpression(mut b) => b.build(ctx),
14243            builder::Builder::JSXExpressionContainer(mut b) => {
14244                if let TransformResult::Changed(v) =
14245                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
14246                    b.expression(v);
14247                }
14248                b.build(ctx)
14249            }
14250            builder::Builder::JSXSpreadChild(mut b) => {
14251                if let TransformResult::Changed(v) =
14252                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
14253                    b.expression(v);
14254                }
14255                b.build(ctx)
14256            }
14257            builder::Builder::JSXOpeningElement(mut b) => {
14258                if let TransformResult::Changed(v) =
14259                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
14260                    b.name(v);
14261                }
14262                if let TransformResult::Changed(v) =
14263                    b.inner.attributes.visit_child_mut(ctx, visitor, Path::new(self, NodeField::attributes)) {
14264                    b.attributes(v);
14265                }
14266                if let TransformResult::Changed(v) =
14267                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
14268                    b.type_arguments(v);
14269                }
14270                b.build(ctx)
14271            }
14272            builder::Builder::JSXClosingElement(mut b) => {
14273                if let TransformResult::Changed(v) =
14274                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
14275                    b.name(v);
14276                }
14277                b.build(ctx)
14278            }
14279            builder::Builder::JSXAttribute(mut b) => {
14280                if let TransformResult::Changed(v) =
14281                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
14282                    b.name(v);
14283                }
14284                if let TransformResult::Changed(v) =
14285                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
14286                    b.value(v);
14287                }
14288                b.build(ctx)
14289            }
14290            builder::Builder::JSXSpreadAttribute(mut b) => {
14291                if let TransformResult::Changed(v) =
14292                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
14293                    b.argument(v);
14294                }
14295                b.build(ctx)
14296            }
14297            builder::Builder::JSXStringLiteral(mut b) => b.build(ctx),
14298            builder::Builder::JSXText(mut b) => b.build(ctx),
14299            builder::Builder::JSXElement(mut b) => {
14300                if let TransformResult::Changed(v) =
14301                    b.inner.opening_element.visit_child_mut(ctx, visitor, Path::new(self, NodeField::opening_element)) {
14302                    b.opening_element(v);
14303                }
14304                if let TransformResult::Changed(v) =
14305                    b.inner.children.visit_child_mut(ctx, visitor, Path::new(self, NodeField::children)) {
14306                    b.children(v);
14307                }
14308                if let TransformResult::Changed(v) =
14309                    b.inner.closing_element.visit_child_mut(ctx, visitor, Path::new(self, NodeField::closing_element)) {
14310                    b.closing_element(v);
14311                }
14312                b.build(ctx)
14313            }
14314            builder::Builder::JSXFragment(mut b) => {
14315                if let TransformResult::Changed(v) =
14316                    b.inner.opening_fragment.visit_child_mut(ctx, visitor, Path::new(self, NodeField::opening_fragment)) {
14317                    b.opening_fragment(v);
14318                }
14319                if let TransformResult::Changed(v) =
14320                    b.inner.children.visit_child_mut(ctx, visitor, Path::new(self, NodeField::children)) {
14321                    b.children(v);
14322                }
14323                if let TransformResult::Changed(v) =
14324                    b.inner.closing_fragment.visit_child_mut(ctx, visitor, Path::new(self, NodeField::closing_fragment)) {
14325                    b.closing_fragment(v);
14326                }
14327                b.build(ctx)
14328            }
14329            builder::Builder::JSXOpeningFragment(mut b) => b.build(ctx),
14330            builder::Builder::JSXClosingFragment(mut b) => b.build(ctx),
14331            builder::Builder::ExistsTypeAnnotation(mut b) => b.build(ctx),
14332            builder::Builder::EmptyTypeAnnotation(mut b) => b.build(ctx),
14333            builder::Builder::StringTypeAnnotation(mut b) => b.build(ctx),
14334            builder::Builder::NumberTypeAnnotation(mut b) => b.build(ctx),
14335            builder::Builder::StringLiteralTypeAnnotation(mut b) => b.build(ctx),
14336            builder::Builder::NumberLiteralTypeAnnotation(mut b) => b.build(ctx),
14337            builder::Builder::BigIntLiteralTypeAnnotation(mut b) => b.build(ctx),
14338            builder::Builder::BooleanTypeAnnotation(mut b) => b.build(ctx),
14339            builder::Builder::BooleanLiteralTypeAnnotation(mut b) => b.build(ctx),
14340            builder::Builder::NullLiteralTypeAnnotation(mut b) => b.build(ctx),
14341            builder::Builder::SymbolTypeAnnotation(mut b) => b.build(ctx),
14342            builder::Builder::AnyTypeAnnotation(mut b) => b.build(ctx),
14343            builder::Builder::MixedTypeAnnotation(mut b) => b.build(ctx),
14344            builder::Builder::BigIntTypeAnnotation(mut b) => b.build(ctx),
14345            builder::Builder::VoidTypeAnnotation(mut b) => b.build(ctx),
14346            builder::Builder::NeverTypeAnnotation(mut b) => b.build(ctx),
14347            builder::Builder::UnknownTypeAnnotation(mut b) => b.build(ctx),
14348            builder::Builder::UndefinedTypeAnnotation(mut b) => b.build(ctx),
14349            builder::Builder::FunctionTypeAnnotation(mut b) => {
14350                if let TransformResult::Changed(v) =
14351                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14352                    b.params(v);
14353                }
14354                if let TransformResult::Changed(v) =
14355                    b.inner.this.visit_child_mut(ctx, visitor, Path::new(self, NodeField::this)) {
14356                    b.this(v);
14357                }
14358                if let TransformResult::Changed(v) =
14359                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
14360                    b.return_type(v);
14361                }
14362                if let TransformResult::Changed(v) =
14363                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
14364                    b.rest(v);
14365                }
14366                if let TransformResult::Changed(v) =
14367                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14368                    b.type_parameters(v);
14369                }
14370                b.build(ctx)
14371            }
14372            builder::Builder::HookTypeAnnotation(mut b) => {
14373                if let TransformResult::Changed(v) =
14374                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14375                    b.params(v);
14376                }
14377                if let TransformResult::Changed(v) =
14378                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
14379                    b.return_type(v);
14380                }
14381                if let TransformResult::Changed(v) =
14382                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
14383                    b.rest(v);
14384                }
14385                if let TransformResult::Changed(v) =
14386                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14387                    b.type_parameters(v);
14388                }
14389                b.build(ctx)
14390            }
14391            builder::Builder::FunctionTypeParam(mut b) => {
14392                if let TransformResult::Changed(v) =
14393                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
14394                    b.name(v);
14395                }
14396                if let TransformResult::Changed(v) =
14397                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14398                    b.type_annotation(v);
14399                }
14400                b.build(ctx)
14401            }
14402            builder::Builder::ComponentTypeAnnotation(mut b) => {
14403                if let TransformResult::Changed(v) =
14404                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14405                    b.params(v);
14406                }
14407                if let TransformResult::Changed(v) =
14408                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
14409                    b.rest(v);
14410                }
14411                if let TransformResult::Changed(v) =
14412                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14413                    b.type_parameters(v);
14414                }
14415                if let TransformResult::Changed(v) =
14416                    b.inner.renders_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::renders_type)) {
14417                    b.renders_type(v);
14418                }
14419                b.build(ctx)
14420            }
14421            builder::Builder::ComponentTypeParameter(mut b) => {
14422                if let TransformResult::Changed(v) =
14423                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
14424                    b.name(v);
14425                }
14426                if let TransformResult::Changed(v) =
14427                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14428                    b.type_annotation(v);
14429                }
14430                b.build(ctx)
14431            }
14432            builder::Builder::NullableTypeAnnotation(mut b) => {
14433                if let TransformResult::Changed(v) =
14434                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14435                    b.type_annotation(v);
14436                }
14437                b.build(ctx)
14438            }
14439            builder::Builder::QualifiedTypeIdentifier(mut b) => {
14440                if let TransformResult::Changed(v) =
14441                    b.inner.qualification.visit_child_mut(ctx, visitor, Path::new(self, NodeField::qualification)) {
14442                    b.qualification(v);
14443                }
14444                if let TransformResult::Changed(v) =
14445                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14446                    b.id(v);
14447                }
14448                b.build(ctx)
14449            }
14450            builder::Builder::TypeofTypeAnnotation(mut b) => {
14451                if let TransformResult::Changed(v) =
14452                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
14453                    b.argument(v);
14454                }
14455                if let TransformResult::Changed(v) =
14456                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
14457                    b.type_arguments(v);
14458                }
14459                b.build(ctx)
14460            }
14461            builder::Builder::KeyofTypeAnnotation(mut b) => {
14462                if let TransformResult::Changed(v) =
14463                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
14464                    b.argument(v);
14465                }
14466                b.build(ctx)
14467            }
14468            builder::Builder::TypeOperator(mut b) => {
14469                if let TransformResult::Changed(v) =
14470                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14471                    b.type_annotation(v);
14472                }
14473                b.build(ctx)
14474            }
14475            builder::Builder::QualifiedTypeofIdentifier(mut b) => {
14476                if let TransformResult::Changed(v) =
14477                    b.inner.qualification.visit_child_mut(ctx, visitor, Path::new(self, NodeField::qualification)) {
14478                    b.qualification(v);
14479                }
14480                if let TransformResult::Changed(v) =
14481                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14482                    b.id(v);
14483                }
14484                b.build(ctx)
14485            }
14486            builder::Builder::TupleTypeAnnotation(mut b) => {
14487                if let TransformResult::Changed(v) =
14488                    b.inner.element_types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_types)) {
14489                    b.element_types(v);
14490                }
14491                b.build(ctx)
14492            }
14493            builder::Builder::TupleTypeSpreadElement(mut b) => {
14494                if let TransformResult::Changed(v) =
14495                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
14496                    b.label(v);
14497                }
14498                if let TransformResult::Changed(v) =
14499                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14500                    b.type_annotation(v);
14501                }
14502                b.build(ctx)
14503            }
14504            builder::Builder::TupleTypeLabeledElement(mut b) => {
14505                if let TransformResult::Changed(v) =
14506                    b.inner.label.visit_child_mut(ctx, visitor, Path::new(self, NodeField::label)) {
14507                    b.label(v);
14508                }
14509                if let TransformResult::Changed(v) =
14510                    b.inner.element_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_type)) {
14511                    b.element_type(v);
14512                }
14513                if let TransformResult::Changed(v) =
14514                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
14515                    b.variance(v);
14516                }
14517                b.build(ctx)
14518            }
14519            builder::Builder::ArrayTypeAnnotation(mut b) => {
14520                if let TransformResult::Changed(v) =
14521                    b.inner.element_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_type)) {
14522                    b.element_type(v);
14523                }
14524                b.build(ctx)
14525            }
14526            builder::Builder::InferTypeAnnotation(mut b) => {
14527                if let TransformResult::Changed(v) =
14528                    b.inner.type_parameter.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameter)) {
14529                    b.type_parameter(v);
14530                }
14531                b.build(ctx)
14532            }
14533            builder::Builder::UnionTypeAnnotation(mut b) => {
14534                if let TransformResult::Changed(v) =
14535                    b.inner.types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::types)) {
14536                    b.types(v);
14537                }
14538                b.build(ctx)
14539            }
14540            builder::Builder::IntersectionTypeAnnotation(mut b) => {
14541                if let TransformResult::Changed(v) =
14542                    b.inner.types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::types)) {
14543                    b.types(v);
14544                }
14545                b.build(ctx)
14546            }
14547            builder::Builder::GenericTypeAnnotation(mut b) => {
14548                if let TransformResult::Changed(v) =
14549                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14550                    b.id(v);
14551                }
14552                if let TransformResult::Changed(v) =
14553                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14554                    b.type_parameters(v);
14555                }
14556                b.build(ctx)
14557            }
14558            builder::Builder::IndexedAccessType(mut b) => {
14559                if let TransformResult::Changed(v) =
14560                    b.inner.object_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object_type)) {
14561                    b.object_type(v);
14562                }
14563                if let TransformResult::Changed(v) =
14564                    b.inner.index_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::index_type)) {
14565                    b.index_type(v);
14566                }
14567                b.build(ctx)
14568            }
14569            builder::Builder::OptionalIndexedAccessType(mut b) => {
14570                if let TransformResult::Changed(v) =
14571                    b.inner.object_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object_type)) {
14572                    b.object_type(v);
14573                }
14574                if let TransformResult::Changed(v) =
14575                    b.inner.index_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::index_type)) {
14576                    b.index_type(v);
14577                }
14578                b.build(ctx)
14579            }
14580            builder::Builder::ConditionalTypeAnnotation(mut b) => {
14581                if let TransformResult::Changed(v) =
14582                    b.inner.check_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::check_type)) {
14583                    b.check_type(v);
14584                }
14585                if let TransformResult::Changed(v) =
14586                    b.inner.extends_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends_type)) {
14587                    b.extends_type(v);
14588                }
14589                if let TransformResult::Changed(v) =
14590                    b.inner.true_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::true_type)) {
14591                    b.true_type(v);
14592                }
14593                if let TransformResult::Changed(v) =
14594                    b.inner.false_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::false_type)) {
14595                    b.false_type(v);
14596                }
14597                b.build(ctx)
14598            }
14599            builder::Builder::TypePredicate(mut b) => {
14600                if let TransformResult::Changed(v) =
14601                    b.inner.parameter_name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::parameter_name)) {
14602                    b.parameter_name(v);
14603                }
14604                if let TransformResult::Changed(v) =
14605                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14606                    b.type_annotation(v);
14607                }
14608                b.build(ctx)
14609            }
14610            builder::Builder::InterfaceTypeAnnotation(mut b) => {
14611                if let TransformResult::Changed(v) =
14612                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
14613                    b.extends(v);
14614                }
14615                if let TransformResult::Changed(v) =
14616                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14617                    b.body(v);
14618                }
14619                b.build(ctx)
14620            }
14621            builder::Builder::TypeAlias(mut b) => {
14622                if let TransformResult::Changed(v) =
14623                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14624                    b.id(v);
14625                }
14626                if let TransformResult::Changed(v) =
14627                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14628                    b.type_parameters(v);
14629                }
14630                if let TransformResult::Changed(v) =
14631                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
14632                    b.right(v);
14633                }
14634                b.build(ctx)
14635            }
14636            builder::Builder::OpaqueType(mut b) => {
14637                if let TransformResult::Changed(v) =
14638                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14639                    b.id(v);
14640                }
14641                if let TransformResult::Changed(v) =
14642                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14643                    b.type_parameters(v);
14644                }
14645                if let TransformResult::Changed(v) =
14646                    b.inner.impltype.visit_child_mut(ctx, visitor, Path::new(self, NodeField::impltype)) {
14647                    b.impltype(v);
14648                }
14649                if let TransformResult::Changed(v) =
14650                    b.inner.lower_bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::lower_bound)) {
14651                    b.lower_bound(v);
14652                }
14653                if let TransformResult::Changed(v) =
14654                    b.inner.upper_bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::upper_bound)) {
14655                    b.upper_bound(v);
14656                }
14657                if let TransformResult::Changed(v) =
14658                    b.inner.supertype.visit_child_mut(ctx, visitor, Path::new(self, NodeField::supertype)) {
14659                    b.supertype(v);
14660                }
14661                b.build(ctx)
14662            }
14663            builder::Builder::InterfaceDeclaration(mut b) => {
14664                if let TransformResult::Changed(v) =
14665                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14666                    b.id(v);
14667                }
14668                if let TransformResult::Changed(v) =
14669                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14670                    b.type_parameters(v);
14671                }
14672                if let TransformResult::Changed(v) =
14673                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
14674                    b.extends(v);
14675                }
14676                if let TransformResult::Changed(v) =
14677                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14678                    b.body(v);
14679                }
14680                b.build(ctx)
14681            }
14682            builder::Builder::DeclareTypeAlias(mut b) => {
14683                if let TransformResult::Changed(v) =
14684                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14685                    b.id(v);
14686                }
14687                if let TransformResult::Changed(v) =
14688                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14689                    b.type_parameters(v);
14690                }
14691                if let TransformResult::Changed(v) =
14692                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
14693                    b.right(v);
14694                }
14695                b.build(ctx)
14696            }
14697            builder::Builder::DeclareOpaqueType(mut b) => {
14698                if let TransformResult::Changed(v) =
14699                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14700                    b.id(v);
14701                }
14702                if let TransformResult::Changed(v) =
14703                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14704                    b.type_parameters(v);
14705                }
14706                if let TransformResult::Changed(v) =
14707                    b.inner.impltype.visit_child_mut(ctx, visitor, Path::new(self, NodeField::impltype)) {
14708                    b.impltype(v);
14709                }
14710                if let TransformResult::Changed(v) =
14711                    b.inner.lower_bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::lower_bound)) {
14712                    b.lower_bound(v);
14713                }
14714                if let TransformResult::Changed(v) =
14715                    b.inner.upper_bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::upper_bound)) {
14716                    b.upper_bound(v);
14717                }
14718                if let TransformResult::Changed(v) =
14719                    b.inner.supertype.visit_child_mut(ctx, visitor, Path::new(self, NodeField::supertype)) {
14720                    b.supertype(v);
14721                }
14722                b.build(ctx)
14723            }
14724            builder::Builder::DeclareInterface(mut b) => {
14725                if let TransformResult::Changed(v) =
14726                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14727                    b.id(v);
14728                }
14729                if let TransformResult::Changed(v) =
14730                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14731                    b.type_parameters(v);
14732                }
14733                if let TransformResult::Changed(v) =
14734                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
14735                    b.extends(v);
14736                }
14737                if let TransformResult::Changed(v) =
14738                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14739                    b.body(v);
14740                }
14741                b.build(ctx)
14742            }
14743            builder::Builder::DeclareClass(mut b) => {
14744                if let TransformResult::Changed(v) =
14745                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14746                    b.id(v);
14747                }
14748                if let TransformResult::Changed(v) =
14749                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14750                    b.type_parameters(v);
14751                }
14752                if let TransformResult::Changed(v) =
14753                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
14754                    b.extends(v);
14755                }
14756                if let TransformResult::Changed(v) =
14757                    b.inner.implements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::implements)) {
14758                    b.implements(v);
14759                }
14760                if let TransformResult::Changed(v) =
14761                    b.inner.mixins.visit_child_mut(ctx, visitor, Path::new(self, NodeField::mixins)) {
14762                    b.mixins(v);
14763                }
14764                if let TransformResult::Changed(v) =
14765                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14766                    b.body(v);
14767                }
14768                b.build(ctx)
14769            }
14770            builder::Builder::DeclareFunction(mut b) => {
14771                if let TransformResult::Changed(v) =
14772                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14773                    b.id(v);
14774                }
14775                if let TransformResult::Changed(v) =
14776                    b.inner.predicate.visit_child_mut(ctx, visitor, Path::new(self, NodeField::predicate)) {
14777                    b.predicate(v);
14778                }
14779                b.build(ctx)
14780            }
14781            builder::Builder::DeclareHook(mut b) => {
14782                if let TransformResult::Changed(v) =
14783                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14784                    b.id(v);
14785                }
14786                b.build(ctx)
14787            }
14788            builder::Builder::DeclareComponent(mut b) => {
14789                if let TransformResult::Changed(v) =
14790                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14791                    b.id(v);
14792                }
14793                if let TransformResult::Changed(v) =
14794                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
14795                    b.params(v);
14796                }
14797                if let TransformResult::Changed(v) =
14798                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
14799                    b.rest(v);
14800                }
14801                if let TransformResult::Changed(v) =
14802                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14803                    b.type_parameters(v);
14804                }
14805                if let TransformResult::Changed(v) =
14806                    b.inner.renders_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::renders_type)) {
14807                    b.renders_type(v);
14808                }
14809                b.build(ctx)
14810            }
14811            builder::Builder::DeclareVariable(mut b) => {
14812                if let TransformResult::Changed(v) =
14813                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14814                    b.id(v);
14815                }
14816                b.build(ctx)
14817            }
14818            builder::Builder::DeclareEnum(mut b) => {
14819                if let TransformResult::Changed(v) =
14820                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14821                    b.id(v);
14822                }
14823                if let TransformResult::Changed(v) =
14824                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14825                    b.body(v);
14826                }
14827                b.build(ctx)
14828            }
14829            builder::Builder::DeclareExportDeclaration(mut b) => {
14830                if let TransformResult::Changed(v) =
14831                    b.inner.declaration.visit_child_mut(ctx, visitor, Path::new(self, NodeField::declaration)) {
14832                    b.declaration(v);
14833                }
14834                if let TransformResult::Changed(v) =
14835                    b.inner.specifiers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::specifiers)) {
14836                    b.specifiers(v);
14837                }
14838                if let TransformResult::Changed(v) =
14839                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
14840                    b.source(v);
14841                }
14842                b.build(ctx)
14843            }
14844            builder::Builder::DeclareExportAllDeclaration(mut b) => {
14845                if let TransformResult::Changed(v) =
14846                    b.inner.source.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source)) {
14847                    b.source(v);
14848                }
14849                b.build(ctx)
14850            }
14851            builder::Builder::DeclareModule(mut b) => {
14852                if let TransformResult::Changed(v) =
14853                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14854                    b.id(v);
14855                }
14856                if let TransformResult::Changed(v) =
14857                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14858                    b.body(v);
14859                }
14860                b.build(ctx)
14861            }
14862            builder::Builder::DeclareNamespace(mut b) => {
14863                if let TransformResult::Changed(v) =
14864                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14865                    b.id(v);
14866                }
14867                if let TransformResult::Changed(v) =
14868                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
14869                    b.body(v);
14870                }
14871                b.build(ctx)
14872            }
14873            builder::Builder::DeclareModuleExports(mut b) => {
14874                if let TransformResult::Changed(v) =
14875                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14876                    b.type_annotation(v);
14877                }
14878                b.build(ctx)
14879            }
14880            builder::Builder::InterfaceExtends(mut b) => {
14881                if let TransformResult::Changed(v) =
14882                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14883                    b.id(v);
14884                }
14885                if let TransformResult::Changed(v) =
14886                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14887                    b.type_parameters(v);
14888                }
14889                b.build(ctx)
14890            }
14891            builder::Builder::ClassImplements(mut b) => {
14892                if let TransformResult::Changed(v) =
14893                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14894                    b.id(v);
14895                }
14896                if let TransformResult::Changed(v) =
14897                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
14898                    b.type_parameters(v);
14899                }
14900                b.build(ctx)
14901            }
14902            builder::Builder::TypeAnnotation(mut b) => {
14903                if let TransformResult::Changed(v) =
14904                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
14905                    b.type_annotation(v);
14906                }
14907                b.build(ctx)
14908            }
14909            builder::Builder::ObjectTypeAnnotation(mut b) => {
14910                if let TransformResult::Changed(v) =
14911                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
14912                    b.properties(v);
14913                }
14914                if let TransformResult::Changed(v) =
14915                    b.inner.indexers.visit_child_mut(ctx, visitor, Path::new(self, NodeField::indexers)) {
14916                    b.indexers(v);
14917                }
14918                if let TransformResult::Changed(v) =
14919                    b.inner.call_properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::call_properties)) {
14920                    b.call_properties(v);
14921                }
14922                if let TransformResult::Changed(v) =
14923                    b.inner.internal_slots.visit_child_mut(ctx, visitor, Path::new(self, NodeField::internal_slots)) {
14924                    b.internal_slots(v);
14925                }
14926                b.build(ctx)
14927            }
14928            builder::Builder::ObjectTypeProperty(mut b) => {
14929                if let TransformResult::Changed(v) =
14930                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
14931                    b.key(v);
14932                }
14933                if let TransformResult::Changed(v) =
14934                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
14935                    b.value(v);
14936                }
14937                if let TransformResult::Changed(v) =
14938                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
14939                    b.variance(v);
14940                }
14941                b.build(ctx)
14942            }
14943            builder::Builder::ObjectTypeSpreadProperty(mut b) => {
14944                if let TransformResult::Changed(v) =
14945                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
14946                    b.argument(v);
14947                }
14948                b.build(ctx)
14949            }
14950            builder::Builder::ObjectTypeInternalSlot(mut b) => {
14951                if let TransformResult::Changed(v) =
14952                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14953                    b.id(v);
14954                }
14955                if let TransformResult::Changed(v) =
14956                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
14957                    b.value(v);
14958                }
14959                b.build(ctx)
14960            }
14961            builder::Builder::ObjectTypeCallProperty(mut b) => {
14962                if let TransformResult::Changed(v) =
14963                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
14964                    b.value(v);
14965                }
14966                b.build(ctx)
14967            }
14968            builder::Builder::ObjectTypeIndexer(mut b) => {
14969                if let TransformResult::Changed(v) =
14970                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
14971                    b.id(v);
14972                }
14973                if let TransformResult::Changed(v) =
14974                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
14975                    b.key(v);
14976                }
14977                if let TransformResult::Changed(v) =
14978                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
14979                    b.value(v);
14980                }
14981                if let TransformResult::Changed(v) =
14982                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
14983                    b.variance(v);
14984                }
14985                b.build(ctx)
14986            }
14987            builder::Builder::ObjectTypeMappedTypeProperty(mut b) => {
14988                if let TransformResult::Changed(v) =
14989                    b.inner.key_tparam.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key_tparam)) {
14990                    b.key_tparam(v);
14991                }
14992                if let TransformResult::Changed(v) =
14993                    b.inner.prop_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::prop_type)) {
14994                    b.prop_type(v);
14995                }
14996                if let TransformResult::Changed(v) =
14997                    b.inner.source_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::source_type)) {
14998                    b.source_type(v);
14999                }
15000                if let TransformResult::Changed(v) =
15001                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
15002                    b.variance(v);
15003                }
15004                b.build(ctx)
15005            }
15006            builder::Builder::Variance(mut b) => b.build(ctx),
15007            builder::Builder::TypeParameterDeclaration(mut b) => {
15008                if let TransformResult::Changed(v) =
15009                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
15010                    b.params(v);
15011                }
15012                b.build(ctx)
15013            }
15014            builder::Builder::TypeParameter(mut b) => {
15015                if let TransformResult::Changed(v) =
15016                    b.inner.bound.visit_child_mut(ctx, visitor, Path::new(self, NodeField::bound)) {
15017                    b.bound(v);
15018                }
15019                if let TransformResult::Changed(v) =
15020                    b.inner.variance.visit_child_mut(ctx, visitor, Path::new(self, NodeField::variance)) {
15021                    b.variance(v);
15022                }
15023                if let TransformResult::Changed(v) =
15024                    b.inner.default.visit_child_mut(ctx, visitor, Path::new(self, NodeField::default)) {
15025                    b.default(v);
15026                }
15027                b.build(ctx)
15028            }
15029            builder::Builder::TypeParameterInstantiation(mut b) => {
15030                if let TransformResult::Changed(v) =
15031                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
15032                    b.params(v);
15033                }
15034                b.build(ctx)
15035            }
15036            builder::Builder::TypeCastExpression(mut b) => {
15037                if let TransformResult::Changed(v) =
15038                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
15039                    b.expression(v);
15040                }
15041                if let TransformResult::Changed(v) =
15042                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15043                    b.type_annotation(v);
15044                }
15045                b.build(ctx)
15046            }
15047            builder::Builder::AsExpression(mut b) => {
15048                if let TransformResult::Changed(v) =
15049                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
15050                    b.expression(v);
15051                }
15052                if let TransformResult::Changed(v) =
15053                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15054                    b.type_annotation(v);
15055                }
15056                b.build(ctx)
15057            }
15058            builder::Builder::AsConstExpression(mut b) => {
15059                if let TransformResult::Changed(v) =
15060                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
15061                    b.expression(v);
15062                }
15063                b.build(ctx)
15064            }
15065            builder::Builder::InferredPredicate(mut b) => b.build(ctx),
15066            builder::Builder::DeclaredPredicate(mut b) => {
15067                if let TransformResult::Changed(v) =
15068                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
15069                    b.value(v);
15070                }
15071                b.build(ctx)
15072            }
15073            builder::Builder::EnumDeclaration(mut b) => {
15074                if let TransformResult::Changed(v) =
15075                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15076                    b.id(v);
15077                }
15078                if let TransformResult::Changed(v) =
15079                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
15080                    b.body(v);
15081                }
15082                b.build(ctx)
15083            }
15084            builder::Builder::EnumStringBody(mut b) => {
15085                if let TransformResult::Changed(v) =
15086                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
15087                    b.members(v);
15088                }
15089                b.build(ctx)
15090            }
15091            builder::Builder::EnumNumberBody(mut b) => {
15092                if let TransformResult::Changed(v) =
15093                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
15094                    b.members(v);
15095                }
15096                b.build(ctx)
15097            }
15098            builder::Builder::EnumBigIntBody(mut b) => {
15099                if let TransformResult::Changed(v) =
15100                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
15101                    b.members(v);
15102                }
15103                b.build(ctx)
15104            }
15105            builder::Builder::EnumBooleanBody(mut b) => {
15106                if let TransformResult::Changed(v) =
15107                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
15108                    b.members(v);
15109                }
15110                b.build(ctx)
15111            }
15112            builder::Builder::EnumSymbolBody(mut b) => {
15113                if let TransformResult::Changed(v) =
15114                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
15115                    b.members(v);
15116                }
15117                b.build(ctx)
15118            }
15119            builder::Builder::EnumDefaultedMember(mut b) => {
15120                if let TransformResult::Changed(v) =
15121                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15122                    b.id(v);
15123                }
15124                b.build(ctx)
15125            }
15126            builder::Builder::EnumStringMember(mut b) => {
15127                if let TransformResult::Changed(v) =
15128                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15129                    b.id(v);
15130                }
15131                if let TransformResult::Changed(v) =
15132                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
15133                    b.init(v);
15134                }
15135                b.build(ctx)
15136            }
15137            builder::Builder::EnumNumberMember(mut b) => {
15138                if let TransformResult::Changed(v) =
15139                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15140                    b.id(v);
15141                }
15142                if let TransformResult::Changed(v) =
15143                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
15144                    b.init(v);
15145                }
15146                b.build(ctx)
15147            }
15148            builder::Builder::EnumBigIntMember(mut b) => {
15149                if let TransformResult::Changed(v) =
15150                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15151                    b.id(v);
15152                }
15153                if let TransformResult::Changed(v) =
15154                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
15155                    b.init(v);
15156                }
15157                b.build(ctx)
15158            }
15159            builder::Builder::EnumBooleanMember(mut b) => {
15160                if let TransformResult::Changed(v) =
15161                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15162                    b.id(v);
15163                }
15164                if let TransformResult::Changed(v) =
15165                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
15166                    b.init(v);
15167                }
15168                b.build(ctx)
15169            }
15170            builder::Builder::ComponentParameter(mut b) => {
15171                if let TransformResult::Changed(v) =
15172                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
15173                    b.name(v);
15174                }
15175                if let TransformResult::Changed(v) =
15176                    b.inner.local.visit_child_mut(ctx, visitor, Path::new(self, NodeField::local)) {
15177                    b.local(v);
15178                }
15179                b.build(ctx)
15180            }
15181            builder::Builder::RecordDeclaration(mut b) => {
15182                if let TransformResult::Changed(v) =
15183                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15184                    b.id(v);
15185                }
15186                if let TransformResult::Changed(v) =
15187                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
15188                    b.type_parameters(v);
15189                }
15190                if let TransformResult::Changed(v) =
15191                    b.inner.implements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::implements)) {
15192                    b.implements(v);
15193                }
15194                if let TransformResult::Changed(v) =
15195                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
15196                    b.body(v);
15197                }
15198                b.build(ctx)
15199            }
15200            builder::Builder::RecordDeclarationImplements(mut b) => {
15201                if let TransformResult::Changed(v) =
15202                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15203                    b.id(v);
15204                }
15205                if let TransformResult::Changed(v) =
15206                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
15207                    b.type_arguments(v);
15208                }
15209                b.build(ctx)
15210            }
15211            builder::Builder::RecordDeclarationBody(mut b) => {
15212                if let TransformResult::Changed(v) =
15213                    b.inner.elements.visit_child_mut(ctx, visitor, Path::new(self, NodeField::elements)) {
15214                    b.elements(v);
15215                }
15216                b.build(ctx)
15217            }
15218            builder::Builder::RecordDeclarationProperty(mut b) => {
15219                if let TransformResult::Changed(v) =
15220                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
15221                    b.key(v);
15222                }
15223                if let TransformResult::Changed(v) =
15224                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15225                    b.type_annotation(v);
15226                }
15227                if let TransformResult::Changed(v) =
15228                    b.inner.default_value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::default_value)) {
15229                    b.default_value(v);
15230                }
15231                b.build(ctx)
15232            }
15233            builder::Builder::RecordDeclarationStaticProperty(mut b) => {
15234                if let TransformResult::Changed(v) =
15235                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
15236                    b.key(v);
15237                }
15238                if let TransformResult::Changed(v) =
15239                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15240                    b.type_annotation(v);
15241                }
15242                if let TransformResult::Changed(v) =
15243                    b.inner.value.visit_child_mut(ctx, visitor, Path::new(self, NodeField::value)) {
15244                    b.value(v);
15245                }
15246                b.build(ctx)
15247            }
15248            builder::Builder::RecordExpression(mut b) => {
15249                if let TransformResult::Changed(v) =
15250                    b.inner.record_constructor.visit_child_mut(ctx, visitor, Path::new(self, NodeField::record_constructor)) {
15251                    b.record_constructor(v);
15252                }
15253                if let TransformResult::Changed(v) =
15254                    b.inner.type_arguments.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_arguments)) {
15255                    b.type_arguments(v);
15256                }
15257                if let TransformResult::Changed(v) =
15258                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
15259                    b.properties(v);
15260                }
15261                b.build(ctx)
15262            }
15263            builder::Builder::RecordExpressionProperties(mut b) => {
15264                if let TransformResult::Changed(v) =
15265                    b.inner.properties.visit_child_mut(ctx, visitor, Path::new(self, NodeField::properties)) {
15266                    b.properties(v);
15267                }
15268                b.build(ctx)
15269            }
15270            builder::Builder::TSTypeAnnotation(mut b) => {
15271                if let TransformResult::Changed(v) =
15272                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15273                    b.type_annotation(v);
15274                }
15275                b.build(ctx)
15276            }
15277            builder::Builder::TSAnyKeyword(mut b) => b.build(ctx),
15278            builder::Builder::TSNumberKeyword(mut b) => b.build(ctx),
15279            builder::Builder::TSBooleanKeyword(mut b) => b.build(ctx),
15280            builder::Builder::TSStringKeyword(mut b) => b.build(ctx),
15281            builder::Builder::TSSymbolKeyword(mut b) => b.build(ctx),
15282            builder::Builder::TSVoidKeyword(mut b) => b.build(ctx),
15283            builder::Builder::TSUndefinedKeyword(mut b) => b.build(ctx),
15284            builder::Builder::TSUnknownKeyword(mut b) => b.build(ctx),
15285            builder::Builder::TSNeverKeyword(mut b) => b.build(ctx),
15286            builder::Builder::TSBigIntKeyword(mut b) => b.build(ctx),
15287            builder::Builder::TSThisType(mut b) => b.build(ctx),
15288            builder::Builder::TSLiteralType(mut b) => {
15289                if let TransformResult::Changed(v) =
15290                    b.inner.literal.visit_child_mut(ctx, visitor, Path::new(self, NodeField::literal)) {
15291                    b.literal(v);
15292                }
15293                b.build(ctx)
15294            }
15295            builder::Builder::TSIndexedAccessType(mut b) => {
15296                if let TransformResult::Changed(v) =
15297                    b.inner.object_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::object_type)) {
15298                    b.object_type(v);
15299                }
15300                if let TransformResult::Changed(v) =
15301                    b.inner.index_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::index_type)) {
15302                    b.index_type(v);
15303                }
15304                b.build(ctx)
15305            }
15306            builder::Builder::TSArrayType(mut b) => {
15307                if let TransformResult::Changed(v) =
15308                    b.inner.element_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_type)) {
15309                    b.element_type(v);
15310                }
15311                b.build(ctx)
15312            }
15313            builder::Builder::TSTypeReference(mut b) => {
15314                if let TransformResult::Changed(v) =
15315                    b.inner.type_name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_name)) {
15316                    b.type_name(v);
15317                }
15318                if let TransformResult::Changed(v) =
15319                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
15320                    b.type_parameters(v);
15321                }
15322                b.build(ctx)
15323            }
15324            builder::Builder::TSQualifiedName(mut b) => {
15325                if let TransformResult::Changed(v) =
15326                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
15327                    b.left(v);
15328                }
15329                if let TransformResult::Changed(v) =
15330                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
15331                    b.right(v);
15332                }
15333                b.build(ctx)
15334            }
15335            builder::Builder::TSFunctionType(mut b) => {
15336                if let TransformResult::Changed(v) =
15337                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
15338                    b.params(v);
15339                }
15340                if let TransformResult::Changed(v) =
15341                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
15342                    b.return_type(v);
15343                }
15344                if let TransformResult::Changed(v) =
15345                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
15346                    b.type_parameters(v);
15347                }
15348                b.build(ctx)
15349            }
15350            builder::Builder::TSConstructorType(mut b) => {
15351                if let TransformResult::Changed(v) =
15352                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
15353                    b.params(v);
15354                }
15355                if let TransformResult::Changed(v) =
15356                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
15357                    b.return_type(v);
15358                }
15359                if let TransformResult::Changed(v) =
15360                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
15361                    b.type_parameters(v);
15362                }
15363                b.build(ctx)
15364            }
15365            builder::Builder::TSTypePredicate(mut b) => {
15366                if let TransformResult::Changed(v) =
15367                    b.inner.parameter_name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::parameter_name)) {
15368                    b.parameter_name(v);
15369                }
15370                if let TransformResult::Changed(v) =
15371                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15372                    b.type_annotation(v);
15373                }
15374                b.build(ctx)
15375            }
15376            builder::Builder::TSTupleType(mut b) => {
15377                if let TransformResult::Changed(v) =
15378                    b.inner.element_types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::element_types)) {
15379                    b.element_types(v);
15380                }
15381                b.build(ctx)
15382            }
15383            builder::Builder::TSTypeAssertion(mut b) => {
15384                if let TransformResult::Changed(v) =
15385                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15386                    b.type_annotation(v);
15387                }
15388                if let TransformResult::Changed(v) =
15389                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
15390                    b.expression(v);
15391                }
15392                b.build(ctx)
15393            }
15394            builder::Builder::TSAsExpression(mut b) => {
15395                if let TransformResult::Changed(v) =
15396                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
15397                    b.expression(v);
15398                }
15399                if let TransformResult::Changed(v) =
15400                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15401                    b.type_annotation(v);
15402                }
15403                b.build(ctx)
15404            }
15405            builder::Builder::TSParameterProperty(mut b) => {
15406                if let TransformResult::Changed(v) =
15407                    b.inner.parameter.visit_child_mut(ctx, visitor, Path::new(self, NodeField::parameter)) {
15408                    b.parameter(v);
15409                }
15410                b.build(ctx)
15411            }
15412            builder::Builder::TSTypeAliasDeclaration(mut b) => {
15413                if let TransformResult::Changed(v) =
15414                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15415                    b.id(v);
15416                }
15417                if let TransformResult::Changed(v) =
15418                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
15419                    b.type_parameters(v);
15420                }
15421                if let TransformResult::Changed(v) =
15422                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15423                    b.type_annotation(v);
15424                }
15425                b.build(ctx)
15426            }
15427            builder::Builder::TSInterfaceDeclaration(mut b) => {
15428                if let TransformResult::Changed(v) =
15429                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15430                    b.id(v);
15431                }
15432                if let TransformResult::Changed(v) =
15433                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
15434                    b.body(v);
15435                }
15436                if let TransformResult::Changed(v) =
15437                    b.inner.extends.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends)) {
15438                    b.extends(v);
15439                }
15440                if let TransformResult::Changed(v) =
15441                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
15442                    b.type_parameters(v);
15443                }
15444                b.build(ctx)
15445            }
15446            builder::Builder::TSInterfaceHeritage(mut b) => {
15447                if let TransformResult::Changed(v) =
15448                    b.inner.expression.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expression)) {
15449                    b.expression(v);
15450                }
15451                if let TransformResult::Changed(v) =
15452                    b.inner.type_parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_parameters)) {
15453                    b.type_parameters(v);
15454                }
15455                b.build(ctx)
15456            }
15457            builder::Builder::TSInterfaceBody(mut b) => {
15458                if let TransformResult::Changed(v) =
15459                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
15460                    b.body(v);
15461                }
15462                b.build(ctx)
15463            }
15464            builder::Builder::TSEnumDeclaration(mut b) => {
15465                if let TransformResult::Changed(v) =
15466                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15467                    b.id(v);
15468                }
15469                if let TransformResult::Changed(v) =
15470                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
15471                    b.members(v);
15472                }
15473                b.build(ctx)
15474            }
15475            builder::Builder::TSEnumMember(mut b) => {
15476                if let TransformResult::Changed(v) =
15477                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15478                    b.id(v);
15479                }
15480                if let TransformResult::Changed(v) =
15481                    b.inner.initializer.visit_child_mut(ctx, visitor, Path::new(self, NodeField::initializer)) {
15482                    b.initializer(v);
15483                }
15484                b.build(ctx)
15485            }
15486            builder::Builder::TSModuleDeclaration(mut b) => {
15487                if let TransformResult::Changed(v) =
15488                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15489                    b.id(v);
15490                }
15491                if let TransformResult::Changed(v) =
15492                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
15493                    b.body(v);
15494                }
15495                b.build(ctx)
15496            }
15497            builder::Builder::TSModuleBlock(mut b) => {
15498                if let TransformResult::Changed(v) =
15499                    b.inner.body.visit_child_mut(ctx, visitor, Path::new(self, NodeField::body)) {
15500                    b.body(v);
15501                }
15502                b.build(ctx)
15503            }
15504            builder::Builder::TSModuleMember(mut b) => {
15505                if let TransformResult::Changed(v) =
15506                    b.inner.id.visit_child_mut(ctx, visitor, Path::new(self, NodeField::id)) {
15507                    b.id(v);
15508                }
15509                if let TransformResult::Changed(v) =
15510                    b.inner.initializer.visit_child_mut(ctx, visitor, Path::new(self, NodeField::initializer)) {
15511                    b.initializer(v);
15512                }
15513                b.build(ctx)
15514            }
15515            builder::Builder::TSTypeParameterDeclaration(mut b) => {
15516                if let TransformResult::Changed(v) =
15517                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
15518                    b.params(v);
15519                }
15520                b.build(ctx)
15521            }
15522            builder::Builder::TSTypeParameter(mut b) => {
15523                if let TransformResult::Changed(v) =
15524                    b.inner.name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::name)) {
15525                    b.name(v);
15526                }
15527                if let TransformResult::Changed(v) =
15528                    b.inner.constraint.visit_child_mut(ctx, visitor, Path::new(self, NodeField::constraint)) {
15529                    b.constraint(v);
15530                }
15531                if let TransformResult::Changed(v) =
15532                    b.inner.default.visit_child_mut(ctx, visitor, Path::new(self, NodeField::default)) {
15533                    b.default(v);
15534                }
15535                b.build(ctx)
15536            }
15537            builder::Builder::TSTypeParameterInstantiation(mut b) => {
15538                if let TransformResult::Changed(v) =
15539                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
15540                    b.params(v);
15541                }
15542                b.build(ctx)
15543            }
15544            builder::Builder::TSUnionType(mut b) => {
15545                if let TransformResult::Changed(v) =
15546                    b.inner.types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::types)) {
15547                    b.types(v);
15548                }
15549                b.build(ctx)
15550            }
15551            builder::Builder::TSIntersectionType(mut b) => {
15552                if let TransformResult::Changed(v) =
15553                    b.inner.types.visit_child_mut(ctx, visitor, Path::new(self, NodeField::types)) {
15554                    b.types(v);
15555                }
15556                b.build(ctx)
15557            }
15558            builder::Builder::TSTypeQuery(mut b) => {
15559                if let TransformResult::Changed(v) =
15560                    b.inner.expr_name.visit_child_mut(ctx, visitor, Path::new(self, NodeField::expr_name)) {
15561                    b.expr_name(v);
15562                }
15563                b.build(ctx)
15564            }
15565            builder::Builder::TSConditionalType(mut b) => {
15566                if let TransformResult::Changed(v) =
15567                    b.inner.check_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::check_type)) {
15568                    b.check_type(v);
15569                }
15570                if let TransformResult::Changed(v) =
15571                    b.inner.extends_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::extends_type)) {
15572                    b.extends_type(v);
15573                }
15574                if let TransformResult::Changed(v) =
15575                    b.inner.true_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::true_type)) {
15576                    b.true_type(v);
15577                }
15578                if let TransformResult::Changed(v) =
15579                    b.inner.false_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::false_type)) {
15580                    b.false_type(v);
15581                }
15582                b.build(ctx)
15583            }
15584            builder::Builder::TSTypeLiteral(mut b) => {
15585                if let TransformResult::Changed(v) =
15586                    b.inner.members.visit_child_mut(ctx, visitor, Path::new(self, NodeField::members)) {
15587                    b.members(v);
15588                }
15589                b.build(ctx)
15590            }
15591            builder::Builder::TSPropertySignature(mut b) => {
15592                if let TransformResult::Changed(v) =
15593                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
15594                    b.key(v);
15595                }
15596                if let TransformResult::Changed(v) =
15597                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15598                    b.type_annotation(v);
15599                }
15600                if let TransformResult::Changed(v) =
15601                    b.inner.initializer.visit_child_mut(ctx, visitor, Path::new(self, NodeField::initializer)) {
15602                    b.initializer(v);
15603                }
15604                b.build(ctx)
15605            }
15606            builder::Builder::TSMethodSignature(mut b) => {
15607                if let TransformResult::Changed(v) =
15608                    b.inner.key.visit_child_mut(ctx, visitor, Path::new(self, NodeField::key)) {
15609                    b.key(v);
15610                }
15611                if let TransformResult::Changed(v) =
15612                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
15613                    b.params(v);
15614                }
15615                if let TransformResult::Changed(v) =
15616                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
15617                    b.return_type(v);
15618                }
15619                b.build(ctx)
15620            }
15621            builder::Builder::TSIndexSignature(mut b) => {
15622                if let TransformResult::Changed(v) =
15623                    b.inner.parameters.visit_child_mut(ctx, visitor, Path::new(self, NodeField::parameters)) {
15624                    b.parameters(v);
15625                }
15626                if let TransformResult::Changed(v) =
15627                    b.inner.type_annotation.visit_child_mut(ctx, visitor, Path::new(self, NodeField::type_annotation)) {
15628                    b.type_annotation(v);
15629                }
15630                b.build(ctx)
15631            }
15632            builder::Builder::TSCallSignatureDeclaration(mut b) => {
15633                if let TransformResult::Changed(v) =
15634                    b.inner.params.visit_child_mut(ctx, visitor, Path::new(self, NodeField::params)) {
15635                    b.params(v);
15636                }
15637                if let TransformResult::Changed(v) =
15638                    b.inner.return_type.visit_child_mut(ctx, visitor, Path::new(self, NodeField::return_type)) {
15639                    b.return_type(v);
15640                }
15641                b.build(ctx)
15642            }
15643            builder::Builder::TSModifiers(mut b) => b.build(ctx),
15644            builder::Builder::CoverEmptyArgs(mut b) => b.build(ctx),
15645            builder::Builder::CoverTrailingComma(mut b) => b.build(ctx),
15646            builder::Builder::CoverInitializer(mut b) => {
15647                if let TransformResult::Changed(v) =
15648                    b.inner.init.visit_child_mut(ctx, visitor, Path::new(self, NodeField::init)) {
15649                    b.init(v);
15650                }
15651                b.build(ctx)
15652            }
15653            builder::Builder::CoverRestElement(mut b) => {
15654                if let TransformResult::Changed(v) =
15655                    b.inner.rest.visit_child_mut(ctx, visitor, Path::new(self, NodeField::rest)) {
15656                    b.rest(v);
15657                }
15658                b.build(ctx)
15659            }
15660            builder::Builder::CoverTypedIdentifier(mut b) => {
15661                if let TransformResult::Changed(v) =
15662                    b.inner.left.visit_child_mut(ctx, visitor, Path::new(self, NodeField::left)) {
15663                    b.left(v);
15664                }
15665                if let TransformResult::Changed(v) =
15666                    b.inner.right.visit_child_mut(ctx, visitor, Path::new(self, NodeField::right)) {
15667                    b.right(v);
15668                }
15669                b.build(ctx)
15670            }
15671            builder::Builder::SHBuiltin(mut b) => b.build(ctx),
15672            builder::Builder::ImplicitCheckedCast(mut b) => {
15673                if let TransformResult::Changed(v) =
15674                    b.inner.argument.visit_child_mut(ctx, visitor, Path::new(self, NodeField::argument)) {
15675                    b.argument(v);
15676                }
15677                b.build(ctx)
15678            }
15679        }
15680    }
15681
15682    /// Call `cb` on every `NodeList` field of this node, including
15683    /// decoration lists. Used by the GC to mark list elements.
15684    pub fn mark_lists<F: FnMut(&NodeList<'gc>)>(&'gc self, cb: &mut F) {
15685        match self {
15686            Node::Program(n) => { cb(&n.body); cb(&n.decorations.get()); cb(&n.dummy_param_list.get()); }
15687            Node::FunctionExpression(n) => { cb(&n.params); cb(&n.decorations.get()); }
15688            Node::ArrowFunctionExpression(n) => { cb(&n.params); cb(&n.decorations.get()); }
15689            Node::FunctionDeclaration(n) => { cb(&n.params); cb(&n.decorations.get()); }
15690            Node::ComponentDeclaration(n) => { cb(&n.params); cb(&n.decorations.get()); }
15691            Node::HookDeclaration(n) => { cb(&n.params); cb(&n.decorations.get()); }
15692            Node::MatchStatement(n) => { cb(&n.cases); }
15693            Node::BlockStatement(n) => { cb(&n.body); }
15694            Node::StaticBlock(n) => { cb(&n.body); }
15695            Node::SwitchStatement(n) => { cb(&n.cases); }
15696            Node::SequenceExpression(n) => { cb(&n.expressions); }
15697            Node::ObjectExpression(n) => { cb(&n.properties); }
15698            Node::ArrayExpression(n) => { cb(&n.elements); }
15699            Node::NewExpression(n) => { cb(&n.arguments); }
15700            Node::CallExpression(n) => { cb(&n.arguments); }
15701            Node::OptionalCallExpression(n) => { cb(&n.arguments); }
15702            Node::SwitchCase(n) => { cb(&n.consequent); }
15703            Node::VariableDeclaration(n) => { cb(&n.declarations); }
15704            Node::TemplateLiteral(n) => { cb(&n.quasis); cb(&n.expressions); }
15705            Node::ClassDeclaration(n) => { cb(&n.implements); cb(&n.decorators); }
15706            Node::ClassExpression(n) => { cb(&n.implements); cb(&n.decorators); }
15707            Node::ClassBody(n) => { cb(&n.body); }
15708            Node::ClassProperty(n) => { cb(&n.decorators); }
15709            Node::ClassPrivateProperty(n) => { cb(&n.decorators); }
15710            Node::MethodDefinition(n) => { cb(&n.decorators); }
15711            Node::ImportDeclaration(n) => { cb(&n.specifiers); cb(&n.attributes); }
15712            Node::ExportNamedDeclaration(n) => { cb(&n.specifiers); }
15713            Node::ObjectPattern(n) => { cb(&n.properties); }
15714            Node::ArrayPattern(n) => { cb(&n.elements); }
15715            Node::MatchExpression(n) => { cb(&n.cases); }
15716            Node::MatchObjectPattern(n) => { cb(&n.properties); }
15717            Node::MatchArrayPattern(n) => { cb(&n.elements); }
15718            Node::MatchOrPattern(n) => { cb(&n.patterns); }
15719            Node::MatchInstanceObjectPattern(n) => { cb(&n.properties); }
15720            Node::JSXOpeningElement(n) => { cb(&n.attributes); }
15721            Node::JSXElement(n) => { cb(&n.children); }
15722            Node::JSXFragment(n) => { cb(&n.children); }
15723            Node::FunctionTypeAnnotation(n) => { cb(&n.params); }
15724            Node::HookTypeAnnotation(n) => { cb(&n.params); }
15725            Node::ComponentTypeAnnotation(n) => { cb(&n.params); }
15726            Node::TupleTypeAnnotation(n) => { cb(&n.element_types); }
15727            Node::UnionTypeAnnotation(n) => { cb(&n.types); }
15728            Node::IntersectionTypeAnnotation(n) => { cb(&n.types); }
15729            Node::InterfaceTypeAnnotation(n) => { cb(&n.extends); }
15730            Node::InterfaceDeclaration(n) => { cb(&n.extends); }
15731            Node::DeclareInterface(n) => { cb(&n.extends); }
15732            Node::DeclareClass(n) => { cb(&n.extends); cb(&n.implements); cb(&n.mixins); }
15733            Node::DeclareComponent(n) => { cb(&n.params); }
15734            Node::DeclareExportDeclaration(n) => { cb(&n.specifiers); }
15735            Node::ObjectTypeAnnotation(n) => { cb(&n.properties); cb(&n.indexers); cb(&n.call_properties); cb(&n.internal_slots); }
15736            Node::TypeParameterDeclaration(n) => { cb(&n.params); }
15737            Node::TypeParameterInstantiation(n) => { cb(&n.params); }
15738            Node::EnumStringBody(n) => { cb(&n.members); }
15739            Node::EnumNumberBody(n) => { cb(&n.members); }
15740            Node::EnumBigIntBody(n) => { cb(&n.members); }
15741            Node::EnumBooleanBody(n) => { cb(&n.members); }
15742            Node::EnumSymbolBody(n) => { cb(&n.members); }
15743            Node::RecordDeclaration(n) => { cb(&n.implements); }
15744            Node::RecordDeclarationBody(n) => { cb(&n.elements); }
15745            Node::RecordExpressionProperties(n) => { cb(&n.properties); }
15746            Node::TSFunctionType(n) => { cb(&n.params); }
15747            Node::TSConstructorType(n) => { cb(&n.params); }
15748            Node::TSTupleType(n) => { cb(&n.element_types); }
15749            Node::TSInterfaceDeclaration(n) => { cb(&n.extends); }
15750            Node::TSInterfaceBody(n) => { cb(&n.body); }
15751            Node::TSEnumDeclaration(n) => { cb(&n.members); }
15752            Node::TSModuleBlock(n) => { cb(&n.body); }
15753            Node::TSTypeParameterDeclaration(n) => { cb(&n.params); }
15754            Node::TSTypeParameterInstantiation(n) => { cb(&n.params); }
15755            Node::TSUnionType(n) => { cb(&n.types); }
15756            Node::TSIntersectionType(n) => { cb(&n.types); }
15757            Node::TSTypeLiteral(n) => { cb(&n.members); }
15758            Node::TSMethodSignature(n) => { cb(&n.params); }
15759            Node::TSIndexSignature(n) => { cb(&n.parameters); }
15760            Node::TSCallSignatureDeclaration(n) => { cb(&n.params); }
15761            _ => {}
15762        }
15763    }
15764
15765    /// The ESTree node type name — the JSON `"type"` value.
15766    pub fn node_type_str(&self) -> &'static str {
15767        match self {
15768            Node::Empty(_) => "Empty",
15769            Node::Metadata(_) => "Metadata",
15770            Node::Program(_) => "Program",
15771            Node::FunctionExpression(_) => "FunctionExpression",
15772            Node::ArrowFunctionExpression(_) => "ArrowFunctionExpression",
15773            Node::FunctionDeclaration(_) => "FunctionDeclaration",
15774            Node::ComponentDeclaration(_) => "ComponentDeclaration",
15775            Node::HookDeclaration(_) => "HookDeclaration",
15776            Node::MatchStatement(_) => "MatchStatement",
15777            Node::WhileStatement(_) => "WhileStatement",
15778            Node::DoWhileStatement(_) => "DoWhileStatement",
15779            Node::ForInStatement(_) => "ForInStatement",
15780            Node::ForOfStatement(_) => "ForOfStatement",
15781            Node::ForStatement(_) => "ForStatement",
15782            Node::DebuggerStatement(_) => "DebuggerStatement",
15783            Node::EmptyStatement(_) => "EmptyStatement",
15784            Node::BlockStatement(_) => "BlockStatement",
15785            Node::StaticBlock(_) => "StaticBlock",
15786            Node::BreakStatement(_) => "BreakStatement",
15787            Node::ContinueStatement(_) => "ContinueStatement",
15788            Node::ThrowStatement(_) => "ThrowStatement",
15789            Node::ReturnStatement(_) => "ReturnStatement",
15790            Node::WithStatement(_) => "WithStatement",
15791            Node::SwitchStatement(_) => "SwitchStatement",
15792            Node::LabeledStatement(_) => "LabeledStatement",
15793            Node::ExpressionStatement(_) => "ExpressionStatement",
15794            Node::TryStatement(_) => "TryStatement",
15795            Node::IfStatement(_) => "IfStatement",
15796            Node::NullLiteral(_) => "NullLiteral",
15797            Node::BooleanLiteral(_) => "BooleanLiteral",
15798            Node::StringLiteral(_) => "StringLiteral",
15799            Node::NumericLiteral(_) => "NumericLiteral",
15800            Node::RegExpLiteral(_) => "RegExpLiteral",
15801            Node::BigIntLiteral(_) => "BigIntLiteral",
15802            Node::ThisExpression(_) => "ThisExpression",
15803            Node::Super(_) => "Super",
15804            Node::SequenceExpression(_) => "SequenceExpression",
15805            Node::ObjectExpression(_) => "ObjectExpression",
15806            Node::ArrayExpression(_) => "ArrayExpression",
15807            Node::SpreadElement(_) => "SpreadElement",
15808            Node::NewExpression(_) => "NewExpression",
15809            Node::YieldExpression(_) => "YieldExpression",
15810            Node::AwaitExpression(_) => "AwaitExpression",
15811            Node::ImportExpression(_) => "ImportExpression",
15812            Node::CallExpression(_) => "CallExpression",
15813            Node::OptionalCallExpression(_) => "OptionalCallExpression",
15814            Node::AssignmentExpression(_) => "AssignmentExpression",
15815            Node::UnaryExpression(_) => "UnaryExpression",
15816            Node::UpdateExpression(_) => "UpdateExpression",
15817            Node::MemberExpression(_) => "MemberExpression",
15818            Node::OptionalMemberExpression(_) => "OptionalMemberExpression",
15819            Node::LogicalExpression(_) => "LogicalExpression",
15820            Node::ConditionalExpression(_) => "ConditionalExpression",
15821            Node::BinaryExpression(_) => "BinaryExpression",
15822            Node::Directive(_) => "Directive",
15823            Node::DirectiveLiteral(_) => "DirectiveLiteral",
15824            Node::Identifier(_) => "Identifier",
15825            Node::PrivateName(_) => "PrivateName",
15826            Node::MetaProperty(_) => "MetaProperty",
15827            Node::SwitchCase(_) => "SwitchCase",
15828            Node::CatchClause(_) => "CatchClause",
15829            Node::VariableDeclarator(_) => "VariableDeclarator",
15830            Node::VariableDeclaration(_) => "VariableDeclaration",
15831            Node::TemplateLiteral(_) => "TemplateLiteral",
15832            Node::TaggedTemplateExpression(_) => "TaggedTemplateExpression",
15833            Node::TemplateElement(_) => "TemplateElement",
15834            Node::Property(_) => "Property",
15835            Node::Decorator(_) => "Decorator",
15836            Node::ClassDeclaration(_) => "ClassDeclaration",
15837            Node::ClassExpression(_) => "ClassExpression",
15838            Node::ClassBody(_) => "ClassBody",
15839            Node::ClassProperty(_) => "ClassProperty",
15840            Node::ClassPrivateProperty(_) => "ClassPrivateProperty",
15841            Node::MethodDefinition(_) => "MethodDefinition",
15842            Node::ImportDeclaration(_) => "ImportDeclaration",
15843            Node::ImportSpecifier(_) => "ImportSpecifier",
15844            Node::ImportDefaultSpecifier(_) => "ImportDefaultSpecifier",
15845            Node::ImportNamespaceSpecifier(_) => "ImportNamespaceSpecifier",
15846            Node::ImportAttribute(_) => "ImportAttribute",
15847            Node::ExportNamedDeclaration(_) => "ExportNamedDeclaration",
15848            Node::ExportSpecifier(_) => "ExportSpecifier",
15849            Node::ExportNamespaceSpecifier(_) => "ExportNamespaceSpecifier",
15850            Node::ExportDefaultDeclaration(_) => "ExportDefaultDeclaration",
15851            Node::ExportAllDeclaration(_) => "ExportAllDeclaration",
15852            Node::ObjectPattern(_) => "ObjectPattern",
15853            Node::ArrayPattern(_) => "ArrayPattern",
15854            Node::RestElement(_) => "RestElement",
15855            Node::AssignmentPattern(_) => "AssignmentPattern",
15856            Node::MatchStatementCase(_) => "MatchStatementCase",
15857            Node::MatchExpression(_) => "MatchExpression",
15858            Node::MatchExpressionCase(_) => "MatchExpressionCase",
15859            Node::MatchWildcardPattern(_) => "MatchWildcardPattern",
15860            Node::MatchLiteralPattern(_) => "MatchLiteralPattern",
15861            Node::MatchUnaryPattern(_) => "MatchUnaryPattern",
15862            Node::MatchIdentifierPattern(_) => "MatchIdentifierPattern",
15863            Node::MatchBindingPattern(_) => "MatchBindingPattern",
15864            Node::MatchObjectPattern(_) => "MatchObjectPattern",
15865            Node::MatchArrayPattern(_) => "MatchArrayPattern",
15866            Node::MatchOrPattern(_) => "MatchOrPattern",
15867            Node::MatchAsPattern(_) => "MatchAsPattern",
15868            Node::MatchMemberPattern(_) => "MatchMemberPattern",
15869            Node::MatchInstancePattern(_) => "MatchInstancePattern",
15870            Node::MatchObjectPatternProperty(_) => "MatchObjectPatternProperty",
15871            Node::MatchInstanceObjectPattern(_) => "MatchInstanceObjectPattern",
15872            Node::MatchRestPattern(_) => "MatchRestPattern",
15873            Node::JSXIdentifier(_) => "JSXIdentifier",
15874            Node::JSXMemberExpression(_) => "JSXMemberExpression",
15875            Node::JSXNamespacedName(_) => "JSXNamespacedName",
15876            Node::JSXEmptyExpression(_) => "JSXEmptyExpression",
15877            Node::JSXExpressionContainer(_) => "JSXExpressionContainer",
15878            Node::JSXSpreadChild(_) => "JSXSpreadChild",
15879            Node::JSXOpeningElement(_) => "JSXOpeningElement",
15880            Node::JSXClosingElement(_) => "JSXClosingElement",
15881            Node::JSXAttribute(_) => "JSXAttribute",
15882            Node::JSXSpreadAttribute(_) => "JSXSpreadAttribute",
15883            Node::JSXStringLiteral(_) => "JSXStringLiteral",
15884            Node::JSXText(_) => "JSXText",
15885            Node::JSXElement(_) => "JSXElement",
15886            Node::JSXFragment(_) => "JSXFragment",
15887            Node::JSXOpeningFragment(_) => "JSXOpeningFragment",
15888            Node::JSXClosingFragment(_) => "JSXClosingFragment",
15889            Node::ExistsTypeAnnotation(_) => "ExistsTypeAnnotation",
15890            Node::EmptyTypeAnnotation(_) => "EmptyTypeAnnotation",
15891            Node::StringTypeAnnotation(_) => "StringTypeAnnotation",
15892            Node::NumberTypeAnnotation(_) => "NumberTypeAnnotation",
15893            Node::StringLiteralTypeAnnotation(_) => "StringLiteralTypeAnnotation",
15894            Node::NumberLiteralTypeAnnotation(_) => "NumberLiteralTypeAnnotation",
15895            Node::BigIntLiteralTypeAnnotation(_) => "BigIntLiteralTypeAnnotation",
15896            Node::BooleanTypeAnnotation(_) => "BooleanTypeAnnotation",
15897            Node::BooleanLiteralTypeAnnotation(_) => "BooleanLiteralTypeAnnotation",
15898            Node::NullLiteralTypeAnnotation(_) => "NullLiteralTypeAnnotation",
15899            Node::SymbolTypeAnnotation(_) => "SymbolTypeAnnotation",
15900            Node::AnyTypeAnnotation(_) => "AnyTypeAnnotation",
15901            Node::MixedTypeAnnotation(_) => "MixedTypeAnnotation",
15902            Node::BigIntTypeAnnotation(_) => "BigIntTypeAnnotation",
15903            Node::VoidTypeAnnotation(_) => "VoidTypeAnnotation",
15904            Node::NeverTypeAnnotation(_) => "NeverTypeAnnotation",
15905            Node::UnknownTypeAnnotation(_) => "UnknownTypeAnnotation",
15906            Node::UndefinedTypeAnnotation(_) => "UndefinedTypeAnnotation",
15907            Node::FunctionTypeAnnotation(_) => "FunctionTypeAnnotation",
15908            Node::HookTypeAnnotation(_) => "HookTypeAnnotation",
15909            Node::FunctionTypeParam(_) => "FunctionTypeParam",
15910            Node::ComponentTypeAnnotation(_) => "ComponentTypeAnnotation",
15911            Node::ComponentTypeParameter(_) => "ComponentTypeParameter",
15912            Node::NullableTypeAnnotation(_) => "NullableTypeAnnotation",
15913            Node::QualifiedTypeIdentifier(_) => "QualifiedTypeIdentifier",
15914            Node::TypeofTypeAnnotation(_) => "TypeofTypeAnnotation",
15915            Node::KeyofTypeAnnotation(_) => "KeyofTypeAnnotation",
15916            Node::TypeOperator(_) => "TypeOperator",
15917            Node::QualifiedTypeofIdentifier(_) => "QualifiedTypeofIdentifier",
15918            Node::TupleTypeAnnotation(_) => "TupleTypeAnnotation",
15919            Node::TupleTypeSpreadElement(_) => "TupleTypeSpreadElement",
15920            Node::TupleTypeLabeledElement(_) => "TupleTypeLabeledElement",
15921            Node::ArrayTypeAnnotation(_) => "ArrayTypeAnnotation",
15922            Node::InferTypeAnnotation(_) => "InferTypeAnnotation",
15923            Node::UnionTypeAnnotation(_) => "UnionTypeAnnotation",
15924            Node::IntersectionTypeAnnotation(_) => "IntersectionTypeAnnotation",
15925            Node::GenericTypeAnnotation(_) => "GenericTypeAnnotation",
15926            Node::IndexedAccessType(_) => "IndexedAccessType",
15927            Node::OptionalIndexedAccessType(_) => "OptionalIndexedAccessType",
15928            Node::ConditionalTypeAnnotation(_) => "ConditionalTypeAnnotation",
15929            Node::TypePredicate(_) => "TypePredicate",
15930            Node::InterfaceTypeAnnotation(_) => "InterfaceTypeAnnotation",
15931            Node::TypeAlias(_) => "TypeAlias",
15932            Node::OpaqueType(_) => "OpaqueType",
15933            Node::InterfaceDeclaration(_) => "InterfaceDeclaration",
15934            Node::DeclareTypeAlias(_) => "DeclareTypeAlias",
15935            Node::DeclareOpaqueType(_) => "DeclareOpaqueType",
15936            Node::DeclareInterface(_) => "DeclareInterface",
15937            Node::DeclareClass(_) => "DeclareClass",
15938            Node::DeclareFunction(_) => "DeclareFunction",
15939            Node::DeclareHook(_) => "DeclareHook",
15940            Node::DeclareComponent(_) => "DeclareComponent",
15941            Node::DeclareVariable(_) => "DeclareVariable",
15942            Node::DeclareEnum(_) => "DeclareEnum",
15943            Node::DeclareExportDeclaration(_) => "DeclareExportDeclaration",
15944            Node::DeclareExportAllDeclaration(_) => "DeclareExportAllDeclaration",
15945            Node::DeclareModule(_) => "DeclareModule",
15946            Node::DeclareNamespace(_) => "DeclareNamespace",
15947            Node::DeclareModuleExports(_) => "DeclareModuleExports",
15948            Node::InterfaceExtends(_) => "InterfaceExtends",
15949            Node::ClassImplements(_) => "ClassImplements",
15950            Node::TypeAnnotation(_) => "TypeAnnotation",
15951            Node::ObjectTypeAnnotation(_) => "ObjectTypeAnnotation",
15952            Node::ObjectTypeProperty(_) => "ObjectTypeProperty",
15953            Node::ObjectTypeSpreadProperty(_) => "ObjectTypeSpreadProperty",
15954            Node::ObjectTypeInternalSlot(_) => "ObjectTypeInternalSlot",
15955            Node::ObjectTypeCallProperty(_) => "ObjectTypeCallProperty",
15956            Node::ObjectTypeIndexer(_) => "ObjectTypeIndexer",
15957            Node::ObjectTypeMappedTypeProperty(_) => "ObjectTypeMappedTypeProperty",
15958            Node::Variance(_) => "Variance",
15959            Node::TypeParameterDeclaration(_) => "TypeParameterDeclaration",
15960            Node::TypeParameter(_) => "TypeParameter",
15961            Node::TypeParameterInstantiation(_) => "TypeParameterInstantiation",
15962            Node::TypeCastExpression(_) => "TypeCastExpression",
15963            Node::AsExpression(_) => "AsExpression",
15964            Node::AsConstExpression(_) => "AsConstExpression",
15965            Node::InferredPredicate(_) => "InferredPredicate",
15966            Node::DeclaredPredicate(_) => "DeclaredPredicate",
15967            Node::EnumDeclaration(_) => "EnumDeclaration",
15968            Node::EnumStringBody(_) => "EnumStringBody",
15969            Node::EnumNumberBody(_) => "EnumNumberBody",
15970            Node::EnumBigIntBody(_) => "EnumBigIntBody",
15971            Node::EnumBooleanBody(_) => "EnumBooleanBody",
15972            Node::EnumSymbolBody(_) => "EnumSymbolBody",
15973            Node::EnumDefaultedMember(_) => "EnumDefaultedMember",
15974            Node::EnumStringMember(_) => "EnumStringMember",
15975            Node::EnumNumberMember(_) => "EnumNumberMember",
15976            Node::EnumBigIntMember(_) => "EnumBigIntMember",
15977            Node::EnumBooleanMember(_) => "EnumBooleanMember",
15978            Node::ComponentParameter(_) => "ComponentParameter",
15979            Node::RecordDeclaration(_) => "RecordDeclaration",
15980            Node::RecordDeclarationImplements(_) => "RecordDeclarationImplements",
15981            Node::RecordDeclarationBody(_) => "RecordDeclarationBody",
15982            Node::RecordDeclarationProperty(_) => "RecordDeclarationProperty",
15983            Node::RecordDeclarationStaticProperty(_) => "RecordDeclarationStaticProperty",
15984            Node::RecordExpression(_) => "RecordExpression",
15985            Node::RecordExpressionProperties(_) => "RecordExpressionProperties",
15986            Node::TSTypeAnnotation(_) => "TSTypeAnnotation",
15987            Node::TSAnyKeyword(_) => "TSAnyKeyword",
15988            Node::TSNumberKeyword(_) => "TSNumberKeyword",
15989            Node::TSBooleanKeyword(_) => "TSBooleanKeyword",
15990            Node::TSStringKeyword(_) => "TSStringKeyword",
15991            Node::TSSymbolKeyword(_) => "TSSymbolKeyword",
15992            Node::TSVoidKeyword(_) => "TSVoidKeyword",
15993            Node::TSUndefinedKeyword(_) => "TSUndefinedKeyword",
15994            Node::TSUnknownKeyword(_) => "TSUnknownKeyword",
15995            Node::TSNeverKeyword(_) => "TSNeverKeyword",
15996            Node::TSBigIntKeyword(_) => "TSBigIntKeyword",
15997            Node::TSThisType(_) => "TSThisType",
15998            Node::TSLiteralType(_) => "TSLiteralType",
15999            Node::TSIndexedAccessType(_) => "TSIndexedAccessType",
16000            Node::TSArrayType(_) => "TSArrayType",
16001            Node::TSTypeReference(_) => "TSTypeReference",
16002            Node::TSQualifiedName(_) => "TSQualifiedName",
16003            Node::TSFunctionType(_) => "TSFunctionType",
16004            Node::TSConstructorType(_) => "TSConstructorType",
16005            Node::TSTypePredicate(_) => "TSTypePredicate",
16006            Node::TSTupleType(_) => "TSTupleType",
16007            Node::TSTypeAssertion(_) => "TSTypeAssertion",
16008            Node::TSAsExpression(_) => "TSAsExpression",
16009            Node::TSParameterProperty(_) => "TSParameterProperty",
16010            Node::TSTypeAliasDeclaration(_) => "TSTypeAliasDeclaration",
16011            Node::TSInterfaceDeclaration(_) => "TSInterfaceDeclaration",
16012            Node::TSInterfaceHeritage(_) => "TSInterfaceHeritage",
16013            Node::TSInterfaceBody(_) => "TSInterfaceBody",
16014            Node::TSEnumDeclaration(_) => "TSEnumDeclaration",
16015            Node::TSEnumMember(_) => "TSEnumMember",
16016            Node::TSModuleDeclaration(_) => "TSModuleDeclaration",
16017            Node::TSModuleBlock(_) => "TSModuleBlock",
16018            Node::TSModuleMember(_) => "TSModuleMember",
16019            Node::TSTypeParameterDeclaration(_) => "TSTypeParameterDeclaration",
16020            Node::TSTypeParameter(_) => "TSTypeParameter",
16021            Node::TSTypeParameterInstantiation(_) => "TSTypeParameterInstantiation",
16022            Node::TSUnionType(_) => "TSUnionType",
16023            Node::TSIntersectionType(_) => "TSIntersectionType",
16024            Node::TSTypeQuery(_) => "TSTypeQuery",
16025            Node::TSConditionalType(_) => "TSConditionalType",
16026            Node::TSTypeLiteral(_) => "TSTypeLiteral",
16027            Node::TSPropertySignature(_) => "TSPropertySignature",
16028            Node::TSMethodSignature(_) => "TSMethodSignature",
16029            Node::TSIndexSignature(_) => "TSIndexSignature",
16030            Node::TSCallSignatureDeclaration(_) => "TSCallSignatureDeclaration",
16031            Node::TSModifiers(_) => "TSModifiers",
16032            Node::CoverEmptyArgs(_) => "CoverEmptyArgs",
16033            Node::CoverTrailingComma(_) => "CoverTrailingComma",
16034            Node::CoverInitializer(_) => "CoverInitializer",
16035            Node::CoverRestElement(_) => "CoverRestElement",
16036            Node::CoverTypedIdentifier(_) => "CoverTypedIdentifier",
16037            Node::SHBuiltin(_) => "SHBuiltin",
16038            Node::ImplicitCheckedCast(_) => "ImplicitCheckedCast",
16039        }
16040    }
16041
16042    /// Emit this node's `.def` child fields as JSON key/values,
16043    /// in declared order. Mirrors C++ `visitChildren`.
16044    pub fn dump_children<'a, 'w>(
16045        &'gc self,
16046        d: &mut crate::dump::ESTreeJSONDumper<'a, 'w>,
16047    ) {
16048        match self {
16049            Node::Empty(_) => {}
16050            Node::Metadata(_) => {}
16051            Node::Program(n) => {
16052                d.field_list("body", n.body, false);
16053            }
16054            Node::FunctionExpression(n) => {
16055                d.field_node("id", n.id, false);
16056                d.field_list("params", n.params, false);
16057                d.field_node("body", Some(n.body), false);
16058                d.field_node("typeParameters", n.type_parameters, true);
16059                d.field_node("returnType", n.return_type, true);
16060                d.field_node("predicate", n.predicate, true);
16061                d.field_bool("generator", n.generator.get(), false);
16062                d.field_bool("async", n.r#async.get(), false);
16063            }
16064            Node::ArrowFunctionExpression(n) => {
16065                d.field_list("params", n.params, false);
16066                d.field_node("body", Some(n.body), false);
16067                d.field_node("typeParameters", n.type_parameters, true);
16068                d.field_node("returnType", n.return_type, true);
16069                d.field_node("predicate", n.predicate, true);
16070                d.field_bool("expression", n.expression.get(), false);
16071                d.field_bool("async", n.r#async.get(), false);
16072            }
16073            Node::FunctionDeclaration(n) => {
16074                d.field_node("id", n.id, false);
16075                d.field_list("params", n.params, false);
16076                d.field_node("body", Some(n.body), false);
16077                d.field_node("typeParameters", n.type_parameters, true);
16078                d.field_node("returnType", n.return_type, true);
16079                d.field_node("predicate", n.predicate, true);
16080                d.field_bool("generator", n.generator.get(), false);
16081                d.field_bool("async", n.r#async.get(), false);
16082            }
16083            Node::ComponentDeclaration(n) => {
16084                d.field_node("id", Some(n.id), false);
16085                d.field_list("params", n.params, false);
16086                d.field_node("body", Some(n.body), false);
16087                d.field_node("typeParameters", n.type_parameters, true);
16088                d.field_node("rendersType", n.renders_type, true);
16089                d.field_bool("async", n.r#async.get(), false);
16090            }
16091            Node::HookDeclaration(n) => {
16092                d.field_node("id", Some(n.id), false);
16093                d.field_list("params", n.params, false);
16094                d.field_node("body", Some(n.body), false);
16095                d.field_node("typeParameters", n.type_parameters, true);
16096                d.field_node("returnType", n.return_type, true);
16097                d.field_bool("async", n.r#async.get(), false);
16098            }
16099            Node::MatchStatement(n) => {
16100                d.field_node("argument", Some(n.argument), false);
16101                d.field_list("cases", n.cases, false);
16102            }
16103            Node::WhileStatement(n) => {
16104                d.field_node("body", Some(n.body), false);
16105                d.field_node("test", Some(n.test), false);
16106            }
16107            Node::DoWhileStatement(n) => {
16108                d.field_node("body", Some(n.body), false);
16109                d.field_node("test", Some(n.test), false);
16110            }
16111            Node::ForInStatement(n) => {
16112                d.field_node("left", Some(n.left), false);
16113                d.field_node("right", Some(n.right), false);
16114                d.field_node("body", Some(n.body), false);
16115            }
16116            Node::ForOfStatement(n) => {
16117                d.field_node("left", Some(n.left), false);
16118                d.field_node("right", Some(n.right), false);
16119                d.field_node("body", Some(n.body), false);
16120                d.field_bool("await", n.r#await.get(), false);
16121            }
16122            Node::ForStatement(n) => {
16123                d.field_node("init", n.init, false);
16124                d.field_node("test", n.test, false);
16125                d.field_node("update", n.update, false);
16126                d.field_node("body", Some(n.body), false);
16127            }
16128            Node::DebuggerStatement(_) => {}
16129            Node::EmptyStatement(_) => {}
16130            Node::BlockStatement(n) => {
16131                d.field_list("body", n.body, false);
16132                d.field_bool("implicit", n.implicit.get(), true);
16133            }
16134            Node::StaticBlock(n) => {
16135                d.field_list("body", n.body, false);
16136            }
16137            Node::BreakStatement(n) => {
16138                d.field_node("label", n.label, false);
16139            }
16140            Node::ContinueStatement(n) => {
16141                d.field_node("label", n.label, false);
16142            }
16143            Node::ThrowStatement(n) => {
16144                d.field_node("argument", Some(n.argument), false);
16145            }
16146            Node::ReturnStatement(n) => {
16147                d.field_node("argument", n.argument, false);
16148            }
16149            Node::WithStatement(n) => {
16150                d.field_node("object", Some(n.object), false);
16151                d.field_node("body", Some(n.body), false);
16152            }
16153            Node::SwitchStatement(n) => {
16154                d.field_node("discriminant", Some(n.discriminant), false);
16155                d.field_list("cases", n.cases, false);
16156            }
16157            Node::LabeledStatement(n) => {
16158                d.field_node("label", Some(n.label), false);
16159                d.field_node("body", Some(n.body), false);
16160            }
16161            Node::ExpressionStatement(n) => {
16162                d.field_node("expression", Some(n.expression), false);
16163                d.field_label("directive", n.directive.get(), false);
16164            }
16165            Node::TryStatement(n) => {
16166                d.field_node("block", Some(n.block), false);
16167                d.field_node("handler", n.handler, false);
16168                d.field_node("finalizer", n.finalizer, false);
16169            }
16170            Node::IfStatement(n) => {
16171                d.field_node("test", Some(n.test), false);
16172                d.field_node("consequent", Some(n.consequent), false);
16173                d.field_node("alternate", n.alternate, false);
16174            }
16175            Node::NullLiteral(_) => {}
16176            Node::BooleanLiteral(n) => {
16177                d.field_bool("value", n.value.get(), false);
16178            }
16179            Node::StringLiteral(n) => {
16180                d.field_label("value", n.value.get(), false);
16181            }
16182            Node::NumericLiteral(n) => {
16183                d.field_number("value", n.value.get(), false);
16184            }
16185            Node::RegExpLiteral(n) => {
16186                d.field_label("pattern", n.pattern.get(), false);
16187                d.field_label("flags", n.flags.get(), false);
16188            }
16189            Node::BigIntLiteral(n) => {
16190                d.field_label("bigint", n.bigint.get(), false);
16191            }
16192            Node::ThisExpression(_) => {}
16193            Node::Super(_) => {}
16194            Node::SequenceExpression(n) => {
16195                d.field_list("expressions", n.expressions, false);
16196            }
16197            Node::ObjectExpression(n) => {
16198                d.field_list("properties", n.properties, false);
16199            }
16200            Node::ArrayExpression(n) => {
16201                d.field_list("elements", n.elements, false);
16202                d.field_bool("trailingComma", n.trailing_comma.get(), false);
16203            }
16204            Node::SpreadElement(n) => {
16205                d.field_node("argument", Some(n.argument), false);
16206            }
16207            Node::NewExpression(n) => {
16208                d.field_node("callee", Some(n.callee), false);
16209                d.field_node("typeArguments", n.type_arguments, true);
16210                d.field_list("arguments", n.arguments, false);
16211            }
16212            Node::YieldExpression(n) => {
16213                d.field_node("argument", n.argument, false);
16214                d.field_bool("delegate", n.delegate.get(), false);
16215            }
16216            Node::AwaitExpression(n) => {
16217                d.field_node("argument", Some(n.argument), false);
16218            }
16219            Node::ImportExpression(n) => {
16220                d.field_node("source", Some(n.source), false);
16221                d.field_node("options", n.options, false);
16222            }
16223            Node::CallExpression(n) => {
16224                d.field_node("callee", Some(n.callee), false);
16225                d.field_node("typeArguments", n.type_arguments, true);
16226                d.field_list("arguments", n.arguments, false);
16227            }
16228            Node::OptionalCallExpression(n) => {
16229                d.field_node("callee", Some(n.callee), false);
16230                d.field_node("typeArguments", n.type_arguments, true);
16231                d.field_list("arguments", n.arguments, false);
16232                d.field_bool("optional", n.optional.get(), false);
16233            }
16234            Node::AssignmentExpression(n) => {
16235                d.field_label("operator", n.operator.get(), false);
16236                d.field_node("left", Some(n.left), false);
16237                d.field_node("right", Some(n.right), false);
16238            }
16239            Node::UnaryExpression(n) => {
16240                d.field_label("operator", n.operator.get(), false);
16241                d.field_node("argument", Some(n.argument), false);
16242                d.field_bool("prefix", n.prefix.get(), false);
16243            }
16244            Node::UpdateExpression(n) => {
16245                d.field_label("operator", n.operator.get(), false);
16246                d.field_node("argument", Some(n.argument), false);
16247                d.field_bool("prefix", n.prefix.get(), false);
16248            }
16249            Node::MemberExpression(n) => {
16250                d.field_node("object", Some(n.object), false);
16251                d.field_node("property", Some(n.property), false);
16252                d.field_bool("computed", n.computed.get(), false);
16253            }
16254            Node::OptionalMemberExpression(n) => {
16255                d.field_node("object", Some(n.object), false);
16256                d.field_node("property", Some(n.property), false);
16257                d.field_bool("computed", n.computed.get(), false);
16258                d.field_bool("optional", n.optional.get(), false);
16259            }
16260            Node::LogicalExpression(n) => {
16261                d.field_node("left", Some(n.left), false);
16262                d.field_node("right", Some(n.right), false);
16263                d.field_label("operator", n.operator.get(), false);
16264            }
16265            Node::ConditionalExpression(n) => {
16266                d.field_node("test", Some(n.test), false);
16267                d.field_node("alternate", Some(n.alternate), false);
16268                d.field_node("consequent", Some(n.consequent), false);
16269            }
16270            Node::BinaryExpression(n) => {
16271                d.field_node("left", Some(n.left), false);
16272                d.field_node("right", Some(n.right), false);
16273                d.field_label("operator", n.operator.get(), false);
16274            }
16275            Node::Directive(n) => {
16276                d.field_node("value", Some(n.value), false);
16277            }
16278            Node::DirectiveLiteral(n) => {
16279                d.field_label("value", n.value.get(), false);
16280            }
16281            Node::Identifier(n) => {
16282                d.field_label("name", n.name.get(), false);
16283                d.field_node("typeAnnotation", n.type_annotation, true);
16284                d.field_bool("optional", n.optional.get(), true);
16285            }
16286            Node::PrivateName(n) => {
16287                d.field_node("id", Some(n.id), false);
16288            }
16289            Node::MetaProperty(n) => {
16290                d.field_node("meta", Some(n.meta), false);
16291                d.field_node("property", Some(n.property), false);
16292            }
16293            Node::SwitchCase(n) => {
16294                d.field_node("test", n.test, false);
16295                d.field_list("consequent", n.consequent, false);
16296            }
16297            Node::CatchClause(n) => {
16298                d.field_node("param", n.param, false);
16299                d.field_node("body", Some(n.body), false);
16300            }
16301            Node::VariableDeclarator(n) => {
16302                d.field_node("init", n.init, false);
16303                d.field_node("id", Some(n.id), false);
16304            }
16305            Node::VariableDeclaration(n) => {
16306                d.field_label("kind", n.kind.get(), false);
16307                d.field_list("declarations", n.declarations, false);
16308            }
16309            Node::TemplateLiteral(n) => {
16310                d.field_list("quasis", n.quasis, false);
16311                d.field_list("expressions", n.expressions, false);
16312            }
16313            Node::TaggedTemplateExpression(n) => {
16314                d.field_node("tag", Some(n.tag), false);
16315                d.field_node("quasi", Some(n.quasi), false);
16316            }
16317            Node::TemplateElement(n) => {
16318                d.field_bool("tail", n.tail.get(), false);
16319                d.field_label("cooked", n.cooked.get(), false);
16320                d.field_label("raw", n.raw.get(), false);
16321            }
16322            Node::Property(n) => {
16323                d.field_node("key", Some(n.key), false);
16324                d.field_node("value", Some(n.value), false);
16325                d.field_label("kind", n.kind.get(), false);
16326                d.field_bool("computed", n.computed.get(), false);
16327                d.field_bool("method", n.method.get(), false);
16328                d.field_bool("shorthand", n.shorthand.get(), false);
16329            }
16330            Node::Decorator(n) => {
16331                d.field_node("expression", Some(n.expression), false);
16332            }
16333            Node::ClassDeclaration(n) => {
16334                d.field_node("id", n.id, false);
16335                d.field_node("typeParameters", n.type_parameters, true);
16336                d.field_node("superClass", n.super_class, false);
16337                d.field_node("superTypeArguments", n.super_type_arguments, true);
16338                d.field_list("implements", n.implements, true);
16339                d.field_list("decorators", n.decorators, true);
16340                d.field_node("body", Some(n.body), false);
16341            }
16342            Node::ClassExpression(n) => {
16343                d.field_node("id", n.id, false);
16344                d.field_node("typeParameters", n.type_parameters, true);
16345                d.field_node("superClass", n.super_class, false);
16346                d.field_node("superTypeArguments", n.super_type_arguments, true);
16347                d.field_list("implements", n.implements, true);
16348                d.field_list("decorators", n.decorators, true);
16349                d.field_node("body", Some(n.body), false);
16350            }
16351            Node::ClassBody(n) => {
16352                d.field_list("body", n.body, false);
16353            }
16354            Node::ClassProperty(n) => {
16355                d.field_node("key", Some(n.key), false);
16356                d.field_node("value", n.value, false);
16357                d.field_bool("computed", n.computed.get(), false);
16358                d.field_bool("static", n.r#static.get(), false);
16359                d.field_list("decorators", n.decorators, true);
16360                d.field_bool("declare", n.declare.get(), false);
16361                d.field_bool("optional", n.optional.get(), true);
16362                d.field_node("variance", n.variance, true);
16363                d.field_node("typeAnnotation", n.type_annotation, true);
16364                d.field_node("tsModifiers", n.ts_modifiers, true);
16365            }
16366            Node::ClassPrivateProperty(n) => {
16367                d.field_node("key", Some(n.key), false);
16368                d.field_node("value", n.value, false);
16369                d.field_bool("static", n.r#static.get(), false);
16370                d.field_list("decorators", n.decorators, true);
16371                d.field_bool("declare", n.declare.get(), false);
16372                d.field_bool("optional", n.optional.get(), true);
16373                d.field_node("variance", n.variance, true);
16374                d.field_node("typeAnnotation", n.type_annotation, true);
16375                d.field_node("tsModifiers", n.ts_modifiers, true);
16376            }
16377            Node::MethodDefinition(n) => {
16378                d.field_node("key", Some(n.key), false);
16379                d.field_node("value", Some(n.value), false);
16380                d.field_label("kind", n.kind.get(), false);
16381                d.field_bool("computed", n.computed.get(), false);
16382                d.field_bool("static", n.r#static.get(), false);
16383                d.field_list("decorators", n.decorators, true);
16384            }
16385            Node::ImportDeclaration(n) => {
16386                d.field_list("specifiers", n.specifiers, false);
16387                d.field_node("source", Some(n.source), false);
16388                d.field_list("attributes", n.attributes, false);
16389                d.field_label("importKind", n.import_kind.get(), false);
16390            }
16391            Node::ImportSpecifier(n) => {
16392                d.field_node("imported", Some(n.imported), false);
16393                d.field_node("local", Some(n.local), false);
16394                d.field_label("importKind", n.import_kind.get(), false);
16395            }
16396            Node::ImportDefaultSpecifier(n) => {
16397                d.field_node("local", Some(n.local), false);
16398            }
16399            Node::ImportNamespaceSpecifier(n) => {
16400                d.field_node("local", Some(n.local), false);
16401            }
16402            Node::ImportAttribute(n) => {
16403                d.field_node("key", Some(n.key), false);
16404                d.field_node("value", Some(n.value), false);
16405            }
16406            Node::ExportNamedDeclaration(n) => {
16407                d.field_node("declaration", n.declaration, false);
16408                d.field_list("specifiers", n.specifiers, false);
16409                d.field_node("source", n.source, false);
16410                d.field_label("exportKind", n.export_kind.get(), false);
16411            }
16412            Node::ExportSpecifier(n) => {
16413                d.field_node("exported", Some(n.exported), false);
16414                d.field_node("local", Some(n.local), false);
16415            }
16416            Node::ExportNamespaceSpecifier(n) => {
16417                d.field_node("exported", Some(n.exported), false);
16418            }
16419            Node::ExportDefaultDeclaration(n) => {
16420                d.field_node("declaration", Some(n.declaration), false);
16421            }
16422            Node::ExportAllDeclaration(n) => {
16423                d.field_node("source", Some(n.source), false);
16424                d.field_label("exportKind", n.export_kind.get(), false);
16425            }
16426            Node::ObjectPattern(n) => {
16427                d.field_list("properties", n.properties, false);
16428                d.field_node("typeAnnotation", n.type_annotation, true);
16429            }
16430            Node::ArrayPattern(n) => {
16431                d.field_list("elements", n.elements, false);
16432                d.field_node("typeAnnotation", n.type_annotation, true);
16433            }
16434            Node::RestElement(n) => {
16435                d.field_node("argument", Some(n.argument), false);
16436            }
16437            Node::AssignmentPattern(n) => {
16438                d.field_node("left", Some(n.left), false);
16439                d.field_node("right", Some(n.right), false);
16440            }
16441            Node::MatchStatementCase(n) => {
16442                d.field_node("pattern", Some(n.pattern), false);
16443                d.field_node("body", Some(n.body), false);
16444                d.field_node("guard", n.guard, false);
16445            }
16446            Node::MatchExpression(n) => {
16447                d.field_node("argument", Some(n.argument), false);
16448                d.field_list("cases", n.cases, false);
16449            }
16450            Node::MatchExpressionCase(n) => {
16451                d.field_node("pattern", Some(n.pattern), false);
16452                d.field_node("body", Some(n.body), false);
16453                d.field_node("guard", n.guard, false);
16454            }
16455            Node::MatchWildcardPattern(_) => {}
16456            Node::MatchLiteralPattern(n) => {
16457                d.field_node("literal", Some(n.literal), false);
16458            }
16459            Node::MatchUnaryPattern(n) => {
16460                d.field_node("argument", Some(n.argument), false);
16461                d.field_label("operator", n.operator.get(), false);
16462            }
16463            Node::MatchIdentifierPattern(n) => {
16464                d.field_node("id", Some(n.id), false);
16465            }
16466            Node::MatchBindingPattern(n) => {
16467                d.field_node("id", Some(n.id), false);
16468                d.field_label("kind", n.kind.get(), false);
16469            }
16470            Node::MatchObjectPattern(n) => {
16471                d.field_list("properties", n.properties, false);
16472                d.field_node("rest", n.rest, false);
16473            }
16474            Node::MatchArrayPattern(n) => {
16475                d.field_list("elements", n.elements, false);
16476                d.field_node("rest", n.rest, false);
16477            }
16478            Node::MatchOrPattern(n) => {
16479                d.field_list("patterns", n.patterns, false);
16480            }
16481            Node::MatchAsPattern(n) => {
16482                d.field_node("pattern", Some(n.pattern), false);
16483                d.field_node("target", Some(n.target), false);
16484            }
16485            Node::MatchMemberPattern(n) => {
16486                d.field_node("base", Some(n.base), false);
16487                d.field_node("property", Some(n.property), false);
16488            }
16489            Node::MatchInstancePattern(n) => {
16490                d.field_node("targetConstructor", Some(n.target_constructor), false);
16491                d.field_node("properties", Some(n.properties), false);
16492            }
16493            Node::MatchObjectPatternProperty(n) => {
16494                d.field_node("key", Some(n.key), false);
16495                d.field_node("pattern", Some(n.pattern), false);
16496                d.field_bool("shorthand", n.shorthand.get(), false);
16497            }
16498            Node::MatchInstanceObjectPattern(n) => {
16499                d.field_list("properties", n.properties, false);
16500                d.field_node("rest", n.rest, false);
16501            }
16502            Node::MatchRestPattern(n) => {
16503                d.field_node("argument", n.argument, false);
16504            }
16505            Node::JSXIdentifier(n) => {
16506                d.field_label("name", n.name.get(), false);
16507            }
16508            Node::JSXMemberExpression(n) => {
16509                d.field_node("object", Some(n.object), false);
16510                d.field_node("property", Some(n.property), false);
16511            }
16512            Node::JSXNamespacedName(n) => {
16513                d.field_node("namespace", Some(n.namespace), false);
16514                d.field_node("name", Some(n.name), false);
16515            }
16516            Node::JSXEmptyExpression(_) => {}
16517            Node::JSXExpressionContainer(n) => {
16518                d.field_node("expression", Some(n.expression), false);
16519            }
16520            Node::JSXSpreadChild(n) => {
16521                d.field_node("expression", Some(n.expression), false);
16522            }
16523            Node::JSXOpeningElement(n) => {
16524                d.field_node("name", Some(n.name), false);
16525                d.field_list("attributes", n.attributes, false);
16526                d.field_bool("selfClosing", n.self_closing.get(), false);
16527                d.field_node("typeArguments", n.type_arguments, true);
16528            }
16529            Node::JSXClosingElement(n) => {
16530                d.field_node("name", Some(n.name), false);
16531            }
16532            Node::JSXAttribute(n) => {
16533                d.field_node("name", Some(n.name), false);
16534                d.field_node("value", n.value, false);
16535            }
16536            Node::JSXSpreadAttribute(n) => {
16537                d.field_node("argument", Some(n.argument), false);
16538            }
16539            Node::JSXStringLiteral(n) => {
16540                d.field_label("value", n.value.get(), false);
16541                d.field_label("raw", n.raw.get(), false);
16542            }
16543            Node::JSXText(n) => {
16544                d.field_label("value", n.value.get(), false);
16545                d.field_label("raw", n.raw.get(), false);
16546            }
16547            Node::JSXElement(n) => {
16548                d.field_node("openingElement", Some(n.opening_element), false);
16549                d.field_list("children", n.children, false);
16550                d.field_node("closingElement", n.closing_element, false);
16551            }
16552            Node::JSXFragment(n) => {
16553                d.field_node("openingFragment", Some(n.opening_fragment), false);
16554                d.field_list("children", n.children, false);
16555                d.field_node("closingFragment", Some(n.closing_fragment), false);
16556            }
16557            Node::JSXOpeningFragment(_) => {}
16558            Node::JSXClosingFragment(_) => {}
16559            Node::ExistsTypeAnnotation(_) => {}
16560            Node::EmptyTypeAnnotation(_) => {}
16561            Node::StringTypeAnnotation(_) => {}
16562            Node::NumberTypeAnnotation(_) => {}
16563            Node::StringLiteralTypeAnnotation(n) => {
16564                d.field_label("value", n.value.get(), false);
16565                d.field_label("raw", n.raw.get(), false);
16566            }
16567            Node::NumberLiteralTypeAnnotation(n) => {
16568                d.field_number("value", n.value.get(), false);
16569                d.field_label("raw", n.raw.get(), false);
16570            }
16571            Node::BigIntLiteralTypeAnnotation(n) => {
16572                d.field_label("raw", n.raw.get(), false);
16573            }
16574            Node::BooleanTypeAnnotation(_) => {}
16575            Node::BooleanLiteralTypeAnnotation(n) => {
16576                d.field_bool("value", n.value.get(), false);
16577                d.field_label("raw", n.raw.get(), false);
16578            }
16579            Node::NullLiteralTypeAnnotation(_) => {}
16580            Node::SymbolTypeAnnotation(_) => {}
16581            Node::AnyTypeAnnotation(_) => {}
16582            Node::MixedTypeAnnotation(_) => {}
16583            Node::BigIntTypeAnnotation(_) => {}
16584            Node::VoidTypeAnnotation(_) => {}
16585            Node::NeverTypeAnnotation(_) => {}
16586            Node::UnknownTypeAnnotation(_) => {}
16587            Node::UndefinedTypeAnnotation(_) => {}
16588            Node::FunctionTypeAnnotation(n) => {
16589                d.field_list("params", n.params, false);
16590                d.field_node("this", n.this, false);
16591                d.field_node("returnType", Some(n.return_type), false);
16592                d.field_node("rest", n.rest, false);
16593                d.field_node("typeParameters", n.type_parameters, false);
16594            }
16595            Node::HookTypeAnnotation(n) => {
16596                d.field_list("params", n.params, false);
16597                d.field_node("returnType", Some(n.return_type), false);
16598                d.field_node("rest", n.rest, false);
16599                d.field_node("typeParameters", n.type_parameters, false);
16600            }
16601            Node::FunctionTypeParam(n) => {
16602                d.field_node("name", n.name, false);
16603                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16604                d.field_bool("optional", n.optional.get(), false);
16605            }
16606            Node::ComponentTypeAnnotation(n) => {
16607                d.field_list("params", n.params, false);
16608                d.field_node("rest", n.rest, false);
16609                d.field_node("typeParameters", n.type_parameters, false);
16610                d.field_node("rendersType", n.renders_type, false);
16611            }
16612            Node::ComponentTypeParameter(n) => {
16613                d.field_node("name", n.name, false);
16614                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16615                d.field_bool("optional", n.optional.get(), false);
16616            }
16617            Node::NullableTypeAnnotation(n) => {
16618                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16619            }
16620            Node::QualifiedTypeIdentifier(n) => {
16621                d.field_node("qualification", Some(n.qualification), false);
16622                d.field_node("id", Some(n.id), false);
16623            }
16624            Node::TypeofTypeAnnotation(n) => {
16625                d.field_node("argument", Some(n.argument), false);
16626                d.field_node("typeArguments", n.type_arguments, true);
16627            }
16628            Node::KeyofTypeAnnotation(n) => {
16629                d.field_node("argument", Some(n.argument), false);
16630            }
16631            Node::TypeOperator(n) => {
16632                d.field_label("operator", n.operator.get(), false);
16633                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16634            }
16635            Node::QualifiedTypeofIdentifier(n) => {
16636                d.field_node("qualification", Some(n.qualification), false);
16637                d.field_node("id", Some(n.id), false);
16638            }
16639            Node::TupleTypeAnnotation(n) => {
16640                d.field_list("elementTypes", n.element_types, false);
16641                d.field_bool("inexact", n.inexact.get(), false);
16642            }
16643            Node::TupleTypeSpreadElement(n) => {
16644                d.field_node("label", n.label, false);
16645                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16646            }
16647            Node::TupleTypeLabeledElement(n) => {
16648                d.field_node("label", Some(n.label), false);
16649                d.field_node("elementType", Some(n.element_type), false);
16650                d.field_bool("optional", n.optional.get(), false);
16651                d.field_node("variance", n.variance, false);
16652            }
16653            Node::ArrayTypeAnnotation(n) => {
16654                d.field_node("elementType", Some(n.element_type), false);
16655            }
16656            Node::InferTypeAnnotation(n) => {
16657                d.field_node("typeParameter", Some(n.type_parameter), false);
16658            }
16659            Node::UnionTypeAnnotation(n) => {
16660                d.field_list("types", n.types, false);
16661            }
16662            Node::IntersectionTypeAnnotation(n) => {
16663                d.field_list("types", n.types, false);
16664            }
16665            Node::GenericTypeAnnotation(n) => {
16666                d.field_node("id", Some(n.id), false);
16667                d.field_node("typeParameters", n.type_parameters, false);
16668            }
16669            Node::IndexedAccessType(n) => {
16670                d.field_node("objectType", Some(n.object_type), false);
16671                d.field_node("indexType", Some(n.index_type), false);
16672            }
16673            Node::OptionalIndexedAccessType(n) => {
16674                d.field_node("objectType", Some(n.object_type), false);
16675                d.field_node("indexType", Some(n.index_type), false);
16676                d.field_bool("optional", n.optional.get(), false);
16677            }
16678            Node::ConditionalTypeAnnotation(n) => {
16679                d.field_node("checkType", Some(n.check_type), false);
16680                d.field_node("extendsType", Some(n.extends_type), false);
16681                d.field_node("trueType", Some(n.true_type), false);
16682                d.field_node("falseType", Some(n.false_type), false);
16683            }
16684            Node::TypePredicate(n) => {
16685                d.field_node("parameterName", Some(n.parameter_name), false);
16686                d.field_node("typeAnnotation", n.type_annotation, false);
16687                d.field_label("kind", n.kind.get(), false);
16688            }
16689            Node::InterfaceTypeAnnotation(n) => {
16690                d.field_list("extends", n.extends, false);
16691                d.field_node("body", n.body, false);
16692            }
16693            Node::TypeAlias(n) => {
16694                d.field_node("id", Some(n.id), false);
16695                d.field_node("typeParameters", n.type_parameters, false);
16696                d.field_node("right", Some(n.right), false);
16697            }
16698            Node::OpaqueType(n) => {
16699                d.field_node("id", Some(n.id), false);
16700                d.field_node("typeParameters", n.type_parameters, false);
16701                d.field_node("impltype", Some(n.impltype), false);
16702                d.field_node("lowerBound", n.lower_bound, false);
16703                d.field_node("upperBound", n.upper_bound, false);
16704                d.field_node("supertype", n.supertype, false);
16705            }
16706            Node::InterfaceDeclaration(n) => {
16707                d.field_node("id", Some(n.id), false);
16708                d.field_node("typeParameters", n.type_parameters, false);
16709                d.field_list("extends", n.extends, false);
16710                d.field_node("body", Some(n.body), false);
16711            }
16712            Node::DeclareTypeAlias(n) => {
16713                d.field_node("id", Some(n.id), false);
16714                d.field_node("typeParameters", n.type_parameters, false);
16715                d.field_node("right", Some(n.right), false);
16716            }
16717            Node::DeclareOpaqueType(n) => {
16718                d.field_node("id", Some(n.id), false);
16719                d.field_node("typeParameters", n.type_parameters, false);
16720                d.field_node("impltype", n.impltype, false);
16721                d.field_node("lowerBound", n.lower_bound, false);
16722                d.field_node("upperBound", n.upper_bound, false);
16723                d.field_node("supertype", n.supertype, false);
16724            }
16725            Node::DeclareInterface(n) => {
16726                d.field_node("id", Some(n.id), false);
16727                d.field_node("typeParameters", n.type_parameters, false);
16728                d.field_list("extends", n.extends, false);
16729                d.field_node("body", Some(n.body), false);
16730            }
16731            Node::DeclareClass(n) => {
16732                d.field_node("id", Some(n.id), false);
16733                d.field_node("typeParameters", n.type_parameters, false);
16734                d.field_list("extends", n.extends, false);
16735                d.field_list("implements", n.implements, false);
16736                d.field_list("mixins", n.mixins, false);
16737                d.field_node("body", Some(n.body), false);
16738            }
16739            Node::DeclareFunction(n) => {
16740                d.field_node("id", Some(n.id), false);
16741                d.field_node("predicate", n.predicate, false);
16742            }
16743            Node::DeclareHook(n) => {
16744                d.field_node("id", Some(n.id), false);
16745            }
16746            Node::DeclareComponent(n) => {
16747                d.field_node("id", Some(n.id), false);
16748                d.field_list("params", n.params, false);
16749                d.field_node("rest", n.rest, false);
16750                d.field_node("typeParameters", n.type_parameters, false);
16751                d.field_node("rendersType", n.renders_type, false);
16752            }
16753            Node::DeclareVariable(n) => {
16754                d.field_node("id", Some(n.id), false);
16755                d.field_label("kind", n.kind.get(), false);
16756            }
16757            Node::DeclareEnum(n) => {
16758                d.field_node("id", Some(n.id), false);
16759                d.field_node("body", Some(n.body), false);
16760            }
16761            Node::DeclareExportDeclaration(n) => {
16762                d.field_node("declaration", n.declaration, false);
16763                d.field_list("specifiers", n.specifiers, false);
16764                d.field_node("source", n.source, false);
16765                d.field_bool("default", n.default.get(), false);
16766            }
16767            Node::DeclareExportAllDeclaration(n) => {
16768                d.field_node("source", Some(n.source), false);
16769            }
16770            Node::DeclareModule(n) => {
16771                d.field_node("id", Some(n.id), false);
16772                d.field_node("body", Some(n.body), false);
16773            }
16774            Node::DeclareNamespace(n) => {
16775                d.field_node("id", Some(n.id), false);
16776                d.field_node("body", Some(n.body), false);
16777            }
16778            Node::DeclareModuleExports(n) => {
16779                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16780            }
16781            Node::InterfaceExtends(n) => {
16782                d.field_node("id", Some(n.id), false);
16783                d.field_node("typeParameters", n.type_parameters, false);
16784            }
16785            Node::ClassImplements(n) => {
16786                d.field_node("id", Some(n.id), false);
16787                d.field_node("typeParameters", n.type_parameters, false);
16788            }
16789            Node::TypeAnnotation(n) => {
16790                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16791            }
16792            Node::ObjectTypeAnnotation(n) => {
16793                d.field_list("properties", n.properties, false);
16794                d.field_list("indexers", n.indexers, false);
16795                d.field_list("callProperties", n.call_properties, false);
16796                d.field_list("internalSlots", n.internal_slots, false);
16797                d.field_bool("inexact", n.inexact.get(), false);
16798                d.field_bool("exact", n.exact.get(), false);
16799            }
16800            Node::ObjectTypeProperty(n) => {
16801                d.field_node("key", Some(n.key), false);
16802                d.field_node("value", Some(n.value), false);
16803                d.field_bool("method", n.method.get(), false);
16804                d.field_bool("optional", n.optional.get(), false);
16805                d.field_bool("static", n.r#static.get(), false);
16806                d.field_bool("proto", n.proto.get(), false);
16807                d.field_node("variance", n.variance, false);
16808                d.field_label("kind", n.kind.get(), false);
16809            }
16810            Node::ObjectTypeSpreadProperty(n) => {
16811                d.field_node("argument", Some(n.argument), false);
16812            }
16813            Node::ObjectTypeInternalSlot(n) => {
16814                d.field_node("id", Some(n.id), false);
16815                d.field_node("value", Some(n.value), false);
16816                d.field_bool("optional", n.optional.get(), false);
16817                d.field_bool("static", n.r#static.get(), false);
16818                d.field_bool("method", n.method.get(), false);
16819            }
16820            Node::ObjectTypeCallProperty(n) => {
16821                d.field_node("value", Some(n.value), false);
16822                d.field_bool("static", n.r#static.get(), false);
16823            }
16824            Node::ObjectTypeIndexer(n) => {
16825                d.field_node("id", n.id, false);
16826                d.field_node("key", Some(n.key), false);
16827                d.field_node("value", Some(n.value), false);
16828                d.field_bool("static", n.r#static.get(), false);
16829                d.field_node("variance", n.variance, false);
16830            }
16831            Node::ObjectTypeMappedTypeProperty(n) => {
16832                d.field_node("keyTparam", Some(n.key_tparam), false);
16833                d.field_node("propType", Some(n.prop_type), false);
16834                d.field_node("sourceType", Some(n.source_type), false);
16835                d.field_node("variance", n.variance, false);
16836                d.field_label("optional", n.optional.get(), false);
16837            }
16838            Node::Variance(n) => {
16839                d.field_label("kind", n.kind.get(), false);
16840            }
16841            Node::TypeParameterDeclaration(n) => {
16842                d.field_list("params", n.params, false);
16843            }
16844            Node::TypeParameter(n) => {
16845                d.field_label("name", n.name.get(), false);
16846                d.field_bool("const", n.r#const.get(), true);
16847                d.field_node("bound", n.bound, false);
16848                d.field_node("variance", n.variance, false);
16849                d.field_node("default", n.default, false);
16850                d.field_bool("usesExtendsBound", n.uses_extends_bound.get(), true);
16851            }
16852            Node::TypeParameterInstantiation(n) => {
16853                d.field_list("params", n.params, false);
16854            }
16855            Node::TypeCastExpression(n) => {
16856                d.field_node("expression", Some(n.expression), false);
16857                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16858            }
16859            Node::AsExpression(n) => {
16860                d.field_node("expression", Some(n.expression), false);
16861                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16862            }
16863            Node::AsConstExpression(n) => {
16864                d.field_node("expression", Some(n.expression), false);
16865            }
16866            Node::InferredPredicate(_) => {}
16867            Node::DeclaredPredicate(n) => {
16868                d.field_node("value", Some(n.value), false);
16869            }
16870            Node::EnumDeclaration(n) => {
16871                d.field_node("id", Some(n.id), false);
16872                d.field_node("body", Some(n.body), false);
16873            }
16874            Node::EnumStringBody(n) => {
16875                d.field_list("members", n.members, false);
16876                d.field_bool("explicitType", n.explicit_type.get(), false);
16877                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
16878            }
16879            Node::EnumNumberBody(n) => {
16880                d.field_list("members", n.members, false);
16881                d.field_bool("explicitType", n.explicit_type.get(), false);
16882                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
16883            }
16884            Node::EnumBigIntBody(n) => {
16885                d.field_list("members", n.members, false);
16886                d.field_bool("explicitType", n.explicit_type.get(), false);
16887                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
16888            }
16889            Node::EnumBooleanBody(n) => {
16890                d.field_list("members", n.members, false);
16891                d.field_bool("explicitType", n.explicit_type.get(), false);
16892                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
16893            }
16894            Node::EnumSymbolBody(n) => {
16895                d.field_list("members", n.members, false);
16896                d.field_bool("hasUnknownMembers", n.has_unknown_members.get(), false);
16897            }
16898            Node::EnumDefaultedMember(n) => {
16899                d.field_node("id", Some(n.id), false);
16900            }
16901            Node::EnumStringMember(n) => {
16902                d.field_node("id", Some(n.id), false);
16903                d.field_node("init", Some(n.init), false);
16904            }
16905            Node::EnumNumberMember(n) => {
16906                d.field_node("id", Some(n.id), false);
16907                d.field_node("init", Some(n.init), false);
16908            }
16909            Node::EnumBigIntMember(n) => {
16910                d.field_node("id", Some(n.id), false);
16911                d.field_node("init", Some(n.init), false);
16912            }
16913            Node::EnumBooleanMember(n) => {
16914                d.field_node("id", Some(n.id), false);
16915                d.field_node("init", Some(n.init), false);
16916            }
16917            Node::ComponentParameter(n) => {
16918                d.field_node("name", Some(n.name), false);
16919                d.field_node("local", Some(n.local), false);
16920                d.field_bool("shorthand", n.shorthand.get(), false);
16921            }
16922            Node::RecordDeclaration(n) => {
16923                d.field_node("id", Some(n.id), false);
16924                d.field_node("typeParameters", n.type_parameters, false);
16925                d.field_list("implements", n.implements, false);
16926                d.field_node("body", Some(n.body), false);
16927            }
16928            Node::RecordDeclarationImplements(n) => {
16929                d.field_node("id", Some(n.id), false);
16930                d.field_node("typeArguments", n.type_arguments, false);
16931            }
16932            Node::RecordDeclarationBody(n) => {
16933                d.field_list("elements", n.elements, false);
16934            }
16935            Node::RecordDeclarationProperty(n) => {
16936                d.field_node("key", Some(n.key), false);
16937                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16938                d.field_node("defaultValue", n.default_value, false);
16939            }
16940            Node::RecordDeclarationStaticProperty(n) => {
16941                d.field_node("key", Some(n.key), false);
16942                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16943                d.field_node("value", Some(n.value), false);
16944            }
16945            Node::RecordExpression(n) => {
16946                d.field_node("recordConstructor", Some(n.record_constructor), false);
16947                d.field_node("typeArguments", n.type_arguments, false);
16948                d.field_node("properties", Some(n.properties), false);
16949            }
16950            Node::RecordExpressionProperties(n) => {
16951                d.field_list("properties", n.properties, false);
16952            }
16953            Node::TSTypeAnnotation(n) => {
16954                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16955            }
16956            Node::TSAnyKeyword(_) => {}
16957            Node::TSNumberKeyword(_) => {}
16958            Node::TSBooleanKeyword(_) => {}
16959            Node::TSStringKeyword(_) => {}
16960            Node::TSSymbolKeyword(_) => {}
16961            Node::TSVoidKeyword(_) => {}
16962            Node::TSUndefinedKeyword(_) => {}
16963            Node::TSUnknownKeyword(_) => {}
16964            Node::TSNeverKeyword(_) => {}
16965            Node::TSBigIntKeyword(_) => {}
16966            Node::TSThisType(_) => {}
16967            Node::TSLiteralType(n) => {
16968                d.field_node("literal", Some(n.literal), false);
16969            }
16970            Node::TSIndexedAccessType(n) => {
16971                d.field_node("objectType", Some(n.object_type), false);
16972                d.field_node("indexType", Some(n.index_type), false);
16973            }
16974            Node::TSArrayType(n) => {
16975                d.field_node("elementType", Some(n.element_type), false);
16976            }
16977            Node::TSTypeReference(n) => {
16978                d.field_node("typeName", Some(n.type_name), false);
16979                d.field_node("typeParameters", n.type_parameters, false);
16980            }
16981            Node::TSQualifiedName(n) => {
16982                d.field_node("left", Some(n.left), false);
16983                d.field_node("right", n.right, false);
16984            }
16985            Node::TSFunctionType(n) => {
16986                d.field_list("params", n.params, false);
16987                d.field_node("returnType", Some(n.return_type), false);
16988                d.field_node("typeParameters", n.type_parameters, false);
16989            }
16990            Node::TSConstructorType(n) => {
16991                d.field_list("params", n.params, false);
16992                d.field_node("returnType", Some(n.return_type), false);
16993                d.field_node("typeParameters", n.type_parameters, false);
16994            }
16995            Node::TSTypePredicate(n) => {
16996                d.field_node("parameterName", Some(n.parameter_name), false);
16997                d.field_node("typeAnnotation", Some(n.type_annotation), false);
16998            }
16999            Node::TSTupleType(n) => {
17000                d.field_list("elementTypes", n.element_types, false);
17001            }
17002            Node::TSTypeAssertion(n) => {
17003                d.field_node("typeAnnotation", Some(n.type_annotation), false);
17004                d.field_node("expression", Some(n.expression), false);
17005            }
17006            Node::TSAsExpression(n) => {
17007                d.field_node("expression", Some(n.expression), false);
17008                d.field_node("typeAnnotation", Some(n.type_annotation), false);
17009            }
17010            Node::TSParameterProperty(n) => {
17011                d.field_node("parameter", Some(n.parameter), false);
17012                d.field_label("accessibility", n.accessibility.get(), false);
17013                d.field_bool("readonly", n.readonly.get(), false);
17014                d.field_bool("static", n.r#static.get(), false);
17015                d.field_bool("export", n.export.get(), false);
17016            }
17017            Node::TSTypeAliasDeclaration(n) => {
17018                d.field_node("id", Some(n.id), false);
17019                d.field_node("typeParameters", n.type_parameters, false);
17020                d.field_node("typeAnnotation", Some(n.type_annotation), false);
17021            }
17022            Node::TSInterfaceDeclaration(n) => {
17023                d.field_node("id", Some(n.id), false);
17024                d.field_node("body", Some(n.body), false);
17025                d.field_list("extends", n.extends, false);
17026                d.field_node("typeParameters", n.type_parameters, false);
17027            }
17028            Node::TSInterfaceHeritage(n) => {
17029                d.field_node("expression", Some(n.expression), false);
17030                d.field_node("typeParameters", n.type_parameters, false);
17031            }
17032            Node::TSInterfaceBody(n) => {
17033                d.field_list("body", n.body, false);
17034            }
17035            Node::TSEnumDeclaration(n) => {
17036                d.field_node("id", Some(n.id), false);
17037                d.field_list("members", n.members, false);
17038            }
17039            Node::TSEnumMember(n) => {
17040                d.field_node("id", Some(n.id), false);
17041                d.field_node("initializer", n.initializer, false);
17042            }
17043            Node::TSModuleDeclaration(n) => {
17044                d.field_node("id", Some(n.id), false);
17045                d.field_node("body", Some(n.body), false);
17046            }
17047            Node::TSModuleBlock(n) => {
17048                d.field_list("body", n.body, false);
17049            }
17050            Node::TSModuleMember(n) => {
17051                d.field_node("id", Some(n.id), false);
17052                d.field_node("initializer", n.initializer, false);
17053            }
17054            Node::TSTypeParameterDeclaration(n) => {
17055                d.field_list("params", n.params, false);
17056            }
17057            Node::TSTypeParameter(n) => {
17058                d.field_node("name", Some(n.name), false);
17059                d.field_node("constraint", n.constraint, false);
17060                d.field_node("default", n.default, false);
17061            }
17062            Node::TSTypeParameterInstantiation(n) => {
17063                d.field_list("params", n.params, false);
17064            }
17065            Node::TSUnionType(n) => {
17066                d.field_list("types", n.types, false);
17067            }
17068            Node::TSIntersectionType(n) => {
17069                d.field_list("types", n.types, false);
17070            }
17071            Node::TSTypeQuery(n) => {
17072                d.field_node("exprName", Some(n.expr_name), false);
17073            }
17074            Node::TSConditionalType(n) => {
17075                d.field_node("checkType", Some(n.check_type), false);
17076                d.field_node("extendsType", Some(n.extends_type), false);
17077                d.field_node("trueType", Some(n.true_type), false);
17078                d.field_node("falseType", Some(n.false_type), false);
17079            }
17080            Node::TSTypeLiteral(n) => {
17081                d.field_list("members", n.members, false);
17082            }
17083            Node::TSPropertySignature(n) => {
17084                d.field_node("key", Some(n.key), false);
17085                d.field_node("typeAnnotation", n.type_annotation, false);
17086                d.field_node("initializer", n.initializer, false);
17087                d.field_bool("optional", n.optional.get(), false);
17088                d.field_bool("computed", n.computed.get(), false);
17089                d.field_bool("readonly", n.readonly.get(), false);
17090                d.field_bool("static", n.r#static.get(), false);
17091                d.field_bool("export", n.export.get(), false);
17092            }
17093            Node::TSMethodSignature(n) => {
17094                d.field_node("key", Some(n.key), false);
17095                d.field_list("params", n.params, false);
17096                d.field_node("returnType", n.return_type, false);
17097                d.field_bool("computed", n.computed.get(), false);
17098            }
17099            Node::TSIndexSignature(n) => {
17100                d.field_list("parameters", n.parameters, false);
17101                d.field_node("typeAnnotation", n.type_annotation, false);
17102            }
17103            Node::TSCallSignatureDeclaration(n) => {
17104                d.field_list("params", n.params, false);
17105                d.field_node("returnType", n.return_type, false);
17106            }
17107            Node::TSModifiers(n) => {
17108                d.field_label("accessibility", n.accessibility.get(), false);
17109                d.field_bool("readonly", n.readonly.get(), false);
17110            }
17111            Node::CoverEmptyArgs(_) => {}
17112            Node::CoverTrailingComma(_) => {}
17113            Node::CoverInitializer(n) => {
17114                d.field_node("init", Some(n.init), false);
17115            }
17116            Node::CoverRestElement(n) => {
17117                d.field_node("rest", Some(n.rest), false);
17118            }
17119            Node::CoverTypedIdentifier(n) => {
17120                d.field_node("left", Some(n.left), false);
17121                d.field_node("right", n.right, false);
17122                d.field_bool("optional", n.optional.get(), false);
17123            }
17124            Node::SHBuiltin(_) => {}
17125            Node::ImplicitCheckedCast(n) => {
17126                d.field_node("argument", Some(n.argument), false);
17127            }
17128        }
17129    }
17130}
17131
17132/// Per-kind node builders: clone a node with (optionally) one
17133/// structural-child field changed. The rebuild primitive used by
17134/// `Node::visit_children_mut`.
17135pub mod builder {
17136    use std::cell::Cell;
17137    use super::*;
17138    use crate::node_child::NodeChild;
17139    use crate::visitor::TransformResult;
17140
17141    /// One builder per node kind; clone-with-one-field-changed.
17142    #[derive(Debug)]
17143    pub enum Builder<'gc> {
17144        /// Builder for [`super::Empty`].
17145        Empty(self::Empty<'gc>),
17146        /// Builder for [`super::Metadata`].
17147        Metadata(self::Metadata<'gc>),
17148        /// Builder for [`super::Program`].
17149        Program(self::Program<'gc>),
17150        /// Builder for [`super::FunctionExpression`].
17151        FunctionExpression(self::FunctionExpression<'gc>),
17152        /// Builder for [`super::ArrowFunctionExpression`].
17153        ArrowFunctionExpression(self::ArrowFunctionExpression<'gc>),
17154        /// Builder for [`super::FunctionDeclaration`].
17155        FunctionDeclaration(self::FunctionDeclaration<'gc>),
17156        /// Builder for [`super::ComponentDeclaration`].
17157        ComponentDeclaration(self::ComponentDeclaration<'gc>),
17158        /// Builder for [`super::HookDeclaration`].
17159        HookDeclaration(self::HookDeclaration<'gc>),
17160        /// Builder for [`super::MatchStatement`].
17161        MatchStatement(self::MatchStatement<'gc>),
17162        /// Builder for [`super::WhileStatement`].
17163        WhileStatement(self::WhileStatement<'gc>),
17164        /// Builder for [`super::DoWhileStatement`].
17165        DoWhileStatement(self::DoWhileStatement<'gc>),
17166        /// Builder for [`super::ForInStatement`].
17167        ForInStatement(self::ForInStatement<'gc>),
17168        /// Builder for [`super::ForOfStatement`].
17169        ForOfStatement(self::ForOfStatement<'gc>),
17170        /// Builder for [`super::ForStatement`].
17171        ForStatement(self::ForStatement<'gc>),
17172        /// Builder for [`super::DebuggerStatement`].
17173        DebuggerStatement(self::DebuggerStatement<'gc>),
17174        /// Builder for [`super::EmptyStatement`].
17175        EmptyStatement(self::EmptyStatement<'gc>),
17176        /// Builder for [`super::BlockStatement`].
17177        BlockStatement(self::BlockStatement<'gc>),
17178        /// Builder for [`super::StaticBlock`].
17179        StaticBlock(self::StaticBlock<'gc>),
17180        /// Builder for [`super::BreakStatement`].
17181        BreakStatement(self::BreakStatement<'gc>),
17182        /// Builder for [`super::ContinueStatement`].
17183        ContinueStatement(self::ContinueStatement<'gc>),
17184        /// Builder for [`super::ThrowStatement`].
17185        ThrowStatement(self::ThrowStatement<'gc>),
17186        /// Builder for [`super::ReturnStatement`].
17187        ReturnStatement(self::ReturnStatement<'gc>),
17188        /// Builder for [`super::WithStatement`].
17189        WithStatement(self::WithStatement<'gc>),
17190        /// Builder for [`super::SwitchStatement`].
17191        SwitchStatement(self::SwitchStatement<'gc>),
17192        /// Builder for [`super::LabeledStatement`].
17193        LabeledStatement(self::LabeledStatement<'gc>),
17194        /// Builder for [`super::ExpressionStatement`].
17195        ExpressionStatement(self::ExpressionStatement<'gc>),
17196        /// Builder for [`super::TryStatement`].
17197        TryStatement(self::TryStatement<'gc>),
17198        /// Builder for [`super::IfStatement`].
17199        IfStatement(self::IfStatement<'gc>),
17200        /// Builder for [`super::NullLiteral`].
17201        NullLiteral(self::NullLiteral<'gc>),
17202        /// Builder for [`super::BooleanLiteral`].
17203        BooleanLiteral(self::BooleanLiteral<'gc>),
17204        /// Builder for [`super::StringLiteral`].
17205        StringLiteral(self::StringLiteral<'gc>),
17206        /// Builder for [`super::NumericLiteral`].
17207        NumericLiteral(self::NumericLiteral<'gc>),
17208        /// Builder for [`super::RegExpLiteral`].
17209        RegExpLiteral(self::RegExpLiteral<'gc>),
17210        /// Builder for [`super::BigIntLiteral`].
17211        BigIntLiteral(self::BigIntLiteral<'gc>),
17212        /// Builder for [`super::ThisExpression`].
17213        ThisExpression(self::ThisExpression<'gc>),
17214        /// Builder for [`super::Super`].
17215        Super(self::Super<'gc>),
17216        /// Builder for [`super::SequenceExpression`].
17217        SequenceExpression(self::SequenceExpression<'gc>),
17218        /// Builder for [`super::ObjectExpression`].
17219        ObjectExpression(self::ObjectExpression<'gc>),
17220        /// Builder for [`super::ArrayExpression`].
17221        ArrayExpression(self::ArrayExpression<'gc>),
17222        /// Builder for [`super::SpreadElement`].
17223        SpreadElement(self::SpreadElement<'gc>),
17224        /// Builder for [`super::NewExpression`].
17225        NewExpression(self::NewExpression<'gc>),
17226        /// Builder for [`super::YieldExpression`].
17227        YieldExpression(self::YieldExpression<'gc>),
17228        /// Builder for [`super::AwaitExpression`].
17229        AwaitExpression(self::AwaitExpression<'gc>),
17230        /// Builder for [`super::ImportExpression`].
17231        ImportExpression(self::ImportExpression<'gc>),
17232        /// Builder for [`super::CallExpression`].
17233        CallExpression(self::CallExpression<'gc>),
17234        /// Builder for [`super::OptionalCallExpression`].
17235        OptionalCallExpression(self::OptionalCallExpression<'gc>),
17236        /// Builder for [`super::AssignmentExpression`].
17237        AssignmentExpression(self::AssignmentExpression<'gc>),
17238        /// Builder for [`super::UnaryExpression`].
17239        UnaryExpression(self::UnaryExpression<'gc>),
17240        /// Builder for [`super::UpdateExpression`].
17241        UpdateExpression(self::UpdateExpression<'gc>),
17242        /// Builder for [`super::MemberExpression`].
17243        MemberExpression(self::MemberExpression<'gc>),
17244        /// Builder for [`super::OptionalMemberExpression`].
17245        OptionalMemberExpression(self::OptionalMemberExpression<'gc>),
17246        /// Builder for [`super::LogicalExpression`].
17247        LogicalExpression(self::LogicalExpression<'gc>),
17248        /// Builder for [`super::ConditionalExpression`].
17249        ConditionalExpression(self::ConditionalExpression<'gc>),
17250        /// Builder for [`super::BinaryExpression`].
17251        BinaryExpression(self::BinaryExpression<'gc>),
17252        /// Builder for [`super::Directive`].
17253        Directive(self::Directive<'gc>),
17254        /// Builder for [`super::DirectiveLiteral`].
17255        DirectiveLiteral(self::DirectiveLiteral<'gc>),
17256        /// Builder for [`super::Identifier`].
17257        Identifier(self::Identifier<'gc>),
17258        /// Builder for [`super::PrivateName`].
17259        PrivateName(self::PrivateName<'gc>),
17260        /// Builder for [`super::MetaProperty`].
17261        MetaProperty(self::MetaProperty<'gc>),
17262        /// Builder for [`super::SwitchCase`].
17263        SwitchCase(self::SwitchCase<'gc>),
17264        /// Builder for [`super::CatchClause`].
17265        CatchClause(self::CatchClause<'gc>),
17266        /// Builder for [`super::VariableDeclarator`].
17267        VariableDeclarator(self::VariableDeclarator<'gc>),
17268        /// Builder for [`super::VariableDeclaration`].
17269        VariableDeclaration(self::VariableDeclaration<'gc>),
17270        /// Builder for [`super::TemplateLiteral`].
17271        TemplateLiteral(self::TemplateLiteral<'gc>),
17272        /// Builder for [`super::TaggedTemplateExpression`].
17273        TaggedTemplateExpression(self::TaggedTemplateExpression<'gc>),
17274        /// Builder for [`super::TemplateElement`].
17275        TemplateElement(self::TemplateElement<'gc>),
17276        /// Builder for [`super::Property`].
17277        Property(self::Property<'gc>),
17278        /// Builder for [`super::Decorator`].
17279        Decorator(self::Decorator<'gc>),
17280        /// Builder for [`super::ClassDeclaration`].
17281        ClassDeclaration(self::ClassDeclaration<'gc>),
17282        /// Builder for [`super::ClassExpression`].
17283        ClassExpression(self::ClassExpression<'gc>),
17284        /// Builder for [`super::ClassBody`].
17285        ClassBody(self::ClassBody<'gc>),
17286        /// Builder for [`super::ClassProperty`].
17287        ClassProperty(self::ClassProperty<'gc>),
17288        /// Builder for [`super::ClassPrivateProperty`].
17289        ClassPrivateProperty(self::ClassPrivateProperty<'gc>),
17290        /// Builder for [`super::MethodDefinition`].
17291        MethodDefinition(self::MethodDefinition<'gc>),
17292        /// Builder for [`super::ImportDeclaration`].
17293        ImportDeclaration(self::ImportDeclaration<'gc>),
17294        /// Builder for [`super::ImportSpecifier`].
17295        ImportSpecifier(self::ImportSpecifier<'gc>),
17296        /// Builder for [`super::ImportDefaultSpecifier`].
17297        ImportDefaultSpecifier(self::ImportDefaultSpecifier<'gc>),
17298        /// Builder for [`super::ImportNamespaceSpecifier`].
17299        ImportNamespaceSpecifier(self::ImportNamespaceSpecifier<'gc>),
17300        /// Builder for [`super::ImportAttribute`].
17301        ImportAttribute(self::ImportAttribute<'gc>),
17302        /// Builder for [`super::ExportNamedDeclaration`].
17303        ExportNamedDeclaration(self::ExportNamedDeclaration<'gc>),
17304        /// Builder for [`super::ExportSpecifier`].
17305        ExportSpecifier(self::ExportSpecifier<'gc>),
17306        /// Builder for [`super::ExportNamespaceSpecifier`].
17307        ExportNamespaceSpecifier(self::ExportNamespaceSpecifier<'gc>),
17308        /// Builder for [`super::ExportDefaultDeclaration`].
17309        ExportDefaultDeclaration(self::ExportDefaultDeclaration<'gc>),
17310        /// Builder for [`super::ExportAllDeclaration`].
17311        ExportAllDeclaration(self::ExportAllDeclaration<'gc>),
17312        /// Builder for [`super::ObjectPattern`].
17313        ObjectPattern(self::ObjectPattern<'gc>),
17314        /// Builder for [`super::ArrayPattern`].
17315        ArrayPattern(self::ArrayPattern<'gc>),
17316        /// Builder for [`super::RestElement`].
17317        RestElement(self::RestElement<'gc>),
17318        /// Builder for [`super::AssignmentPattern`].
17319        AssignmentPattern(self::AssignmentPattern<'gc>),
17320        /// Builder for [`super::MatchStatementCase`].
17321        MatchStatementCase(self::MatchStatementCase<'gc>),
17322        /// Builder for [`super::MatchExpression`].
17323        MatchExpression(self::MatchExpression<'gc>),
17324        /// Builder for [`super::MatchExpressionCase`].
17325        MatchExpressionCase(self::MatchExpressionCase<'gc>),
17326        /// Builder for [`super::MatchWildcardPattern`].
17327        MatchWildcardPattern(self::MatchWildcardPattern<'gc>),
17328        /// Builder for [`super::MatchLiteralPattern`].
17329        MatchLiteralPattern(self::MatchLiteralPattern<'gc>),
17330        /// Builder for [`super::MatchUnaryPattern`].
17331        MatchUnaryPattern(self::MatchUnaryPattern<'gc>),
17332        /// Builder for [`super::MatchIdentifierPattern`].
17333        MatchIdentifierPattern(self::MatchIdentifierPattern<'gc>),
17334        /// Builder for [`super::MatchBindingPattern`].
17335        MatchBindingPattern(self::MatchBindingPattern<'gc>),
17336        /// Builder for [`super::MatchObjectPattern`].
17337        MatchObjectPattern(self::MatchObjectPattern<'gc>),
17338        /// Builder for [`super::MatchArrayPattern`].
17339        MatchArrayPattern(self::MatchArrayPattern<'gc>),
17340        /// Builder for [`super::MatchOrPattern`].
17341        MatchOrPattern(self::MatchOrPattern<'gc>),
17342        /// Builder for [`super::MatchAsPattern`].
17343        MatchAsPattern(self::MatchAsPattern<'gc>),
17344        /// Builder for [`super::MatchMemberPattern`].
17345        MatchMemberPattern(self::MatchMemberPattern<'gc>),
17346        /// Builder for [`super::MatchInstancePattern`].
17347        MatchInstancePattern(self::MatchInstancePattern<'gc>),
17348        /// Builder for [`super::MatchObjectPatternProperty`].
17349        MatchObjectPatternProperty(self::MatchObjectPatternProperty<'gc>),
17350        /// Builder for [`super::MatchInstanceObjectPattern`].
17351        MatchInstanceObjectPattern(self::MatchInstanceObjectPattern<'gc>),
17352        /// Builder for [`super::MatchRestPattern`].
17353        MatchRestPattern(self::MatchRestPattern<'gc>),
17354        /// Builder for [`super::JSXIdentifier`].
17355        JSXIdentifier(self::JSXIdentifier<'gc>),
17356        /// Builder for [`super::JSXMemberExpression`].
17357        JSXMemberExpression(self::JSXMemberExpression<'gc>),
17358        /// Builder for [`super::JSXNamespacedName`].
17359        JSXNamespacedName(self::JSXNamespacedName<'gc>),
17360        /// Builder for [`super::JSXEmptyExpression`].
17361        JSXEmptyExpression(self::JSXEmptyExpression<'gc>),
17362        /// Builder for [`super::JSXExpressionContainer`].
17363        JSXExpressionContainer(self::JSXExpressionContainer<'gc>),
17364        /// Builder for [`super::JSXSpreadChild`].
17365        JSXSpreadChild(self::JSXSpreadChild<'gc>),
17366        /// Builder for [`super::JSXOpeningElement`].
17367        JSXOpeningElement(self::JSXOpeningElement<'gc>),
17368        /// Builder for [`super::JSXClosingElement`].
17369        JSXClosingElement(self::JSXClosingElement<'gc>),
17370        /// Builder for [`super::JSXAttribute`].
17371        JSXAttribute(self::JSXAttribute<'gc>),
17372        /// Builder for [`super::JSXSpreadAttribute`].
17373        JSXSpreadAttribute(self::JSXSpreadAttribute<'gc>),
17374        /// Builder for [`super::JSXStringLiteral`].
17375        JSXStringLiteral(self::JSXStringLiteral<'gc>),
17376        /// Builder for [`super::JSXText`].
17377        JSXText(self::JSXText<'gc>),
17378        /// Builder for [`super::JSXElement`].
17379        JSXElement(self::JSXElement<'gc>),
17380        /// Builder for [`super::JSXFragment`].
17381        JSXFragment(self::JSXFragment<'gc>),
17382        /// Builder for [`super::JSXOpeningFragment`].
17383        JSXOpeningFragment(self::JSXOpeningFragment<'gc>),
17384        /// Builder for [`super::JSXClosingFragment`].
17385        JSXClosingFragment(self::JSXClosingFragment<'gc>),
17386        /// Builder for [`super::ExistsTypeAnnotation`].
17387        ExistsTypeAnnotation(self::ExistsTypeAnnotation<'gc>),
17388        /// Builder for [`super::EmptyTypeAnnotation`].
17389        EmptyTypeAnnotation(self::EmptyTypeAnnotation<'gc>),
17390        /// Builder for [`super::StringTypeAnnotation`].
17391        StringTypeAnnotation(self::StringTypeAnnotation<'gc>),
17392        /// Builder for [`super::NumberTypeAnnotation`].
17393        NumberTypeAnnotation(self::NumberTypeAnnotation<'gc>),
17394        /// Builder for [`super::StringLiteralTypeAnnotation`].
17395        StringLiteralTypeAnnotation(self::StringLiteralTypeAnnotation<'gc>),
17396        /// Builder for [`super::NumberLiteralTypeAnnotation`].
17397        NumberLiteralTypeAnnotation(self::NumberLiteralTypeAnnotation<'gc>),
17398        /// Builder for [`super::BigIntLiteralTypeAnnotation`].
17399        BigIntLiteralTypeAnnotation(self::BigIntLiteralTypeAnnotation<'gc>),
17400        /// Builder for [`super::BooleanTypeAnnotation`].
17401        BooleanTypeAnnotation(self::BooleanTypeAnnotation<'gc>),
17402        /// Builder for [`super::BooleanLiteralTypeAnnotation`].
17403        BooleanLiteralTypeAnnotation(self::BooleanLiteralTypeAnnotation<'gc>),
17404        /// Builder for [`super::NullLiteralTypeAnnotation`].
17405        NullLiteralTypeAnnotation(self::NullLiteralTypeAnnotation<'gc>),
17406        /// Builder for [`super::SymbolTypeAnnotation`].
17407        SymbolTypeAnnotation(self::SymbolTypeAnnotation<'gc>),
17408        /// Builder for [`super::AnyTypeAnnotation`].
17409        AnyTypeAnnotation(self::AnyTypeAnnotation<'gc>),
17410        /// Builder for [`super::MixedTypeAnnotation`].
17411        MixedTypeAnnotation(self::MixedTypeAnnotation<'gc>),
17412        /// Builder for [`super::BigIntTypeAnnotation`].
17413        BigIntTypeAnnotation(self::BigIntTypeAnnotation<'gc>),
17414        /// Builder for [`super::VoidTypeAnnotation`].
17415        VoidTypeAnnotation(self::VoidTypeAnnotation<'gc>),
17416        /// Builder for [`super::NeverTypeAnnotation`].
17417        NeverTypeAnnotation(self::NeverTypeAnnotation<'gc>),
17418        /// Builder for [`super::UnknownTypeAnnotation`].
17419        UnknownTypeAnnotation(self::UnknownTypeAnnotation<'gc>),
17420        /// Builder for [`super::UndefinedTypeAnnotation`].
17421        UndefinedTypeAnnotation(self::UndefinedTypeAnnotation<'gc>),
17422        /// Builder for [`super::FunctionTypeAnnotation`].
17423        FunctionTypeAnnotation(self::FunctionTypeAnnotation<'gc>),
17424        /// Builder for [`super::HookTypeAnnotation`].
17425        HookTypeAnnotation(self::HookTypeAnnotation<'gc>),
17426        /// Builder for [`super::FunctionTypeParam`].
17427        FunctionTypeParam(self::FunctionTypeParam<'gc>),
17428        /// Builder for [`super::ComponentTypeAnnotation`].
17429        ComponentTypeAnnotation(self::ComponentTypeAnnotation<'gc>),
17430        /// Builder for [`super::ComponentTypeParameter`].
17431        ComponentTypeParameter(self::ComponentTypeParameter<'gc>),
17432        /// Builder for [`super::NullableTypeAnnotation`].
17433        NullableTypeAnnotation(self::NullableTypeAnnotation<'gc>),
17434        /// Builder for [`super::QualifiedTypeIdentifier`].
17435        QualifiedTypeIdentifier(self::QualifiedTypeIdentifier<'gc>),
17436        /// Builder for [`super::TypeofTypeAnnotation`].
17437        TypeofTypeAnnotation(self::TypeofTypeAnnotation<'gc>),
17438        /// Builder for [`super::KeyofTypeAnnotation`].
17439        KeyofTypeAnnotation(self::KeyofTypeAnnotation<'gc>),
17440        /// Builder for [`super::TypeOperator`].
17441        TypeOperator(self::TypeOperator<'gc>),
17442        /// Builder for [`super::QualifiedTypeofIdentifier`].
17443        QualifiedTypeofIdentifier(self::QualifiedTypeofIdentifier<'gc>),
17444        /// Builder for [`super::TupleTypeAnnotation`].
17445        TupleTypeAnnotation(self::TupleTypeAnnotation<'gc>),
17446        /// Builder for [`super::TupleTypeSpreadElement`].
17447        TupleTypeSpreadElement(self::TupleTypeSpreadElement<'gc>),
17448        /// Builder for [`super::TupleTypeLabeledElement`].
17449        TupleTypeLabeledElement(self::TupleTypeLabeledElement<'gc>),
17450        /// Builder for [`super::ArrayTypeAnnotation`].
17451        ArrayTypeAnnotation(self::ArrayTypeAnnotation<'gc>),
17452        /// Builder for [`super::InferTypeAnnotation`].
17453        InferTypeAnnotation(self::InferTypeAnnotation<'gc>),
17454        /// Builder for [`super::UnionTypeAnnotation`].
17455        UnionTypeAnnotation(self::UnionTypeAnnotation<'gc>),
17456        /// Builder for [`super::IntersectionTypeAnnotation`].
17457        IntersectionTypeAnnotation(self::IntersectionTypeAnnotation<'gc>),
17458        /// Builder for [`super::GenericTypeAnnotation`].
17459        GenericTypeAnnotation(self::GenericTypeAnnotation<'gc>),
17460        /// Builder for [`super::IndexedAccessType`].
17461        IndexedAccessType(self::IndexedAccessType<'gc>),
17462        /// Builder for [`super::OptionalIndexedAccessType`].
17463        OptionalIndexedAccessType(self::OptionalIndexedAccessType<'gc>),
17464        /// Builder for [`super::ConditionalTypeAnnotation`].
17465        ConditionalTypeAnnotation(self::ConditionalTypeAnnotation<'gc>),
17466        /// Builder for [`super::TypePredicate`].
17467        TypePredicate(self::TypePredicate<'gc>),
17468        /// Builder for [`super::InterfaceTypeAnnotation`].
17469        InterfaceTypeAnnotation(self::InterfaceTypeAnnotation<'gc>),
17470        /// Builder for [`super::TypeAlias`].
17471        TypeAlias(self::TypeAlias<'gc>),
17472        /// Builder for [`super::OpaqueType`].
17473        OpaqueType(self::OpaqueType<'gc>),
17474        /// Builder for [`super::InterfaceDeclaration`].
17475        InterfaceDeclaration(self::InterfaceDeclaration<'gc>),
17476        /// Builder for [`super::DeclareTypeAlias`].
17477        DeclareTypeAlias(self::DeclareTypeAlias<'gc>),
17478        /// Builder for [`super::DeclareOpaqueType`].
17479        DeclareOpaqueType(self::DeclareOpaqueType<'gc>),
17480        /// Builder for [`super::DeclareInterface`].
17481        DeclareInterface(self::DeclareInterface<'gc>),
17482        /// Builder for [`super::DeclareClass`].
17483        DeclareClass(self::DeclareClass<'gc>),
17484        /// Builder for [`super::DeclareFunction`].
17485        DeclareFunction(self::DeclareFunction<'gc>),
17486        /// Builder for [`super::DeclareHook`].
17487        DeclareHook(self::DeclareHook<'gc>),
17488        /// Builder for [`super::DeclareComponent`].
17489        DeclareComponent(self::DeclareComponent<'gc>),
17490        /// Builder for [`super::DeclareVariable`].
17491        DeclareVariable(self::DeclareVariable<'gc>),
17492        /// Builder for [`super::DeclareEnum`].
17493        DeclareEnum(self::DeclareEnum<'gc>),
17494        /// Builder for [`super::DeclareExportDeclaration`].
17495        DeclareExportDeclaration(self::DeclareExportDeclaration<'gc>),
17496        /// Builder for [`super::DeclareExportAllDeclaration`].
17497        DeclareExportAllDeclaration(self::DeclareExportAllDeclaration<'gc>),
17498        /// Builder for [`super::DeclareModule`].
17499        DeclareModule(self::DeclareModule<'gc>),
17500        /// Builder for [`super::DeclareNamespace`].
17501        DeclareNamespace(self::DeclareNamespace<'gc>),
17502        /// Builder for [`super::DeclareModuleExports`].
17503        DeclareModuleExports(self::DeclareModuleExports<'gc>),
17504        /// Builder for [`super::InterfaceExtends`].
17505        InterfaceExtends(self::InterfaceExtends<'gc>),
17506        /// Builder for [`super::ClassImplements`].
17507        ClassImplements(self::ClassImplements<'gc>),
17508        /// Builder for [`super::TypeAnnotation`].
17509        TypeAnnotation(self::TypeAnnotation<'gc>),
17510        /// Builder for [`super::ObjectTypeAnnotation`].
17511        ObjectTypeAnnotation(self::ObjectTypeAnnotation<'gc>),
17512        /// Builder for [`super::ObjectTypeProperty`].
17513        ObjectTypeProperty(self::ObjectTypeProperty<'gc>),
17514        /// Builder for [`super::ObjectTypeSpreadProperty`].
17515        ObjectTypeSpreadProperty(self::ObjectTypeSpreadProperty<'gc>),
17516        /// Builder for [`super::ObjectTypeInternalSlot`].
17517        ObjectTypeInternalSlot(self::ObjectTypeInternalSlot<'gc>),
17518        /// Builder for [`super::ObjectTypeCallProperty`].
17519        ObjectTypeCallProperty(self::ObjectTypeCallProperty<'gc>),
17520        /// Builder for [`super::ObjectTypeIndexer`].
17521        ObjectTypeIndexer(self::ObjectTypeIndexer<'gc>),
17522        /// Builder for [`super::ObjectTypeMappedTypeProperty`].
17523        ObjectTypeMappedTypeProperty(self::ObjectTypeMappedTypeProperty<'gc>),
17524        /// Builder for [`super::Variance`].
17525        Variance(self::Variance<'gc>),
17526        /// Builder for [`super::TypeParameterDeclaration`].
17527        TypeParameterDeclaration(self::TypeParameterDeclaration<'gc>),
17528        /// Builder for [`super::TypeParameter`].
17529        TypeParameter(self::TypeParameter<'gc>),
17530        /// Builder for [`super::TypeParameterInstantiation`].
17531        TypeParameterInstantiation(self::TypeParameterInstantiation<'gc>),
17532        /// Builder for [`super::TypeCastExpression`].
17533        TypeCastExpression(self::TypeCastExpression<'gc>),
17534        /// Builder for [`super::AsExpression`].
17535        AsExpression(self::AsExpression<'gc>),
17536        /// Builder for [`super::AsConstExpression`].
17537        AsConstExpression(self::AsConstExpression<'gc>),
17538        /// Builder for [`super::InferredPredicate`].
17539        InferredPredicate(self::InferredPredicate<'gc>),
17540        /// Builder for [`super::DeclaredPredicate`].
17541        DeclaredPredicate(self::DeclaredPredicate<'gc>),
17542        /// Builder for [`super::EnumDeclaration`].
17543        EnumDeclaration(self::EnumDeclaration<'gc>),
17544        /// Builder for [`super::EnumStringBody`].
17545        EnumStringBody(self::EnumStringBody<'gc>),
17546        /// Builder for [`super::EnumNumberBody`].
17547        EnumNumberBody(self::EnumNumberBody<'gc>),
17548        /// Builder for [`super::EnumBigIntBody`].
17549        EnumBigIntBody(self::EnumBigIntBody<'gc>),
17550        /// Builder for [`super::EnumBooleanBody`].
17551        EnumBooleanBody(self::EnumBooleanBody<'gc>),
17552        /// Builder for [`super::EnumSymbolBody`].
17553        EnumSymbolBody(self::EnumSymbolBody<'gc>),
17554        /// Builder for [`super::EnumDefaultedMember`].
17555        EnumDefaultedMember(self::EnumDefaultedMember<'gc>),
17556        /// Builder for [`super::EnumStringMember`].
17557        EnumStringMember(self::EnumStringMember<'gc>),
17558        /// Builder for [`super::EnumNumberMember`].
17559        EnumNumberMember(self::EnumNumberMember<'gc>),
17560        /// Builder for [`super::EnumBigIntMember`].
17561        EnumBigIntMember(self::EnumBigIntMember<'gc>),
17562        /// Builder for [`super::EnumBooleanMember`].
17563        EnumBooleanMember(self::EnumBooleanMember<'gc>),
17564        /// Builder for [`super::ComponentParameter`].
17565        ComponentParameter(self::ComponentParameter<'gc>),
17566        /// Builder for [`super::RecordDeclaration`].
17567        RecordDeclaration(self::RecordDeclaration<'gc>),
17568        /// Builder for [`super::RecordDeclarationImplements`].
17569        RecordDeclarationImplements(self::RecordDeclarationImplements<'gc>),
17570        /// Builder for [`super::RecordDeclarationBody`].
17571        RecordDeclarationBody(self::RecordDeclarationBody<'gc>),
17572        /// Builder for [`super::RecordDeclarationProperty`].
17573        RecordDeclarationProperty(self::RecordDeclarationProperty<'gc>),
17574        /// Builder for [`super::RecordDeclarationStaticProperty`].
17575        RecordDeclarationStaticProperty(self::RecordDeclarationStaticProperty<'gc>),
17576        /// Builder for [`super::RecordExpression`].
17577        RecordExpression(self::RecordExpression<'gc>),
17578        /// Builder for [`super::RecordExpressionProperties`].
17579        RecordExpressionProperties(self::RecordExpressionProperties<'gc>),
17580        /// Builder for [`super::TSTypeAnnotation`].
17581        TSTypeAnnotation(self::TSTypeAnnotation<'gc>),
17582        /// Builder for [`super::TSAnyKeyword`].
17583        TSAnyKeyword(self::TSAnyKeyword<'gc>),
17584        /// Builder for [`super::TSNumberKeyword`].
17585        TSNumberKeyword(self::TSNumberKeyword<'gc>),
17586        /// Builder for [`super::TSBooleanKeyword`].
17587        TSBooleanKeyword(self::TSBooleanKeyword<'gc>),
17588        /// Builder for [`super::TSStringKeyword`].
17589        TSStringKeyword(self::TSStringKeyword<'gc>),
17590        /// Builder for [`super::TSSymbolKeyword`].
17591        TSSymbolKeyword(self::TSSymbolKeyword<'gc>),
17592        /// Builder for [`super::TSVoidKeyword`].
17593        TSVoidKeyword(self::TSVoidKeyword<'gc>),
17594        /// Builder for [`super::TSUndefinedKeyword`].
17595        TSUndefinedKeyword(self::TSUndefinedKeyword<'gc>),
17596        /// Builder for [`super::TSUnknownKeyword`].
17597        TSUnknownKeyword(self::TSUnknownKeyword<'gc>),
17598        /// Builder for [`super::TSNeverKeyword`].
17599        TSNeverKeyword(self::TSNeverKeyword<'gc>),
17600        /// Builder for [`super::TSBigIntKeyword`].
17601        TSBigIntKeyword(self::TSBigIntKeyword<'gc>),
17602        /// Builder for [`super::TSThisType`].
17603        TSThisType(self::TSThisType<'gc>),
17604        /// Builder for [`super::TSLiteralType`].
17605        TSLiteralType(self::TSLiteralType<'gc>),
17606        /// Builder for [`super::TSIndexedAccessType`].
17607        TSIndexedAccessType(self::TSIndexedAccessType<'gc>),
17608        /// Builder for [`super::TSArrayType`].
17609        TSArrayType(self::TSArrayType<'gc>),
17610        /// Builder for [`super::TSTypeReference`].
17611        TSTypeReference(self::TSTypeReference<'gc>),
17612        /// Builder for [`super::TSQualifiedName`].
17613        TSQualifiedName(self::TSQualifiedName<'gc>),
17614        /// Builder for [`super::TSFunctionType`].
17615        TSFunctionType(self::TSFunctionType<'gc>),
17616        /// Builder for [`super::TSConstructorType`].
17617        TSConstructorType(self::TSConstructorType<'gc>),
17618        /// Builder for [`super::TSTypePredicate`].
17619        TSTypePredicate(self::TSTypePredicate<'gc>),
17620        /// Builder for [`super::TSTupleType`].
17621        TSTupleType(self::TSTupleType<'gc>),
17622        /// Builder for [`super::TSTypeAssertion`].
17623        TSTypeAssertion(self::TSTypeAssertion<'gc>),
17624        /// Builder for [`super::TSAsExpression`].
17625        TSAsExpression(self::TSAsExpression<'gc>),
17626        /// Builder for [`super::TSParameterProperty`].
17627        TSParameterProperty(self::TSParameterProperty<'gc>),
17628        /// Builder for [`super::TSTypeAliasDeclaration`].
17629        TSTypeAliasDeclaration(self::TSTypeAliasDeclaration<'gc>),
17630        /// Builder for [`super::TSInterfaceDeclaration`].
17631        TSInterfaceDeclaration(self::TSInterfaceDeclaration<'gc>),
17632        /// Builder for [`super::TSInterfaceHeritage`].
17633        TSInterfaceHeritage(self::TSInterfaceHeritage<'gc>),
17634        /// Builder for [`super::TSInterfaceBody`].
17635        TSInterfaceBody(self::TSInterfaceBody<'gc>),
17636        /// Builder for [`super::TSEnumDeclaration`].
17637        TSEnumDeclaration(self::TSEnumDeclaration<'gc>),
17638        /// Builder for [`super::TSEnumMember`].
17639        TSEnumMember(self::TSEnumMember<'gc>),
17640        /// Builder for [`super::TSModuleDeclaration`].
17641        TSModuleDeclaration(self::TSModuleDeclaration<'gc>),
17642        /// Builder for [`super::TSModuleBlock`].
17643        TSModuleBlock(self::TSModuleBlock<'gc>),
17644        /// Builder for [`super::TSModuleMember`].
17645        TSModuleMember(self::TSModuleMember<'gc>),
17646        /// Builder for [`super::TSTypeParameterDeclaration`].
17647        TSTypeParameterDeclaration(self::TSTypeParameterDeclaration<'gc>),
17648        /// Builder for [`super::TSTypeParameter`].
17649        TSTypeParameter(self::TSTypeParameter<'gc>),
17650        /// Builder for [`super::TSTypeParameterInstantiation`].
17651        TSTypeParameterInstantiation(self::TSTypeParameterInstantiation<'gc>),
17652        /// Builder for [`super::TSUnionType`].
17653        TSUnionType(self::TSUnionType<'gc>),
17654        /// Builder for [`super::TSIntersectionType`].
17655        TSIntersectionType(self::TSIntersectionType<'gc>),
17656        /// Builder for [`super::TSTypeQuery`].
17657        TSTypeQuery(self::TSTypeQuery<'gc>),
17658        /// Builder for [`super::TSConditionalType`].
17659        TSConditionalType(self::TSConditionalType<'gc>),
17660        /// Builder for [`super::TSTypeLiteral`].
17661        TSTypeLiteral(self::TSTypeLiteral<'gc>),
17662        /// Builder for [`super::TSPropertySignature`].
17663        TSPropertySignature(self::TSPropertySignature<'gc>),
17664        /// Builder for [`super::TSMethodSignature`].
17665        TSMethodSignature(self::TSMethodSignature<'gc>),
17666        /// Builder for [`super::TSIndexSignature`].
17667        TSIndexSignature(self::TSIndexSignature<'gc>),
17668        /// Builder for [`super::TSCallSignatureDeclaration`].
17669        TSCallSignatureDeclaration(self::TSCallSignatureDeclaration<'gc>),
17670        /// Builder for [`super::TSModifiers`].
17671        TSModifiers(self::TSModifiers<'gc>),
17672        /// Builder for [`super::CoverEmptyArgs`].
17673        CoverEmptyArgs(self::CoverEmptyArgs<'gc>),
17674        /// Builder for [`super::CoverTrailingComma`].
17675        CoverTrailingComma(self::CoverTrailingComma<'gc>),
17676        /// Builder for [`super::CoverInitializer`].
17677        CoverInitializer(self::CoverInitializer<'gc>),
17678        /// Builder for [`super::CoverRestElement`].
17679        CoverRestElement(self::CoverRestElement<'gc>),
17680        /// Builder for [`super::CoverTypedIdentifier`].
17681        CoverTypedIdentifier(self::CoverTypedIdentifier<'gc>),
17682        /// Builder for [`super::SHBuiltin`].
17683        SHBuiltin(self::SHBuiltin<'gc>),
17684        /// Builder for [`super::ImplicitCheckedCast`].
17685        ImplicitCheckedCast(self::ImplicitCheckedCast<'gc>),
17686    }
17687
17688    impl<'gc> Builder<'gc> {
17689        /// Start a builder for `node`, dispatching on its kind.
17690        pub fn from_node(node: &'gc Node<'gc>) -> Self {
17691            match node {
17692                Node::Empty(n) => Builder::Empty(self::Empty::from_node(n)),
17693                Node::Metadata(n) => Builder::Metadata(self::Metadata::from_node(n)),
17694                Node::Program(n) => Builder::Program(self::Program::from_node(n)),
17695                Node::FunctionExpression(n) => Builder::FunctionExpression(self::FunctionExpression::from_node(n)),
17696                Node::ArrowFunctionExpression(n) => Builder::ArrowFunctionExpression(self::ArrowFunctionExpression::from_node(n)),
17697                Node::FunctionDeclaration(n) => Builder::FunctionDeclaration(self::FunctionDeclaration::from_node(n)),
17698                Node::ComponentDeclaration(n) => Builder::ComponentDeclaration(self::ComponentDeclaration::from_node(n)),
17699                Node::HookDeclaration(n) => Builder::HookDeclaration(self::HookDeclaration::from_node(n)),
17700                Node::MatchStatement(n) => Builder::MatchStatement(self::MatchStatement::from_node(n)),
17701                Node::WhileStatement(n) => Builder::WhileStatement(self::WhileStatement::from_node(n)),
17702                Node::DoWhileStatement(n) => Builder::DoWhileStatement(self::DoWhileStatement::from_node(n)),
17703                Node::ForInStatement(n) => Builder::ForInStatement(self::ForInStatement::from_node(n)),
17704                Node::ForOfStatement(n) => Builder::ForOfStatement(self::ForOfStatement::from_node(n)),
17705                Node::ForStatement(n) => Builder::ForStatement(self::ForStatement::from_node(n)),
17706                Node::DebuggerStatement(n) => Builder::DebuggerStatement(self::DebuggerStatement::from_node(n)),
17707                Node::EmptyStatement(n) => Builder::EmptyStatement(self::EmptyStatement::from_node(n)),
17708                Node::BlockStatement(n) => Builder::BlockStatement(self::BlockStatement::from_node(n)),
17709                Node::StaticBlock(n) => Builder::StaticBlock(self::StaticBlock::from_node(n)),
17710                Node::BreakStatement(n) => Builder::BreakStatement(self::BreakStatement::from_node(n)),
17711                Node::ContinueStatement(n) => Builder::ContinueStatement(self::ContinueStatement::from_node(n)),
17712                Node::ThrowStatement(n) => Builder::ThrowStatement(self::ThrowStatement::from_node(n)),
17713                Node::ReturnStatement(n) => Builder::ReturnStatement(self::ReturnStatement::from_node(n)),
17714                Node::WithStatement(n) => Builder::WithStatement(self::WithStatement::from_node(n)),
17715                Node::SwitchStatement(n) => Builder::SwitchStatement(self::SwitchStatement::from_node(n)),
17716                Node::LabeledStatement(n) => Builder::LabeledStatement(self::LabeledStatement::from_node(n)),
17717                Node::ExpressionStatement(n) => Builder::ExpressionStatement(self::ExpressionStatement::from_node(n)),
17718                Node::TryStatement(n) => Builder::TryStatement(self::TryStatement::from_node(n)),
17719                Node::IfStatement(n) => Builder::IfStatement(self::IfStatement::from_node(n)),
17720                Node::NullLiteral(n) => Builder::NullLiteral(self::NullLiteral::from_node(n)),
17721                Node::BooleanLiteral(n) => Builder::BooleanLiteral(self::BooleanLiteral::from_node(n)),
17722                Node::StringLiteral(n) => Builder::StringLiteral(self::StringLiteral::from_node(n)),
17723                Node::NumericLiteral(n) => Builder::NumericLiteral(self::NumericLiteral::from_node(n)),
17724                Node::RegExpLiteral(n) => Builder::RegExpLiteral(self::RegExpLiteral::from_node(n)),
17725                Node::BigIntLiteral(n) => Builder::BigIntLiteral(self::BigIntLiteral::from_node(n)),
17726                Node::ThisExpression(n) => Builder::ThisExpression(self::ThisExpression::from_node(n)),
17727                Node::Super(n) => Builder::Super(self::Super::from_node(n)),
17728                Node::SequenceExpression(n) => Builder::SequenceExpression(self::SequenceExpression::from_node(n)),
17729                Node::ObjectExpression(n) => Builder::ObjectExpression(self::ObjectExpression::from_node(n)),
17730                Node::ArrayExpression(n) => Builder::ArrayExpression(self::ArrayExpression::from_node(n)),
17731                Node::SpreadElement(n) => Builder::SpreadElement(self::SpreadElement::from_node(n)),
17732                Node::NewExpression(n) => Builder::NewExpression(self::NewExpression::from_node(n)),
17733                Node::YieldExpression(n) => Builder::YieldExpression(self::YieldExpression::from_node(n)),
17734                Node::AwaitExpression(n) => Builder::AwaitExpression(self::AwaitExpression::from_node(n)),
17735                Node::ImportExpression(n) => Builder::ImportExpression(self::ImportExpression::from_node(n)),
17736                Node::CallExpression(n) => Builder::CallExpression(self::CallExpression::from_node(n)),
17737                Node::OptionalCallExpression(n) => Builder::OptionalCallExpression(self::OptionalCallExpression::from_node(n)),
17738                Node::AssignmentExpression(n) => Builder::AssignmentExpression(self::AssignmentExpression::from_node(n)),
17739                Node::UnaryExpression(n) => Builder::UnaryExpression(self::UnaryExpression::from_node(n)),
17740                Node::UpdateExpression(n) => Builder::UpdateExpression(self::UpdateExpression::from_node(n)),
17741                Node::MemberExpression(n) => Builder::MemberExpression(self::MemberExpression::from_node(n)),
17742                Node::OptionalMemberExpression(n) => Builder::OptionalMemberExpression(self::OptionalMemberExpression::from_node(n)),
17743                Node::LogicalExpression(n) => Builder::LogicalExpression(self::LogicalExpression::from_node(n)),
17744                Node::ConditionalExpression(n) => Builder::ConditionalExpression(self::ConditionalExpression::from_node(n)),
17745                Node::BinaryExpression(n) => Builder::BinaryExpression(self::BinaryExpression::from_node(n)),
17746                Node::Directive(n) => Builder::Directive(self::Directive::from_node(n)),
17747                Node::DirectiveLiteral(n) => Builder::DirectiveLiteral(self::DirectiveLiteral::from_node(n)),
17748                Node::Identifier(n) => Builder::Identifier(self::Identifier::from_node(n)),
17749                Node::PrivateName(n) => Builder::PrivateName(self::PrivateName::from_node(n)),
17750                Node::MetaProperty(n) => Builder::MetaProperty(self::MetaProperty::from_node(n)),
17751                Node::SwitchCase(n) => Builder::SwitchCase(self::SwitchCase::from_node(n)),
17752                Node::CatchClause(n) => Builder::CatchClause(self::CatchClause::from_node(n)),
17753                Node::VariableDeclarator(n) => Builder::VariableDeclarator(self::VariableDeclarator::from_node(n)),
17754                Node::VariableDeclaration(n) => Builder::VariableDeclaration(self::VariableDeclaration::from_node(n)),
17755                Node::TemplateLiteral(n) => Builder::TemplateLiteral(self::TemplateLiteral::from_node(n)),
17756                Node::TaggedTemplateExpression(n) => Builder::TaggedTemplateExpression(self::TaggedTemplateExpression::from_node(n)),
17757                Node::TemplateElement(n) => Builder::TemplateElement(self::TemplateElement::from_node(n)),
17758                Node::Property(n) => Builder::Property(self::Property::from_node(n)),
17759                Node::Decorator(n) => Builder::Decorator(self::Decorator::from_node(n)),
17760                Node::ClassDeclaration(n) => Builder::ClassDeclaration(self::ClassDeclaration::from_node(n)),
17761                Node::ClassExpression(n) => Builder::ClassExpression(self::ClassExpression::from_node(n)),
17762                Node::ClassBody(n) => Builder::ClassBody(self::ClassBody::from_node(n)),
17763                Node::ClassProperty(n) => Builder::ClassProperty(self::ClassProperty::from_node(n)),
17764                Node::ClassPrivateProperty(n) => Builder::ClassPrivateProperty(self::ClassPrivateProperty::from_node(n)),
17765                Node::MethodDefinition(n) => Builder::MethodDefinition(self::MethodDefinition::from_node(n)),
17766                Node::ImportDeclaration(n) => Builder::ImportDeclaration(self::ImportDeclaration::from_node(n)),
17767                Node::ImportSpecifier(n) => Builder::ImportSpecifier(self::ImportSpecifier::from_node(n)),
17768                Node::ImportDefaultSpecifier(n) => Builder::ImportDefaultSpecifier(self::ImportDefaultSpecifier::from_node(n)),
17769                Node::ImportNamespaceSpecifier(n) => Builder::ImportNamespaceSpecifier(self::ImportNamespaceSpecifier::from_node(n)),
17770                Node::ImportAttribute(n) => Builder::ImportAttribute(self::ImportAttribute::from_node(n)),
17771                Node::ExportNamedDeclaration(n) => Builder::ExportNamedDeclaration(self::ExportNamedDeclaration::from_node(n)),
17772                Node::ExportSpecifier(n) => Builder::ExportSpecifier(self::ExportSpecifier::from_node(n)),
17773                Node::ExportNamespaceSpecifier(n) => Builder::ExportNamespaceSpecifier(self::ExportNamespaceSpecifier::from_node(n)),
17774                Node::ExportDefaultDeclaration(n) => Builder::ExportDefaultDeclaration(self::ExportDefaultDeclaration::from_node(n)),
17775                Node::ExportAllDeclaration(n) => Builder::ExportAllDeclaration(self::ExportAllDeclaration::from_node(n)),
17776                Node::ObjectPattern(n) => Builder::ObjectPattern(self::ObjectPattern::from_node(n)),
17777                Node::ArrayPattern(n) => Builder::ArrayPattern(self::ArrayPattern::from_node(n)),
17778                Node::RestElement(n) => Builder::RestElement(self::RestElement::from_node(n)),
17779                Node::AssignmentPattern(n) => Builder::AssignmentPattern(self::AssignmentPattern::from_node(n)),
17780                Node::MatchStatementCase(n) => Builder::MatchStatementCase(self::MatchStatementCase::from_node(n)),
17781                Node::MatchExpression(n) => Builder::MatchExpression(self::MatchExpression::from_node(n)),
17782                Node::MatchExpressionCase(n) => Builder::MatchExpressionCase(self::MatchExpressionCase::from_node(n)),
17783                Node::MatchWildcardPattern(n) => Builder::MatchWildcardPattern(self::MatchWildcardPattern::from_node(n)),
17784                Node::MatchLiteralPattern(n) => Builder::MatchLiteralPattern(self::MatchLiteralPattern::from_node(n)),
17785                Node::MatchUnaryPattern(n) => Builder::MatchUnaryPattern(self::MatchUnaryPattern::from_node(n)),
17786                Node::MatchIdentifierPattern(n) => Builder::MatchIdentifierPattern(self::MatchIdentifierPattern::from_node(n)),
17787                Node::MatchBindingPattern(n) => Builder::MatchBindingPattern(self::MatchBindingPattern::from_node(n)),
17788                Node::MatchObjectPattern(n) => Builder::MatchObjectPattern(self::MatchObjectPattern::from_node(n)),
17789                Node::MatchArrayPattern(n) => Builder::MatchArrayPattern(self::MatchArrayPattern::from_node(n)),
17790                Node::MatchOrPattern(n) => Builder::MatchOrPattern(self::MatchOrPattern::from_node(n)),
17791                Node::MatchAsPattern(n) => Builder::MatchAsPattern(self::MatchAsPattern::from_node(n)),
17792                Node::MatchMemberPattern(n) => Builder::MatchMemberPattern(self::MatchMemberPattern::from_node(n)),
17793                Node::MatchInstancePattern(n) => Builder::MatchInstancePattern(self::MatchInstancePattern::from_node(n)),
17794                Node::MatchObjectPatternProperty(n) => Builder::MatchObjectPatternProperty(self::MatchObjectPatternProperty::from_node(n)),
17795                Node::MatchInstanceObjectPattern(n) => Builder::MatchInstanceObjectPattern(self::MatchInstanceObjectPattern::from_node(n)),
17796                Node::MatchRestPattern(n) => Builder::MatchRestPattern(self::MatchRestPattern::from_node(n)),
17797                Node::JSXIdentifier(n) => Builder::JSXIdentifier(self::JSXIdentifier::from_node(n)),
17798                Node::JSXMemberExpression(n) => Builder::JSXMemberExpression(self::JSXMemberExpression::from_node(n)),
17799                Node::JSXNamespacedName(n) => Builder::JSXNamespacedName(self::JSXNamespacedName::from_node(n)),
17800                Node::JSXEmptyExpression(n) => Builder::JSXEmptyExpression(self::JSXEmptyExpression::from_node(n)),
17801                Node::JSXExpressionContainer(n) => Builder::JSXExpressionContainer(self::JSXExpressionContainer::from_node(n)),
17802                Node::JSXSpreadChild(n) => Builder::JSXSpreadChild(self::JSXSpreadChild::from_node(n)),
17803                Node::JSXOpeningElement(n) => Builder::JSXOpeningElement(self::JSXOpeningElement::from_node(n)),
17804                Node::JSXClosingElement(n) => Builder::JSXClosingElement(self::JSXClosingElement::from_node(n)),
17805                Node::JSXAttribute(n) => Builder::JSXAttribute(self::JSXAttribute::from_node(n)),
17806                Node::JSXSpreadAttribute(n) => Builder::JSXSpreadAttribute(self::JSXSpreadAttribute::from_node(n)),
17807                Node::JSXStringLiteral(n) => Builder::JSXStringLiteral(self::JSXStringLiteral::from_node(n)),
17808                Node::JSXText(n) => Builder::JSXText(self::JSXText::from_node(n)),
17809                Node::JSXElement(n) => Builder::JSXElement(self::JSXElement::from_node(n)),
17810                Node::JSXFragment(n) => Builder::JSXFragment(self::JSXFragment::from_node(n)),
17811                Node::JSXOpeningFragment(n) => Builder::JSXOpeningFragment(self::JSXOpeningFragment::from_node(n)),
17812                Node::JSXClosingFragment(n) => Builder::JSXClosingFragment(self::JSXClosingFragment::from_node(n)),
17813                Node::ExistsTypeAnnotation(n) => Builder::ExistsTypeAnnotation(self::ExistsTypeAnnotation::from_node(n)),
17814                Node::EmptyTypeAnnotation(n) => Builder::EmptyTypeAnnotation(self::EmptyTypeAnnotation::from_node(n)),
17815                Node::StringTypeAnnotation(n) => Builder::StringTypeAnnotation(self::StringTypeAnnotation::from_node(n)),
17816                Node::NumberTypeAnnotation(n) => Builder::NumberTypeAnnotation(self::NumberTypeAnnotation::from_node(n)),
17817                Node::StringLiteralTypeAnnotation(n) => Builder::StringLiteralTypeAnnotation(self::StringLiteralTypeAnnotation::from_node(n)),
17818                Node::NumberLiteralTypeAnnotation(n) => Builder::NumberLiteralTypeAnnotation(self::NumberLiteralTypeAnnotation::from_node(n)),
17819                Node::BigIntLiteralTypeAnnotation(n) => Builder::BigIntLiteralTypeAnnotation(self::BigIntLiteralTypeAnnotation::from_node(n)),
17820                Node::BooleanTypeAnnotation(n) => Builder::BooleanTypeAnnotation(self::BooleanTypeAnnotation::from_node(n)),
17821                Node::BooleanLiteralTypeAnnotation(n) => Builder::BooleanLiteralTypeAnnotation(self::BooleanLiteralTypeAnnotation::from_node(n)),
17822                Node::NullLiteralTypeAnnotation(n) => Builder::NullLiteralTypeAnnotation(self::NullLiteralTypeAnnotation::from_node(n)),
17823                Node::SymbolTypeAnnotation(n) => Builder::SymbolTypeAnnotation(self::SymbolTypeAnnotation::from_node(n)),
17824                Node::AnyTypeAnnotation(n) => Builder::AnyTypeAnnotation(self::AnyTypeAnnotation::from_node(n)),
17825                Node::MixedTypeAnnotation(n) => Builder::MixedTypeAnnotation(self::MixedTypeAnnotation::from_node(n)),
17826                Node::BigIntTypeAnnotation(n) => Builder::BigIntTypeAnnotation(self::BigIntTypeAnnotation::from_node(n)),
17827                Node::VoidTypeAnnotation(n) => Builder::VoidTypeAnnotation(self::VoidTypeAnnotation::from_node(n)),
17828                Node::NeverTypeAnnotation(n) => Builder::NeverTypeAnnotation(self::NeverTypeAnnotation::from_node(n)),
17829                Node::UnknownTypeAnnotation(n) => Builder::UnknownTypeAnnotation(self::UnknownTypeAnnotation::from_node(n)),
17830                Node::UndefinedTypeAnnotation(n) => Builder::UndefinedTypeAnnotation(self::UndefinedTypeAnnotation::from_node(n)),
17831                Node::FunctionTypeAnnotation(n) => Builder::FunctionTypeAnnotation(self::FunctionTypeAnnotation::from_node(n)),
17832                Node::HookTypeAnnotation(n) => Builder::HookTypeAnnotation(self::HookTypeAnnotation::from_node(n)),
17833                Node::FunctionTypeParam(n) => Builder::FunctionTypeParam(self::FunctionTypeParam::from_node(n)),
17834                Node::ComponentTypeAnnotation(n) => Builder::ComponentTypeAnnotation(self::ComponentTypeAnnotation::from_node(n)),
17835                Node::ComponentTypeParameter(n) => Builder::ComponentTypeParameter(self::ComponentTypeParameter::from_node(n)),
17836                Node::NullableTypeAnnotation(n) => Builder::NullableTypeAnnotation(self::NullableTypeAnnotation::from_node(n)),
17837                Node::QualifiedTypeIdentifier(n) => Builder::QualifiedTypeIdentifier(self::QualifiedTypeIdentifier::from_node(n)),
17838                Node::TypeofTypeAnnotation(n) => Builder::TypeofTypeAnnotation(self::TypeofTypeAnnotation::from_node(n)),
17839                Node::KeyofTypeAnnotation(n) => Builder::KeyofTypeAnnotation(self::KeyofTypeAnnotation::from_node(n)),
17840                Node::TypeOperator(n) => Builder::TypeOperator(self::TypeOperator::from_node(n)),
17841                Node::QualifiedTypeofIdentifier(n) => Builder::QualifiedTypeofIdentifier(self::QualifiedTypeofIdentifier::from_node(n)),
17842                Node::TupleTypeAnnotation(n) => Builder::TupleTypeAnnotation(self::TupleTypeAnnotation::from_node(n)),
17843                Node::TupleTypeSpreadElement(n) => Builder::TupleTypeSpreadElement(self::TupleTypeSpreadElement::from_node(n)),
17844                Node::TupleTypeLabeledElement(n) => Builder::TupleTypeLabeledElement(self::TupleTypeLabeledElement::from_node(n)),
17845                Node::ArrayTypeAnnotation(n) => Builder::ArrayTypeAnnotation(self::ArrayTypeAnnotation::from_node(n)),
17846                Node::InferTypeAnnotation(n) => Builder::InferTypeAnnotation(self::InferTypeAnnotation::from_node(n)),
17847                Node::UnionTypeAnnotation(n) => Builder::UnionTypeAnnotation(self::UnionTypeAnnotation::from_node(n)),
17848                Node::IntersectionTypeAnnotation(n) => Builder::IntersectionTypeAnnotation(self::IntersectionTypeAnnotation::from_node(n)),
17849                Node::GenericTypeAnnotation(n) => Builder::GenericTypeAnnotation(self::GenericTypeAnnotation::from_node(n)),
17850                Node::IndexedAccessType(n) => Builder::IndexedAccessType(self::IndexedAccessType::from_node(n)),
17851                Node::OptionalIndexedAccessType(n) => Builder::OptionalIndexedAccessType(self::OptionalIndexedAccessType::from_node(n)),
17852                Node::ConditionalTypeAnnotation(n) => Builder::ConditionalTypeAnnotation(self::ConditionalTypeAnnotation::from_node(n)),
17853                Node::TypePredicate(n) => Builder::TypePredicate(self::TypePredicate::from_node(n)),
17854                Node::InterfaceTypeAnnotation(n) => Builder::InterfaceTypeAnnotation(self::InterfaceTypeAnnotation::from_node(n)),
17855                Node::TypeAlias(n) => Builder::TypeAlias(self::TypeAlias::from_node(n)),
17856                Node::OpaqueType(n) => Builder::OpaqueType(self::OpaqueType::from_node(n)),
17857                Node::InterfaceDeclaration(n) => Builder::InterfaceDeclaration(self::InterfaceDeclaration::from_node(n)),
17858                Node::DeclareTypeAlias(n) => Builder::DeclareTypeAlias(self::DeclareTypeAlias::from_node(n)),
17859                Node::DeclareOpaqueType(n) => Builder::DeclareOpaqueType(self::DeclareOpaqueType::from_node(n)),
17860                Node::DeclareInterface(n) => Builder::DeclareInterface(self::DeclareInterface::from_node(n)),
17861                Node::DeclareClass(n) => Builder::DeclareClass(self::DeclareClass::from_node(n)),
17862                Node::DeclareFunction(n) => Builder::DeclareFunction(self::DeclareFunction::from_node(n)),
17863                Node::DeclareHook(n) => Builder::DeclareHook(self::DeclareHook::from_node(n)),
17864                Node::DeclareComponent(n) => Builder::DeclareComponent(self::DeclareComponent::from_node(n)),
17865                Node::DeclareVariable(n) => Builder::DeclareVariable(self::DeclareVariable::from_node(n)),
17866                Node::DeclareEnum(n) => Builder::DeclareEnum(self::DeclareEnum::from_node(n)),
17867                Node::DeclareExportDeclaration(n) => Builder::DeclareExportDeclaration(self::DeclareExportDeclaration::from_node(n)),
17868                Node::DeclareExportAllDeclaration(n) => Builder::DeclareExportAllDeclaration(self::DeclareExportAllDeclaration::from_node(n)),
17869                Node::DeclareModule(n) => Builder::DeclareModule(self::DeclareModule::from_node(n)),
17870                Node::DeclareNamespace(n) => Builder::DeclareNamespace(self::DeclareNamespace::from_node(n)),
17871                Node::DeclareModuleExports(n) => Builder::DeclareModuleExports(self::DeclareModuleExports::from_node(n)),
17872                Node::InterfaceExtends(n) => Builder::InterfaceExtends(self::InterfaceExtends::from_node(n)),
17873                Node::ClassImplements(n) => Builder::ClassImplements(self::ClassImplements::from_node(n)),
17874                Node::TypeAnnotation(n) => Builder::TypeAnnotation(self::TypeAnnotation::from_node(n)),
17875                Node::ObjectTypeAnnotation(n) => Builder::ObjectTypeAnnotation(self::ObjectTypeAnnotation::from_node(n)),
17876                Node::ObjectTypeProperty(n) => Builder::ObjectTypeProperty(self::ObjectTypeProperty::from_node(n)),
17877                Node::ObjectTypeSpreadProperty(n) => Builder::ObjectTypeSpreadProperty(self::ObjectTypeSpreadProperty::from_node(n)),
17878                Node::ObjectTypeInternalSlot(n) => Builder::ObjectTypeInternalSlot(self::ObjectTypeInternalSlot::from_node(n)),
17879                Node::ObjectTypeCallProperty(n) => Builder::ObjectTypeCallProperty(self::ObjectTypeCallProperty::from_node(n)),
17880                Node::ObjectTypeIndexer(n) => Builder::ObjectTypeIndexer(self::ObjectTypeIndexer::from_node(n)),
17881                Node::ObjectTypeMappedTypeProperty(n) => Builder::ObjectTypeMappedTypeProperty(self::ObjectTypeMappedTypeProperty::from_node(n)),
17882                Node::Variance(n) => Builder::Variance(self::Variance::from_node(n)),
17883                Node::TypeParameterDeclaration(n) => Builder::TypeParameterDeclaration(self::TypeParameterDeclaration::from_node(n)),
17884                Node::TypeParameter(n) => Builder::TypeParameter(self::TypeParameter::from_node(n)),
17885                Node::TypeParameterInstantiation(n) => Builder::TypeParameterInstantiation(self::TypeParameterInstantiation::from_node(n)),
17886                Node::TypeCastExpression(n) => Builder::TypeCastExpression(self::TypeCastExpression::from_node(n)),
17887                Node::AsExpression(n) => Builder::AsExpression(self::AsExpression::from_node(n)),
17888                Node::AsConstExpression(n) => Builder::AsConstExpression(self::AsConstExpression::from_node(n)),
17889                Node::InferredPredicate(n) => Builder::InferredPredicate(self::InferredPredicate::from_node(n)),
17890                Node::DeclaredPredicate(n) => Builder::DeclaredPredicate(self::DeclaredPredicate::from_node(n)),
17891                Node::EnumDeclaration(n) => Builder::EnumDeclaration(self::EnumDeclaration::from_node(n)),
17892                Node::EnumStringBody(n) => Builder::EnumStringBody(self::EnumStringBody::from_node(n)),
17893                Node::EnumNumberBody(n) => Builder::EnumNumberBody(self::EnumNumberBody::from_node(n)),
17894                Node::EnumBigIntBody(n) => Builder::EnumBigIntBody(self::EnumBigIntBody::from_node(n)),
17895                Node::EnumBooleanBody(n) => Builder::EnumBooleanBody(self::EnumBooleanBody::from_node(n)),
17896                Node::EnumSymbolBody(n) => Builder::EnumSymbolBody(self::EnumSymbolBody::from_node(n)),
17897                Node::EnumDefaultedMember(n) => Builder::EnumDefaultedMember(self::EnumDefaultedMember::from_node(n)),
17898                Node::EnumStringMember(n) => Builder::EnumStringMember(self::EnumStringMember::from_node(n)),
17899                Node::EnumNumberMember(n) => Builder::EnumNumberMember(self::EnumNumberMember::from_node(n)),
17900                Node::EnumBigIntMember(n) => Builder::EnumBigIntMember(self::EnumBigIntMember::from_node(n)),
17901                Node::EnumBooleanMember(n) => Builder::EnumBooleanMember(self::EnumBooleanMember::from_node(n)),
17902                Node::ComponentParameter(n) => Builder::ComponentParameter(self::ComponentParameter::from_node(n)),
17903                Node::RecordDeclaration(n) => Builder::RecordDeclaration(self::RecordDeclaration::from_node(n)),
17904                Node::RecordDeclarationImplements(n) => Builder::RecordDeclarationImplements(self::RecordDeclarationImplements::from_node(n)),
17905                Node::RecordDeclarationBody(n) => Builder::RecordDeclarationBody(self::RecordDeclarationBody::from_node(n)),
17906                Node::RecordDeclarationProperty(n) => Builder::RecordDeclarationProperty(self::RecordDeclarationProperty::from_node(n)),
17907                Node::RecordDeclarationStaticProperty(n) => Builder::RecordDeclarationStaticProperty(self::RecordDeclarationStaticProperty::from_node(n)),
17908                Node::RecordExpression(n) => Builder::RecordExpression(self::RecordExpression::from_node(n)),
17909                Node::RecordExpressionProperties(n) => Builder::RecordExpressionProperties(self::RecordExpressionProperties::from_node(n)),
17910                Node::TSTypeAnnotation(n) => Builder::TSTypeAnnotation(self::TSTypeAnnotation::from_node(n)),
17911                Node::TSAnyKeyword(n) => Builder::TSAnyKeyword(self::TSAnyKeyword::from_node(n)),
17912                Node::TSNumberKeyword(n) => Builder::TSNumberKeyword(self::TSNumberKeyword::from_node(n)),
17913                Node::TSBooleanKeyword(n) => Builder::TSBooleanKeyword(self::TSBooleanKeyword::from_node(n)),
17914                Node::TSStringKeyword(n) => Builder::TSStringKeyword(self::TSStringKeyword::from_node(n)),
17915                Node::TSSymbolKeyword(n) => Builder::TSSymbolKeyword(self::TSSymbolKeyword::from_node(n)),
17916                Node::TSVoidKeyword(n) => Builder::TSVoidKeyword(self::TSVoidKeyword::from_node(n)),
17917                Node::TSUndefinedKeyword(n) => Builder::TSUndefinedKeyword(self::TSUndefinedKeyword::from_node(n)),
17918                Node::TSUnknownKeyword(n) => Builder::TSUnknownKeyword(self::TSUnknownKeyword::from_node(n)),
17919                Node::TSNeverKeyword(n) => Builder::TSNeverKeyword(self::TSNeverKeyword::from_node(n)),
17920                Node::TSBigIntKeyword(n) => Builder::TSBigIntKeyword(self::TSBigIntKeyword::from_node(n)),
17921                Node::TSThisType(n) => Builder::TSThisType(self::TSThisType::from_node(n)),
17922                Node::TSLiteralType(n) => Builder::TSLiteralType(self::TSLiteralType::from_node(n)),
17923                Node::TSIndexedAccessType(n) => Builder::TSIndexedAccessType(self::TSIndexedAccessType::from_node(n)),
17924                Node::TSArrayType(n) => Builder::TSArrayType(self::TSArrayType::from_node(n)),
17925                Node::TSTypeReference(n) => Builder::TSTypeReference(self::TSTypeReference::from_node(n)),
17926                Node::TSQualifiedName(n) => Builder::TSQualifiedName(self::TSQualifiedName::from_node(n)),
17927                Node::TSFunctionType(n) => Builder::TSFunctionType(self::TSFunctionType::from_node(n)),
17928                Node::TSConstructorType(n) => Builder::TSConstructorType(self::TSConstructorType::from_node(n)),
17929                Node::TSTypePredicate(n) => Builder::TSTypePredicate(self::TSTypePredicate::from_node(n)),
17930                Node::TSTupleType(n) => Builder::TSTupleType(self::TSTupleType::from_node(n)),
17931                Node::TSTypeAssertion(n) => Builder::TSTypeAssertion(self::TSTypeAssertion::from_node(n)),
17932                Node::TSAsExpression(n) => Builder::TSAsExpression(self::TSAsExpression::from_node(n)),
17933                Node::TSParameterProperty(n) => Builder::TSParameterProperty(self::TSParameterProperty::from_node(n)),
17934                Node::TSTypeAliasDeclaration(n) => Builder::TSTypeAliasDeclaration(self::TSTypeAliasDeclaration::from_node(n)),
17935                Node::TSInterfaceDeclaration(n) => Builder::TSInterfaceDeclaration(self::TSInterfaceDeclaration::from_node(n)),
17936                Node::TSInterfaceHeritage(n) => Builder::TSInterfaceHeritage(self::TSInterfaceHeritage::from_node(n)),
17937                Node::TSInterfaceBody(n) => Builder::TSInterfaceBody(self::TSInterfaceBody::from_node(n)),
17938                Node::TSEnumDeclaration(n) => Builder::TSEnumDeclaration(self::TSEnumDeclaration::from_node(n)),
17939                Node::TSEnumMember(n) => Builder::TSEnumMember(self::TSEnumMember::from_node(n)),
17940                Node::TSModuleDeclaration(n) => Builder::TSModuleDeclaration(self::TSModuleDeclaration::from_node(n)),
17941                Node::TSModuleBlock(n) => Builder::TSModuleBlock(self::TSModuleBlock::from_node(n)),
17942                Node::TSModuleMember(n) => Builder::TSModuleMember(self::TSModuleMember::from_node(n)),
17943                Node::TSTypeParameterDeclaration(n) => Builder::TSTypeParameterDeclaration(self::TSTypeParameterDeclaration::from_node(n)),
17944                Node::TSTypeParameter(n) => Builder::TSTypeParameter(self::TSTypeParameter::from_node(n)),
17945                Node::TSTypeParameterInstantiation(n) => Builder::TSTypeParameterInstantiation(self::TSTypeParameterInstantiation::from_node(n)),
17946                Node::TSUnionType(n) => Builder::TSUnionType(self::TSUnionType::from_node(n)),
17947                Node::TSIntersectionType(n) => Builder::TSIntersectionType(self::TSIntersectionType::from_node(n)),
17948                Node::TSTypeQuery(n) => Builder::TSTypeQuery(self::TSTypeQuery::from_node(n)),
17949                Node::TSConditionalType(n) => Builder::TSConditionalType(self::TSConditionalType::from_node(n)),
17950                Node::TSTypeLiteral(n) => Builder::TSTypeLiteral(self::TSTypeLiteral::from_node(n)),
17951                Node::TSPropertySignature(n) => Builder::TSPropertySignature(self::TSPropertySignature::from_node(n)),
17952                Node::TSMethodSignature(n) => Builder::TSMethodSignature(self::TSMethodSignature::from_node(n)),
17953                Node::TSIndexSignature(n) => Builder::TSIndexSignature(self::TSIndexSignature::from_node(n)),
17954                Node::TSCallSignatureDeclaration(n) => Builder::TSCallSignatureDeclaration(self::TSCallSignatureDeclaration::from_node(n)),
17955                Node::TSModifiers(n) => Builder::TSModifiers(self::TSModifiers::from_node(n)),
17956                Node::CoverEmptyArgs(n) => Builder::CoverEmptyArgs(self::CoverEmptyArgs::from_node(n)),
17957                Node::CoverTrailingComma(n) => Builder::CoverTrailingComma(self::CoverTrailingComma::from_node(n)),
17958                Node::CoverInitializer(n) => Builder::CoverInitializer(self::CoverInitializer::from_node(n)),
17959                Node::CoverRestElement(n) => Builder::CoverRestElement(self::CoverRestElement::from_node(n)),
17960                Node::CoverTypedIdentifier(n) => Builder::CoverTypedIdentifier(self::CoverTypedIdentifier::from_node(n)),
17961                Node::SHBuiltin(n) => Builder::SHBuiltin(self::SHBuiltin::from_node(n)),
17962                Node::ImplicitCheckedCast(n) => Builder::ImplicitCheckedCast(self::ImplicitCheckedCast::from_node(n)),
17963            }
17964        }
17965    }
17966
17967    /// Clone-with-changes builder for [`super::Empty`].
17968    #[derive(Debug)]
17969    pub struct Empty<'gc> {
17970        is_changed: bool,
17971        pub(super) inner: super::Empty<'gc>,
17972    }
17973    impl<'gc> Empty<'gc> {
17974        /// Start from a copy of `node`, with no field changed yet.
17975        pub fn from_node(node: &'gc super::Empty<'gc>) -> Self {
17976            Self {
17977                is_changed: false,
17978                inner: super::Empty {
17979                    metadata: node.metadata.duplicate(),
17980                },
17981            }
17982        }
17983        /// Allocate the rebuilt node if a setter ran, else
17984        /// `TransformResult::Unchanged`.
17985        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
17986            if self.is_changed {
17987                TransformResult::Changed(self.build_forced(gc))
17988            } else {
17989                TransformResult::Unchanged
17990            }
17991        }
17992        /// Allocate the node unconditionally, changed or not.
17993        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
17994            gc.alloc(Node::Empty(self.inner))
17995        }
17996    }
17997    /// Clone-with-changes builder for [`super::Metadata`].
17998    #[derive(Debug)]
17999    pub struct Metadata<'gc> {
18000        is_changed: bool,
18001        pub(super) inner: super::Metadata<'gc>,
18002    }
18003    impl<'gc> Metadata<'gc> {
18004        /// Start from a copy of `node`, with no field changed yet.
18005        pub fn from_node(node: &'gc super::Metadata<'gc>) -> Self {
18006            Self {
18007                is_changed: false,
18008                inner: super::Metadata {
18009                    metadata: node.metadata.duplicate(),
18010                },
18011            }
18012        }
18013        /// Allocate the rebuilt node if a setter ran, else
18014        /// `TransformResult::Unchanged`.
18015        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18016            if self.is_changed {
18017                TransformResult::Changed(self.build_forced(gc))
18018            } else {
18019                TransformResult::Unchanged
18020            }
18021        }
18022        /// Allocate the node unconditionally, changed or not.
18023        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18024            gc.alloc(Node::Metadata(self.inner))
18025        }
18026    }
18027    /// Clone-with-changes builder for [`super::Program`].
18028    #[derive(Debug)]
18029    pub struct Program<'gc> {
18030        is_changed: bool,
18031        pub(super) inner: super::Program<'gc>,
18032    }
18033    impl<'gc> Program<'gc> {
18034        /// Start from a copy of `node`, with no field changed yet.
18035        pub fn from_node(node: &'gc super::Program<'gc>) -> Self {
18036            Self {
18037                is_changed: false,
18038                inner: super::Program {
18039                    metadata: node.metadata.duplicate(),
18040                    body: node.body.duplicate(),
18041                    scope: Cell::new(node.scope.get()),
18042                    sem_info: Cell::new(node.sem_info.get()),
18043                    strictness: Cell::new(node.strictness.get()),
18044                    is_method_definition: Cell::new(node.is_method_definition.get()),
18045                    decorations: Cell::new(node.decorations.get()),
18046                    dummy_param_list: Cell::new(node.dummy_param_list.get()),
18047                },
18048            }
18049        }
18050        /// Allocate the rebuilt node if a setter ran, else
18051        /// `TransformResult::Unchanged`.
18052        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18053            if self.is_changed {
18054                TransformResult::Changed(self.build_forced(gc))
18055            } else {
18056                TransformResult::Unchanged
18057            }
18058        }
18059        /// Allocate the node unconditionally, changed or not.
18060        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18061            gc.alloc(Node::Program(self.inner))
18062        }
18063        /// Set the `body` field and mark the builder changed.
18064        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
18065    }
18066    /// Clone-with-changes builder for [`super::FunctionExpression`].
18067    #[derive(Debug)]
18068    pub struct FunctionExpression<'gc> {
18069        is_changed: bool,
18070        pub(super) inner: super::FunctionExpression<'gc>,
18071    }
18072    impl<'gc> FunctionExpression<'gc> {
18073        /// Start from a copy of `node`, with no field changed yet.
18074        pub fn from_node(node: &'gc super::FunctionExpression<'gc>) -> Self {
18075            Self {
18076                is_changed: false,
18077                inner: super::FunctionExpression {
18078                    metadata: node.metadata.duplicate(),
18079                    id: node.id.duplicate(),
18080                    params: node.params.duplicate(),
18081                    body: node.body.duplicate(),
18082                    type_parameters: node.type_parameters.duplicate(),
18083                    return_type: node.return_type.duplicate(),
18084                    predicate: node.predicate.duplicate(),
18085                    generator: Cell::new(node.generator.get()),
18086                    r#async: Cell::new(node.r#async.get()),
18087                    scope: Cell::new(node.scope.get()),
18088                    sem_info: Cell::new(node.sem_info.get()),
18089                    strictness: Cell::new(node.strictness.get()),
18090                    is_method_definition: Cell::new(node.is_method_definition.get()),
18091                    decorations: Cell::new(node.decorations.get()),
18092                },
18093            }
18094        }
18095        /// Allocate the rebuilt node if a setter ran, else
18096        /// `TransformResult::Unchanged`.
18097        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18098            if self.is_changed {
18099                TransformResult::Changed(self.build_forced(gc))
18100            } else {
18101                TransformResult::Unchanged
18102            }
18103        }
18104        /// Allocate the node unconditionally, changed or not.
18105        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18106            gc.alloc(Node::FunctionExpression(self.inner))
18107        }
18108        /// Set the `id` field and mark the builder changed.
18109        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
18110        /// Set the `params` field and mark the builder changed.
18111        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
18112        /// Set the `body` field and mark the builder changed.
18113        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18114        /// Set the `type_parameters` field and mark the builder changed.
18115        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
18116        /// Set the `return_type` field and mark the builder changed.
18117        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
18118        /// Set the `predicate` field and mark the builder changed.
18119        pub fn predicate(&mut self, predicate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.predicate = predicate; }
18120    }
18121    /// Clone-with-changes builder for [`super::ArrowFunctionExpression`].
18122    #[derive(Debug)]
18123    pub struct ArrowFunctionExpression<'gc> {
18124        is_changed: bool,
18125        pub(super) inner: super::ArrowFunctionExpression<'gc>,
18126    }
18127    impl<'gc> ArrowFunctionExpression<'gc> {
18128        /// Start from a copy of `node`, with no field changed yet.
18129        pub fn from_node(node: &'gc super::ArrowFunctionExpression<'gc>) -> Self {
18130            Self {
18131                is_changed: false,
18132                inner: super::ArrowFunctionExpression {
18133                    metadata: node.metadata.duplicate(),
18134                    params: node.params.duplicate(),
18135                    body: node.body.duplicate(),
18136                    type_parameters: node.type_parameters.duplicate(),
18137                    return_type: node.return_type.duplicate(),
18138                    predicate: node.predicate.duplicate(),
18139                    expression: Cell::new(node.expression.get()),
18140                    r#async: Cell::new(node.r#async.get()),
18141                    scope: Cell::new(node.scope.get()),
18142                    sem_info: Cell::new(node.sem_info.get()),
18143                    strictness: Cell::new(node.strictness.get()),
18144                    is_method_definition: Cell::new(node.is_method_definition.get()),
18145                    decorations: Cell::new(node.decorations.get()),
18146                },
18147            }
18148        }
18149        /// Allocate the rebuilt node if a setter ran, else
18150        /// `TransformResult::Unchanged`.
18151        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18152            if self.is_changed {
18153                TransformResult::Changed(self.build_forced(gc))
18154            } else {
18155                TransformResult::Unchanged
18156            }
18157        }
18158        /// Allocate the node unconditionally, changed or not.
18159        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18160            gc.alloc(Node::ArrowFunctionExpression(self.inner))
18161        }
18162        /// Set the `params` field and mark the builder changed.
18163        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
18164        /// Set the `body` field and mark the builder changed.
18165        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18166        /// Set the `type_parameters` field and mark the builder changed.
18167        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
18168        /// Set the `return_type` field and mark the builder changed.
18169        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
18170        /// Set the `predicate` field and mark the builder changed.
18171        pub fn predicate(&mut self, predicate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.predicate = predicate; }
18172    }
18173    /// Clone-with-changes builder for [`super::FunctionDeclaration`].
18174    #[derive(Debug)]
18175    pub struct FunctionDeclaration<'gc> {
18176        is_changed: bool,
18177        pub(super) inner: super::FunctionDeclaration<'gc>,
18178    }
18179    impl<'gc> FunctionDeclaration<'gc> {
18180        /// Start from a copy of `node`, with no field changed yet.
18181        pub fn from_node(node: &'gc super::FunctionDeclaration<'gc>) -> Self {
18182            Self {
18183                is_changed: false,
18184                inner: super::FunctionDeclaration {
18185                    metadata: node.metadata.duplicate(),
18186                    id: node.id.duplicate(),
18187                    params: node.params.duplicate(),
18188                    body: node.body.duplicate(),
18189                    type_parameters: node.type_parameters.duplicate(),
18190                    return_type: node.return_type.duplicate(),
18191                    predicate: node.predicate.duplicate(),
18192                    generator: Cell::new(node.generator.get()),
18193                    r#async: Cell::new(node.r#async.get()),
18194                    scope: Cell::new(node.scope.get()),
18195                    sem_info: Cell::new(node.sem_info.get()),
18196                    strictness: Cell::new(node.strictness.get()),
18197                    is_method_definition: Cell::new(node.is_method_definition.get()),
18198                    decorations: Cell::new(node.decorations.get()),
18199                },
18200            }
18201        }
18202        /// Allocate the rebuilt node if a setter ran, else
18203        /// `TransformResult::Unchanged`.
18204        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18205            if self.is_changed {
18206                TransformResult::Changed(self.build_forced(gc))
18207            } else {
18208                TransformResult::Unchanged
18209            }
18210        }
18211        /// Allocate the node unconditionally, changed or not.
18212        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18213            gc.alloc(Node::FunctionDeclaration(self.inner))
18214        }
18215        /// Set the `id` field and mark the builder changed.
18216        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
18217        /// Set the `params` field and mark the builder changed.
18218        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
18219        /// Set the `body` field and mark the builder changed.
18220        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18221        /// Set the `type_parameters` field and mark the builder changed.
18222        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
18223        /// Set the `return_type` field and mark the builder changed.
18224        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
18225        /// Set the `predicate` field and mark the builder changed.
18226        pub fn predicate(&mut self, predicate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.predicate = predicate; }
18227    }
18228    /// Clone-with-changes builder for [`super::ComponentDeclaration`].
18229    #[derive(Debug)]
18230    pub struct ComponentDeclaration<'gc> {
18231        is_changed: bool,
18232        pub(super) inner: super::ComponentDeclaration<'gc>,
18233    }
18234    impl<'gc> ComponentDeclaration<'gc> {
18235        /// Start from a copy of `node`, with no field changed yet.
18236        pub fn from_node(node: &'gc super::ComponentDeclaration<'gc>) -> Self {
18237            Self {
18238                is_changed: false,
18239                inner: super::ComponentDeclaration {
18240                    metadata: node.metadata.duplicate(),
18241                    id: node.id.duplicate(),
18242                    params: node.params.duplicate(),
18243                    body: node.body.duplicate(),
18244                    type_parameters: node.type_parameters.duplicate(),
18245                    renders_type: node.renders_type.duplicate(),
18246                    r#async: Cell::new(node.r#async.get()),
18247                    scope: Cell::new(node.scope.get()),
18248                    sem_info: Cell::new(node.sem_info.get()),
18249                    strictness: Cell::new(node.strictness.get()),
18250                    is_method_definition: Cell::new(node.is_method_definition.get()),
18251                    decorations: Cell::new(node.decorations.get()),
18252                },
18253            }
18254        }
18255        /// Allocate the rebuilt node if a setter ran, else
18256        /// `TransformResult::Unchanged`.
18257        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18258            if self.is_changed {
18259                TransformResult::Changed(self.build_forced(gc))
18260            } else {
18261                TransformResult::Unchanged
18262            }
18263        }
18264        /// Allocate the node unconditionally, changed or not.
18265        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18266            gc.alloc(Node::ComponentDeclaration(self.inner))
18267        }
18268        /// Set the `id` field and mark the builder changed.
18269        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
18270        /// Set the `params` field and mark the builder changed.
18271        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
18272        /// Set the `body` field and mark the builder changed.
18273        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18274        /// Set the `type_parameters` field and mark the builder changed.
18275        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
18276        /// Set the `renders_type` field and mark the builder changed.
18277        pub fn renders_type(&mut self, renders_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.renders_type = renders_type; }
18278    }
18279    /// Clone-with-changes builder for [`super::HookDeclaration`].
18280    #[derive(Debug)]
18281    pub struct HookDeclaration<'gc> {
18282        is_changed: bool,
18283        pub(super) inner: super::HookDeclaration<'gc>,
18284    }
18285    impl<'gc> HookDeclaration<'gc> {
18286        /// Start from a copy of `node`, with no field changed yet.
18287        pub fn from_node(node: &'gc super::HookDeclaration<'gc>) -> Self {
18288            Self {
18289                is_changed: false,
18290                inner: super::HookDeclaration {
18291                    metadata: node.metadata.duplicate(),
18292                    id: node.id.duplicate(),
18293                    params: node.params.duplicate(),
18294                    body: node.body.duplicate(),
18295                    type_parameters: node.type_parameters.duplicate(),
18296                    return_type: node.return_type.duplicate(),
18297                    r#async: Cell::new(node.r#async.get()),
18298                    scope: Cell::new(node.scope.get()),
18299                    sem_info: Cell::new(node.sem_info.get()),
18300                    strictness: Cell::new(node.strictness.get()),
18301                    is_method_definition: Cell::new(node.is_method_definition.get()),
18302                    decorations: Cell::new(node.decorations.get()),
18303                },
18304            }
18305        }
18306        /// Allocate the rebuilt node if a setter ran, else
18307        /// `TransformResult::Unchanged`.
18308        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18309            if self.is_changed {
18310                TransformResult::Changed(self.build_forced(gc))
18311            } else {
18312                TransformResult::Unchanged
18313            }
18314        }
18315        /// Allocate the node unconditionally, changed or not.
18316        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18317            gc.alloc(Node::HookDeclaration(self.inner))
18318        }
18319        /// Set the `id` field and mark the builder changed.
18320        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
18321        /// Set the `params` field and mark the builder changed.
18322        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
18323        /// Set the `body` field and mark the builder changed.
18324        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18325        /// Set the `type_parameters` field and mark the builder changed.
18326        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
18327        /// Set the `return_type` field and mark the builder changed.
18328        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
18329    }
18330    /// Clone-with-changes builder for [`super::MatchStatement`].
18331    #[derive(Debug)]
18332    pub struct MatchStatement<'gc> {
18333        is_changed: bool,
18334        pub(super) inner: super::MatchStatement<'gc>,
18335    }
18336    impl<'gc> MatchStatement<'gc> {
18337        /// Start from a copy of `node`, with no field changed yet.
18338        pub fn from_node(node: &'gc super::MatchStatement<'gc>) -> Self {
18339            Self {
18340                is_changed: false,
18341                inner: super::MatchStatement {
18342                    metadata: node.metadata.duplicate(),
18343                    argument: node.argument.duplicate(),
18344                    cases: node.cases.duplicate(),
18345                },
18346            }
18347        }
18348        /// Allocate the rebuilt node if a setter ran, else
18349        /// `TransformResult::Unchanged`.
18350        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18351            if self.is_changed {
18352                TransformResult::Changed(self.build_forced(gc))
18353            } else {
18354                TransformResult::Unchanged
18355            }
18356        }
18357        /// Allocate the node unconditionally, changed or not.
18358        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18359            gc.alloc(Node::MatchStatement(self.inner))
18360        }
18361        /// Set the `argument` field and mark the builder changed.
18362        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
18363        /// Set the `cases` field and mark the builder changed.
18364        pub fn cases(&mut self, cases: NodeList<'gc>) { self.is_changed = true; self.inner.cases = cases; }
18365    }
18366    /// Clone-with-changes builder for [`super::WhileStatement`].
18367    #[derive(Debug)]
18368    pub struct WhileStatement<'gc> {
18369        is_changed: bool,
18370        pub(super) inner: super::WhileStatement<'gc>,
18371    }
18372    impl<'gc> WhileStatement<'gc> {
18373        /// Start from a copy of `node`, with no field changed yet.
18374        pub fn from_node(node: &'gc super::WhileStatement<'gc>) -> Self {
18375            Self {
18376                is_changed: false,
18377                inner: super::WhileStatement {
18378                    metadata: node.metadata.duplicate(),
18379                    body: node.body.duplicate(),
18380                    test: node.test.duplicate(),
18381                    label_index: Cell::new(node.label_index.get()),
18382                },
18383            }
18384        }
18385        /// Allocate the rebuilt node if a setter ran, else
18386        /// `TransformResult::Unchanged`.
18387        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18388            if self.is_changed {
18389                TransformResult::Changed(self.build_forced(gc))
18390            } else {
18391                TransformResult::Unchanged
18392            }
18393        }
18394        /// Allocate the node unconditionally, changed or not.
18395        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18396            gc.alloc(Node::WhileStatement(self.inner))
18397        }
18398        /// Set the `body` field and mark the builder changed.
18399        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18400        /// Set the `test` field and mark the builder changed.
18401        pub fn test(&mut self, test: &'gc Node<'gc>) { self.is_changed = true; self.inner.test = test; }
18402    }
18403    /// Clone-with-changes builder for [`super::DoWhileStatement`].
18404    #[derive(Debug)]
18405    pub struct DoWhileStatement<'gc> {
18406        is_changed: bool,
18407        pub(super) inner: super::DoWhileStatement<'gc>,
18408    }
18409    impl<'gc> DoWhileStatement<'gc> {
18410        /// Start from a copy of `node`, with no field changed yet.
18411        pub fn from_node(node: &'gc super::DoWhileStatement<'gc>) -> Self {
18412            Self {
18413                is_changed: false,
18414                inner: super::DoWhileStatement {
18415                    metadata: node.metadata.duplicate(),
18416                    body: node.body.duplicate(),
18417                    test: node.test.duplicate(),
18418                    label_index: Cell::new(node.label_index.get()),
18419                },
18420            }
18421        }
18422        /// Allocate the rebuilt node if a setter ran, else
18423        /// `TransformResult::Unchanged`.
18424        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18425            if self.is_changed {
18426                TransformResult::Changed(self.build_forced(gc))
18427            } else {
18428                TransformResult::Unchanged
18429            }
18430        }
18431        /// Allocate the node unconditionally, changed or not.
18432        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18433            gc.alloc(Node::DoWhileStatement(self.inner))
18434        }
18435        /// Set the `body` field and mark the builder changed.
18436        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18437        /// Set the `test` field and mark the builder changed.
18438        pub fn test(&mut self, test: &'gc Node<'gc>) { self.is_changed = true; self.inner.test = test; }
18439    }
18440    /// Clone-with-changes builder for [`super::ForInStatement`].
18441    #[derive(Debug)]
18442    pub struct ForInStatement<'gc> {
18443        is_changed: bool,
18444        pub(super) inner: super::ForInStatement<'gc>,
18445    }
18446    impl<'gc> ForInStatement<'gc> {
18447        /// Start from a copy of `node`, with no field changed yet.
18448        pub fn from_node(node: &'gc super::ForInStatement<'gc>) -> Self {
18449            Self {
18450                is_changed: false,
18451                inner: super::ForInStatement {
18452                    metadata: node.metadata.duplicate(),
18453                    left: node.left.duplicate(),
18454                    right: node.right.duplicate(),
18455                    body: node.body.duplicate(),
18456                    label_index: Cell::new(node.label_index.get()),
18457                    scope: Cell::new(node.scope.get()),
18458                },
18459            }
18460        }
18461        /// Allocate the rebuilt node if a setter ran, else
18462        /// `TransformResult::Unchanged`.
18463        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18464            if self.is_changed {
18465                TransformResult::Changed(self.build_forced(gc))
18466            } else {
18467                TransformResult::Unchanged
18468            }
18469        }
18470        /// Allocate the node unconditionally, changed or not.
18471        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18472            gc.alloc(Node::ForInStatement(self.inner))
18473        }
18474        /// Set the `left` field and mark the builder changed.
18475        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
18476        /// Set the `right` field and mark the builder changed.
18477        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
18478        /// Set the `body` field and mark the builder changed.
18479        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18480    }
18481    /// Clone-with-changes builder for [`super::ForOfStatement`].
18482    #[derive(Debug)]
18483    pub struct ForOfStatement<'gc> {
18484        is_changed: bool,
18485        pub(super) inner: super::ForOfStatement<'gc>,
18486    }
18487    impl<'gc> ForOfStatement<'gc> {
18488        /// Start from a copy of `node`, with no field changed yet.
18489        pub fn from_node(node: &'gc super::ForOfStatement<'gc>) -> Self {
18490            Self {
18491                is_changed: false,
18492                inner: super::ForOfStatement {
18493                    metadata: node.metadata.duplicate(),
18494                    left: node.left.duplicate(),
18495                    right: node.right.duplicate(),
18496                    body: node.body.duplicate(),
18497                    r#await: Cell::new(node.r#await.get()),
18498                    label_index: Cell::new(node.label_index.get()),
18499                    scope: Cell::new(node.scope.get()),
18500                },
18501            }
18502        }
18503        /// Allocate the rebuilt node if a setter ran, else
18504        /// `TransformResult::Unchanged`.
18505        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18506            if self.is_changed {
18507                TransformResult::Changed(self.build_forced(gc))
18508            } else {
18509                TransformResult::Unchanged
18510            }
18511        }
18512        /// Allocate the node unconditionally, changed or not.
18513        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18514            gc.alloc(Node::ForOfStatement(self.inner))
18515        }
18516        /// Set the `left` field and mark the builder changed.
18517        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
18518        /// Set the `right` field and mark the builder changed.
18519        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
18520        /// Set the `body` field and mark the builder changed.
18521        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18522    }
18523    /// Clone-with-changes builder for [`super::ForStatement`].
18524    #[derive(Debug)]
18525    pub struct ForStatement<'gc> {
18526        is_changed: bool,
18527        pub(super) inner: super::ForStatement<'gc>,
18528    }
18529    impl<'gc> ForStatement<'gc> {
18530        /// Start from a copy of `node`, with no field changed yet.
18531        pub fn from_node(node: &'gc super::ForStatement<'gc>) -> Self {
18532            Self {
18533                is_changed: false,
18534                inner: super::ForStatement {
18535                    metadata: node.metadata.duplicate(),
18536                    init: node.init.duplicate(),
18537                    test: node.test.duplicate(),
18538                    update: node.update.duplicate(),
18539                    body: node.body.duplicate(),
18540                    label_index: Cell::new(node.label_index.get()),
18541                    scope: Cell::new(node.scope.get()),
18542                },
18543            }
18544        }
18545        /// Allocate the rebuilt node if a setter ran, else
18546        /// `TransformResult::Unchanged`.
18547        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18548            if self.is_changed {
18549                TransformResult::Changed(self.build_forced(gc))
18550            } else {
18551                TransformResult::Unchanged
18552            }
18553        }
18554        /// Allocate the node unconditionally, changed or not.
18555        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18556            gc.alloc(Node::ForStatement(self.inner))
18557        }
18558        /// Set the `init` field and mark the builder changed.
18559        pub fn init(&mut self, init: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.init = init; }
18560        /// Set the `test` field and mark the builder changed.
18561        pub fn test(&mut self, test: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.test = test; }
18562        /// Set the `update` field and mark the builder changed.
18563        pub fn update(&mut self, update: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.update = update; }
18564        /// Set the `body` field and mark the builder changed.
18565        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18566    }
18567    /// Clone-with-changes builder for [`super::DebuggerStatement`].
18568    #[derive(Debug)]
18569    pub struct DebuggerStatement<'gc> {
18570        is_changed: bool,
18571        pub(super) inner: super::DebuggerStatement<'gc>,
18572    }
18573    impl<'gc> DebuggerStatement<'gc> {
18574        /// Start from a copy of `node`, with no field changed yet.
18575        pub fn from_node(node: &'gc super::DebuggerStatement<'gc>) -> Self {
18576            Self {
18577                is_changed: false,
18578                inner: super::DebuggerStatement {
18579                    metadata: node.metadata.duplicate(),
18580                },
18581            }
18582        }
18583        /// Allocate the rebuilt node if a setter ran, else
18584        /// `TransformResult::Unchanged`.
18585        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18586            if self.is_changed {
18587                TransformResult::Changed(self.build_forced(gc))
18588            } else {
18589                TransformResult::Unchanged
18590            }
18591        }
18592        /// Allocate the node unconditionally, changed or not.
18593        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18594            gc.alloc(Node::DebuggerStatement(self.inner))
18595        }
18596    }
18597    /// Clone-with-changes builder for [`super::EmptyStatement`].
18598    #[derive(Debug)]
18599    pub struct EmptyStatement<'gc> {
18600        is_changed: bool,
18601        pub(super) inner: super::EmptyStatement<'gc>,
18602    }
18603    impl<'gc> EmptyStatement<'gc> {
18604        /// Start from a copy of `node`, with no field changed yet.
18605        pub fn from_node(node: &'gc super::EmptyStatement<'gc>) -> Self {
18606            Self {
18607                is_changed: false,
18608                inner: super::EmptyStatement {
18609                    metadata: node.metadata.duplicate(),
18610                },
18611            }
18612        }
18613        /// Allocate the rebuilt node if a setter ran, else
18614        /// `TransformResult::Unchanged`.
18615        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18616            if self.is_changed {
18617                TransformResult::Changed(self.build_forced(gc))
18618            } else {
18619                TransformResult::Unchanged
18620            }
18621        }
18622        /// Allocate the node unconditionally, changed or not.
18623        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18624            gc.alloc(Node::EmptyStatement(self.inner))
18625        }
18626    }
18627    /// Clone-with-changes builder for [`super::BlockStatement`].
18628    #[derive(Debug)]
18629    pub struct BlockStatement<'gc> {
18630        is_changed: bool,
18631        pub(super) inner: super::BlockStatement<'gc>,
18632    }
18633    impl<'gc> BlockStatement<'gc> {
18634        /// Start from a copy of `node`, with no field changed yet.
18635        pub fn from_node(node: &'gc super::BlockStatement<'gc>) -> Self {
18636            Self {
18637                is_changed: false,
18638                inner: super::BlockStatement {
18639                    metadata: node.metadata.duplicate(),
18640                    body: node.body.duplicate(),
18641                    implicit: Cell::new(node.implicit.get()),
18642                    scope: Cell::new(node.scope.get()),
18643                    buffer_id: Cell::new(node.buffer_id.get()),
18644                    is_lazy_function_body: Cell::new(node.is_lazy_function_body.get()),
18645                    param_yield: Cell::new(node.param_yield.get()),
18646                    param_await: Cell::new(node.param_await.get()),
18647                    contains_arrow_functions: Cell::new(node.contains_arrow_functions.get()),
18648                    may_contain_arrow_functions_using_arguments: Cell::new(node.may_contain_arrow_functions_using_arguments.get()),
18649                },
18650            }
18651        }
18652        /// Allocate the rebuilt node if a setter ran, else
18653        /// `TransformResult::Unchanged`.
18654        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18655            if self.is_changed {
18656                TransformResult::Changed(self.build_forced(gc))
18657            } else {
18658                TransformResult::Unchanged
18659            }
18660        }
18661        /// Allocate the node unconditionally, changed or not.
18662        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18663            gc.alloc(Node::BlockStatement(self.inner))
18664        }
18665        /// Set the `body` field and mark the builder changed.
18666        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
18667    }
18668    /// Clone-with-changes builder for [`super::StaticBlock`].
18669    #[derive(Debug)]
18670    pub struct StaticBlock<'gc> {
18671        is_changed: bool,
18672        pub(super) inner: super::StaticBlock<'gc>,
18673    }
18674    impl<'gc> StaticBlock<'gc> {
18675        /// Start from a copy of `node`, with no field changed yet.
18676        pub fn from_node(node: &'gc super::StaticBlock<'gc>) -> Self {
18677            Self {
18678                is_changed: false,
18679                inner: super::StaticBlock {
18680                    metadata: node.metadata.duplicate(),
18681                    body: node.body.duplicate(),
18682                    scope: Cell::new(node.scope.get()),
18683                    function_info: Cell::new(node.function_info.get()),
18684                },
18685            }
18686        }
18687        /// Allocate the rebuilt node if a setter ran, else
18688        /// `TransformResult::Unchanged`.
18689        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18690            if self.is_changed {
18691                TransformResult::Changed(self.build_forced(gc))
18692            } else {
18693                TransformResult::Unchanged
18694            }
18695        }
18696        /// Allocate the node unconditionally, changed or not.
18697        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18698            gc.alloc(Node::StaticBlock(self.inner))
18699        }
18700        /// Set the `body` field and mark the builder changed.
18701        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
18702    }
18703    /// Clone-with-changes builder for [`super::BreakStatement`].
18704    #[derive(Debug)]
18705    pub struct BreakStatement<'gc> {
18706        is_changed: bool,
18707        pub(super) inner: super::BreakStatement<'gc>,
18708    }
18709    impl<'gc> BreakStatement<'gc> {
18710        /// Start from a copy of `node`, with no field changed yet.
18711        pub fn from_node(node: &'gc super::BreakStatement<'gc>) -> Self {
18712            Self {
18713                is_changed: false,
18714                inner: super::BreakStatement {
18715                    metadata: node.metadata.duplicate(),
18716                    label: node.label.duplicate(),
18717                    label_index: Cell::new(node.label_index.get()),
18718                },
18719            }
18720        }
18721        /// Allocate the rebuilt node if a setter ran, else
18722        /// `TransformResult::Unchanged`.
18723        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18724            if self.is_changed {
18725                TransformResult::Changed(self.build_forced(gc))
18726            } else {
18727                TransformResult::Unchanged
18728            }
18729        }
18730        /// Allocate the node unconditionally, changed or not.
18731        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18732            gc.alloc(Node::BreakStatement(self.inner))
18733        }
18734        /// Set the `label` field and mark the builder changed.
18735        pub fn label(&mut self, label: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.label = label; }
18736    }
18737    /// Clone-with-changes builder for [`super::ContinueStatement`].
18738    #[derive(Debug)]
18739    pub struct ContinueStatement<'gc> {
18740        is_changed: bool,
18741        pub(super) inner: super::ContinueStatement<'gc>,
18742    }
18743    impl<'gc> ContinueStatement<'gc> {
18744        /// Start from a copy of `node`, with no field changed yet.
18745        pub fn from_node(node: &'gc super::ContinueStatement<'gc>) -> Self {
18746            Self {
18747                is_changed: false,
18748                inner: super::ContinueStatement {
18749                    metadata: node.metadata.duplicate(),
18750                    label: node.label.duplicate(),
18751                    label_index: Cell::new(node.label_index.get()),
18752                },
18753            }
18754        }
18755        /// Allocate the rebuilt node if a setter ran, else
18756        /// `TransformResult::Unchanged`.
18757        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18758            if self.is_changed {
18759                TransformResult::Changed(self.build_forced(gc))
18760            } else {
18761                TransformResult::Unchanged
18762            }
18763        }
18764        /// Allocate the node unconditionally, changed or not.
18765        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18766            gc.alloc(Node::ContinueStatement(self.inner))
18767        }
18768        /// Set the `label` field and mark the builder changed.
18769        pub fn label(&mut self, label: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.label = label; }
18770    }
18771    /// Clone-with-changes builder for [`super::ThrowStatement`].
18772    #[derive(Debug)]
18773    pub struct ThrowStatement<'gc> {
18774        is_changed: bool,
18775        pub(super) inner: super::ThrowStatement<'gc>,
18776    }
18777    impl<'gc> ThrowStatement<'gc> {
18778        /// Start from a copy of `node`, with no field changed yet.
18779        pub fn from_node(node: &'gc super::ThrowStatement<'gc>) -> Self {
18780            Self {
18781                is_changed: false,
18782                inner: super::ThrowStatement {
18783                    metadata: node.metadata.duplicate(),
18784                    argument: node.argument.duplicate(),
18785                },
18786            }
18787        }
18788        /// Allocate the rebuilt node if a setter ran, else
18789        /// `TransformResult::Unchanged`.
18790        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18791            if self.is_changed {
18792                TransformResult::Changed(self.build_forced(gc))
18793            } else {
18794                TransformResult::Unchanged
18795            }
18796        }
18797        /// Allocate the node unconditionally, changed or not.
18798        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18799            gc.alloc(Node::ThrowStatement(self.inner))
18800        }
18801        /// Set the `argument` field and mark the builder changed.
18802        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
18803    }
18804    /// Clone-with-changes builder for [`super::ReturnStatement`].
18805    #[derive(Debug)]
18806    pub struct ReturnStatement<'gc> {
18807        is_changed: bool,
18808        pub(super) inner: super::ReturnStatement<'gc>,
18809    }
18810    impl<'gc> ReturnStatement<'gc> {
18811        /// Start from a copy of `node`, with no field changed yet.
18812        pub fn from_node(node: &'gc super::ReturnStatement<'gc>) -> Self {
18813            Self {
18814                is_changed: false,
18815                inner: super::ReturnStatement {
18816                    metadata: node.metadata.duplicate(),
18817                    argument: node.argument.duplicate(),
18818                },
18819            }
18820        }
18821        /// Allocate the rebuilt node if a setter ran, else
18822        /// `TransformResult::Unchanged`.
18823        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18824            if self.is_changed {
18825                TransformResult::Changed(self.build_forced(gc))
18826            } else {
18827                TransformResult::Unchanged
18828            }
18829        }
18830        /// Allocate the node unconditionally, changed or not.
18831        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18832            gc.alloc(Node::ReturnStatement(self.inner))
18833        }
18834        /// Set the `argument` field and mark the builder changed.
18835        pub fn argument(&mut self, argument: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.argument = argument; }
18836    }
18837    /// Clone-with-changes builder for [`super::WithStatement`].
18838    #[derive(Debug)]
18839    pub struct WithStatement<'gc> {
18840        is_changed: bool,
18841        pub(super) inner: super::WithStatement<'gc>,
18842    }
18843    impl<'gc> WithStatement<'gc> {
18844        /// Start from a copy of `node`, with no field changed yet.
18845        pub fn from_node(node: &'gc super::WithStatement<'gc>) -> Self {
18846            Self {
18847                is_changed: false,
18848                inner: super::WithStatement {
18849                    metadata: node.metadata.duplicate(),
18850                    object: node.object.duplicate(),
18851                    body: node.body.duplicate(),
18852                },
18853            }
18854        }
18855        /// Allocate the rebuilt node if a setter ran, else
18856        /// `TransformResult::Unchanged`.
18857        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18858            if self.is_changed {
18859                TransformResult::Changed(self.build_forced(gc))
18860            } else {
18861                TransformResult::Unchanged
18862            }
18863        }
18864        /// Allocate the node unconditionally, changed or not.
18865        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18866            gc.alloc(Node::WithStatement(self.inner))
18867        }
18868        /// Set the `object` field and mark the builder changed.
18869        pub fn object(&mut self, object: &'gc Node<'gc>) { self.is_changed = true; self.inner.object = object; }
18870        /// Set the `body` field and mark the builder changed.
18871        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18872    }
18873    /// Clone-with-changes builder for [`super::SwitchStatement`].
18874    #[derive(Debug)]
18875    pub struct SwitchStatement<'gc> {
18876        is_changed: bool,
18877        pub(super) inner: super::SwitchStatement<'gc>,
18878    }
18879    impl<'gc> SwitchStatement<'gc> {
18880        /// Start from a copy of `node`, with no field changed yet.
18881        pub fn from_node(node: &'gc super::SwitchStatement<'gc>) -> Self {
18882            Self {
18883                is_changed: false,
18884                inner: super::SwitchStatement {
18885                    metadata: node.metadata.duplicate(),
18886                    discriminant: node.discriminant.duplicate(),
18887                    cases: node.cases.duplicate(),
18888                    label_index: Cell::new(node.label_index.get()),
18889                    scope: Cell::new(node.scope.get()),
18890                },
18891            }
18892        }
18893        /// Allocate the rebuilt node if a setter ran, else
18894        /// `TransformResult::Unchanged`.
18895        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18896            if self.is_changed {
18897                TransformResult::Changed(self.build_forced(gc))
18898            } else {
18899                TransformResult::Unchanged
18900            }
18901        }
18902        /// Allocate the node unconditionally, changed or not.
18903        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18904            gc.alloc(Node::SwitchStatement(self.inner))
18905        }
18906        /// Set the `discriminant` field and mark the builder changed.
18907        pub fn discriminant(&mut self, discriminant: &'gc Node<'gc>) { self.is_changed = true; self.inner.discriminant = discriminant; }
18908        /// Set the `cases` field and mark the builder changed.
18909        pub fn cases(&mut self, cases: NodeList<'gc>) { self.is_changed = true; self.inner.cases = cases; }
18910    }
18911    /// Clone-with-changes builder for [`super::LabeledStatement`].
18912    #[derive(Debug)]
18913    pub struct LabeledStatement<'gc> {
18914        is_changed: bool,
18915        pub(super) inner: super::LabeledStatement<'gc>,
18916    }
18917    impl<'gc> LabeledStatement<'gc> {
18918        /// Start from a copy of `node`, with no field changed yet.
18919        pub fn from_node(node: &'gc super::LabeledStatement<'gc>) -> Self {
18920            Self {
18921                is_changed: false,
18922                inner: super::LabeledStatement {
18923                    metadata: node.metadata.duplicate(),
18924                    label: node.label.duplicate(),
18925                    body: node.body.duplicate(),
18926                    label_index: Cell::new(node.label_index.get()),
18927                },
18928            }
18929        }
18930        /// Allocate the rebuilt node if a setter ran, else
18931        /// `TransformResult::Unchanged`.
18932        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18933            if self.is_changed {
18934                TransformResult::Changed(self.build_forced(gc))
18935            } else {
18936                TransformResult::Unchanged
18937            }
18938        }
18939        /// Allocate the node unconditionally, changed or not.
18940        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18941            gc.alloc(Node::LabeledStatement(self.inner))
18942        }
18943        /// Set the `label` field and mark the builder changed.
18944        pub fn label(&mut self, label: &'gc Node<'gc>) { self.is_changed = true; self.inner.label = label; }
18945        /// Set the `body` field and mark the builder changed.
18946        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
18947    }
18948    /// Clone-with-changes builder for [`super::ExpressionStatement`].
18949    #[derive(Debug)]
18950    pub struct ExpressionStatement<'gc> {
18951        is_changed: bool,
18952        pub(super) inner: super::ExpressionStatement<'gc>,
18953    }
18954    impl<'gc> ExpressionStatement<'gc> {
18955        /// Start from a copy of `node`, with no field changed yet.
18956        pub fn from_node(node: &'gc super::ExpressionStatement<'gc>) -> Self {
18957            Self {
18958                is_changed: false,
18959                inner: super::ExpressionStatement {
18960                    metadata: node.metadata.duplicate(),
18961                    expression: node.expression.duplicate(),
18962                    directive: Cell::new(node.directive.get()),
18963                },
18964            }
18965        }
18966        /// Allocate the rebuilt node if a setter ran, else
18967        /// `TransformResult::Unchanged`.
18968        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
18969            if self.is_changed {
18970                TransformResult::Changed(self.build_forced(gc))
18971            } else {
18972                TransformResult::Unchanged
18973            }
18974        }
18975        /// Allocate the node unconditionally, changed or not.
18976        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
18977            gc.alloc(Node::ExpressionStatement(self.inner))
18978        }
18979        /// Set the `expression` field and mark the builder changed.
18980        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
18981    }
18982    /// Clone-with-changes builder for [`super::TryStatement`].
18983    #[derive(Debug)]
18984    pub struct TryStatement<'gc> {
18985        is_changed: bool,
18986        pub(super) inner: super::TryStatement<'gc>,
18987    }
18988    impl<'gc> TryStatement<'gc> {
18989        /// Start from a copy of `node`, with no field changed yet.
18990        pub fn from_node(node: &'gc super::TryStatement<'gc>) -> Self {
18991            Self {
18992                is_changed: false,
18993                inner: super::TryStatement {
18994                    metadata: node.metadata.duplicate(),
18995                    block: node.block.duplicate(),
18996                    handler: node.handler.duplicate(),
18997                    finalizer: node.finalizer.duplicate(),
18998                },
18999            }
19000        }
19001        /// Allocate the rebuilt node if a setter ran, else
19002        /// `TransformResult::Unchanged`.
19003        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19004            if self.is_changed {
19005                TransformResult::Changed(self.build_forced(gc))
19006            } else {
19007                TransformResult::Unchanged
19008            }
19009        }
19010        /// Allocate the node unconditionally, changed or not.
19011        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19012            gc.alloc(Node::TryStatement(self.inner))
19013        }
19014        /// Set the `block` field and mark the builder changed.
19015        pub fn block(&mut self, block: &'gc Node<'gc>) { self.is_changed = true; self.inner.block = block; }
19016        /// Set the `handler` field and mark the builder changed.
19017        pub fn handler(&mut self, handler: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.handler = handler; }
19018        /// Set the `finalizer` field and mark the builder changed.
19019        pub fn finalizer(&mut self, finalizer: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.finalizer = finalizer; }
19020    }
19021    /// Clone-with-changes builder for [`super::IfStatement`].
19022    #[derive(Debug)]
19023    pub struct IfStatement<'gc> {
19024        is_changed: bool,
19025        pub(super) inner: super::IfStatement<'gc>,
19026    }
19027    impl<'gc> IfStatement<'gc> {
19028        /// Start from a copy of `node`, with no field changed yet.
19029        pub fn from_node(node: &'gc super::IfStatement<'gc>) -> Self {
19030            Self {
19031                is_changed: false,
19032                inner: super::IfStatement {
19033                    metadata: node.metadata.duplicate(),
19034                    test: node.test.duplicate(),
19035                    consequent: node.consequent.duplicate(),
19036                    alternate: node.alternate.duplicate(),
19037                },
19038            }
19039        }
19040        /// Allocate the rebuilt node if a setter ran, else
19041        /// `TransformResult::Unchanged`.
19042        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19043            if self.is_changed {
19044                TransformResult::Changed(self.build_forced(gc))
19045            } else {
19046                TransformResult::Unchanged
19047            }
19048        }
19049        /// Allocate the node unconditionally, changed or not.
19050        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19051            gc.alloc(Node::IfStatement(self.inner))
19052        }
19053        /// Set the `test` field and mark the builder changed.
19054        pub fn test(&mut self, test: &'gc Node<'gc>) { self.is_changed = true; self.inner.test = test; }
19055        /// Set the `consequent` field and mark the builder changed.
19056        pub fn consequent(&mut self, consequent: &'gc Node<'gc>) { self.is_changed = true; self.inner.consequent = consequent; }
19057        /// Set the `alternate` field and mark the builder changed.
19058        pub fn alternate(&mut self, alternate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.alternate = alternate; }
19059    }
19060    /// Clone-with-changes builder for [`super::NullLiteral`].
19061    #[derive(Debug)]
19062    pub struct NullLiteral<'gc> {
19063        is_changed: bool,
19064        pub(super) inner: super::NullLiteral<'gc>,
19065    }
19066    impl<'gc> NullLiteral<'gc> {
19067        /// Start from a copy of `node`, with no field changed yet.
19068        pub fn from_node(node: &'gc super::NullLiteral<'gc>) -> Self {
19069            Self {
19070                is_changed: false,
19071                inner: super::NullLiteral {
19072                    metadata: node.metadata.duplicate(),
19073                },
19074            }
19075        }
19076        /// Allocate the rebuilt node if a setter ran, else
19077        /// `TransformResult::Unchanged`.
19078        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19079            if self.is_changed {
19080                TransformResult::Changed(self.build_forced(gc))
19081            } else {
19082                TransformResult::Unchanged
19083            }
19084        }
19085        /// Allocate the node unconditionally, changed or not.
19086        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19087            gc.alloc(Node::NullLiteral(self.inner))
19088        }
19089    }
19090    /// Clone-with-changes builder for [`super::BooleanLiteral`].
19091    #[derive(Debug)]
19092    pub struct BooleanLiteral<'gc> {
19093        is_changed: bool,
19094        pub(super) inner: super::BooleanLiteral<'gc>,
19095    }
19096    impl<'gc> BooleanLiteral<'gc> {
19097        /// Start from a copy of `node`, with no field changed yet.
19098        pub fn from_node(node: &'gc super::BooleanLiteral<'gc>) -> Self {
19099            Self {
19100                is_changed: false,
19101                inner: super::BooleanLiteral {
19102                    metadata: node.metadata.duplicate(),
19103                    value: Cell::new(node.value.get()),
19104                },
19105            }
19106        }
19107        /// Allocate the rebuilt node if a setter ran, else
19108        /// `TransformResult::Unchanged`.
19109        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19110            if self.is_changed {
19111                TransformResult::Changed(self.build_forced(gc))
19112            } else {
19113                TransformResult::Unchanged
19114            }
19115        }
19116        /// Allocate the node unconditionally, changed or not.
19117        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19118            gc.alloc(Node::BooleanLiteral(self.inner))
19119        }
19120    }
19121    /// Clone-with-changes builder for [`super::StringLiteral`].
19122    #[derive(Debug)]
19123    pub struct StringLiteral<'gc> {
19124        is_changed: bool,
19125        pub(super) inner: super::StringLiteral<'gc>,
19126    }
19127    impl<'gc> StringLiteral<'gc> {
19128        /// Start from a copy of `node`, with no field changed yet.
19129        pub fn from_node(node: &'gc super::StringLiteral<'gc>) -> Self {
19130            Self {
19131                is_changed: false,
19132                inner: super::StringLiteral {
19133                    metadata: node.metadata.duplicate(),
19134                    value: Cell::new(node.value.get()),
19135                },
19136            }
19137        }
19138        /// Allocate the rebuilt node if a setter ran, else
19139        /// `TransformResult::Unchanged`.
19140        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19141            if self.is_changed {
19142                TransformResult::Changed(self.build_forced(gc))
19143            } else {
19144                TransformResult::Unchanged
19145            }
19146        }
19147        /// Allocate the node unconditionally, changed or not.
19148        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19149            gc.alloc(Node::StringLiteral(self.inner))
19150        }
19151    }
19152    /// Clone-with-changes builder for [`super::NumericLiteral`].
19153    #[derive(Debug)]
19154    pub struct NumericLiteral<'gc> {
19155        is_changed: bool,
19156        pub(super) inner: super::NumericLiteral<'gc>,
19157    }
19158    impl<'gc> NumericLiteral<'gc> {
19159        /// Start from a copy of `node`, with no field changed yet.
19160        pub fn from_node(node: &'gc super::NumericLiteral<'gc>) -> Self {
19161            Self {
19162                is_changed: false,
19163                inner: super::NumericLiteral {
19164                    metadata: node.metadata.duplicate(),
19165                    value: Cell::new(node.value.get()),
19166                },
19167            }
19168        }
19169        /// Allocate the rebuilt node if a setter ran, else
19170        /// `TransformResult::Unchanged`.
19171        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19172            if self.is_changed {
19173                TransformResult::Changed(self.build_forced(gc))
19174            } else {
19175                TransformResult::Unchanged
19176            }
19177        }
19178        /// Allocate the node unconditionally, changed or not.
19179        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19180            gc.alloc(Node::NumericLiteral(self.inner))
19181        }
19182    }
19183    /// Clone-with-changes builder for [`super::RegExpLiteral`].
19184    #[derive(Debug)]
19185    pub struct RegExpLiteral<'gc> {
19186        is_changed: bool,
19187        pub(super) inner: super::RegExpLiteral<'gc>,
19188    }
19189    impl<'gc> RegExpLiteral<'gc> {
19190        /// Start from a copy of `node`, with no field changed yet.
19191        pub fn from_node(node: &'gc super::RegExpLiteral<'gc>) -> Self {
19192            Self {
19193                is_changed: false,
19194                inner: super::RegExpLiteral {
19195                    metadata: node.metadata.duplicate(),
19196                    pattern: Cell::new(node.pattern.get()),
19197                    flags: Cell::new(node.flags.get()),
19198                },
19199            }
19200        }
19201        /// Allocate the rebuilt node if a setter ran, else
19202        /// `TransformResult::Unchanged`.
19203        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19204            if self.is_changed {
19205                TransformResult::Changed(self.build_forced(gc))
19206            } else {
19207                TransformResult::Unchanged
19208            }
19209        }
19210        /// Allocate the node unconditionally, changed or not.
19211        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19212            gc.alloc(Node::RegExpLiteral(self.inner))
19213        }
19214    }
19215    /// Clone-with-changes builder for [`super::BigIntLiteral`].
19216    #[derive(Debug)]
19217    pub struct BigIntLiteral<'gc> {
19218        is_changed: bool,
19219        pub(super) inner: super::BigIntLiteral<'gc>,
19220    }
19221    impl<'gc> BigIntLiteral<'gc> {
19222        /// Start from a copy of `node`, with no field changed yet.
19223        pub fn from_node(node: &'gc super::BigIntLiteral<'gc>) -> Self {
19224            Self {
19225                is_changed: false,
19226                inner: super::BigIntLiteral {
19227                    metadata: node.metadata.duplicate(),
19228                    bigint: Cell::new(node.bigint.get()),
19229                },
19230            }
19231        }
19232        /// Allocate the rebuilt node if a setter ran, else
19233        /// `TransformResult::Unchanged`.
19234        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19235            if self.is_changed {
19236                TransformResult::Changed(self.build_forced(gc))
19237            } else {
19238                TransformResult::Unchanged
19239            }
19240        }
19241        /// Allocate the node unconditionally, changed or not.
19242        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19243            gc.alloc(Node::BigIntLiteral(self.inner))
19244        }
19245    }
19246    /// Clone-with-changes builder for [`super::ThisExpression`].
19247    #[derive(Debug)]
19248    pub struct ThisExpression<'gc> {
19249        is_changed: bool,
19250        pub(super) inner: super::ThisExpression<'gc>,
19251    }
19252    impl<'gc> ThisExpression<'gc> {
19253        /// Start from a copy of `node`, with no field changed yet.
19254        pub fn from_node(node: &'gc super::ThisExpression<'gc>) -> Self {
19255            Self {
19256                is_changed: false,
19257                inner: super::ThisExpression {
19258                    metadata: node.metadata.duplicate(),
19259                },
19260            }
19261        }
19262        /// Allocate the rebuilt node if a setter ran, else
19263        /// `TransformResult::Unchanged`.
19264        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19265            if self.is_changed {
19266                TransformResult::Changed(self.build_forced(gc))
19267            } else {
19268                TransformResult::Unchanged
19269            }
19270        }
19271        /// Allocate the node unconditionally, changed or not.
19272        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19273            gc.alloc(Node::ThisExpression(self.inner))
19274        }
19275    }
19276    /// Clone-with-changes builder for [`super::Super`].
19277    #[derive(Debug)]
19278    pub struct Super<'gc> {
19279        is_changed: bool,
19280        pub(super) inner: super::Super<'gc>,
19281    }
19282    impl<'gc> Super<'gc> {
19283        /// Start from a copy of `node`, with no field changed yet.
19284        pub fn from_node(node: &'gc super::Super<'gc>) -> Self {
19285            Self {
19286                is_changed: false,
19287                inner: super::Super {
19288                    metadata: node.metadata.duplicate(),
19289                },
19290            }
19291        }
19292        /// Allocate the rebuilt node if a setter ran, else
19293        /// `TransformResult::Unchanged`.
19294        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19295            if self.is_changed {
19296                TransformResult::Changed(self.build_forced(gc))
19297            } else {
19298                TransformResult::Unchanged
19299            }
19300        }
19301        /// Allocate the node unconditionally, changed or not.
19302        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19303            gc.alloc(Node::Super(self.inner))
19304        }
19305    }
19306    /// Clone-with-changes builder for [`super::SequenceExpression`].
19307    #[derive(Debug)]
19308    pub struct SequenceExpression<'gc> {
19309        is_changed: bool,
19310        pub(super) inner: super::SequenceExpression<'gc>,
19311    }
19312    impl<'gc> SequenceExpression<'gc> {
19313        /// Start from a copy of `node`, with no field changed yet.
19314        pub fn from_node(node: &'gc super::SequenceExpression<'gc>) -> Self {
19315            Self {
19316                is_changed: false,
19317                inner: super::SequenceExpression {
19318                    metadata: node.metadata.duplicate(),
19319                    expressions: node.expressions.duplicate(),
19320                },
19321            }
19322        }
19323        /// Allocate the rebuilt node if a setter ran, else
19324        /// `TransformResult::Unchanged`.
19325        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19326            if self.is_changed {
19327                TransformResult::Changed(self.build_forced(gc))
19328            } else {
19329                TransformResult::Unchanged
19330            }
19331        }
19332        /// Allocate the node unconditionally, changed or not.
19333        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19334            gc.alloc(Node::SequenceExpression(self.inner))
19335        }
19336        /// Set the `expressions` field and mark the builder changed.
19337        pub fn expressions(&mut self, expressions: NodeList<'gc>) { self.is_changed = true; self.inner.expressions = expressions; }
19338    }
19339    /// Clone-with-changes builder for [`super::ObjectExpression`].
19340    #[derive(Debug)]
19341    pub struct ObjectExpression<'gc> {
19342        is_changed: bool,
19343        pub(super) inner: super::ObjectExpression<'gc>,
19344    }
19345    impl<'gc> ObjectExpression<'gc> {
19346        /// Start from a copy of `node`, with no field changed yet.
19347        pub fn from_node(node: &'gc super::ObjectExpression<'gc>) -> Self {
19348            Self {
19349                is_changed: false,
19350                inner: super::ObjectExpression {
19351                    metadata: node.metadata.duplicate(),
19352                    properties: node.properties.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::ObjectExpression(self.inner))
19368        }
19369        /// Set the `properties` field and mark the builder changed.
19370        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
19371    }
19372    /// Clone-with-changes builder for [`super::ArrayExpression`].
19373    #[derive(Debug)]
19374    pub struct ArrayExpression<'gc> {
19375        is_changed: bool,
19376        pub(super) inner: super::ArrayExpression<'gc>,
19377    }
19378    impl<'gc> ArrayExpression<'gc> {
19379        /// Start from a copy of `node`, with no field changed yet.
19380        pub fn from_node(node: &'gc super::ArrayExpression<'gc>) -> Self {
19381            Self {
19382                is_changed: false,
19383                inner: super::ArrayExpression {
19384                    metadata: node.metadata.duplicate(),
19385                    elements: node.elements.duplicate(),
19386                    trailing_comma: Cell::new(node.trailing_comma.get()),
19387                },
19388            }
19389        }
19390        /// Allocate the rebuilt node if a setter ran, else
19391        /// `TransformResult::Unchanged`.
19392        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19393            if self.is_changed {
19394                TransformResult::Changed(self.build_forced(gc))
19395            } else {
19396                TransformResult::Unchanged
19397            }
19398        }
19399        /// Allocate the node unconditionally, changed or not.
19400        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19401            gc.alloc(Node::ArrayExpression(self.inner))
19402        }
19403        /// Set the `elements` field and mark the builder changed.
19404        pub fn elements(&mut self, elements: NodeList<'gc>) { self.is_changed = true; self.inner.elements = elements; }
19405    }
19406    /// Clone-with-changes builder for [`super::SpreadElement`].
19407    #[derive(Debug)]
19408    pub struct SpreadElement<'gc> {
19409        is_changed: bool,
19410        pub(super) inner: super::SpreadElement<'gc>,
19411    }
19412    impl<'gc> SpreadElement<'gc> {
19413        /// Start from a copy of `node`, with no field changed yet.
19414        pub fn from_node(node: &'gc super::SpreadElement<'gc>) -> Self {
19415            Self {
19416                is_changed: false,
19417                inner: super::SpreadElement {
19418                    metadata: node.metadata.duplicate(),
19419                    argument: node.argument.duplicate(),
19420                },
19421            }
19422        }
19423        /// Allocate the rebuilt node if a setter ran, else
19424        /// `TransformResult::Unchanged`.
19425        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19426            if self.is_changed {
19427                TransformResult::Changed(self.build_forced(gc))
19428            } else {
19429                TransformResult::Unchanged
19430            }
19431        }
19432        /// Allocate the node unconditionally, changed or not.
19433        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19434            gc.alloc(Node::SpreadElement(self.inner))
19435        }
19436        /// Set the `argument` field and mark the builder changed.
19437        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
19438    }
19439    /// Clone-with-changes builder for [`super::NewExpression`].
19440    #[derive(Debug)]
19441    pub struct NewExpression<'gc> {
19442        is_changed: bool,
19443        pub(super) inner: super::NewExpression<'gc>,
19444    }
19445    impl<'gc> NewExpression<'gc> {
19446        /// Start from a copy of `node`, with no field changed yet.
19447        pub fn from_node(node: &'gc super::NewExpression<'gc>) -> Self {
19448            Self {
19449                is_changed: false,
19450                inner: super::NewExpression {
19451                    metadata: node.metadata.duplicate(),
19452                    callee: node.callee.duplicate(),
19453                    type_arguments: node.type_arguments.duplicate(),
19454                    arguments: node.arguments.duplicate(),
19455                },
19456            }
19457        }
19458        /// Allocate the rebuilt node if a setter ran, else
19459        /// `TransformResult::Unchanged`.
19460        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19461            if self.is_changed {
19462                TransformResult::Changed(self.build_forced(gc))
19463            } else {
19464                TransformResult::Unchanged
19465            }
19466        }
19467        /// Allocate the node unconditionally, changed or not.
19468        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19469            gc.alloc(Node::NewExpression(self.inner))
19470        }
19471        /// Set the `callee` field and mark the builder changed.
19472        pub fn callee(&mut self, callee: &'gc Node<'gc>) { self.is_changed = true; self.inner.callee = callee; }
19473        /// Set the `type_arguments` field and mark the builder changed.
19474        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
19475        /// Set the `arguments` field and mark the builder changed.
19476        pub fn arguments(&mut self, arguments: NodeList<'gc>) { self.is_changed = true; self.inner.arguments = arguments; }
19477    }
19478    /// Clone-with-changes builder for [`super::YieldExpression`].
19479    #[derive(Debug)]
19480    pub struct YieldExpression<'gc> {
19481        is_changed: bool,
19482        pub(super) inner: super::YieldExpression<'gc>,
19483    }
19484    impl<'gc> YieldExpression<'gc> {
19485        /// Start from a copy of `node`, with no field changed yet.
19486        pub fn from_node(node: &'gc super::YieldExpression<'gc>) -> Self {
19487            Self {
19488                is_changed: false,
19489                inner: super::YieldExpression {
19490                    metadata: node.metadata.duplicate(),
19491                    argument: node.argument.duplicate(),
19492                    delegate: Cell::new(node.delegate.get()),
19493                },
19494            }
19495        }
19496        /// Allocate the rebuilt node if a setter ran, else
19497        /// `TransformResult::Unchanged`.
19498        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19499            if self.is_changed {
19500                TransformResult::Changed(self.build_forced(gc))
19501            } else {
19502                TransformResult::Unchanged
19503            }
19504        }
19505        /// Allocate the node unconditionally, changed or not.
19506        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19507            gc.alloc(Node::YieldExpression(self.inner))
19508        }
19509        /// Set the `argument` field and mark the builder changed.
19510        pub fn argument(&mut self, argument: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.argument = argument; }
19511    }
19512    /// Clone-with-changes builder for [`super::AwaitExpression`].
19513    #[derive(Debug)]
19514    pub struct AwaitExpression<'gc> {
19515        is_changed: bool,
19516        pub(super) inner: super::AwaitExpression<'gc>,
19517    }
19518    impl<'gc> AwaitExpression<'gc> {
19519        /// Start from a copy of `node`, with no field changed yet.
19520        pub fn from_node(node: &'gc super::AwaitExpression<'gc>) -> Self {
19521            Self {
19522                is_changed: false,
19523                inner: super::AwaitExpression {
19524                    metadata: node.metadata.duplicate(),
19525                    argument: node.argument.duplicate(),
19526                },
19527            }
19528        }
19529        /// Allocate the rebuilt node if a setter ran, else
19530        /// `TransformResult::Unchanged`.
19531        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19532            if self.is_changed {
19533                TransformResult::Changed(self.build_forced(gc))
19534            } else {
19535                TransformResult::Unchanged
19536            }
19537        }
19538        /// Allocate the node unconditionally, changed or not.
19539        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19540            gc.alloc(Node::AwaitExpression(self.inner))
19541        }
19542        /// Set the `argument` field and mark the builder changed.
19543        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
19544    }
19545    /// Clone-with-changes builder for [`super::ImportExpression`].
19546    #[derive(Debug)]
19547    pub struct ImportExpression<'gc> {
19548        is_changed: bool,
19549        pub(super) inner: super::ImportExpression<'gc>,
19550    }
19551    impl<'gc> ImportExpression<'gc> {
19552        /// Start from a copy of `node`, with no field changed yet.
19553        pub fn from_node(node: &'gc super::ImportExpression<'gc>) -> Self {
19554            Self {
19555                is_changed: false,
19556                inner: super::ImportExpression {
19557                    metadata: node.metadata.duplicate(),
19558                    source: node.source.duplicate(),
19559                    options: node.options.duplicate(),
19560                },
19561            }
19562        }
19563        /// Allocate the rebuilt node if a setter ran, else
19564        /// `TransformResult::Unchanged`.
19565        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19566            if self.is_changed {
19567                TransformResult::Changed(self.build_forced(gc))
19568            } else {
19569                TransformResult::Unchanged
19570            }
19571        }
19572        /// Allocate the node unconditionally, changed or not.
19573        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19574            gc.alloc(Node::ImportExpression(self.inner))
19575        }
19576        /// Set the `source` field and mark the builder changed.
19577        pub fn source(&mut self, source: &'gc Node<'gc>) { self.is_changed = true; self.inner.source = source; }
19578        /// Set the `options` field and mark the builder changed.
19579        pub fn options(&mut self, options: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.options = options; }
19580    }
19581    /// Clone-with-changes builder for [`super::CallExpression`].
19582    #[derive(Debug)]
19583    pub struct CallExpression<'gc> {
19584        is_changed: bool,
19585        pub(super) inner: super::CallExpression<'gc>,
19586    }
19587    impl<'gc> CallExpression<'gc> {
19588        /// Start from a copy of `node`, with no field changed yet.
19589        pub fn from_node(node: &'gc super::CallExpression<'gc>) -> Self {
19590            Self {
19591                is_changed: false,
19592                inner: super::CallExpression {
19593                    metadata: node.metadata.duplicate(),
19594                    callee: node.callee.duplicate(),
19595                    type_arguments: node.type_arguments.duplicate(),
19596                    arguments: node.arguments.duplicate(),
19597                },
19598            }
19599        }
19600        /// Allocate the rebuilt node if a setter ran, else
19601        /// `TransformResult::Unchanged`.
19602        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19603            if self.is_changed {
19604                TransformResult::Changed(self.build_forced(gc))
19605            } else {
19606                TransformResult::Unchanged
19607            }
19608        }
19609        /// Allocate the node unconditionally, changed or not.
19610        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19611            gc.alloc(Node::CallExpression(self.inner))
19612        }
19613        /// Set the `callee` field and mark the builder changed.
19614        pub fn callee(&mut self, callee: &'gc Node<'gc>) { self.is_changed = true; self.inner.callee = callee; }
19615        /// Set the `type_arguments` field and mark the builder changed.
19616        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
19617        /// Set the `arguments` field and mark the builder changed.
19618        pub fn arguments(&mut self, arguments: NodeList<'gc>) { self.is_changed = true; self.inner.arguments = arguments; }
19619    }
19620    /// Clone-with-changes builder for [`super::OptionalCallExpression`].
19621    #[derive(Debug)]
19622    pub struct OptionalCallExpression<'gc> {
19623        is_changed: bool,
19624        pub(super) inner: super::OptionalCallExpression<'gc>,
19625    }
19626    impl<'gc> OptionalCallExpression<'gc> {
19627        /// Start from a copy of `node`, with no field changed yet.
19628        pub fn from_node(node: &'gc super::OptionalCallExpression<'gc>) -> Self {
19629            Self {
19630                is_changed: false,
19631                inner: super::OptionalCallExpression {
19632                    metadata: node.metadata.duplicate(),
19633                    callee: node.callee.duplicate(),
19634                    type_arguments: node.type_arguments.duplicate(),
19635                    arguments: node.arguments.duplicate(),
19636                    optional: Cell::new(node.optional.get()),
19637                },
19638            }
19639        }
19640        /// Allocate the rebuilt node if a setter ran, else
19641        /// `TransformResult::Unchanged`.
19642        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19643            if self.is_changed {
19644                TransformResult::Changed(self.build_forced(gc))
19645            } else {
19646                TransformResult::Unchanged
19647            }
19648        }
19649        /// Allocate the node unconditionally, changed or not.
19650        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19651            gc.alloc(Node::OptionalCallExpression(self.inner))
19652        }
19653        /// Set the `callee` field and mark the builder changed.
19654        pub fn callee(&mut self, callee: &'gc Node<'gc>) { self.is_changed = true; self.inner.callee = callee; }
19655        /// Set the `type_arguments` field and mark the builder changed.
19656        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
19657        /// Set the `arguments` field and mark the builder changed.
19658        pub fn arguments(&mut self, arguments: NodeList<'gc>) { self.is_changed = true; self.inner.arguments = arguments; }
19659    }
19660    /// Clone-with-changes builder for [`super::AssignmentExpression`].
19661    #[derive(Debug)]
19662    pub struct AssignmentExpression<'gc> {
19663        is_changed: bool,
19664        pub(super) inner: super::AssignmentExpression<'gc>,
19665    }
19666    impl<'gc> AssignmentExpression<'gc> {
19667        /// Start from a copy of `node`, with no field changed yet.
19668        pub fn from_node(node: &'gc super::AssignmentExpression<'gc>) -> Self {
19669            Self {
19670                is_changed: false,
19671                inner: super::AssignmentExpression {
19672                    metadata: node.metadata.duplicate(),
19673                    operator: Cell::new(node.operator.get()),
19674                    left: node.left.duplicate(),
19675                    right: node.right.duplicate(),
19676                },
19677            }
19678        }
19679        /// Allocate the rebuilt node if a setter ran, else
19680        /// `TransformResult::Unchanged`.
19681        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19682            if self.is_changed {
19683                TransformResult::Changed(self.build_forced(gc))
19684            } else {
19685                TransformResult::Unchanged
19686            }
19687        }
19688        /// Allocate the node unconditionally, changed or not.
19689        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19690            gc.alloc(Node::AssignmentExpression(self.inner))
19691        }
19692        /// Set the `left` field and mark the builder changed.
19693        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
19694        /// Set the `right` field and mark the builder changed.
19695        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
19696    }
19697    /// Clone-with-changes builder for [`super::UnaryExpression`].
19698    #[derive(Debug)]
19699    pub struct UnaryExpression<'gc> {
19700        is_changed: bool,
19701        pub(super) inner: super::UnaryExpression<'gc>,
19702    }
19703    impl<'gc> UnaryExpression<'gc> {
19704        /// Start from a copy of `node`, with no field changed yet.
19705        pub fn from_node(node: &'gc super::UnaryExpression<'gc>) -> Self {
19706            Self {
19707                is_changed: false,
19708                inner: super::UnaryExpression {
19709                    metadata: node.metadata.duplicate(),
19710                    operator: Cell::new(node.operator.get()),
19711                    argument: node.argument.duplicate(),
19712                    prefix: Cell::new(node.prefix.get()),
19713                },
19714            }
19715        }
19716        /// Allocate the rebuilt node if a setter ran, else
19717        /// `TransformResult::Unchanged`.
19718        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19719            if self.is_changed {
19720                TransformResult::Changed(self.build_forced(gc))
19721            } else {
19722                TransformResult::Unchanged
19723            }
19724        }
19725        /// Allocate the node unconditionally, changed or not.
19726        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19727            gc.alloc(Node::UnaryExpression(self.inner))
19728        }
19729        /// Set the `argument` field and mark the builder changed.
19730        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
19731    }
19732    /// Clone-with-changes builder for [`super::UpdateExpression`].
19733    #[derive(Debug)]
19734    pub struct UpdateExpression<'gc> {
19735        is_changed: bool,
19736        pub(super) inner: super::UpdateExpression<'gc>,
19737    }
19738    impl<'gc> UpdateExpression<'gc> {
19739        /// Start from a copy of `node`, with no field changed yet.
19740        pub fn from_node(node: &'gc super::UpdateExpression<'gc>) -> Self {
19741            Self {
19742                is_changed: false,
19743                inner: super::UpdateExpression {
19744                    metadata: node.metadata.duplicate(),
19745                    operator: Cell::new(node.operator.get()),
19746                    argument: node.argument.duplicate(),
19747                    prefix: Cell::new(node.prefix.get()),
19748                },
19749            }
19750        }
19751        /// Allocate the rebuilt node if a setter ran, else
19752        /// `TransformResult::Unchanged`.
19753        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19754            if self.is_changed {
19755                TransformResult::Changed(self.build_forced(gc))
19756            } else {
19757                TransformResult::Unchanged
19758            }
19759        }
19760        /// Allocate the node unconditionally, changed or not.
19761        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19762            gc.alloc(Node::UpdateExpression(self.inner))
19763        }
19764        /// Set the `argument` field and mark the builder changed.
19765        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
19766    }
19767    /// Clone-with-changes builder for [`super::MemberExpression`].
19768    #[derive(Debug)]
19769    pub struct MemberExpression<'gc> {
19770        is_changed: bool,
19771        pub(super) inner: super::MemberExpression<'gc>,
19772    }
19773    impl<'gc> MemberExpression<'gc> {
19774        /// Start from a copy of `node`, with no field changed yet.
19775        pub fn from_node(node: &'gc super::MemberExpression<'gc>) -> Self {
19776            Self {
19777                is_changed: false,
19778                inner: super::MemberExpression {
19779                    metadata: node.metadata.duplicate(),
19780                    object: node.object.duplicate(),
19781                    property: node.property.duplicate(),
19782                    computed: Cell::new(node.computed.get()),
19783                },
19784            }
19785        }
19786        /// Allocate the rebuilt node if a setter ran, else
19787        /// `TransformResult::Unchanged`.
19788        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19789            if self.is_changed {
19790                TransformResult::Changed(self.build_forced(gc))
19791            } else {
19792                TransformResult::Unchanged
19793            }
19794        }
19795        /// Allocate the node unconditionally, changed or not.
19796        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19797            gc.alloc(Node::MemberExpression(self.inner))
19798        }
19799        /// Set the `object` field and mark the builder changed.
19800        pub fn object(&mut self, object: &'gc Node<'gc>) { self.is_changed = true; self.inner.object = object; }
19801        /// Set the `property` field and mark the builder changed.
19802        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
19803    }
19804    /// Clone-with-changes builder for [`super::OptionalMemberExpression`].
19805    #[derive(Debug)]
19806    pub struct OptionalMemberExpression<'gc> {
19807        is_changed: bool,
19808        pub(super) inner: super::OptionalMemberExpression<'gc>,
19809    }
19810    impl<'gc> OptionalMemberExpression<'gc> {
19811        /// Start from a copy of `node`, with no field changed yet.
19812        pub fn from_node(node: &'gc super::OptionalMemberExpression<'gc>) -> Self {
19813            Self {
19814                is_changed: false,
19815                inner: super::OptionalMemberExpression {
19816                    metadata: node.metadata.duplicate(),
19817                    object: node.object.duplicate(),
19818                    property: node.property.duplicate(),
19819                    computed: Cell::new(node.computed.get()),
19820                    optional: Cell::new(node.optional.get()),
19821                },
19822            }
19823        }
19824        /// Allocate the rebuilt node if a setter ran, else
19825        /// `TransformResult::Unchanged`.
19826        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19827            if self.is_changed {
19828                TransformResult::Changed(self.build_forced(gc))
19829            } else {
19830                TransformResult::Unchanged
19831            }
19832        }
19833        /// Allocate the node unconditionally, changed or not.
19834        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19835            gc.alloc(Node::OptionalMemberExpression(self.inner))
19836        }
19837        /// Set the `object` field and mark the builder changed.
19838        pub fn object(&mut self, object: &'gc Node<'gc>) { self.is_changed = true; self.inner.object = object; }
19839        /// Set the `property` field and mark the builder changed.
19840        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
19841    }
19842    /// Clone-with-changes builder for [`super::LogicalExpression`].
19843    #[derive(Debug)]
19844    pub struct LogicalExpression<'gc> {
19845        is_changed: bool,
19846        pub(super) inner: super::LogicalExpression<'gc>,
19847    }
19848    impl<'gc> LogicalExpression<'gc> {
19849        /// Start from a copy of `node`, with no field changed yet.
19850        pub fn from_node(node: &'gc super::LogicalExpression<'gc>) -> Self {
19851            Self {
19852                is_changed: false,
19853                inner: super::LogicalExpression {
19854                    metadata: node.metadata.duplicate(),
19855                    left: node.left.duplicate(),
19856                    right: node.right.duplicate(),
19857                    operator: Cell::new(node.operator.get()),
19858                },
19859            }
19860        }
19861        /// Allocate the rebuilt node if a setter ran, else
19862        /// `TransformResult::Unchanged`.
19863        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19864            if self.is_changed {
19865                TransformResult::Changed(self.build_forced(gc))
19866            } else {
19867                TransformResult::Unchanged
19868            }
19869        }
19870        /// Allocate the node unconditionally, changed or not.
19871        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19872            gc.alloc(Node::LogicalExpression(self.inner))
19873        }
19874        /// Set the `left` field and mark the builder changed.
19875        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
19876        /// Set the `right` field and mark the builder changed.
19877        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
19878    }
19879    /// Clone-with-changes builder for [`super::ConditionalExpression`].
19880    #[derive(Debug)]
19881    pub struct ConditionalExpression<'gc> {
19882        is_changed: bool,
19883        pub(super) inner: super::ConditionalExpression<'gc>,
19884    }
19885    impl<'gc> ConditionalExpression<'gc> {
19886        /// Start from a copy of `node`, with no field changed yet.
19887        pub fn from_node(node: &'gc super::ConditionalExpression<'gc>) -> Self {
19888            Self {
19889                is_changed: false,
19890                inner: super::ConditionalExpression {
19891                    metadata: node.metadata.duplicate(),
19892                    test: node.test.duplicate(),
19893                    alternate: node.alternate.duplicate(),
19894                    consequent: node.consequent.duplicate(),
19895                },
19896            }
19897        }
19898        /// Allocate the rebuilt node if a setter ran, else
19899        /// `TransformResult::Unchanged`.
19900        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19901            if self.is_changed {
19902                TransformResult::Changed(self.build_forced(gc))
19903            } else {
19904                TransformResult::Unchanged
19905            }
19906        }
19907        /// Allocate the node unconditionally, changed or not.
19908        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19909            gc.alloc(Node::ConditionalExpression(self.inner))
19910        }
19911        /// Set the `test` field and mark the builder changed.
19912        pub fn test(&mut self, test: &'gc Node<'gc>) { self.is_changed = true; self.inner.test = test; }
19913        /// Set the `alternate` field and mark the builder changed.
19914        pub fn alternate(&mut self, alternate: &'gc Node<'gc>) { self.is_changed = true; self.inner.alternate = alternate; }
19915        /// Set the `consequent` field and mark the builder changed.
19916        pub fn consequent(&mut self, consequent: &'gc Node<'gc>) { self.is_changed = true; self.inner.consequent = consequent; }
19917    }
19918    /// Clone-with-changes builder for [`super::BinaryExpression`].
19919    #[derive(Debug)]
19920    pub struct BinaryExpression<'gc> {
19921        is_changed: bool,
19922        pub(super) inner: super::BinaryExpression<'gc>,
19923    }
19924    impl<'gc> BinaryExpression<'gc> {
19925        /// Start from a copy of `node`, with no field changed yet.
19926        pub fn from_node(node: &'gc super::BinaryExpression<'gc>) -> Self {
19927            Self {
19928                is_changed: false,
19929                inner: super::BinaryExpression {
19930                    metadata: node.metadata.duplicate(),
19931                    left: node.left.duplicate(),
19932                    right: node.right.duplicate(),
19933                    operator: Cell::new(node.operator.get()),
19934                },
19935            }
19936        }
19937        /// Allocate the rebuilt node if a setter ran, else
19938        /// `TransformResult::Unchanged`.
19939        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19940            if self.is_changed {
19941                TransformResult::Changed(self.build_forced(gc))
19942            } else {
19943                TransformResult::Unchanged
19944            }
19945        }
19946        /// Allocate the node unconditionally, changed or not.
19947        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19948            gc.alloc(Node::BinaryExpression(self.inner))
19949        }
19950        /// Set the `left` field and mark the builder changed.
19951        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
19952        /// Set the `right` field and mark the builder changed.
19953        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
19954    }
19955    /// Clone-with-changes builder for [`super::Directive`].
19956    #[derive(Debug)]
19957    pub struct Directive<'gc> {
19958        is_changed: bool,
19959        pub(super) inner: super::Directive<'gc>,
19960    }
19961    impl<'gc> Directive<'gc> {
19962        /// Start from a copy of `node`, with no field changed yet.
19963        pub fn from_node(node: &'gc super::Directive<'gc>) -> Self {
19964            Self {
19965                is_changed: false,
19966                inner: super::Directive {
19967                    metadata: node.metadata.duplicate(),
19968                    value: node.value.duplicate(),
19969                },
19970            }
19971        }
19972        /// Allocate the rebuilt node if a setter ran, else
19973        /// `TransformResult::Unchanged`.
19974        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
19975            if self.is_changed {
19976                TransformResult::Changed(self.build_forced(gc))
19977            } else {
19978                TransformResult::Unchanged
19979            }
19980        }
19981        /// Allocate the node unconditionally, changed or not.
19982        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
19983            gc.alloc(Node::Directive(self.inner))
19984        }
19985        /// Set the `value` field and mark the builder changed.
19986        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
19987    }
19988    /// Clone-with-changes builder for [`super::DirectiveLiteral`].
19989    #[derive(Debug)]
19990    pub struct DirectiveLiteral<'gc> {
19991        is_changed: bool,
19992        pub(super) inner: super::DirectiveLiteral<'gc>,
19993    }
19994    impl<'gc> DirectiveLiteral<'gc> {
19995        /// Start from a copy of `node`, with no field changed yet.
19996        pub fn from_node(node: &'gc super::DirectiveLiteral<'gc>) -> Self {
19997            Self {
19998                is_changed: false,
19999                inner: super::DirectiveLiteral {
20000                    metadata: node.metadata.duplicate(),
20001                    value: Cell::new(node.value.get()),
20002                },
20003            }
20004        }
20005        /// Allocate the rebuilt node if a setter ran, else
20006        /// `TransformResult::Unchanged`.
20007        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20008            if self.is_changed {
20009                TransformResult::Changed(self.build_forced(gc))
20010            } else {
20011                TransformResult::Unchanged
20012            }
20013        }
20014        /// Allocate the node unconditionally, changed or not.
20015        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20016            gc.alloc(Node::DirectiveLiteral(self.inner))
20017        }
20018    }
20019    /// Clone-with-changes builder for [`super::Identifier`].
20020    #[derive(Debug)]
20021    pub struct Identifier<'gc> {
20022        is_changed: bool,
20023        pub(super) inner: super::Identifier<'gc>,
20024    }
20025    impl<'gc> Identifier<'gc> {
20026        /// Start from a copy of `node`, with no field changed yet.
20027        pub fn from_node(node: &'gc super::Identifier<'gc>) -> Self {
20028            Self {
20029                is_changed: false,
20030                inner: super::Identifier {
20031                    metadata: node.metadata.duplicate(),
20032                    name: Cell::new(node.name.get()),
20033                    type_annotation: node.type_annotation.duplicate(),
20034                    optional: Cell::new(node.optional.get()),
20035                    unresolvable: Cell::new(node.unresolvable.get()),
20036                    decl_state: Cell::new(node.decl_state.get()),
20037                    decl: Cell::new(node.decl.get()),
20038                },
20039            }
20040        }
20041        /// Allocate the rebuilt node if a setter ran, else
20042        /// `TransformResult::Unchanged`.
20043        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20044            if self.is_changed {
20045                TransformResult::Changed(self.build_forced(gc))
20046            } else {
20047                TransformResult::Unchanged
20048            }
20049        }
20050        /// Allocate the node unconditionally, changed or not.
20051        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20052            gc.alloc(Node::Identifier(self.inner))
20053        }
20054        /// Set the `type_annotation` field and mark the builder changed.
20055        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
20056    }
20057    /// Clone-with-changes builder for [`super::PrivateName`].
20058    #[derive(Debug)]
20059    pub struct PrivateName<'gc> {
20060        is_changed: bool,
20061        pub(super) inner: super::PrivateName<'gc>,
20062    }
20063    impl<'gc> PrivateName<'gc> {
20064        /// Start from a copy of `node`, with no field changed yet.
20065        pub fn from_node(node: &'gc super::PrivateName<'gc>) -> Self {
20066            Self {
20067                is_changed: false,
20068                inner: super::PrivateName {
20069                    metadata: node.metadata.duplicate(),
20070                    id: node.id.duplicate(),
20071                },
20072            }
20073        }
20074        /// Allocate the rebuilt node if a setter ran, else
20075        /// `TransformResult::Unchanged`.
20076        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20077            if self.is_changed {
20078                TransformResult::Changed(self.build_forced(gc))
20079            } else {
20080                TransformResult::Unchanged
20081            }
20082        }
20083        /// Allocate the node unconditionally, changed or not.
20084        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20085            gc.alloc(Node::PrivateName(self.inner))
20086        }
20087        /// Set the `id` field and mark the builder changed.
20088        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
20089    }
20090    /// Clone-with-changes builder for [`super::MetaProperty`].
20091    #[derive(Debug)]
20092    pub struct MetaProperty<'gc> {
20093        is_changed: bool,
20094        pub(super) inner: super::MetaProperty<'gc>,
20095    }
20096    impl<'gc> MetaProperty<'gc> {
20097        /// Start from a copy of `node`, with no field changed yet.
20098        pub fn from_node(node: &'gc super::MetaProperty<'gc>) -> Self {
20099            Self {
20100                is_changed: false,
20101                inner: super::MetaProperty {
20102                    metadata: node.metadata.duplicate(),
20103                    meta: node.meta.duplicate(),
20104                    property: node.property.duplicate(),
20105                },
20106            }
20107        }
20108        /// Allocate the rebuilt node if a setter ran, else
20109        /// `TransformResult::Unchanged`.
20110        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20111            if self.is_changed {
20112                TransformResult::Changed(self.build_forced(gc))
20113            } else {
20114                TransformResult::Unchanged
20115            }
20116        }
20117        /// Allocate the node unconditionally, changed or not.
20118        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20119            gc.alloc(Node::MetaProperty(self.inner))
20120        }
20121        /// Set the `meta` field and mark the builder changed.
20122        pub fn meta(&mut self, meta: &'gc Node<'gc>) { self.is_changed = true; self.inner.meta = meta; }
20123        /// Set the `property` field and mark the builder changed.
20124        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
20125    }
20126    /// Clone-with-changes builder for [`super::SwitchCase`].
20127    #[derive(Debug)]
20128    pub struct SwitchCase<'gc> {
20129        is_changed: bool,
20130        pub(super) inner: super::SwitchCase<'gc>,
20131    }
20132    impl<'gc> SwitchCase<'gc> {
20133        /// Start from a copy of `node`, with no field changed yet.
20134        pub fn from_node(node: &'gc super::SwitchCase<'gc>) -> Self {
20135            Self {
20136                is_changed: false,
20137                inner: super::SwitchCase {
20138                    metadata: node.metadata.duplicate(),
20139                    test: node.test.duplicate(),
20140                    consequent: node.consequent.duplicate(),
20141                },
20142            }
20143        }
20144        /// Allocate the rebuilt node if a setter ran, else
20145        /// `TransformResult::Unchanged`.
20146        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20147            if self.is_changed {
20148                TransformResult::Changed(self.build_forced(gc))
20149            } else {
20150                TransformResult::Unchanged
20151            }
20152        }
20153        /// Allocate the node unconditionally, changed or not.
20154        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20155            gc.alloc(Node::SwitchCase(self.inner))
20156        }
20157        /// Set the `test` field and mark the builder changed.
20158        pub fn test(&mut self, test: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.test = test; }
20159        /// Set the `consequent` field and mark the builder changed.
20160        pub fn consequent(&mut self, consequent: NodeList<'gc>) { self.is_changed = true; self.inner.consequent = consequent; }
20161    }
20162    /// Clone-with-changes builder for [`super::CatchClause`].
20163    #[derive(Debug)]
20164    pub struct CatchClause<'gc> {
20165        is_changed: bool,
20166        pub(super) inner: super::CatchClause<'gc>,
20167    }
20168    impl<'gc> CatchClause<'gc> {
20169        /// Start from a copy of `node`, with no field changed yet.
20170        pub fn from_node(node: &'gc super::CatchClause<'gc>) -> Self {
20171            Self {
20172                is_changed: false,
20173                inner: super::CatchClause {
20174                    metadata: node.metadata.duplicate(),
20175                    param: node.param.duplicate(),
20176                    body: node.body.duplicate(),
20177                    scope: Cell::new(node.scope.get()),
20178                },
20179            }
20180        }
20181        /// Allocate the rebuilt node if a setter ran, else
20182        /// `TransformResult::Unchanged`.
20183        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20184            if self.is_changed {
20185                TransformResult::Changed(self.build_forced(gc))
20186            } else {
20187                TransformResult::Unchanged
20188            }
20189        }
20190        /// Allocate the node unconditionally, changed or not.
20191        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20192            gc.alloc(Node::CatchClause(self.inner))
20193        }
20194        /// Set the `param` field and mark the builder changed.
20195        pub fn param(&mut self, param: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.param = param; }
20196        /// Set the `body` field and mark the builder changed.
20197        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
20198    }
20199    /// Clone-with-changes builder for [`super::VariableDeclarator`].
20200    #[derive(Debug)]
20201    pub struct VariableDeclarator<'gc> {
20202        is_changed: bool,
20203        pub(super) inner: super::VariableDeclarator<'gc>,
20204    }
20205    impl<'gc> VariableDeclarator<'gc> {
20206        /// Start from a copy of `node`, with no field changed yet.
20207        pub fn from_node(node: &'gc super::VariableDeclarator<'gc>) -> Self {
20208            Self {
20209                is_changed: false,
20210                inner: super::VariableDeclarator {
20211                    metadata: node.metadata.duplicate(),
20212                    init: node.init.duplicate(),
20213                    id: node.id.duplicate(),
20214                },
20215            }
20216        }
20217        /// Allocate the rebuilt node if a setter ran, else
20218        /// `TransformResult::Unchanged`.
20219        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20220            if self.is_changed {
20221                TransformResult::Changed(self.build_forced(gc))
20222            } else {
20223                TransformResult::Unchanged
20224            }
20225        }
20226        /// Allocate the node unconditionally, changed or not.
20227        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20228            gc.alloc(Node::VariableDeclarator(self.inner))
20229        }
20230        /// Set the `init` field and mark the builder changed.
20231        pub fn init(&mut self, init: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.init = init; }
20232        /// Set the `id` field and mark the builder changed.
20233        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
20234    }
20235    /// Clone-with-changes builder for [`super::VariableDeclaration`].
20236    #[derive(Debug)]
20237    pub struct VariableDeclaration<'gc> {
20238        is_changed: bool,
20239        pub(super) inner: super::VariableDeclaration<'gc>,
20240    }
20241    impl<'gc> VariableDeclaration<'gc> {
20242        /// Start from a copy of `node`, with no field changed yet.
20243        pub fn from_node(node: &'gc super::VariableDeclaration<'gc>) -> Self {
20244            Self {
20245                is_changed: false,
20246                inner: super::VariableDeclaration {
20247                    metadata: node.metadata.duplicate(),
20248                    kind: Cell::new(node.kind.get()),
20249                    declarations: node.declarations.duplicate(),
20250                },
20251            }
20252        }
20253        /// Allocate the rebuilt node if a setter ran, else
20254        /// `TransformResult::Unchanged`.
20255        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20256            if self.is_changed {
20257                TransformResult::Changed(self.build_forced(gc))
20258            } else {
20259                TransformResult::Unchanged
20260            }
20261        }
20262        /// Allocate the node unconditionally, changed or not.
20263        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20264            gc.alloc(Node::VariableDeclaration(self.inner))
20265        }
20266        /// Set the `declarations` field and mark the builder changed.
20267        pub fn declarations(&mut self, declarations: NodeList<'gc>) { self.is_changed = true; self.inner.declarations = declarations; }
20268    }
20269    /// Clone-with-changes builder for [`super::TemplateLiteral`].
20270    #[derive(Debug)]
20271    pub struct TemplateLiteral<'gc> {
20272        is_changed: bool,
20273        pub(super) inner: super::TemplateLiteral<'gc>,
20274    }
20275    impl<'gc> TemplateLiteral<'gc> {
20276        /// Start from a copy of `node`, with no field changed yet.
20277        pub fn from_node(node: &'gc super::TemplateLiteral<'gc>) -> Self {
20278            Self {
20279                is_changed: false,
20280                inner: super::TemplateLiteral {
20281                    metadata: node.metadata.duplicate(),
20282                    quasis: node.quasis.duplicate(),
20283                    expressions: node.expressions.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::TemplateLiteral(self.inner))
20299        }
20300        /// Set the `quasis` field and mark the builder changed.
20301        pub fn quasis(&mut self, quasis: NodeList<'gc>) { self.is_changed = true; self.inner.quasis = quasis; }
20302        /// Set the `expressions` field and mark the builder changed.
20303        pub fn expressions(&mut self, expressions: NodeList<'gc>) { self.is_changed = true; self.inner.expressions = expressions; }
20304    }
20305    /// Clone-with-changes builder for [`super::TaggedTemplateExpression`].
20306    #[derive(Debug)]
20307    pub struct TaggedTemplateExpression<'gc> {
20308        is_changed: bool,
20309        pub(super) inner: super::TaggedTemplateExpression<'gc>,
20310    }
20311    impl<'gc> TaggedTemplateExpression<'gc> {
20312        /// Start from a copy of `node`, with no field changed yet.
20313        pub fn from_node(node: &'gc super::TaggedTemplateExpression<'gc>) -> Self {
20314            Self {
20315                is_changed: false,
20316                inner: super::TaggedTemplateExpression {
20317                    metadata: node.metadata.duplicate(),
20318                    tag: node.tag.duplicate(),
20319                    quasi: node.quasi.duplicate(),
20320                },
20321            }
20322        }
20323        /// Allocate the rebuilt node if a setter ran, else
20324        /// `TransformResult::Unchanged`.
20325        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20326            if self.is_changed {
20327                TransformResult::Changed(self.build_forced(gc))
20328            } else {
20329                TransformResult::Unchanged
20330            }
20331        }
20332        /// Allocate the node unconditionally, changed or not.
20333        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20334            gc.alloc(Node::TaggedTemplateExpression(self.inner))
20335        }
20336        /// Set the `tag` field and mark the builder changed.
20337        pub fn tag(&mut self, tag: &'gc Node<'gc>) { self.is_changed = true; self.inner.tag = tag; }
20338        /// Set the `quasi` field and mark the builder changed.
20339        pub fn quasi(&mut self, quasi: &'gc Node<'gc>) { self.is_changed = true; self.inner.quasi = quasi; }
20340    }
20341    /// Clone-with-changes builder for [`super::TemplateElement`].
20342    #[derive(Debug)]
20343    pub struct TemplateElement<'gc> {
20344        is_changed: bool,
20345        pub(super) inner: super::TemplateElement<'gc>,
20346    }
20347    impl<'gc> TemplateElement<'gc> {
20348        /// Start from a copy of `node`, with no field changed yet.
20349        pub fn from_node(node: &'gc super::TemplateElement<'gc>) -> Self {
20350            Self {
20351                is_changed: false,
20352                inner: super::TemplateElement {
20353                    metadata: node.metadata.duplicate(),
20354                    tail: Cell::new(node.tail.get()),
20355                    cooked: Cell::new(node.cooked.get()),
20356                    raw: Cell::new(node.raw.get()),
20357                },
20358            }
20359        }
20360        /// Allocate the rebuilt node if a setter ran, else
20361        /// `TransformResult::Unchanged`.
20362        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20363            if self.is_changed {
20364                TransformResult::Changed(self.build_forced(gc))
20365            } else {
20366                TransformResult::Unchanged
20367            }
20368        }
20369        /// Allocate the node unconditionally, changed or not.
20370        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20371            gc.alloc(Node::TemplateElement(self.inner))
20372        }
20373    }
20374    /// Clone-with-changes builder for [`super::Property`].
20375    #[derive(Debug)]
20376    pub struct Property<'gc> {
20377        is_changed: bool,
20378        pub(super) inner: super::Property<'gc>,
20379    }
20380    impl<'gc> Property<'gc> {
20381        /// Start from a copy of `node`, with no field changed yet.
20382        pub fn from_node(node: &'gc super::Property<'gc>) -> Self {
20383            Self {
20384                is_changed: false,
20385                inner: super::Property {
20386                    metadata: node.metadata.duplicate(),
20387                    key: node.key.duplicate(),
20388                    value: node.value.duplicate(),
20389                    kind: Cell::new(node.kind.get()),
20390                    computed: Cell::new(node.computed.get()),
20391                    method: Cell::new(node.method.get()),
20392                    shorthand: Cell::new(node.shorthand.get()),
20393                },
20394            }
20395        }
20396        /// Allocate the rebuilt node if a setter ran, else
20397        /// `TransformResult::Unchanged`.
20398        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20399            if self.is_changed {
20400                TransformResult::Changed(self.build_forced(gc))
20401            } else {
20402                TransformResult::Unchanged
20403            }
20404        }
20405        /// Allocate the node unconditionally, changed or not.
20406        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20407            gc.alloc(Node::Property(self.inner))
20408        }
20409        /// Set the `key` field and mark the builder changed.
20410        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
20411        /// Set the `value` field and mark the builder changed.
20412        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
20413    }
20414    /// Clone-with-changes builder for [`super::Decorator`].
20415    #[derive(Debug)]
20416    pub struct Decorator<'gc> {
20417        is_changed: bool,
20418        pub(super) inner: super::Decorator<'gc>,
20419    }
20420    impl<'gc> Decorator<'gc> {
20421        /// Start from a copy of `node`, with no field changed yet.
20422        pub fn from_node(node: &'gc super::Decorator<'gc>) -> Self {
20423            Self {
20424                is_changed: false,
20425                inner: super::Decorator {
20426                    metadata: node.metadata.duplicate(),
20427                    expression: node.expression.duplicate(),
20428                },
20429            }
20430        }
20431        /// Allocate the rebuilt node if a setter ran, else
20432        /// `TransformResult::Unchanged`.
20433        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20434            if self.is_changed {
20435                TransformResult::Changed(self.build_forced(gc))
20436            } else {
20437                TransformResult::Unchanged
20438            }
20439        }
20440        /// Allocate the node unconditionally, changed or not.
20441        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20442            gc.alloc(Node::Decorator(self.inner))
20443        }
20444        /// Set the `expression` field and mark the builder changed.
20445        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
20446    }
20447    /// Clone-with-changes builder for [`super::ClassDeclaration`].
20448    #[derive(Debug)]
20449    pub struct ClassDeclaration<'gc> {
20450        is_changed: bool,
20451        pub(super) inner: super::ClassDeclaration<'gc>,
20452    }
20453    impl<'gc> ClassDeclaration<'gc> {
20454        /// Start from a copy of `node`, with no field changed yet.
20455        pub fn from_node(node: &'gc super::ClassDeclaration<'gc>) -> Self {
20456            Self {
20457                is_changed: false,
20458                inner: super::ClassDeclaration {
20459                    metadata: node.metadata.duplicate(),
20460                    id: node.id.duplicate(),
20461                    type_parameters: node.type_parameters.duplicate(),
20462                    super_class: node.super_class.duplicate(),
20463                    super_type_arguments: node.super_type_arguments.duplicate(),
20464                    implements: node.implements.duplicate(),
20465                    decorators: node.decorators.duplicate(),
20466                    body: node.body.duplicate(),
20467                    scope: Cell::new(node.scope.get()),
20468                    implicit_ctor_function_info: Cell::new(node.implicit_ctor_function_info.get()),
20469                    instance_elements_init_function_info: Cell::new(node.instance_elements_init_function_info.get()),
20470                    static_elements_init_function_info: Cell::new(node.static_elements_init_function_info.get()),
20471                },
20472            }
20473        }
20474        /// Allocate the rebuilt node if a setter ran, else
20475        /// `TransformResult::Unchanged`.
20476        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20477            if self.is_changed {
20478                TransformResult::Changed(self.build_forced(gc))
20479            } else {
20480                TransformResult::Unchanged
20481            }
20482        }
20483        /// Allocate the node unconditionally, changed or not.
20484        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20485            gc.alloc(Node::ClassDeclaration(self.inner))
20486        }
20487        /// Set the `id` field and mark the builder changed.
20488        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
20489        /// Set the `type_parameters` field and mark the builder changed.
20490        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
20491        /// Set the `super_class` field and mark the builder changed.
20492        pub fn super_class(&mut self, super_class: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.super_class = super_class; }
20493        /// Set the `super_type_arguments` field and mark the builder changed.
20494        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; }
20495        /// Set the `implements` field and mark the builder changed.
20496        pub fn implements(&mut self, implements: NodeList<'gc>) { self.is_changed = true; self.inner.implements = implements; }
20497        /// Set the `decorators` field and mark the builder changed.
20498        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
20499        /// Set the `body` field and mark the builder changed.
20500        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
20501    }
20502    /// Clone-with-changes builder for [`super::ClassExpression`].
20503    #[derive(Debug)]
20504    pub struct ClassExpression<'gc> {
20505        is_changed: bool,
20506        pub(super) inner: super::ClassExpression<'gc>,
20507    }
20508    impl<'gc> ClassExpression<'gc> {
20509        /// Start from a copy of `node`, with no field changed yet.
20510        pub fn from_node(node: &'gc super::ClassExpression<'gc>) -> Self {
20511            Self {
20512                is_changed: false,
20513                inner: super::ClassExpression {
20514                    metadata: node.metadata.duplicate(),
20515                    id: node.id.duplicate(),
20516                    type_parameters: node.type_parameters.duplicate(),
20517                    super_class: node.super_class.duplicate(),
20518                    super_type_arguments: node.super_type_arguments.duplicate(),
20519                    implements: node.implements.duplicate(),
20520                    decorators: node.decorators.duplicate(),
20521                    body: node.body.duplicate(),
20522                    scope: Cell::new(node.scope.get()),
20523                    implicit_ctor_function_info: Cell::new(node.implicit_ctor_function_info.get()),
20524                    instance_elements_init_function_info: Cell::new(node.instance_elements_init_function_info.get()),
20525                    static_elements_init_function_info: Cell::new(node.static_elements_init_function_info.get()),
20526                },
20527            }
20528        }
20529        /// Allocate the rebuilt node if a setter ran, else
20530        /// `TransformResult::Unchanged`.
20531        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20532            if self.is_changed {
20533                TransformResult::Changed(self.build_forced(gc))
20534            } else {
20535                TransformResult::Unchanged
20536            }
20537        }
20538        /// Allocate the node unconditionally, changed or not.
20539        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20540            gc.alloc(Node::ClassExpression(self.inner))
20541        }
20542        /// Set the `id` field and mark the builder changed.
20543        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
20544        /// Set the `type_parameters` field and mark the builder changed.
20545        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
20546        /// Set the `super_class` field and mark the builder changed.
20547        pub fn super_class(&mut self, super_class: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.super_class = super_class; }
20548        /// Set the `super_type_arguments` field and mark the builder changed.
20549        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; }
20550        /// Set the `implements` field and mark the builder changed.
20551        pub fn implements(&mut self, implements: NodeList<'gc>) { self.is_changed = true; self.inner.implements = implements; }
20552        /// Set the `decorators` field and mark the builder changed.
20553        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
20554        /// Set the `body` field and mark the builder changed.
20555        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
20556    }
20557    /// Clone-with-changes builder for [`super::ClassBody`].
20558    #[derive(Debug)]
20559    pub struct ClassBody<'gc> {
20560        is_changed: bool,
20561        pub(super) inner: super::ClassBody<'gc>,
20562    }
20563    impl<'gc> ClassBody<'gc> {
20564        /// Start from a copy of `node`, with no field changed yet.
20565        pub fn from_node(node: &'gc super::ClassBody<'gc>) -> Self {
20566            Self {
20567                is_changed: false,
20568                inner: super::ClassBody {
20569                    metadata: node.metadata.duplicate(),
20570                    body: node.body.duplicate(),
20571                },
20572            }
20573        }
20574        /// Allocate the rebuilt node if a setter ran, else
20575        /// `TransformResult::Unchanged`.
20576        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20577            if self.is_changed {
20578                TransformResult::Changed(self.build_forced(gc))
20579            } else {
20580                TransformResult::Unchanged
20581            }
20582        }
20583        /// Allocate the node unconditionally, changed or not.
20584        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20585            gc.alloc(Node::ClassBody(self.inner))
20586        }
20587        /// Set the `body` field and mark the builder changed.
20588        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
20589    }
20590    /// Clone-with-changes builder for [`super::ClassProperty`].
20591    #[derive(Debug)]
20592    pub struct ClassProperty<'gc> {
20593        is_changed: bool,
20594        pub(super) inner: super::ClassProperty<'gc>,
20595    }
20596    impl<'gc> ClassProperty<'gc> {
20597        /// Start from a copy of `node`, with no field changed yet.
20598        pub fn from_node(node: &'gc super::ClassProperty<'gc>) -> Self {
20599            Self {
20600                is_changed: false,
20601                inner: super::ClassProperty {
20602                    metadata: node.metadata.duplicate(),
20603                    key: node.key.duplicate(),
20604                    value: node.value.duplicate(),
20605                    computed: Cell::new(node.computed.get()),
20606                    r#static: Cell::new(node.r#static.get()),
20607                    decorators: node.decorators.duplicate(),
20608                    declare: Cell::new(node.declare.get()),
20609                    optional: Cell::new(node.optional.get()),
20610                    variance: node.variance.duplicate(),
20611                    type_annotation: node.type_annotation.duplicate(),
20612                    ts_modifiers: node.ts_modifiers.duplicate(),
20613                },
20614            }
20615        }
20616        /// Allocate the rebuilt node if a setter ran, else
20617        /// `TransformResult::Unchanged`.
20618        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20619            if self.is_changed {
20620                TransformResult::Changed(self.build_forced(gc))
20621            } else {
20622                TransformResult::Unchanged
20623            }
20624        }
20625        /// Allocate the node unconditionally, changed or not.
20626        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20627            gc.alloc(Node::ClassProperty(self.inner))
20628        }
20629        /// Set the `key` field and mark the builder changed.
20630        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
20631        /// Set the `value` field and mark the builder changed.
20632        pub fn value(&mut self, value: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.value = value; }
20633        /// Set the `decorators` field and mark the builder changed.
20634        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
20635        /// Set the `variance` field and mark the builder changed.
20636        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
20637        /// Set the `type_annotation` field and mark the builder changed.
20638        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
20639        /// Set the `ts_modifiers` field and mark the builder changed.
20640        pub fn ts_modifiers(&mut self, ts_modifiers: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.ts_modifiers = ts_modifiers; }
20641    }
20642    /// Clone-with-changes builder for [`super::ClassPrivateProperty`].
20643    #[derive(Debug)]
20644    pub struct ClassPrivateProperty<'gc> {
20645        is_changed: bool,
20646        pub(super) inner: super::ClassPrivateProperty<'gc>,
20647    }
20648    impl<'gc> ClassPrivateProperty<'gc> {
20649        /// Start from a copy of `node`, with no field changed yet.
20650        pub fn from_node(node: &'gc super::ClassPrivateProperty<'gc>) -> Self {
20651            Self {
20652                is_changed: false,
20653                inner: super::ClassPrivateProperty {
20654                    metadata: node.metadata.duplicate(),
20655                    key: node.key.duplicate(),
20656                    value: node.value.duplicate(),
20657                    r#static: Cell::new(node.r#static.get()),
20658                    decorators: node.decorators.duplicate(),
20659                    declare: Cell::new(node.declare.get()),
20660                    optional: Cell::new(node.optional.get()),
20661                    variance: node.variance.duplicate(),
20662                    type_annotation: node.type_annotation.duplicate(),
20663                    ts_modifiers: node.ts_modifiers.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::ClassPrivateProperty(self.inner))
20679        }
20680        /// Set the `key` field and mark the builder changed.
20681        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
20682        /// Set the `value` field and mark the builder changed.
20683        pub fn value(&mut self, value: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.value = value; }
20684        /// Set the `decorators` field and mark the builder changed.
20685        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
20686        /// Set the `variance` field and mark the builder changed.
20687        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
20688        /// Set the `type_annotation` field and mark the builder changed.
20689        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
20690        /// Set the `ts_modifiers` field and mark the builder changed.
20691        pub fn ts_modifiers(&mut self, ts_modifiers: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.ts_modifiers = ts_modifiers; }
20692    }
20693    /// Clone-with-changes builder for [`super::MethodDefinition`].
20694    #[derive(Debug)]
20695    pub struct MethodDefinition<'gc> {
20696        is_changed: bool,
20697        pub(super) inner: super::MethodDefinition<'gc>,
20698    }
20699    impl<'gc> MethodDefinition<'gc> {
20700        /// Start from a copy of `node`, with no field changed yet.
20701        pub fn from_node(node: &'gc super::MethodDefinition<'gc>) -> Self {
20702            Self {
20703                is_changed: false,
20704                inner: super::MethodDefinition {
20705                    metadata: node.metadata.duplicate(),
20706                    key: node.key.duplicate(),
20707                    value: node.value.duplicate(),
20708                    kind: Cell::new(node.kind.get()),
20709                    computed: Cell::new(node.computed.get()),
20710                    r#static: Cell::new(node.r#static.get()),
20711                    decorators: node.decorators.duplicate(),
20712                },
20713            }
20714        }
20715        /// Allocate the rebuilt node if a setter ran, else
20716        /// `TransformResult::Unchanged`.
20717        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20718            if self.is_changed {
20719                TransformResult::Changed(self.build_forced(gc))
20720            } else {
20721                TransformResult::Unchanged
20722            }
20723        }
20724        /// Allocate the node unconditionally, changed or not.
20725        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20726            gc.alloc(Node::MethodDefinition(self.inner))
20727        }
20728        /// Set the `key` field and mark the builder changed.
20729        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
20730        /// Set the `value` field and mark the builder changed.
20731        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
20732        /// Set the `decorators` field and mark the builder changed.
20733        pub fn decorators(&mut self, decorators: NodeList<'gc>) { self.is_changed = true; self.inner.decorators = decorators; }
20734    }
20735    /// Clone-with-changes builder for [`super::ImportDeclaration`].
20736    #[derive(Debug)]
20737    pub struct ImportDeclaration<'gc> {
20738        is_changed: bool,
20739        pub(super) inner: super::ImportDeclaration<'gc>,
20740    }
20741    impl<'gc> ImportDeclaration<'gc> {
20742        /// Start from a copy of `node`, with no field changed yet.
20743        pub fn from_node(node: &'gc super::ImportDeclaration<'gc>) -> Self {
20744            Self {
20745                is_changed: false,
20746                inner: super::ImportDeclaration {
20747                    metadata: node.metadata.duplicate(),
20748                    specifiers: node.specifiers.duplicate(),
20749                    source: node.source.duplicate(),
20750                    attributes: node.attributes.duplicate(),
20751                    import_kind: Cell::new(node.import_kind.get()),
20752                },
20753            }
20754        }
20755        /// Allocate the rebuilt node if a setter ran, else
20756        /// `TransformResult::Unchanged`.
20757        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20758            if self.is_changed {
20759                TransformResult::Changed(self.build_forced(gc))
20760            } else {
20761                TransformResult::Unchanged
20762            }
20763        }
20764        /// Allocate the node unconditionally, changed or not.
20765        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20766            gc.alloc(Node::ImportDeclaration(self.inner))
20767        }
20768        /// Set the `specifiers` field and mark the builder changed.
20769        pub fn specifiers(&mut self, specifiers: NodeList<'gc>) { self.is_changed = true; self.inner.specifiers = specifiers; }
20770        /// Set the `source` field and mark the builder changed.
20771        pub fn source(&mut self, source: &'gc Node<'gc>) { self.is_changed = true; self.inner.source = source; }
20772        /// Set the `attributes` field and mark the builder changed.
20773        pub fn attributes(&mut self, attributes: NodeList<'gc>) { self.is_changed = true; self.inner.attributes = attributes; }
20774    }
20775    /// Clone-with-changes builder for [`super::ImportSpecifier`].
20776    #[derive(Debug)]
20777    pub struct ImportSpecifier<'gc> {
20778        is_changed: bool,
20779        pub(super) inner: super::ImportSpecifier<'gc>,
20780    }
20781    impl<'gc> ImportSpecifier<'gc> {
20782        /// Start from a copy of `node`, with no field changed yet.
20783        pub fn from_node(node: &'gc super::ImportSpecifier<'gc>) -> Self {
20784            Self {
20785                is_changed: false,
20786                inner: super::ImportSpecifier {
20787                    metadata: node.metadata.duplicate(),
20788                    imported: node.imported.duplicate(),
20789                    local: node.local.duplicate(),
20790                    import_kind: Cell::new(node.import_kind.get()),
20791                },
20792            }
20793        }
20794        /// Allocate the rebuilt node if a setter ran, else
20795        /// `TransformResult::Unchanged`.
20796        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20797            if self.is_changed {
20798                TransformResult::Changed(self.build_forced(gc))
20799            } else {
20800                TransformResult::Unchanged
20801            }
20802        }
20803        /// Allocate the node unconditionally, changed or not.
20804        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20805            gc.alloc(Node::ImportSpecifier(self.inner))
20806        }
20807        /// Set the `imported` field and mark the builder changed.
20808        pub fn imported(&mut self, imported: &'gc Node<'gc>) { self.is_changed = true; self.inner.imported = imported; }
20809        /// Set the `local` field and mark the builder changed.
20810        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
20811    }
20812    /// Clone-with-changes builder for [`super::ImportDefaultSpecifier`].
20813    #[derive(Debug)]
20814    pub struct ImportDefaultSpecifier<'gc> {
20815        is_changed: bool,
20816        pub(super) inner: super::ImportDefaultSpecifier<'gc>,
20817    }
20818    impl<'gc> ImportDefaultSpecifier<'gc> {
20819        /// Start from a copy of `node`, with no field changed yet.
20820        pub fn from_node(node: &'gc super::ImportDefaultSpecifier<'gc>) -> Self {
20821            Self {
20822                is_changed: false,
20823                inner: super::ImportDefaultSpecifier {
20824                    metadata: node.metadata.duplicate(),
20825                    local: node.local.duplicate(),
20826                },
20827            }
20828        }
20829        /// Allocate the rebuilt node if a setter ran, else
20830        /// `TransformResult::Unchanged`.
20831        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20832            if self.is_changed {
20833                TransformResult::Changed(self.build_forced(gc))
20834            } else {
20835                TransformResult::Unchanged
20836            }
20837        }
20838        /// Allocate the node unconditionally, changed or not.
20839        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20840            gc.alloc(Node::ImportDefaultSpecifier(self.inner))
20841        }
20842        /// Set the `local` field and mark the builder changed.
20843        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
20844    }
20845    /// Clone-with-changes builder for [`super::ImportNamespaceSpecifier`].
20846    #[derive(Debug)]
20847    pub struct ImportNamespaceSpecifier<'gc> {
20848        is_changed: bool,
20849        pub(super) inner: super::ImportNamespaceSpecifier<'gc>,
20850    }
20851    impl<'gc> ImportNamespaceSpecifier<'gc> {
20852        /// Start from a copy of `node`, with no field changed yet.
20853        pub fn from_node(node: &'gc super::ImportNamespaceSpecifier<'gc>) -> Self {
20854            Self {
20855                is_changed: false,
20856                inner: super::ImportNamespaceSpecifier {
20857                    metadata: node.metadata.duplicate(),
20858                    local: node.local.duplicate(),
20859                },
20860            }
20861        }
20862        /// Allocate the rebuilt node if a setter ran, else
20863        /// `TransformResult::Unchanged`.
20864        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20865            if self.is_changed {
20866                TransformResult::Changed(self.build_forced(gc))
20867            } else {
20868                TransformResult::Unchanged
20869            }
20870        }
20871        /// Allocate the node unconditionally, changed or not.
20872        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20873            gc.alloc(Node::ImportNamespaceSpecifier(self.inner))
20874        }
20875        /// Set the `local` field and mark the builder changed.
20876        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
20877    }
20878    /// Clone-with-changes builder for [`super::ImportAttribute`].
20879    #[derive(Debug)]
20880    pub struct ImportAttribute<'gc> {
20881        is_changed: bool,
20882        pub(super) inner: super::ImportAttribute<'gc>,
20883    }
20884    impl<'gc> ImportAttribute<'gc> {
20885        /// Start from a copy of `node`, with no field changed yet.
20886        pub fn from_node(node: &'gc super::ImportAttribute<'gc>) -> Self {
20887            Self {
20888                is_changed: false,
20889                inner: super::ImportAttribute {
20890                    metadata: node.metadata.duplicate(),
20891                    key: node.key.duplicate(),
20892                    value: node.value.duplicate(),
20893                },
20894            }
20895        }
20896        /// Allocate the rebuilt node if a setter ran, else
20897        /// `TransformResult::Unchanged`.
20898        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20899            if self.is_changed {
20900                TransformResult::Changed(self.build_forced(gc))
20901            } else {
20902                TransformResult::Unchanged
20903            }
20904        }
20905        /// Allocate the node unconditionally, changed or not.
20906        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20907            gc.alloc(Node::ImportAttribute(self.inner))
20908        }
20909        /// Set the `key` field and mark the builder changed.
20910        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
20911        /// Set the `value` field and mark the builder changed.
20912        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
20913    }
20914    /// Clone-with-changes builder for [`super::ExportNamedDeclaration`].
20915    #[derive(Debug)]
20916    pub struct ExportNamedDeclaration<'gc> {
20917        is_changed: bool,
20918        pub(super) inner: super::ExportNamedDeclaration<'gc>,
20919    }
20920    impl<'gc> ExportNamedDeclaration<'gc> {
20921        /// Start from a copy of `node`, with no field changed yet.
20922        pub fn from_node(node: &'gc super::ExportNamedDeclaration<'gc>) -> Self {
20923            Self {
20924                is_changed: false,
20925                inner: super::ExportNamedDeclaration {
20926                    metadata: node.metadata.duplicate(),
20927                    declaration: node.declaration.duplicate(),
20928                    specifiers: node.specifiers.duplicate(),
20929                    source: node.source.duplicate(),
20930                    export_kind: Cell::new(node.export_kind.get()),
20931                },
20932            }
20933        }
20934        /// Allocate the rebuilt node if a setter ran, else
20935        /// `TransformResult::Unchanged`.
20936        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20937            if self.is_changed {
20938                TransformResult::Changed(self.build_forced(gc))
20939            } else {
20940                TransformResult::Unchanged
20941            }
20942        }
20943        /// Allocate the node unconditionally, changed or not.
20944        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20945            gc.alloc(Node::ExportNamedDeclaration(self.inner))
20946        }
20947        /// Set the `declaration` field and mark the builder changed.
20948        pub fn declaration(&mut self, declaration: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.declaration = declaration; }
20949        /// Set the `specifiers` field and mark the builder changed.
20950        pub fn specifiers(&mut self, specifiers: NodeList<'gc>) { self.is_changed = true; self.inner.specifiers = specifiers; }
20951        /// Set the `source` field and mark the builder changed.
20952        pub fn source(&mut self, source: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.source = source; }
20953    }
20954    /// Clone-with-changes builder for [`super::ExportSpecifier`].
20955    #[derive(Debug)]
20956    pub struct ExportSpecifier<'gc> {
20957        is_changed: bool,
20958        pub(super) inner: super::ExportSpecifier<'gc>,
20959    }
20960    impl<'gc> ExportSpecifier<'gc> {
20961        /// Start from a copy of `node`, with no field changed yet.
20962        pub fn from_node(node: &'gc super::ExportSpecifier<'gc>) -> Self {
20963            Self {
20964                is_changed: false,
20965                inner: super::ExportSpecifier {
20966                    metadata: node.metadata.duplicate(),
20967                    exported: node.exported.duplicate(),
20968                    local: node.local.duplicate(),
20969                },
20970            }
20971        }
20972        /// Allocate the rebuilt node if a setter ran, else
20973        /// `TransformResult::Unchanged`.
20974        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
20975            if self.is_changed {
20976                TransformResult::Changed(self.build_forced(gc))
20977            } else {
20978                TransformResult::Unchanged
20979            }
20980        }
20981        /// Allocate the node unconditionally, changed or not.
20982        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
20983            gc.alloc(Node::ExportSpecifier(self.inner))
20984        }
20985        /// Set the `exported` field and mark the builder changed.
20986        pub fn exported(&mut self, exported: &'gc Node<'gc>) { self.is_changed = true; self.inner.exported = exported; }
20987        /// Set the `local` field and mark the builder changed.
20988        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
20989    }
20990    /// Clone-with-changes builder for [`super::ExportNamespaceSpecifier`].
20991    #[derive(Debug)]
20992    pub struct ExportNamespaceSpecifier<'gc> {
20993        is_changed: bool,
20994        pub(super) inner: super::ExportNamespaceSpecifier<'gc>,
20995    }
20996    impl<'gc> ExportNamespaceSpecifier<'gc> {
20997        /// Start from a copy of `node`, with no field changed yet.
20998        pub fn from_node(node: &'gc super::ExportNamespaceSpecifier<'gc>) -> Self {
20999            Self {
21000                is_changed: false,
21001                inner: super::ExportNamespaceSpecifier {
21002                    metadata: node.metadata.duplicate(),
21003                    exported: node.exported.duplicate(),
21004                },
21005            }
21006        }
21007        /// Allocate the rebuilt node if a setter ran, else
21008        /// `TransformResult::Unchanged`.
21009        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21010            if self.is_changed {
21011                TransformResult::Changed(self.build_forced(gc))
21012            } else {
21013                TransformResult::Unchanged
21014            }
21015        }
21016        /// Allocate the node unconditionally, changed or not.
21017        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21018            gc.alloc(Node::ExportNamespaceSpecifier(self.inner))
21019        }
21020        /// Set the `exported` field and mark the builder changed.
21021        pub fn exported(&mut self, exported: &'gc Node<'gc>) { self.is_changed = true; self.inner.exported = exported; }
21022    }
21023    /// Clone-with-changes builder for [`super::ExportDefaultDeclaration`].
21024    #[derive(Debug)]
21025    pub struct ExportDefaultDeclaration<'gc> {
21026        is_changed: bool,
21027        pub(super) inner: super::ExportDefaultDeclaration<'gc>,
21028    }
21029    impl<'gc> ExportDefaultDeclaration<'gc> {
21030        /// Start from a copy of `node`, with no field changed yet.
21031        pub fn from_node(node: &'gc super::ExportDefaultDeclaration<'gc>) -> Self {
21032            Self {
21033                is_changed: false,
21034                inner: super::ExportDefaultDeclaration {
21035                    metadata: node.metadata.duplicate(),
21036                    declaration: node.declaration.duplicate(),
21037                },
21038            }
21039        }
21040        /// Allocate the rebuilt node if a setter ran, else
21041        /// `TransformResult::Unchanged`.
21042        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21043            if self.is_changed {
21044                TransformResult::Changed(self.build_forced(gc))
21045            } else {
21046                TransformResult::Unchanged
21047            }
21048        }
21049        /// Allocate the node unconditionally, changed or not.
21050        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21051            gc.alloc(Node::ExportDefaultDeclaration(self.inner))
21052        }
21053        /// Set the `declaration` field and mark the builder changed.
21054        pub fn declaration(&mut self, declaration: &'gc Node<'gc>) { self.is_changed = true; self.inner.declaration = declaration; }
21055    }
21056    /// Clone-with-changes builder for [`super::ExportAllDeclaration`].
21057    #[derive(Debug)]
21058    pub struct ExportAllDeclaration<'gc> {
21059        is_changed: bool,
21060        pub(super) inner: super::ExportAllDeclaration<'gc>,
21061    }
21062    impl<'gc> ExportAllDeclaration<'gc> {
21063        /// Start from a copy of `node`, with no field changed yet.
21064        pub fn from_node(node: &'gc super::ExportAllDeclaration<'gc>) -> Self {
21065            Self {
21066                is_changed: false,
21067                inner: super::ExportAllDeclaration {
21068                    metadata: node.metadata.duplicate(),
21069                    source: node.source.duplicate(),
21070                    export_kind: Cell::new(node.export_kind.get()),
21071                },
21072            }
21073        }
21074        /// Allocate the rebuilt node if a setter ran, else
21075        /// `TransformResult::Unchanged`.
21076        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21077            if self.is_changed {
21078                TransformResult::Changed(self.build_forced(gc))
21079            } else {
21080                TransformResult::Unchanged
21081            }
21082        }
21083        /// Allocate the node unconditionally, changed or not.
21084        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21085            gc.alloc(Node::ExportAllDeclaration(self.inner))
21086        }
21087        /// Set the `source` field and mark the builder changed.
21088        pub fn source(&mut self, source: &'gc Node<'gc>) { self.is_changed = true; self.inner.source = source; }
21089    }
21090    /// Clone-with-changes builder for [`super::ObjectPattern`].
21091    #[derive(Debug)]
21092    pub struct ObjectPattern<'gc> {
21093        is_changed: bool,
21094        pub(super) inner: super::ObjectPattern<'gc>,
21095    }
21096    impl<'gc> ObjectPattern<'gc> {
21097        /// Start from a copy of `node`, with no field changed yet.
21098        pub fn from_node(node: &'gc super::ObjectPattern<'gc>) -> Self {
21099            Self {
21100                is_changed: false,
21101                inner: super::ObjectPattern {
21102                    metadata: node.metadata.duplicate(),
21103                    properties: node.properties.duplicate(),
21104                    type_annotation: node.type_annotation.duplicate(),
21105                },
21106            }
21107        }
21108        /// Allocate the rebuilt node if a setter ran, else
21109        /// `TransformResult::Unchanged`.
21110        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21111            if self.is_changed {
21112                TransformResult::Changed(self.build_forced(gc))
21113            } else {
21114                TransformResult::Unchanged
21115            }
21116        }
21117        /// Allocate the node unconditionally, changed or not.
21118        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21119            gc.alloc(Node::ObjectPattern(self.inner))
21120        }
21121        /// Set the `properties` field and mark the builder changed.
21122        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
21123        /// Set the `type_annotation` field and mark the builder changed.
21124        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
21125    }
21126    /// Clone-with-changes builder for [`super::ArrayPattern`].
21127    #[derive(Debug)]
21128    pub struct ArrayPattern<'gc> {
21129        is_changed: bool,
21130        pub(super) inner: super::ArrayPattern<'gc>,
21131    }
21132    impl<'gc> ArrayPattern<'gc> {
21133        /// Start from a copy of `node`, with no field changed yet.
21134        pub fn from_node(node: &'gc super::ArrayPattern<'gc>) -> Self {
21135            Self {
21136                is_changed: false,
21137                inner: super::ArrayPattern {
21138                    metadata: node.metadata.duplicate(),
21139                    elements: node.elements.duplicate(),
21140                    type_annotation: node.type_annotation.duplicate(),
21141                },
21142            }
21143        }
21144        /// Allocate the rebuilt node if a setter ran, else
21145        /// `TransformResult::Unchanged`.
21146        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21147            if self.is_changed {
21148                TransformResult::Changed(self.build_forced(gc))
21149            } else {
21150                TransformResult::Unchanged
21151            }
21152        }
21153        /// Allocate the node unconditionally, changed or not.
21154        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21155            gc.alloc(Node::ArrayPattern(self.inner))
21156        }
21157        /// Set the `elements` field and mark the builder changed.
21158        pub fn elements(&mut self, elements: NodeList<'gc>) { self.is_changed = true; self.inner.elements = elements; }
21159        /// Set the `type_annotation` field and mark the builder changed.
21160        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
21161    }
21162    /// Clone-with-changes builder for [`super::RestElement`].
21163    #[derive(Debug)]
21164    pub struct RestElement<'gc> {
21165        is_changed: bool,
21166        pub(super) inner: super::RestElement<'gc>,
21167    }
21168    impl<'gc> RestElement<'gc> {
21169        /// Start from a copy of `node`, with no field changed yet.
21170        pub fn from_node(node: &'gc super::RestElement<'gc>) -> Self {
21171            Self {
21172                is_changed: false,
21173                inner: super::RestElement {
21174                    metadata: node.metadata.duplicate(),
21175                    argument: node.argument.duplicate(),
21176                },
21177            }
21178        }
21179        /// Allocate the rebuilt node if a setter ran, else
21180        /// `TransformResult::Unchanged`.
21181        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21182            if self.is_changed {
21183                TransformResult::Changed(self.build_forced(gc))
21184            } else {
21185                TransformResult::Unchanged
21186            }
21187        }
21188        /// Allocate the node unconditionally, changed or not.
21189        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21190            gc.alloc(Node::RestElement(self.inner))
21191        }
21192        /// Set the `argument` field and mark the builder changed.
21193        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
21194    }
21195    /// Clone-with-changes builder for [`super::AssignmentPattern`].
21196    #[derive(Debug)]
21197    pub struct AssignmentPattern<'gc> {
21198        is_changed: bool,
21199        pub(super) inner: super::AssignmentPattern<'gc>,
21200    }
21201    impl<'gc> AssignmentPattern<'gc> {
21202        /// Start from a copy of `node`, with no field changed yet.
21203        pub fn from_node(node: &'gc super::AssignmentPattern<'gc>) -> Self {
21204            Self {
21205                is_changed: false,
21206                inner: super::AssignmentPattern {
21207                    metadata: node.metadata.duplicate(),
21208                    left: node.left.duplicate(),
21209                    right: node.right.duplicate(),
21210                },
21211            }
21212        }
21213        /// Allocate the rebuilt node if a setter ran, else
21214        /// `TransformResult::Unchanged`.
21215        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21216            if self.is_changed {
21217                TransformResult::Changed(self.build_forced(gc))
21218            } else {
21219                TransformResult::Unchanged
21220            }
21221        }
21222        /// Allocate the node unconditionally, changed or not.
21223        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21224            gc.alloc(Node::AssignmentPattern(self.inner))
21225        }
21226        /// Set the `left` field and mark the builder changed.
21227        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
21228        /// Set the `right` field and mark the builder changed.
21229        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
21230    }
21231    /// Clone-with-changes builder for [`super::MatchStatementCase`].
21232    #[derive(Debug)]
21233    pub struct MatchStatementCase<'gc> {
21234        is_changed: bool,
21235        pub(super) inner: super::MatchStatementCase<'gc>,
21236    }
21237    impl<'gc> MatchStatementCase<'gc> {
21238        /// Start from a copy of `node`, with no field changed yet.
21239        pub fn from_node(node: &'gc super::MatchStatementCase<'gc>) -> Self {
21240            Self {
21241                is_changed: false,
21242                inner: super::MatchStatementCase {
21243                    metadata: node.metadata.duplicate(),
21244                    pattern: node.pattern.duplicate(),
21245                    body: node.body.duplicate(),
21246                    guard: node.guard.duplicate(),
21247                },
21248            }
21249        }
21250        /// Allocate the rebuilt node if a setter ran, else
21251        /// `TransformResult::Unchanged`.
21252        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21253            if self.is_changed {
21254                TransformResult::Changed(self.build_forced(gc))
21255            } else {
21256                TransformResult::Unchanged
21257            }
21258        }
21259        /// Allocate the node unconditionally, changed or not.
21260        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21261            gc.alloc(Node::MatchStatementCase(self.inner))
21262        }
21263        /// Set the `pattern` field and mark the builder changed.
21264        pub fn pattern(&mut self, pattern: &'gc Node<'gc>) { self.is_changed = true; self.inner.pattern = pattern; }
21265        /// Set the `body` field and mark the builder changed.
21266        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
21267        /// Set the `guard` field and mark the builder changed.
21268        pub fn guard(&mut self, guard: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.guard = guard; }
21269    }
21270    /// Clone-with-changes builder for [`super::MatchExpression`].
21271    #[derive(Debug)]
21272    pub struct MatchExpression<'gc> {
21273        is_changed: bool,
21274        pub(super) inner: super::MatchExpression<'gc>,
21275    }
21276    impl<'gc> MatchExpression<'gc> {
21277        /// Start from a copy of `node`, with no field changed yet.
21278        pub fn from_node(node: &'gc super::MatchExpression<'gc>) -> Self {
21279            Self {
21280                is_changed: false,
21281                inner: super::MatchExpression {
21282                    metadata: node.metadata.duplicate(),
21283                    argument: node.argument.duplicate(),
21284                    cases: node.cases.duplicate(),
21285                },
21286            }
21287        }
21288        /// Allocate the rebuilt node if a setter ran, else
21289        /// `TransformResult::Unchanged`.
21290        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21291            if self.is_changed {
21292                TransformResult::Changed(self.build_forced(gc))
21293            } else {
21294                TransformResult::Unchanged
21295            }
21296        }
21297        /// Allocate the node unconditionally, changed or not.
21298        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21299            gc.alloc(Node::MatchExpression(self.inner))
21300        }
21301        /// Set the `argument` field and mark the builder changed.
21302        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
21303        /// Set the `cases` field and mark the builder changed.
21304        pub fn cases(&mut self, cases: NodeList<'gc>) { self.is_changed = true; self.inner.cases = cases; }
21305    }
21306    /// Clone-with-changes builder for [`super::MatchExpressionCase`].
21307    #[derive(Debug)]
21308    pub struct MatchExpressionCase<'gc> {
21309        is_changed: bool,
21310        pub(super) inner: super::MatchExpressionCase<'gc>,
21311    }
21312    impl<'gc> MatchExpressionCase<'gc> {
21313        /// Start from a copy of `node`, with no field changed yet.
21314        pub fn from_node(node: &'gc super::MatchExpressionCase<'gc>) -> Self {
21315            Self {
21316                is_changed: false,
21317                inner: super::MatchExpressionCase {
21318                    metadata: node.metadata.duplicate(),
21319                    pattern: node.pattern.duplicate(),
21320                    body: node.body.duplicate(),
21321                    guard: node.guard.duplicate(),
21322                },
21323            }
21324        }
21325        /// Allocate the rebuilt node if a setter ran, else
21326        /// `TransformResult::Unchanged`.
21327        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21328            if self.is_changed {
21329                TransformResult::Changed(self.build_forced(gc))
21330            } else {
21331                TransformResult::Unchanged
21332            }
21333        }
21334        /// Allocate the node unconditionally, changed or not.
21335        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21336            gc.alloc(Node::MatchExpressionCase(self.inner))
21337        }
21338        /// Set the `pattern` field and mark the builder changed.
21339        pub fn pattern(&mut self, pattern: &'gc Node<'gc>) { self.is_changed = true; self.inner.pattern = pattern; }
21340        /// Set the `body` field and mark the builder changed.
21341        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
21342        /// Set the `guard` field and mark the builder changed.
21343        pub fn guard(&mut self, guard: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.guard = guard; }
21344    }
21345    /// Clone-with-changes builder for [`super::MatchWildcardPattern`].
21346    #[derive(Debug)]
21347    pub struct MatchWildcardPattern<'gc> {
21348        is_changed: bool,
21349        pub(super) inner: super::MatchWildcardPattern<'gc>,
21350    }
21351    impl<'gc> MatchWildcardPattern<'gc> {
21352        /// Start from a copy of `node`, with no field changed yet.
21353        pub fn from_node(node: &'gc super::MatchWildcardPattern<'gc>) -> Self {
21354            Self {
21355                is_changed: false,
21356                inner: super::MatchWildcardPattern {
21357                    metadata: node.metadata.duplicate(),
21358                },
21359            }
21360        }
21361        /// Allocate the rebuilt node if a setter ran, else
21362        /// `TransformResult::Unchanged`.
21363        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21364            if self.is_changed {
21365                TransformResult::Changed(self.build_forced(gc))
21366            } else {
21367                TransformResult::Unchanged
21368            }
21369        }
21370        /// Allocate the node unconditionally, changed or not.
21371        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21372            gc.alloc(Node::MatchWildcardPattern(self.inner))
21373        }
21374    }
21375    /// Clone-with-changes builder for [`super::MatchLiteralPattern`].
21376    #[derive(Debug)]
21377    pub struct MatchLiteralPattern<'gc> {
21378        is_changed: bool,
21379        pub(super) inner: super::MatchLiteralPattern<'gc>,
21380    }
21381    impl<'gc> MatchLiteralPattern<'gc> {
21382        /// Start from a copy of `node`, with no field changed yet.
21383        pub fn from_node(node: &'gc super::MatchLiteralPattern<'gc>) -> Self {
21384            Self {
21385                is_changed: false,
21386                inner: super::MatchLiteralPattern {
21387                    metadata: node.metadata.duplicate(),
21388                    literal: node.literal.duplicate(),
21389                },
21390            }
21391        }
21392        /// Allocate the rebuilt node if a setter ran, else
21393        /// `TransformResult::Unchanged`.
21394        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21395            if self.is_changed {
21396                TransformResult::Changed(self.build_forced(gc))
21397            } else {
21398                TransformResult::Unchanged
21399            }
21400        }
21401        /// Allocate the node unconditionally, changed or not.
21402        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21403            gc.alloc(Node::MatchLiteralPattern(self.inner))
21404        }
21405        /// Set the `literal` field and mark the builder changed.
21406        pub fn literal(&mut self, literal: &'gc Node<'gc>) { self.is_changed = true; self.inner.literal = literal; }
21407    }
21408    /// Clone-with-changes builder for [`super::MatchUnaryPattern`].
21409    #[derive(Debug)]
21410    pub struct MatchUnaryPattern<'gc> {
21411        is_changed: bool,
21412        pub(super) inner: super::MatchUnaryPattern<'gc>,
21413    }
21414    impl<'gc> MatchUnaryPattern<'gc> {
21415        /// Start from a copy of `node`, with no field changed yet.
21416        pub fn from_node(node: &'gc super::MatchUnaryPattern<'gc>) -> Self {
21417            Self {
21418                is_changed: false,
21419                inner: super::MatchUnaryPattern {
21420                    metadata: node.metadata.duplicate(),
21421                    argument: node.argument.duplicate(),
21422                    operator: Cell::new(node.operator.get()),
21423                },
21424            }
21425        }
21426        /// Allocate the rebuilt node if a setter ran, else
21427        /// `TransformResult::Unchanged`.
21428        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21429            if self.is_changed {
21430                TransformResult::Changed(self.build_forced(gc))
21431            } else {
21432                TransformResult::Unchanged
21433            }
21434        }
21435        /// Allocate the node unconditionally, changed or not.
21436        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21437            gc.alloc(Node::MatchUnaryPattern(self.inner))
21438        }
21439        /// Set the `argument` field and mark the builder changed.
21440        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
21441    }
21442    /// Clone-with-changes builder for [`super::MatchIdentifierPattern`].
21443    #[derive(Debug)]
21444    pub struct MatchIdentifierPattern<'gc> {
21445        is_changed: bool,
21446        pub(super) inner: super::MatchIdentifierPattern<'gc>,
21447    }
21448    impl<'gc> MatchIdentifierPattern<'gc> {
21449        /// Start from a copy of `node`, with no field changed yet.
21450        pub fn from_node(node: &'gc super::MatchIdentifierPattern<'gc>) -> Self {
21451            Self {
21452                is_changed: false,
21453                inner: super::MatchIdentifierPattern {
21454                    metadata: node.metadata.duplicate(),
21455                    id: node.id.duplicate(),
21456                },
21457            }
21458        }
21459        /// Allocate the rebuilt node if a setter ran, else
21460        /// `TransformResult::Unchanged`.
21461        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21462            if self.is_changed {
21463                TransformResult::Changed(self.build_forced(gc))
21464            } else {
21465                TransformResult::Unchanged
21466            }
21467        }
21468        /// Allocate the node unconditionally, changed or not.
21469        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21470            gc.alloc(Node::MatchIdentifierPattern(self.inner))
21471        }
21472        /// Set the `id` field and mark the builder changed.
21473        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
21474    }
21475    /// Clone-with-changes builder for [`super::MatchBindingPattern`].
21476    #[derive(Debug)]
21477    pub struct MatchBindingPattern<'gc> {
21478        is_changed: bool,
21479        pub(super) inner: super::MatchBindingPattern<'gc>,
21480    }
21481    impl<'gc> MatchBindingPattern<'gc> {
21482        /// Start from a copy of `node`, with no field changed yet.
21483        pub fn from_node(node: &'gc super::MatchBindingPattern<'gc>) -> Self {
21484            Self {
21485                is_changed: false,
21486                inner: super::MatchBindingPattern {
21487                    metadata: node.metadata.duplicate(),
21488                    id: node.id.duplicate(),
21489                    kind: Cell::new(node.kind.get()),
21490                },
21491            }
21492        }
21493        /// Allocate the rebuilt node if a setter ran, else
21494        /// `TransformResult::Unchanged`.
21495        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21496            if self.is_changed {
21497                TransformResult::Changed(self.build_forced(gc))
21498            } else {
21499                TransformResult::Unchanged
21500            }
21501        }
21502        /// Allocate the node unconditionally, changed or not.
21503        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21504            gc.alloc(Node::MatchBindingPattern(self.inner))
21505        }
21506        /// Set the `id` field and mark the builder changed.
21507        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
21508    }
21509    /// Clone-with-changes builder for [`super::MatchObjectPattern`].
21510    #[derive(Debug)]
21511    pub struct MatchObjectPattern<'gc> {
21512        is_changed: bool,
21513        pub(super) inner: super::MatchObjectPattern<'gc>,
21514    }
21515    impl<'gc> MatchObjectPattern<'gc> {
21516        /// Start from a copy of `node`, with no field changed yet.
21517        pub fn from_node(node: &'gc super::MatchObjectPattern<'gc>) -> Self {
21518            Self {
21519                is_changed: false,
21520                inner: super::MatchObjectPattern {
21521                    metadata: node.metadata.duplicate(),
21522                    properties: node.properties.duplicate(),
21523                    rest: node.rest.duplicate(),
21524                },
21525            }
21526        }
21527        /// Allocate the rebuilt node if a setter ran, else
21528        /// `TransformResult::Unchanged`.
21529        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21530            if self.is_changed {
21531                TransformResult::Changed(self.build_forced(gc))
21532            } else {
21533                TransformResult::Unchanged
21534            }
21535        }
21536        /// Allocate the node unconditionally, changed or not.
21537        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21538            gc.alloc(Node::MatchObjectPattern(self.inner))
21539        }
21540        /// Set the `properties` field and mark the builder changed.
21541        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
21542        /// Set the `rest` field and mark the builder changed.
21543        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
21544    }
21545    /// Clone-with-changes builder for [`super::MatchArrayPattern`].
21546    #[derive(Debug)]
21547    pub struct MatchArrayPattern<'gc> {
21548        is_changed: bool,
21549        pub(super) inner: super::MatchArrayPattern<'gc>,
21550    }
21551    impl<'gc> MatchArrayPattern<'gc> {
21552        /// Start from a copy of `node`, with no field changed yet.
21553        pub fn from_node(node: &'gc super::MatchArrayPattern<'gc>) -> Self {
21554            Self {
21555                is_changed: false,
21556                inner: super::MatchArrayPattern {
21557                    metadata: node.metadata.duplicate(),
21558                    elements: node.elements.duplicate(),
21559                    rest: node.rest.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::MatchArrayPattern(self.inner))
21575        }
21576        /// Set the `elements` field and mark the builder changed.
21577        pub fn elements(&mut self, elements: NodeList<'gc>) { self.is_changed = true; self.inner.elements = elements; }
21578        /// Set the `rest` field and mark the builder changed.
21579        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
21580    }
21581    /// Clone-with-changes builder for [`super::MatchOrPattern`].
21582    #[derive(Debug)]
21583    pub struct MatchOrPattern<'gc> {
21584        is_changed: bool,
21585        pub(super) inner: super::MatchOrPattern<'gc>,
21586    }
21587    impl<'gc> MatchOrPattern<'gc> {
21588        /// Start from a copy of `node`, with no field changed yet.
21589        pub fn from_node(node: &'gc super::MatchOrPattern<'gc>) -> Self {
21590            Self {
21591                is_changed: false,
21592                inner: super::MatchOrPattern {
21593                    metadata: node.metadata.duplicate(),
21594                    patterns: node.patterns.duplicate(),
21595                },
21596            }
21597        }
21598        /// Allocate the rebuilt node if a setter ran, else
21599        /// `TransformResult::Unchanged`.
21600        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21601            if self.is_changed {
21602                TransformResult::Changed(self.build_forced(gc))
21603            } else {
21604                TransformResult::Unchanged
21605            }
21606        }
21607        /// Allocate the node unconditionally, changed or not.
21608        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21609            gc.alloc(Node::MatchOrPattern(self.inner))
21610        }
21611        /// Set the `patterns` field and mark the builder changed.
21612        pub fn patterns(&mut self, patterns: NodeList<'gc>) { self.is_changed = true; self.inner.patterns = patterns; }
21613    }
21614    /// Clone-with-changes builder for [`super::MatchAsPattern`].
21615    #[derive(Debug)]
21616    pub struct MatchAsPattern<'gc> {
21617        is_changed: bool,
21618        pub(super) inner: super::MatchAsPattern<'gc>,
21619    }
21620    impl<'gc> MatchAsPattern<'gc> {
21621        /// Start from a copy of `node`, with no field changed yet.
21622        pub fn from_node(node: &'gc super::MatchAsPattern<'gc>) -> Self {
21623            Self {
21624                is_changed: false,
21625                inner: super::MatchAsPattern {
21626                    metadata: node.metadata.duplicate(),
21627                    pattern: node.pattern.duplicate(),
21628                    target: node.target.duplicate(),
21629                },
21630            }
21631        }
21632        /// Allocate the rebuilt node if a setter ran, else
21633        /// `TransformResult::Unchanged`.
21634        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21635            if self.is_changed {
21636                TransformResult::Changed(self.build_forced(gc))
21637            } else {
21638                TransformResult::Unchanged
21639            }
21640        }
21641        /// Allocate the node unconditionally, changed or not.
21642        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21643            gc.alloc(Node::MatchAsPattern(self.inner))
21644        }
21645        /// Set the `pattern` field and mark the builder changed.
21646        pub fn pattern(&mut self, pattern: &'gc Node<'gc>) { self.is_changed = true; self.inner.pattern = pattern; }
21647        /// Set the `target` field and mark the builder changed.
21648        pub fn target(&mut self, target: &'gc Node<'gc>) { self.is_changed = true; self.inner.target = target; }
21649    }
21650    /// Clone-with-changes builder for [`super::MatchMemberPattern`].
21651    #[derive(Debug)]
21652    pub struct MatchMemberPattern<'gc> {
21653        is_changed: bool,
21654        pub(super) inner: super::MatchMemberPattern<'gc>,
21655    }
21656    impl<'gc> MatchMemberPattern<'gc> {
21657        /// Start from a copy of `node`, with no field changed yet.
21658        pub fn from_node(node: &'gc super::MatchMemberPattern<'gc>) -> Self {
21659            Self {
21660                is_changed: false,
21661                inner: super::MatchMemberPattern {
21662                    metadata: node.metadata.duplicate(),
21663                    base: node.base.duplicate(),
21664                    property: node.property.duplicate(),
21665                },
21666            }
21667        }
21668        /// Allocate the rebuilt node if a setter ran, else
21669        /// `TransformResult::Unchanged`.
21670        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21671            if self.is_changed {
21672                TransformResult::Changed(self.build_forced(gc))
21673            } else {
21674                TransformResult::Unchanged
21675            }
21676        }
21677        /// Allocate the node unconditionally, changed or not.
21678        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21679            gc.alloc(Node::MatchMemberPattern(self.inner))
21680        }
21681        /// Set the `base` field and mark the builder changed.
21682        pub fn base(&mut self, base: &'gc Node<'gc>) { self.is_changed = true; self.inner.base = base; }
21683        /// Set the `property` field and mark the builder changed.
21684        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
21685    }
21686    /// Clone-with-changes builder for [`super::MatchInstancePattern`].
21687    #[derive(Debug)]
21688    pub struct MatchInstancePattern<'gc> {
21689        is_changed: bool,
21690        pub(super) inner: super::MatchInstancePattern<'gc>,
21691    }
21692    impl<'gc> MatchInstancePattern<'gc> {
21693        /// Start from a copy of `node`, with no field changed yet.
21694        pub fn from_node(node: &'gc super::MatchInstancePattern<'gc>) -> Self {
21695            Self {
21696                is_changed: false,
21697                inner: super::MatchInstancePattern {
21698                    metadata: node.metadata.duplicate(),
21699                    target_constructor: node.target_constructor.duplicate(),
21700                    properties: node.properties.duplicate(),
21701                },
21702            }
21703        }
21704        /// Allocate the rebuilt node if a setter ran, else
21705        /// `TransformResult::Unchanged`.
21706        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21707            if self.is_changed {
21708                TransformResult::Changed(self.build_forced(gc))
21709            } else {
21710                TransformResult::Unchanged
21711            }
21712        }
21713        /// Allocate the node unconditionally, changed or not.
21714        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21715            gc.alloc(Node::MatchInstancePattern(self.inner))
21716        }
21717        /// Set the `target_constructor` field and mark the builder changed.
21718        pub fn target_constructor(&mut self, target_constructor: &'gc Node<'gc>) { self.is_changed = true; self.inner.target_constructor = target_constructor; }
21719        /// Set the `properties` field and mark the builder changed.
21720        pub fn properties(&mut self, properties: &'gc Node<'gc>) { self.is_changed = true; self.inner.properties = properties; }
21721    }
21722    /// Clone-with-changes builder for [`super::MatchObjectPatternProperty`].
21723    #[derive(Debug)]
21724    pub struct MatchObjectPatternProperty<'gc> {
21725        is_changed: bool,
21726        pub(super) inner: super::MatchObjectPatternProperty<'gc>,
21727    }
21728    impl<'gc> MatchObjectPatternProperty<'gc> {
21729        /// Start from a copy of `node`, with no field changed yet.
21730        pub fn from_node(node: &'gc super::MatchObjectPatternProperty<'gc>) -> Self {
21731            Self {
21732                is_changed: false,
21733                inner: super::MatchObjectPatternProperty {
21734                    metadata: node.metadata.duplicate(),
21735                    key: node.key.duplicate(),
21736                    pattern: node.pattern.duplicate(),
21737                    shorthand: Cell::new(node.shorthand.get()),
21738                },
21739            }
21740        }
21741        /// Allocate the rebuilt node if a setter ran, else
21742        /// `TransformResult::Unchanged`.
21743        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21744            if self.is_changed {
21745                TransformResult::Changed(self.build_forced(gc))
21746            } else {
21747                TransformResult::Unchanged
21748            }
21749        }
21750        /// Allocate the node unconditionally, changed or not.
21751        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21752            gc.alloc(Node::MatchObjectPatternProperty(self.inner))
21753        }
21754        /// Set the `key` field and mark the builder changed.
21755        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
21756        /// Set the `pattern` field and mark the builder changed.
21757        pub fn pattern(&mut self, pattern: &'gc Node<'gc>) { self.is_changed = true; self.inner.pattern = pattern; }
21758    }
21759    /// Clone-with-changes builder for [`super::MatchInstanceObjectPattern`].
21760    #[derive(Debug)]
21761    pub struct MatchInstanceObjectPattern<'gc> {
21762        is_changed: bool,
21763        pub(super) inner: super::MatchInstanceObjectPattern<'gc>,
21764    }
21765    impl<'gc> MatchInstanceObjectPattern<'gc> {
21766        /// Start from a copy of `node`, with no field changed yet.
21767        pub fn from_node(node: &'gc super::MatchInstanceObjectPattern<'gc>) -> Self {
21768            Self {
21769                is_changed: false,
21770                inner: super::MatchInstanceObjectPattern {
21771                    metadata: node.metadata.duplicate(),
21772                    properties: node.properties.duplicate(),
21773                    rest: node.rest.duplicate(),
21774                },
21775            }
21776        }
21777        /// Allocate the rebuilt node if a setter ran, else
21778        /// `TransformResult::Unchanged`.
21779        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21780            if self.is_changed {
21781                TransformResult::Changed(self.build_forced(gc))
21782            } else {
21783                TransformResult::Unchanged
21784            }
21785        }
21786        /// Allocate the node unconditionally, changed or not.
21787        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21788            gc.alloc(Node::MatchInstanceObjectPattern(self.inner))
21789        }
21790        /// Set the `properties` field and mark the builder changed.
21791        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
21792        /// Set the `rest` field and mark the builder changed.
21793        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
21794    }
21795    /// Clone-with-changes builder for [`super::MatchRestPattern`].
21796    #[derive(Debug)]
21797    pub struct MatchRestPattern<'gc> {
21798        is_changed: bool,
21799        pub(super) inner: super::MatchRestPattern<'gc>,
21800    }
21801    impl<'gc> MatchRestPattern<'gc> {
21802        /// Start from a copy of `node`, with no field changed yet.
21803        pub fn from_node(node: &'gc super::MatchRestPattern<'gc>) -> Self {
21804            Self {
21805                is_changed: false,
21806                inner: super::MatchRestPattern {
21807                    metadata: node.metadata.duplicate(),
21808                    argument: node.argument.duplicate(),
21809                },
21810            }
21811        }
21812        /// Allocate the rebuilt node if a setter ran, else
21813        /// `TransformResult::Unchanged`.
21814        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21815            if self.is_changed {
21816                TransformResult::Changed(self.build_forced(gc))
21817            } else {
21818                TransformResult::Unchanged
21819            }
21820        }
21821        /// Allocate the node unconditionally, changed or not.
21822        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21823            gc.alloc(Node::MatchRestPattern(self.inner))
21824        }
21825        /// Set the `argument` field and mark the builder changed.
21826        pub fn argument(&mut self, argument: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.argument = argument; }
21827    }
21828    /// Clone-with-changes builder for [`super::JSXIdentifier`].
21829    #[derive(Debug)]
21830    pub struct JSXIdentifier<'gc> {
21831        is_changed: bool,
21832        pub(super) inner: super::JSXIdentifier<'gc>,
21833    }
21834    impl<'gc> JSXIdentifier<'gc> {
21835        /// Start from a copy of `node`, with no field changed yet.
21836        pub fn from_node(node: &'gc super::JSXIdentifier<'gc>) -> Self {
21837            Self {
21838                is_changed: false,
21839                inner: super::JSXIdentifier {
21840                    metadata: node.metadata.duplicate(),
21841                    name: Cell::new(node.name.get()),
21842                },
21843            }
21844        }
21845        /// Allocate the rebuilt node if a setter ran, else
21846        /// `TransformResult::Unchanged`.
21847        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21848            if self.is_changed {
21849                TransformResult::Changed(self.build_forced(gc))
21850            } else {
21851                TransformResult::Unchanged
21852            }
21853        }
21854        /// Allocate the node unconditionally, changed or not.
21855        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21856            gc.alloc(Node::JSXIdentifier(self.inner))
21857        }
21858    }
21859    /// Clone-with-changes builder for [`super::JSXMemberExpression`].
21860    #[derive(Debug)]
21861    pub struct JSXMemberExpression<'gc> {
21862        is_changed: bool,
21863        pub(super) inner: super::JSXMemberExpression<'gc>,
21864    }
21865    impl<'gc> JSXMemberExpression<'gc> {
21866        /// Start from a copy of `node`, with no field changed yet.
21867        pub fn from_node(node: &'gc super::JSXMemberExpression<'gc>) -> Self {
21868            Self {
21869                is_changed: false,
21870                inner: super::JSXMemberExpression {
21871                    metadata: node.metadata.duplicate(),
21872                    object: node.object.duplicate(),
21873                    property: node.property.duplicate(),
21874                },
21875            }
21876        }
21877        /// Allocate the rebuilt node if a setter ran, else
21878        /// `TransformResult::Unchanged`.
21879        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21880            if self.is_changed {
21881                TransformResult::Changed(self.build_forced(gc))
21882            } else {
21883                TransformResult::Unchanged
21884            }
21885        }
21886        /// Allocate the node unconditionally, changed or not.
21887        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21888            gc.alloc(Node::JSXMemberExpression(self.inner))
21889        }
21890        /// Set the `object` field and mark the builder changed.
21891        pub fn object(&mut self, object: &'gc Node<'gc>) { self.is_changed = true; self.inner.object = object; }
21892        /// Set the `property` field and mark the builder changed.
21893        pub fn property(&mut self, property: &'gc Node<'gc>) { self.is_changed = true; self.inner.property = property; }
21894    }
21895    /// Clone-with-changes builder for [`super::JSXNamespacedName`].
21896    #[derive(Debug)]
21897    pub struct JSXNamespacedName<'gc> {
21898        is_changed: bool,
21899        pub(super) inner: super::JSXNamespacedName<'gc>,
21900    }
21901    impl<'gc> JSXNamespacedName<'gc> {
21902        /// Start from a copy of `node`, with no field changed yet.
21903        pub fn from_node(node: &'gc super::JSXNamespacedName<'gc>) -> Self {
21904            Self {
21905                is_changed: false,
21906                inner: super::JSXNamespacedName {
21907                    metadata: node.metadata.duplicate(),
21908                    namespace: node.namespace.duplicate(),
21909                    name: node.name.duplicate(),
21910                },
21911            }
21912        }
21913        /// Allocate the rebuilt node if a setter ran, else
21914        /// `TransformResult::Unchanged`.
21915        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21916            if self.is_changed {
21917                TransformResult::Changed(self.build_forced(gc))
21918            } else {
21919                TransformResult::Unchanged
21920            }
21921        }
21922        /// Allocate the node unconditionally, changed or not.
21923        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21924            gc.alloc(Node::JSXNamespacedName(self.inner))
21925        }
21926        /// Set the `namespace` field and mark the builder changed.
21927        pub fn namespace(&mut self, namespace: &'gc Node<'gc>) { self.is_changed = true; self.inner.namespace = namespace; }
21928        /// Set the `name` field and mark the builder changed.
21929        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
21930    }
21931    /// Clone-with-changes builder for [`super::JSXEmptyExpression`].
21932    #[derive(Debug)]
21933    pub struct JSXEmptyExpression<'gc> {
21934        is_changed: bool,
21935        pub(super) inner: super::JSXEmptyExpression<'gc>,
21936    }
21937    impl<'gc> JSXEmptyExpression<'gc> {
21938        /// Start from a copy of `node`, with no field changed yet.
21939        pub fn from_node(node: &'gc super::JSXEmptyExpression<'gc>) -> Self {
21940            Self {
21941                is_changed: false,
21942                inner: super::JSXEmptyExpression {
21943                    metadata: node.metadata.duplicate(),
21944                },
21945            }
21946        }
21947        /// Allocate the rebuilt node if a setter ran, else
21948        /// `TransformResult::Unchanged`.
21949        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21950            if self.is_changed {
21951                TransformResult::Changed(self.build_forced(gc))
21952            } else {
21953                TransformResult::Unchanged
21954            }
21955        }
21956        /// Allocate the node unconditionally, changed or not.
21957        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21958            gc.alloc(Node::JSXEmptyExpression(self.inner))
21959        }
21960    }
21961    /// Clone-with-changes builder for [`super::JSXExpressionContainer`].
21962    #[derive(Debug)]
21963    pub struct JSXExpressionContainer<'gc> {
21964        is_changed: bool,
21965        pub(super) inner: super::JSXExpressionContainer<'gc>,
21966    }
21967    impl<'gc> JSXExpressionContainer<'gc> {
21968        /// Start from a copy of `node`, with no field changed yet.
21969        pub fn from_node(node: &'gc super::JSXExpressionContainer<'gc>) -> Self {
21970            Self {
21971                is_changed: false,
21972                inner: super::JSXExpressionContainer {
21973                    metadata: node.metadata.duplicate(),
21974                    expression: node.expression.duplicate(),
21975                },
21976            }
21977        }
21978        /// Allocate the rebuilt node if a setter ran, else
21979        /// `TransformResult::Unchanged`.
21980        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
21981            if self.is_changed {
21982                TransformResult::Changed(self.build_forced(gc))
21983            } else {
21984                TransformResult::Unchanged
21985            }
21986        }
21987        /// Allocate the node unconditionally, changed or not.
21988        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
21989            gc.alloc(Node::JSXExpressionContainer(self.inner))
21990        }
21991        /// Set the `expression` field and mark the builder changed.
21992        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
21993    }
21994    /// Clone-with-changes builder for [`super::JSXSpreadChild`].
21995    #[derive(Debug)]
21996    pub struct JSXSpreadChild<'gc> {
21997        is_changed: bool,
21998        pub(super) inner: super::JSXSpreadChild<'gc>,
21999    }
22000    impl<'gc> JSXSpreadChild<'gc> {
22001        /// Start from a copy of `node`, with no field changed yet.
22002        pub fn from_node(node: &'gc super::JSXSpreadChild<'gc>) -> Self {
22003            Self {
22004                is_changed: false,
22005                inner: super::JSXSpreadChild {
22006                    metadata: node.metadata.duplicate(),
22007                    expression: node.expression.duplicate(),
22008                },
22009            }
22010        }
22011        /// Allocate the rebuilt node if a setter ran, else
22012        /// `TransformResult::Unchanged`.
22013        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22014            if self.is_changed {
22015                TransformResult::Changed(self.build_forced(gc))
22016            } else {
22017                TransformResult::Unchanged
22018            }
22019        }
22020        /// Allocate the node unconditionally, changed or not.
22021        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22022            gc.alloc(Node::JSXSpreadChild(self.inner))
22023        }
22024        /// Set the `expression` field and mark the builder changed.
22025        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
22026    }
22027    /// Clone-with-changes builder for [`super::JSXOpeningElement`].
22028    #[derive(Debug)]
22029    pub struct JSXOpeningElement<'gc> {
22030        is_changed: bool,
22031        pub(super) inner: super::JSXOpeningElement<'gc>,
22032    }
22033    impl<'gc> JSXOpeningElement<'gc> {
22034        /// Start from a copy of `node`, with no field changed yet.
22035        pub fn from_node(node: &'gc super::JSXOpeningElement<'gc>) -> Self {
22036            Self {
22037                is_changed: false,
22038                inner: super::JSXOpeningElement {
22039                    metadata: node.metadata.duplicate(),
22040                    name: node.name.duplicate(),
22041                    attributes: node.attributes.duplicate(),
22042                    self_closing: Cell::new(node.self_closing.get()),
22043                    type_arguments: node.type_arguments.duplicate(),
22044                },
22045            }
22046        }
22047        /// Allocate the rebuilt node if a setter ran, else
22048        /// `TransformResult::Unchanged`.
22049        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22050            if self.is_changed {
22051                TransformResult::Changed(self.build_forced(gc))
22052            } else {
22053                TransformResult::Unchanged
22054            }
22055        }
22056        /// Allocate the node unconditionally, changed or not.
22057        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22058            gc.alloc(Node::JSXOpeningElement(self.inner))
22059        }
22060        /// Set the `name` field and mark the builder changed.
22061        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
22062        /// Set the `attributes` field and mark the builder changed.
22063        pub fn attributes(&mut self, attributes: NodeList<'gc>) { self.is_changed = true; self.inner.attributes = attributes; }
22064        /// Set the `type_arguments` field and mark the builder changed.
22065        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
22066    }
22067    /// Clone-with-changes builder for [`super::JSXClosingElement`].
22068    #[derive(Debug)]
22069    pub struct JSXClosingElement<'gc> {
22070        is_changed: bool,
22071        pub(super) inner: super::JSXClosingElement<'gc>,
22072    }
22073    impl<'gc> JSXClosingElement<'gc> {
22074        /// Start from a copy of `node`, with no field changed yet.
22075        pub fn from_node(node: &'gc super::JSXClosingElement<'gc>) -> Self {
22076            Self {
22077                is_changed: false,
22078                inner: super::JSXClosingElement {
22079                    metadata: node.metadata.duplicate(),
22080                    name: node.name.duplicate(),
22081                },
22082            }
22083        }
22084        /// Allocate the rebuilt node if a setter ran, else
22085        /// `TransformResult::Unchanged`.
22086        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22087            if self.is_changed {
22088                TransformResult::Changed(self.build_forced(gc))
22089            } else {
22090                TransformResult::Unchanged
22091            }
22092        }
22093        /// Allocate the node unconditionally, changed or not.
22094        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22095            gc.alloc(Node::JSXClosingElement(self.inner))
22096        }
22097        /// Set the `name` field and mark the builder changed.
22098        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
22099    }
22100    /// Clone-with-changes builder for [`super::JSXAttribute`].
22101    #[derive(Debug)]
22102    pub struct JSXAttribute<'gc> {
22103        is_changed: bool,
22104        pub(super) inner: super::JSXAttribute<'gc>,
22105    }
22106    impl<'gc> JSXAttribute<'gc> {
22107        /// Start from a copy of `node`, with no field changed yet.
22108        pub fn from_node(node: &'gc super::JSXAttribute<'gc>) -> Self {
22109            Self {
22110                is_changed: false,
22111                inner: super::JSXAttribute {
22112                    metadata: node.metadata.duplicate(),
22113                    name: node.name.duplicate(),
22114                    value: node.value.duplicate(),
22115                },
22116            }
22117        }
22118        /// Allocate the rebuilt node if a setter ran, else
22119        /// `TransformResult::Unchanged`.
22120        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22121            if self.is_changed {
22122                TransformResult::Changed(self.build_forced(gc))
22123            } else {
22124                TransformResult::Unchanged
22125            }
22126        }
22127        /// Allocate the node unconditionally, changed or not.
22128        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22129            gc.alloc(Node::JSXAttribute(self.inner))
22130        }
22131        /// Set the `name` field and mark the builder changed.
22132        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
22133        /// Set the `value` field and mark the builder changed.
22134        pub fn value(&mut self, value: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.value = value; }
22135    }
22136    /// Clone-with-changes builder for [`super::JSXSpreadAttribute`].
22137    #[derive(Debug)]
22138    pub struct JSXSpreadAttribute<'gc> {
22139        is_changed: bool,
22140        pub(super) inner: super::JSXSpreadAttribute<'gc>,
22141    }
22142    impl<'gc> JSXSpreadAttribute<'gc> {
22143        /// Start from a copy of `node`, with no field changed yet.
22144        pub fn from_node(node: &'gc super::JSXSpreadAttribute<'gc>) -> Self {
22145            Self {
22146                is_changed: false,
22147                inner: super::JSXSpreadAttribute {
22148                    metadata: node.metadata.duplicate(),
22149                    argument: node.argument.duplicate(),
22150                },
22151            }
22152        }
22153        /// Allocate the rebuilt node if a setter ran, else
22154        /// `TransformResult::Unchanged`.
22155        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22156            if self.is_changed {
22157                TransformResult::Changed(self.build_forced(gc))
22158            } else {
22159                TransformResult::Unchanged
22160            }
22161        }
22162        /// Allocate the node unconditionally, changed or not.
22163        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22164            gc.alloc(Node::JSXSpreadAttribute(self.inner))
22165        }
22166        /// Set the `argument` field and mark the builder changed.
22167        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
22168    }
22169    /// Clone-with-changes builder for [`super::JSXStringLiteral`].
22170    #[derive(Debug)]
22171    pub struct JSXStringLiteral<'gc> {
22172        is_changed: bool,
22173        pub(super) inner: super::JSXStringLiteral<'gc>,
22174    }
22175    impl<'gc> JSXStringLiteral<'gc> {
22176        /// Start from a copy of `node`, with no field changed yet.
22177        pub fn from_node(node: &'gc super::JSXStringLiteral<'gc>) -> Self {
22178            Self {
22179                is_changed: false,
22180                inner: super::JSXStringLiteral {
22181                    metadata: node.metadata.duplicate(),
22182                    value: Cell::new(node.value.get()),
22183                    raw: Cell::new(node.raw.get()),
22184                },
22185            }
22186        }
22187        /// Allocate the rebuilt node if a setter ran, else
22188        /// `TransformResult::Unchanged`.
22189        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22190            if self.is_changed {
22191                TransformResult::Changed(self.build_forced(gc))
22192            } else {
22193                TransformResult::Unchanged
22194            }
22195        }
22196        /// Allocate the node unconditionally, changed or not.
22197        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22198            gc.alloc(Node::JSXStringLiteral(self.inner))
22199        }
22200    }
22201    /// Clone-with-changes builder for [`super::JSXText`].
22202    #[derive(Debug)]
22203    pub struct JSXText<'gc> {
22204        is_changed: bool,
22205        pub(super) inner: super::JSXText<'gc>,
22206    }
22207    impl<'gc> JSXText<'gc> {
22208        /// Start from a copy of `node`, with no field changed yet.
22209        pub fn from_node(node: &'gc super::JSXText<'gc>) -> Self {
22210            Self {
22211                is_changed: false,
22212                inner: super::JSXText {
22213                    metadata: node.metadata.duplicate(),
22214                    value: Cell::new(node.value.get()),
22215                    raw: Cell::new(node.raw.get()),
22216                },
22217            }
22218        }
22219        /// Allocate the rebuilt node if a setter ran, else
22220        /// `TransformResult::Unchanged`.
22221        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22222            if self.is_changed {
22223                TransformResult::Changed(self.build_forced(gc))
22224            } else {
22225                TransformResult::Unchanged
22226            }
22227        }
22228        /// Allocate the node unconditionally, changed or not.
22229        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22230            gc.alloc(Node::JSXText(self.inner))
22231        }
22232    }
22233    /// Clone-with-changes builder for [`super::JSXElement`].
22234    #[derive(Debug)]
22235    pub struct JSXElement<'gc> {
22236        is_changed: bool,
22237        pub(super) inner: super::JSXElement<'gc>,
22238    }
22239    impl<'gc> JSXElement<'gc> {
22240        /// Start from a copy of `node`, with no field changed yet.
22241        pub fn from_node(node: &'gc super::JSXElement<'gc>) -> Self {
22242            Self {
22243                is_changed: false,
22244                inner: super::JSXElement {
22245                    metadata: node.metadata.duplicate(),
22246                    opening_element: node.opening_element.duplicate(),
22247                    children: node.children.duplicate(),
22248                    closing_element: node.closing_element.duplicate(),
22249                },
22250            }
22251        }
22252        /// Allocate the rebuilt node if a setter ran, else
22253        /// `TransformResult::Unchanged`.
22254        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22255            if self.is_changed {
22256                TransformResult::Changed(self.build_forced(gc))
22257            } else {
22258                TransformResult::Unchanged
22259            }
22260        }
22261        /// Allocate the node unconditionally, changed or not.
22262        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22263            gc.alloc(Node::JSXElement(self.inner))
22264        }
22265        /// Set the `opening_element` field and mark the builder changed.
22266        pub fn opening_element(&mut self, opening_element: &'gc Node<'gc>) { self.is_changed = true; self.inner.opening_element = opening_element; }
22267        /// Set the `children` field and mark the builder changed.
22268        pub fn children(&mut self, children: NodeList<'gc>) { self.is_changed = true; self.inner.children = children; }
22269        /// Set the `closing_element` field and mark the builder changed.
22270        pub fn closing_element(&mut self, closing_element: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.closing_element = closing_element; }
22271    }
22272    /// Clone-with-changes builder for [`super::JSXFragment`].
22273    #[derive(Debug)]
22274    pub struct JSXFragment<'gc> {
22275        is_changed: bool,
22276        pub(super) inner: super::JSXFragment<'gc>,
22277    }
22278    impl<'gc> JSXFragment<'gc> {
22279        /// Start from a copy of `node`, with no field changed yet.
22280        pub fn from_node(node: &'gc super::JSXFragment<'gc>) -> Self {
22281            Self {
22282                is_changed: false,
22283                inner: super::JSXFragment {
22284                    metadata: node.metadata.duplicate(),
22285                    opening_fragment: node.opening_fragment.duplicate(),
22286                    children: node.children.duplicate(),
22287                    closing_fragment: node.closing_fragment.duplicate(),
22288                },
22289            }
22290        }
22291        /// Allocate the rebuilt node if a setter ran, else
22292        /// `TransformResult::Unchanged`.
22293        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22294            if self.is_changed {
22295                TransformResult::Changed(self.build_forced(gc))
22296            } else {
22297                TransformResult::Unchanged
22298            }
22299        }
22300        /// Allocate the node unconditionally, changed or not.
22301        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22302            gc.alloc(Node::JSXFragment(self.inner))
22303        }
22304        /// Set the `opening_fragment` field and mark the builder changed.
22305        pub fn opening_fragment(&mut self, opening_fragment: &'gc Node<'gc>) { self.is_changed = true; self.inner.opening_fragment = opening_fragment; }
22306        /// Set the `children` field and mark the builder changed.
22307        pub fn children(&mut self, children: NodeList<'gc>) { self.is_changed = true; self.inner.children = children; }
22308        /// Set the `closing_fragment` field and mark the builder changed.
22309        pub fn closing_fragment(&mut self, closing_fragment: &'gc Node<'gc>) { self.is_changed = true; self.inner.closing_fragment = closing_fragment; }
22310    }
22311    /// Clone-with-changes builder for [`super::JSXOpeningFragment`].
22312    #[derive(Debug)]
22313    pub struct JSXOpeningFragment<'gc> {
22314        is_changed: bool,
22315        pub(super) inner: super::JSXOpeningFragment<'gc>,
22316    }
22317    impl<'gc> JSXOpeningFragment<'gc> {
22318        /// Start from a copy of `node`, with no field changed yet.
22319        pub fn from_node(node: &'gc super::JSXOpeningFragment<'gc>) -> Self {
22320            Self {
22321                is_changed: false,
22322                inner: super::JSXOpeningFragment {
22323                    metadata: node.metadata.duplicate(),
22324                },
22325            }
22326        }
22327        /// Allocate the rebuilt node if a setter ran, else
22328        /// `TransformResult::Unchanged`.
22329        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22330            if self.is_changed {
22331                TransformResult::Changed(self.build_forced(gc))
22332            } else {
22333                TransformResult::Unchanged
22334            }
22335        }
22336        /// Allocate the node unconditionally, changed or not.
22337        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22338            gc.alloc(Node::JSXOpeningFragment(self.inner))
22339        }
22340    }
22341    /// Clone-with-changes builder for [`super::JSXClosingFragment`].
22342    #[derive(Debug)]
22343    pub struct JSXClosingFragment<'gc> {
22344        is_changed: bool,
22345        pub(super) inner: super::JSXClosingFragment<'gc>,
22346    }
22347    impl<'gc> JSXClosingFragment<'gc> {
22348        /// Start from a copy of `node`, with no field changed yet.
22349        pub fn from_node(node: &'gc super::JSXClosingFragment<'gc>) -> Self {
22350            Self {
22351                is_changed: false,
22352                inner: super::JSXClosingFragment {
22353                    metadata: node.metadata.duplicate(),
22354                },
22355            }
22356        }
22357        /// Allocate the rebuilt node if a setter ran, else
22358        /// `TransformResult::Unchanged`.
22359        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22360            if self.is_changed {
22361                TransformResult::Changed(self.build_forced(gc))
22362            } else {
22363                TransformResult::Unchanged
22364            }
22365        }
22366        /// Allocate the node unconditionally, changed or not.
22367        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22368            gc.alloc(Node::JSXClosingFragment(self.inner))
22369        }
22370    }
22371    /// Clone-with-changes builder for [`super::ExistsTypeAnnotation`].
22372    #[derive(Debug)]
22373    pub struct ExistsTypeAnnotation<'gc> {
22374        is_changed: bool,
22375        pub(super) inner: super::ExistsTypeAnnotation<'gc>,
22376    }
22377    impl<'gc> ExistsTypeAnnotation<'gc> {
22378        /// Start from a copy of `node`, with no field changed yet.
22379        pub fn from_node(node: &'gc super::ExistsTypeAnnotation<'gc>) -> Self {
22380            Self {
22381                is_changed: false,
22382                inner: super::ExistsTypeAnnotation {
22383                    metadata: node.metadata.duplicate(),
22384                },
22385            }
22386        }
22387        /// Allocate the rebuilt node if a setter ran, else
22388        /// `TransformResult::Unchanged`.
22389        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22390            if self.is_changed {
22391                TransformResult::Changed(self.build_forced(gc))
22392            } else {
22393                TransformResult::Unchanged
22394            }
22395        }
22396        /// Allocate the node unconditionally, changed or not.
22397        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22398            gc.alloc(Node::ExistsTypeAnnotation(self.inner))
22399        }
22400    }
22401    /// Clone-with-changes builder for [`super::EmptyTypeAnnotation`].
22402    #[derive(Debug)]
22403    pub struct EmptyTypeAnnotation<'gc> {
22404        is_changed: bool,
22405        pub(super) inner: super::EmptyTypeAnnotation<'gc>,
22406    }
22407    impl<'gc> EmptyTypeAnnotation<'gc> {
22408        /// Start from a copy of `node`, with no field changed yet.
22409        pub fn from_node(node: &'gc super::EmptyTypeAnnotation<'gc>) -> Self {
22410            Self {
22411                is_changed: false,
22412                inner: super::EmptyTypeAnnotation {
22413                    metadata: node.metadata.duplicate(),
22414                },
22415            }
22416        }
22417        /// Allocate the rebuilt node if a setter ran, else
22418        /// `TransformResult::Unchanged`.
22419        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22420            if self.is_changed {
22421                TransformResult::Changed(self.build_forced(gc))
22422            } else {
22423                TransformResult::Unchanged
22424            }
22425        }
22426        /// Allocate the node unconditionally, changed or not.
22427        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22428            gc.alloc(Node::EmptyTypeAnnotation(self.inner))
22429        }
22430    }
22431    /// Clone-with-changes builder for [`super::StringTypeAnnotation`].
22432    #[derive(Debug)]
22433    pub struct StringTypeAnnotation<'gc> {
22434        is_changed: bool,
22435        pub(super) inner: super::StringTypeAnnotation<'gc>,
22436    }
22437    impl<'gc> StringTypeAnnotation<'gc> {
22438        /// Start from a copy of `node`, with no field changed yet.
22439        pub fn from_node(node: &'gc super::StringTypeAnnotation<'gc>) -> Self {
22440            Self {
22441                is_changed: false,
22442                inner: super::StringTypeAnnotation {
22443                    metadata: node.metadata.duplicate(),
22444                },
22445            }
22446        }
22447        /// Allocate the rebuilt node if a setter ran, else
22448        /// `TransformResult::Unchanged`.
22449        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22450            if self.is_changed {
22451                TransformResult::Changed(self.build_forced(gc))
22452            } else {
22453                TransformResult::Unchanged
22454            }
22455        }
22456        /// Allocate the node unconditionally, changed or not.
22457        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22458            gc.alloc(Node::StringTypeAnnotation(self.inner))
22459        }
22460    }
22461    /// Clone-with-changes builder for [`super::NumberTypeAnnotation`].
22462    #[derive(Debug)]
22463    pub struct NumberTypeAnnotation<'gc> {
22464        is_changed: bool,
22465        pub(super) inner: super::NumberTypeAnnotation<'gc>,
22466    }
22467    impl<'gc> NumberTypeAnnotation<'gc> {
22468        /// Start from a copy of `node`, with no field changed yet.
22469        pub fn from_node(node: &'gc super::NumberTypeAnnotation<'gc>) -> Self {
22470            Self {
22471                is_changed: false,
22472                inner: super::NumberTypeAnnotation {
22473                    metadata: node.metadata.duplicate(),
22474                },
22475            }
22476        }
22477        /// Allocate the rebuilt node if a setter ran, else
22478        /// `TransformResult::Unchanged`.
22479        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22480            if self.is_changed {
22481                TransformResult::Changed(self.build_forced(gc))
22482            } else {
22483                TransformResult::Unchanged
22484            }
22485        }
22486        /// Allocate the node unconditionally, changed or not.
22487        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22488            gc.alloc(Node::NumberTypeAnnotation(self.inner))
22489        }
22490    }
22491    /// Clone-with-changes builder for [`super::StringLiteralTypeAnnotation`].
22492    #[derive(Debug)]
22493    pub struct StringLiteralTypeAnnotation<'gc> {
22494        is_changed: bool,
22495        pub(super) inner: super::StringLiteralTypeAnnotation<'gc>,
22496    }
22497    impl<'gc> StringLiteralTypeAnnotation<'gc> {
22498        /// Start from a copy of `node`, with no field changed yet.
22499        pub fn from_node(node: &'gc super::StringLiteralTypeAnnotation<'gc>) -> Self {
22500            Self {
22501                is_changed: false,
22502                inner: super::StringLiteralTypeAnnotation {
22503                    metadata: node.metadata.duplicate(),
22504                    value: Cell::new(node.value.get()),
22505                    raw: Cell::new(node.raw.get()),
22506                },
22507            }
22508        }
22509        /// Allocate the rebuilt node if a setter ran, else
22510        /// `TransformResult::Unchanged`.
22511        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22512            if self.is_changed {
22513                TransformResult::Changed(self.build_forced(gc))
22514            } else {
22515                TransformResult::Unchanged
22516            }
22517        }
22518        /// Allocate the node unconditionally, changed or not.
22519        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22520            gc.alloc(Node::StringLiteralTypeAnnotation(self.inner))
22521        }
22522    }
22523    /// Clone-with-changes builder for [`super::NumberLiteralTypeAnnotation`].
22524    #[derive(Debug)]
22525    pub struct NumberLiteralTypeAnnotation<'gc> {
22526        is_changed: bool,
22527        pub(super) inner: super::NumberLiteralTypeAnnotation<'gc>,
22528    }
22529    impl<'gc> NumberLiteralTypeAnnotation<'gc> {
22530        /// Start from a copy of `node`, with no field changed yet.
22531        pub fn from_node(node: &'gc super::NumberLiteralTypeAnnotation<'gc>) -> Self {
22532            Self {
22533                is_changed: false,
22534                inner: super::NumberLiteralTypeAnnotation {
22535                    metadata: node.metadata.duplicate(),
22536                    value: Cell::new(node.value.get()),
22537                    raw: Cell::new(node.raw.get()),
22538                },
22539            }
22540        }
22541        /// Allocate the rebuilt node if a setter ran, else
22542        /// `TransformResult::Unchanged`.
22543        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22544            if self.is_changed {
22545                TransformResult::Changed(self.build_forced(gc))
22546            } else {
22547                TransformResult::Unchanged
22548            }
22549        }
22550        /// Allocate the node unconditionally, changed or not.
22551        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22552            gc.alloc(Node::NumberLiteralTypeAnnotation(self.inner))
22553        }
22554    }
22555    /// Clone-with-changes builder for [`super::BigIntLiteralTypeAnnotation`].
22556    #[derive(Debug)]
22557    pub struct BigIntLiteralTypeAnnotation<'gc> {
22558        is_changed: bool,
22559        pub(super) inner: super::BigIntLiteralTypeAnnotation<'gc>,
22560    }
22561    impl<'gc> BigIntLiteralTypeAnnotation<'gc> {
22562        /// Start from a copy of `node`, with no field changed yet.
22563        pub fn from_node(node: &'gc super::BigIntLiteralTypeAnnotation<'gc>) -> Self {
22564            Self {
22565                is_changed: false,
22566                inner: super::BigIntLiteralTypeAnnotation {
22567                    metadata: node.metadata.duplicate(),
22568                    raw: Cell::new(node.raw.get()),
22569                },
22570            }
22571        }
22572        /// Allocate the rebuilt node if a setter ran, else
22573        /// `TransformResult::Unchanged`.
22574        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22575            if self.is_changed {
22576                TransformResult::Changed(self.build_forced(gc))
22577            } else {
22578                TransformResult::Unchanged
22579            }
22580        }
22581        /// Allocate the node unconditionally, changed or not.
22582        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22583            gc.alloc(Node::BigIntLiteralTypeAnnotation(self.inner))
22584        }
22585    }
22586    /// Clone-with-changes builder for [`super::BooleanTypeAnnotation`].
22587    #[derive(Debug)]
22588    pub struct BooleanTypeAnnotation<'gc> {
22589        is_changed: bool,
22590        pub(super) inner: super::BooleanTypeAnnotation<'gc>,
22591    }
22592    impl<'gc> BooleanTypeAnnotation<'gc> {
22593        /// Start from a copy of `node`, with no field changed yet.
22594        pub fn from_node(node: &'gc super::BooleanTypeAnnotation<'gc>) -> Self {
22595            Self {
22596                is_changed: false,
22597                inner: super::BooleanTypeAnnotation {
22598                    metadata: node.metadata.duplicate(),
22599                },
22600            }
22601        }
22602        /// Allocate the rebuilt node if a setter ran, else
22603        /// `TransformResult::Unchanged`.
22604        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22605            if self.is_changed {
22606                TransformResult::Changed(self.build_forced(gc))
22607            } else {
22608                TransformResult::Unchanged
22609            }
22610        }
22611        /// Allocate the node unconditionally, changed or not.
22612        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22613            gc.alloc(Node::BooleanTypeAnnotation(self.inner))
22614        }
22615    }
22616    /// Clone-with-changes builder for [`super::BooleanLiteralTypeAnnotation`].
22617    #[derive(Debug)]
22618    pub struct BooleanLiteralTypeAnnotation<'gc> {
22619        is_changed: bool,
22620        pub(super) inner: super::BooleanLiteralTypeAnnotation<'gc>,
22621    }
22622    impl<'gc> BooleanLiteralTypeAnnotation<'gc> {
22623        /// Start from a copy of `node`, with no field changed yet.
22624        pub fn from_node(node: &'gc super::BooleanLiteralTypeAnnotation<'gc>) -> Self {
22625            Self {
22626                is_changed: false,
22627                inner: super::BooleanLiteralTypeAnnotation {
22628                    metadata: node.metadata.duplicate(),
22629                    value: Cell::new(node.value.get()),
22630                    raw: Cell::new(node.raw.get()),
22631                },
22632            }
22633        }
22634        /// Allocate the rebuilt node if a setter ran, else
22635        /// `TransformResult::Unchanged`.
22636        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22637            if self.is_changed {
22638                TransformResult::Changed(self.build_forced(gc))
22639            } else {
22640                TransformResult::Unchanged
22641            }
22642        }
22643        /// Allocate the node unconditionally, changed or not.
22644        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22645            gc.alloc(Node::BooleanLiteralTypeAnnotation(self.inner))
22646        }
22647    }
22648    /// Clone-with-changes builder for [`super::NullLiteralTypeAnnotation`].
22649    #[derive(Debug)]
22650    pub struct NullLiteralTypeAnnotation<'gc> {
22651        is_changed: bool,
22652        pub(super) inner: super::NullLiteralTypeAnnotation<'gc>,
22653    }
22654    impl<'gc> NullLiteralTypeAnnotation<'gc> {
22655        /// Start from a copy of `node`, with no field changed yet.
22656        pub fn from_node(node: &'gc super::NullLiteralTypeAnnotation<'gc>) -> Self {
22657            Self {
22658                is_changed: false,
22659                inner: super::NullLiteralTypeAnnotation {
22660                    metadata: node.metadata.duplicate(),
22661                },
22662            }
22663        }
22664        /// Allocate the rebuilt node if a setter ran, else
22665        /// `TransformResult::Unchanged`.
22666        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22667            if self.is_changed {
22668                TransformResult::Changed(self.build_forced(gc))
22669            } else {
22670                TransformResult::Unchanged
22671            }
22672        }
22673        /// Allocate the node unconditionally, changed or not.
22674        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22675            gc.alloc(Node::NullLiteralTypeAnnotation(self.inner))
22676        }
22677    }
22678    /// Clone-with-changes builder for [`super::SymbolTypeAnnotation`].
22679    #[derive(Debug)]
22680    pub struct SymbolTypeAnnotation<'gc> {
22681        is_changed: bool,
22682        pub(super) inner: super::SymbolTypeAnnotation<'gc>,
22683    }
22684    impl<'gc> SymbolTypeAnnotation<'gc> {
22685        /// Start from a copy of `node`, with no field changed yet.
22686        pub fn from_node(node: &'gc super::SymbolTypeAnnotation<'gc>) -> Self {
22687            Self {
22688                is_changed: false,
22689                inner: super::SymbolTypeAnnotation {
22690                    metadata: node.metadata.duplicate(),
22691                },
22692            }
22693        }
22694        /// Allocate the rebuilt node if a setter ran, else
22695        /// `TransformResult::Unchanged`.
22696        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22697            if self.is_changed {
22698                TransformResult::Changed(self.build_forced(gc))
22699            } else {
22700                TransformResult::Unchanged
22701            }
22702        }
22703        /// Allocate the node unconditionally, changed or not.
22704        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22705            gc.alloc(Node::SymbolTypeAnnotation(self.inner))
22706        }
22707    }
22708    /// Clone-with-changes builder for [`super::AnyTypeAnnotation`].
22709    #[derive(Debug)]
22710    pub struct AnyTypeAnnotation<'gc> {
22711        is_changed: bool,
22712        pub(super) inner: super::AnyTypeAnnotation<'gc>,
22713    }
22714    impl<'gc> AnyTypeAnnotation<'gc> {
22715        /// Start from a copy of `node`, with no field changed yet.
22716        pub fn from_node(node: &'gc super::AnyTypeAnnotation<'gc>) -> Self {
22717            Self {
22718                is_changed: false,
22719                inner: super::AnyTypeAnnotation {
22720                    metadata: node.metadata.duplicate(),
22721                },
22722            }
22723        }
22724        /// Allocate the rebuilt node if a setter ran, else
22725        /// `TransformResult::Unchanged`.
22726        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22727            if self.is_changed {
22728                TransformResult::Changed(self.build_forced(gc))
22729            } else {
22730                TransformResult::Unchanged
22731            }
22732        }
22733        /// Allocate the node unconditionally, changed or not.
22734        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22735            gc.alloc(Node::AnyTypeAnnotation(self.inner))
22736        }
22737    }
22738    /// Clone-with-changes builder for [`super::MixedTypeAnnotation`].
22739    #[derive(Debug)]
22740    pub struct MixedTypeAnnotation<'gc> {
22741        is_changed: bool,
22742        pub(super) inner: super::MixedTypeAnnotation<'gc>,
22743    }
22744    impl<'gc> MixedTypeAnnotation<'gc> {
22745        /// Start from a copy of `node`, with no field changed yet.
22746        pub fn from_node(node: &'gc super::MixedTypeAnnotation<'gc>) -> Self {
22747            Self {
22748                is_changed: false,
22749                inner: super::MixedTypeAnnotation {
22750                    metadata: node.metadata.duplicate(),
22751                },
22752            }
22753        }
22754        /// Allocate the rebuilt node if a setter ran, else
22755        /// `TransformResult::Unchanged`.
22756        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22757            if self.is_changed {
22758                TransformResult::Changed(self.build_forced(gc))
22759            } else {
22760                TransformResult::Unchanged
22761            }
22762        }
22763        /// Allocate the node unconditionally, changed or not.
22764        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22765            gc.alloc(Node::MixedTypeAnnotation(self.inner))
22766        }
22767    }
22768    /// Clone-with-changes builder for [`super::BigIntTypeAnnotation`].
22769    #[derive(Debug)]
22770    pub struct BigIntTypeAnnotation<'gc> {
22771        is_changed: bool,
22772        pub(super) inner: super::BigIntTypeAnnotation<'gc>,
22773    }
22774    impl<'gc> BigIntTypeAnnotation<'gc> {
22775        /// Start from a copy of `node`, with no field changed yet.
22776        pub fn from_node(node: &'gc super::BigIntTypeAnnotation<'gc>) -> Self {
22777            Self {
22778                is_changed: false,
22779                inner: super::BigIntTypeAnnotation {
22780                    metadata: node.metadata.duplicate(),
22781                },
22782            }
22783        }
22784        /// Allocate the rebuilt node if a setter ran, else
22785        /// `TransformResult::Unchanged`.
22786        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22787            if self.is_changed {
22788                TransformResult::Changed(self.build_forced(gc))
22789            } else {
22790                TransformResult::Unchanged
22791            }
22792        }
22793        /// Allocate the node unconditionally, changed or not.
22794        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22795            gc.alloc(Node::BigIntTypeAnnotation(self.inner))
22796        }
22797    }
22798    /// Clone-with-changes builder for [`super::VoidTypeAnnotation`].
22799    #[derive(Debug)]
22800    pub struct VoidTypeAnnotation<'gc> {
22801        is_changed: bool,
22802        pub(super) inner: super::VoidTypeAnnotation<'gc>,
22803    }
22804    impl<'gc> VoidTypeAnnotation<'gc> {
22805        /// Start from a copy of `node`, with no field changed yet.
22806        pub fn from_node(node: &'gc super::VoidTypeAnnotation<'gc>) -> Self {
22807            Self {
22808                is_changed: false,
22809                inner: super::VoidTypeAnnotation {
22810                    metadata: node.metadata.duplicate(),
22811                },
22812            }
22813        }
22814        /// Allocate the rebuilt node if a setter ran, else
22815        /// `TransformResult::Unchanged`.
22816        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22817            if self.is_changed {
22818                TransformResult::Changed(self.build_forced(gc))
22819            } else {
22820                TransformResult::Unchanged
22821            }
22822        }
22823        /// Allocate the node unconditionally, changed or not.
22824        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22825            gc.alloc(Node::VoidTypeAnnotation(self.inner))
22826        }
22827    }
22828    /// Clone-with-changes builder for [`super::NeverTypeAnnotation`].
22829    #[derive(Debug)]
22830    pub struct NeverTypeAnnotation<'gc> {
22831        is_changed: bool,
22832        pub(super) inner: super::NeverTypeAnnotation<'gc>,
22833    }
22834    impl<'gc> NeverTypeAnnotation<'gc> {
22835        /// Start from a copy of `node`, with no field changed yet.
22836        pub fn from_node(node: &'gc super::NeverTypeAnnotation<'gc>) -> Self {
22837            Self {
22838                is_changed: false,
22839                inner: super::NeverTypeAnnotation {
22840                    metadata: node.metadata.duplicate(),
22841                },
22842            }
22843        }
22844        /// Allocate the rebuilt node if a setter ran, else
22845        /// `TransformResult::Unchanged`.
22846        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22847            if self.is_changed {
22848                TransformResult::Changed(self.build_forced(gc))
22849            } else {
22850                TransformResult::Unchanged
22851            }
22852        }
22853        /// Allocate the node unconditionally, changed or not.
22854        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22855            gc.alloc(Node::NeverTypeAnnotation(self.inner))
22856        }
22857    }
22858    /// Clone-with-changes builder for [`super::UnknownTypeAnnotation`].
22859    #[derive(Debug)]
22860    pub struct UnknownTypeAnnotation<'gc> {
22861        is_changed: bool,
22862        pub(super) inner: super::UnknownTypeAnnotation<'gc>,
22863    }
22864    impl<'gc> UnknownTypeAnnotation<'gc> {
22865        /// Start from a copy of `node`, with no field changed yet.
22866        pub fn from_node(node: &'gc super::UnknownTypeAnnotation<'gc>) -> Self {
22867            Self {
22868                is_changed: false,
22869                inner: super::UnknownTypeAnnotation {
22870                    metadata: node.metadata.duplicate(),
22871                },
22872            }
22873        }
22874        /// Allocate the rebuilt node if a setter ran, else
22875        /// `TransformResult::Unchanged`.
22876        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22877            if self.is_changed {
22878                TransformResult::Changed(self.build_forced(gc))
22879            } else {
22880                TransformResult::Unchanged
22881            }
22882        }
22883        /// Allocate the node unconditionally, changed or not.
22884        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22885            gc.alloc(Node::UnknownTypeAnnotation(self.inner))
22886        }
22887    }
22888    /// Clone-with-changes builder for [`super::UndefinedTypeAnnotation`].
22889    #[derive(Debug)]
22890    pub struct UndefinedTypeAnnotation<'gc> {
22891        is_changed: bool,
22892        pub(super) inner: super::UndefinedTypeAnnotation<'gc>,
22893    }
22894    impl<'gc> UndefinedTypeAnnotation<'gc> {
22895        /// Start from a copy of `node`, with no field changed yet.
22896        pub fn from_node(node: &'gc super::UndefinedTypeAnnotation<'gc>) -> Self {
22897            Self {
22898                is_changed: false,
22899                inner: super::UndefinedTypeAnnotation {
22900                    metadata: node.metadata.duplicate(),
22901                },
22902            }
22903        }
22904        /// Allocate the rebuilt node if a setter ran, else
22905        /// `TransformResult::Unchanged`.
22906        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22907            if self.is_changed {
22908                TransformResult::Changed(self.build_forced(gc))
22909            } else {
22910                TransformResult::Unchanged
22911            }
22912        }
22913        /// Allocate the node unconditionally, changed or not.
22914        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22915            gc.alloc(Node::UndefinedTypeAnnotation(self.inner))
22916        }
22917    }
22918    /// Clone-with-changes builder for [`super::FunctionTypeAnnotation`].
22919    #[derive(Debug)]
22920    pub struct FunctionTypeAnnotation<'gc> {
22921        is_changed: bool,
22922        pub(super) inner: super::FunctionTypeAnnotation<'gc>,
22923    }
22924    impl<'gc> FunctionTypeAnnotation<'gc> {
22925        /// Start from a copy of `node`, with no field changed yet.
22926        pub fn from_node(node: &'gc super::FunctionTypeAnnotation<'gc>) -> Self {
22927            Self {
22928                is_changed: false,
22929                inner: super::FunctionTypeAnnotation {
22930                    metadata: node.metadata.duplicate(),
22931                    params: node.params.duplicate(),
22932                    this: node.this.duplicate(),
22933                    return_type: node.return_type.duplicate(),
22934                    rest: node.rest.duplicate(),
22935                    type_parameters: node.type_parameters.duplicate(),
22936                },
22937            }
22938        }
22939        /// Allocate the rebuilt node if a setter ran, else
22940        /// `TransformResult::Unchanged`.
22941        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22942            if self.is_changed {
22943                TransformResult::Changed(self.build_forced(gc))
22944            } else {
22945                TransformResult::Unchanged
22946            }
22947        }
22948        /// Allocate the node unconditionally, changed or not.
22949        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22950            gc.alloc(Node::FunctionTypeAnnotation(self.inner))
22951        }
22952        /// Set the `params` field and mark the builder changed.
22953        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
22954        /// Set the `this` field and mark the builder changed.
22955        pub fn this(&mut self, this: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.this = this; }
22956        /// Set the `return_type` field and mark the builder changed.
22957        pub fn return_type(&mut self, return_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.return_type = return_type; }
22958        /// Set the `rest` field and mark the builder changed.
22959        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
22960        /// Set the `type_parameters` field and mark the builder changed.
22961        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
22962    }
22963    /// Clone-with-changes builder for [`super::HookTypeAnnotation`].
22964    #[derive(Debug)]
22965    pub struct HookTypeAnnotation<'gc> {
22966        is_changed: bool,
22967        pub(super) inner: super::HookTypeAnnotation<'gc>,
22968    }
22969    impl<'gc> HookTypeAnnotation<'gc> {
22970        /// Start from a copy of `node`, with no field changed yet.
22971        pub fn from_node(node: &'gc super::HookTypeAnnotation<'gc>) -> Self {
22972            Self {
22973                is_changed: false,
22974                inner: super::HookTypeAnnotation {
22975                    metadata: node.metadata.duplicate(),
22976                    params: node.params.duplicate(),
22977                    return_type: node.return_type.duplicate(),
22978                    rest: node.rest.duplicate(),
22979                    type_parameters: node.type_parameters.duplicate(),
22980                },
22981            }
22982        }
22983        /// Allocate the rebuilt node if a setter ran, else
22984        /// `TransformResult::Unchanged`.
22985        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
22986            if self.is_changed {
22987                TransformResult::Changed(self.build_forced(gc))
22988            } else {
22989                TransformResult::Unchanged
22990            }
22991        }
22992        /// Allocate the node unconditionally, changed or not.
22993        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
22994            gc.alloc(Node::HookTypeAnnotation(self.inner))
22995        }
22996        /// Set the `params` field and mark the builder changed.
22997        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
22998        /// Set the `return_type` field and mark the builder changed.
22999        pub fn return_type(&mut self, return_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.return_type = return_type; }
23000        /// Set the `rest` field and mark the builder changed.
23001        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
23002        /// Set the `type_parameters` field and mark the builder changed.
23003        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
23004    }
23005    /// Clone-with-changes builder for [`super::FunctionTypeParam`].
23006    #[derive(Debug)]
23007    pub struct FunctionTypeParam<'gc> {
23008        is_changed: bool,
23009        pub(super) inner: super::FunctionTypeParam<'gc>,
23010    }
23011    impl<'gc> FunctionTypeParam<'gc> {
23012        /// Start from a copy of `node`, with no field changed yet.
23013        pub fn from_node(node: &'gc super::FunctionTypeParam<'gc>) -> Self {
23014            Self {
23015                is_changed: false,
23016                inner: super::FunctionTypeParam {
23017                    metadata: node.metadata.duplicate(),
23018                    name: node.name.duplicate(),
23019                    type_annotation: node.type_annotation.duplicate(),
23020                    optional: Cell::new(node.optional.get()),
23021                },
23022            }
23023        }
23024        /// Allocate the rebuilt node if a setter ran, else
23025        /// `TransformResult::Unchanged`.
23026        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23027            if self.is_changed {
23028                TransformResult::Changed(self.build_forced(gc))
23029            } else {
23030                TransformResult::Unchanged
23031            }
23032        }
23033        /// Allocate the node unconditionally, changed or not.
23034        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23035            gc.alloc(Node::FunctionTypeParam(self.inner))
23036        }
23037        /// Set the `name` field and mark the builder changed.
23038        pub fn name(&mut self, name: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.name = name; }
23039        /// Set the `type_annotation` field and mark the builder changed.
23040        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23041    }
23042    /// Clone-with-changes builder for [`super::ComponentTypeAnnotation`].
23043    #[derive(Debug)]
23044    pub struct ComponentTypeAnnotation<'gc> {
23045        is_changed: bool,
23046        pub(super) inner: super::ComponentTypeAnnotation<'gc>,
23047    }
23048    impl<'gc> ComponentTypeAnnotation<'gc> {
23049        /// Start from a copy of `node`, with no field changed yet.
23050        pub fn from_node(node: &'gc super::ComponentTypeAnnotation<'gc>) -> Self {
23051            Self {
23052                is_changed: false,
23053                inner: super::ComponentTypeAnnotation {
23054                    metadata: node.metadata.duplicate(),
23055                    params: node.params.duplicate(),
23056                    rest: node.rest.duplicate(),
23057                    type_parameters: node.type_parameters.duplicate(),
23058                    renders_type: node.renders_type.duplicate(),
23059                },
23060            }
23061        }
23062        /// Allocate the rebuilt node if a setter ran, else
23063        /// `TransformResult::Unchanged`.
23064        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23065            if self.is_changed {
23066                TransformResult::Changed(self.build_forced(gc))
23067            } else {
23068                TransformResult::Unchanged
23069            }
23070        }
23071        /// Allocate the node unconditionally, changed or not.
23072        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23073            gc.alloc(Node::ComponentTypeAnnotation(self.inner))
23074        }
23075        /// Set the `params` field and mark the builder changed.
23076        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
23077        /// Set the `rest` field and mark the builder changed.
23078        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
23079        /// Set the `type_parameters` field and mark the builder changed.
23080        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
23081        /// Set the `renders_type` field and mark the builder changed.
23082        pub fn renders_type(&mut self, renders_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.renders_type = renders_type; }
23083    }
23084    /// Clone-with-changes builder for [`super::ComponentTypeParameter`].
23085    #[derive(Debug)]
23086    pub struct ComponentTypeParameter<'gc> {
23087        is_changed: bool,
23088        pub(super) inner: super::ComponentTypeParameter<'gc>,
23089    }
23090    impl<'gc> ComponentTypeParameter<'gc> {
23091        /// Start from a copy of `node`, with no field changed yet.
23092        pub fn from_node(node: &'gc super::ComponentTypeParameter<'gc>) -> Self {
23093            Self {
23094                is_changed: false,
23095                inner: super::ComponentTypeParameter {
23096                    metadata: node.metadata.duplicate(),
23097                    name: node.name.duplicate(),
23098                    type_annotation: node.type_annotation.duplicate(),
23099                    optional: Cell::new(node.optional.get()),
23100                },
23101            }
23102        }
23103        /// Allocate the rebuilt node if a setter ran, else
23104        /// `TransformResult::Unchanged`.
23105        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23106            if self.is_changed {
23107                TransformResult::Changed(self.build_forced(gc))
23108            } else {
23109                TransformResult::Unchanged
23110            }
23111        }
23112        /// Allocate the node unconditionally, changed or not.
23113        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23114            gc.alloc(Node::ComponentTypeParameter(self.inner))
23115        }
23116        /// Set the `name` field and mark the builder changed.
23117        pub fn name(&mut self, name: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.name = name; }
23118        /// Set the `type_annotation` field and mark the builder changed.
23119        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23120    }
23121    /// Clone-with-changes builder for [`super::NullableTypeAnnotation`].
23122    #[derive(Debug)]
23123    pub struct NullableTypeAnnotation<'gc> {
23124        is_changed: bool,
23125        pub(super) inner: super::NullableTypeAnnotation<'gc>,
23126    }
23127    impl<'gc> NullableTypeAnnotation<'gc> {
23128        /// Start from a copy of `node`, with no field changed yet.
23129        pub fn from_node(node: &'gc super::NullableTypeAnnotation<'gc>) -> Self {
23130            Self {
23131                is_changed: false,
23132                inner: super::NullableTypeAnnotation {
23133                    metadata: node.metadata.duplicate(),
23134                    type_annotation: node.type_annotation.duplicate(),
23135                },
23136            }
23137        }
23138        /// Allocate the rebuilt node if a setter ran, else
23139        /// `TransformResult::Unchanged`.
23140        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23141            if self.is_changed {
23142                TransformResult::Changed(self.build_forced(gc))
23143            } else {
23144                TransformResult::Unchanged
23145            }
23146        }
23147        /// Allocate the node unconditionally, changed or not.
23148        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23149            gc.alloc(Node::NullableTypeAnnotation(self.inner))
23150        }
23151        /// Set the `type_annotation` field and mark the builder changed.
23152        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23153    }
23154    /// Clone-with-changes builder for [`super::QualifiedTypeIdentifier`].
23155    #[derive(Debug)]
23156    pub struct QualifiedTypeIdentifier<'gc> {
23157        is_changed: bool,
23158        pub(super) inner: super::QualifiedTypeIdentifier<'gc>,
23159    }
23160    impl<'gc> QualifiedTypeIdentifier<'gc> {
23161        /// Start from a copy of `node`, with no field changed yet.
23162        pub fn from_node(node: &'gc super::QualifiedTypeIdentifier<'gc>) -> Self {
23163            Self {
23164                is_changed: false,
23165                inner: super::QualifiedTypeIdentifier {
23166                    metadata: node.metadata.duplicate(),
23167                    qualification: node.qualification.duplicate(),
23168                    id: node.id.duplicate(),
23169                },
23170            }
23171        }
23172        /// Allocate the rebuilt node if a setter ran, else
23173        /// `TransformResult::Unchanged`.
23174        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23175            if self.is_changed {
23176                TransformResult::Changed(self.build_forced(gc))
23177            } else {
23178                TransformResult::Unchanged
23179            }
23180        }
23181        /// Allocate the node unconditionally, changed or not.
23182        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23183            gc.alloc(Node::QualifiedTypeIdentifier(self.inner))
23184        }
23185        /// Set the `qualification` field and mark the builder changed.
23186        pub fn qualification(&mut self, qualification: &'gc Node<'gc>) { self.is_changed = true; self.inner.qualification = qualification; }
23187        /// Set the `id` field and mark the builder changed.
23188        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23189    }
23190    /// Clone-with-changes builder for [`super::TypeofTypeAnnotation`].
23191    #[derive(Debug)]
23192    pub struct TypeofTypeAnnotation<'gc> {
23193        is_changed: bool,
23194        pub(super) inner: super::TypeofTypeAnnotation<'gc>,
23195    }
23196    impl<'gc> TypeofTypeAnnotation<'gc> {
23197        /// Start from a copy of `node`, with no field changed yet.
23198        pub fn from_node(node: &'gc super::TypeofTypeAnnotation<'gc>) -> Self {
23199            Self {
23200                is_changed: false,
23201                inner: super::TypeofTypeAnnotation {
23202                    metadata: node.metadata.duplicate(),
23203                    argument: node.argument.duplicate(),
23204                    type_arguments: node.type_arguments.duplicate(),
23205                },
23206            }
23207        }
23208        /// Allocate the rebuilt node if a setter ran, else
23209        /// `TransformResult::Unchanged`.
23210        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23211            if self.is_changed {
23212                TransformResult::Changed(self.build_forced(gc))
23213            } else {
23214                TransformResult::Unchanged
23215            }
23216        }
23217        /// Allocate the node unconditionally, changed or not.
23218        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23219            gc.alloc(Node::TypeofTypeAnnotation(self.inner))
23220        }
23221        /// Set the `argument` field and mark the builder changed.
23222        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
23223        /// Set the `type_arguments` field and mark the builder changed.
23224        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
23225    }
23226    /// Clone-with-changes builder for [`super::KeyofTypeAnnotation`].
23227    #[derive(Debug)]
23228    pub struct KeyofTypeAnnotation<'gc> {
23229        is_changed: bool,
23230        pub(super) inner: super::KeyofTypeAnnotation<'gc>,
23231    }
23232    impl<'gc> KeyofTypeAnnotation<'gc> {
23233        /// Start from a copy of `node`, with no field changed yet.
23234        pub fn from_node(node: &'gc super::KeyofTypeAnnotation<'gc>) -> Self {
23235            Self {
23236                is_changed: false,
23237                inner: super::KeyofTypeAnnotation {
23238                    metadata: node.metadata.duplicate(),
23239                    argument: node.argument.duplicate(),
23240                },
23241            }
23242        }
23243        /// Allocate the rebuilt node if a setter ran, else
23244        /// `TransformResult::Unchanged`.
23245        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23246            if self.is_changed {
23247                TransformResult::Changed(self.build_forced(gc))
23248            } else {
23249                TransformResult::Unchanged
23250            }
23251        }
23252        /// Allocate the node unconditionally, changed or not.
23253        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23254            gc.alloc(Node::KeyofTypeAnnotation(self.inner))
23255        }
23256        /// Set the `argument` field and mark the builder changed.
23257        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
23258    }
23259    /// Clone-with-changes builder for [`super::TypeOperator`].
23260    #[derive(Debug)]
23261    pub struct TypeOperator<'gc> {
23262        is_changed: bool,
23263        pub(super) inner: super::TypeOperator<'gc>,
23264    }
23265    impl<'gc> TypeOperator<'gc> {
23266        /// Start from a copy of `node`, with no field changed yet.
23267        pub fn from_node(node: &'gc super::TypeOperator<'gc>) -> Self {
23268            Self {
23269                is_changed: false,
23270                inner: super::TypeOperator {
23271                    metadata: node.metadata.duplicate(),
23272                    operator: Cell::new(node.operator.get()),
23273                    type_annotation: node.type_annotation.duplicate(),
23274                },
23275            }
23276        }
23277        /// Allocate the rebuilt node if a setter ran, else
23278        /// `TransformResult::Unchanged`.
23279        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23280            if self.is_changed {
23281                TransformResult::Changed(self.build_forced(gc))
23282            } else {
23283                TransformResult::Unchanged
23284            }
23285        }
23286        /// Allocate the node unconditionally, changed or not.
23287        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23288            gc.alloc(Node::TypeOperator(self.inner))
23289        }
23290        /// Set the `type_annotation` field and mark the builder changed.
23291        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23292    }
23293    /// Clone-with-changes builder for [`super::QualifiedTypeofIdentifier`].
23294    #[derive(Debug)]
23295    pub struct QualifiedTypeofIdentifier<'gc> {
23296        is_changed: bool,
23297        pub(super) inner: super::QualifiedTypeofIdentifier<'gc>,
23298    }
23299    impl<'gc> QualifiedTypeofIdentifier<'gc> {
23300        /// Start from a copy of `node`, with no field changed yet.
23301        pub fn from_node(node: &'gc super::QualifiedTypeofIdentifier<'gc>) -> Self {
23302            Self {
23303                is_changed: false,
23304                inner: super::QualifiedTypeofIdentifier {
23305                    metadata: node.metadata.duplicate(),
23306                    qualification: node.qualification.duplicate(),
23307                    id: node.id.duplicate(),
23308                },
23309            }
23310        }
23311        /// Allocate the rebuilt node if a setter ran, else
23312        /// `TransformResult::Unchanged`.
23313        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23314            if self.is_changed {
23315                TransformResult::Changed(self.build_forced(gc))
23316            } else {
23317                TransformResult::Unchanged
23318            }
23319        }
23320        /// Allocate the node unconditionally, changed or not.
23321        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23322            gc.alloc(Node::QualifiedTypeofIdentifier(self.inner))
23323        }
23324        /// Set the `qualification` field and mark the builder changed.
23325        pub fn qualification(&mut self, qualification: &'gc Node<'gc>) { self.is_changed = true; self.inner.qualification = qualification; }
23326        /// Set the `id` field and mark the builder changed.
23327        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23328    }
23329    /// Clone-with-changes builder for [`super::TupleTypeAnnotation`].
23330    #[derive(Debug)]
23331    pub struct TupleTypeAnnotation<'gc> {
23332        is_changed: bool,
23333        pub(super) inner: super::TupleTypeAnnotation<'gc>,
23334    }
23335    impl<'gc> TupleTypeAnnotation<'gc> {
23336        /// Start from a copy of `node`, with no field changed yet.
23337        pub fn from_node(node: &'gc super::TupleTypeAnnotation<'gc>) -> Self {
23338            Self {
23339                is_changed: false,
23340                inner: super::TupleTypeAnnotation {
23341                    metadata: node.metadata.duplicate(),
23342                    element_types: node.element_types.duplicate(),
23343                    inexact: Cell::new(node.inexact.get()),
23344                },
23345            }
23346        }
23347        /// Allocate the rebuilt node if a setter ran, else
23348        /// `TransformResult::Unchanged`.
23349        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23350            if self.is_changed {
23351                TransformResult::Changed(self.build_forced(gc))
23352            } else {
23353                TransformResult::Unchanged
23354            }
23355        }
23356        /// Allocate the node unconditionally, changed or not.
23357        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23358            gc.alloc(Node::TupleTypeAnnotation(self.inner))
23359        }
23360        /// Set the `element_types` field and mark the builder changed.
23361        pub fn element_types(&mut self, element_types: NodeList<'gc>) { self.is_changed = true; self.inner.element_types = element_types; }
23362    }
23363    /// Clone-with-changes builder for [`super::TupleTypeSpreadElement`].
23364    #[derive(Debug)]
23365    pub struct TupleTypeSpreadElement<'gc> {
23366        is_changed: bool,
23367        pub(super) inner: super::TupleTypeSpreadElement<'gc>,
23368    }
23369    impl<'gc> TupleTypeSpreadElement<'gc> {
23370        /// Start from a copy of `node`, with no field changed yet.
23371        pub fn from_node(node: &'gc super::TupleTypeSpreadElement<'gc>) -> Self {
23372            Self {
23373                is_changed: false,
23374                inner: super::TupleTypeSpreadElement {
23375                    metadata: node.metadata.duplicate(),
23376                    label: node.label.duplicate(),
23377                    type_annotation: node.type_annotation.duplicate(),
23378                },
23379            }
23380        }
23381        /// Allocate the rebuilt node if a setter ran, else
23382        /// `TransformResult::Unchanged`.
23383        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23384            if self.is_changed {
23385                TransformResult::Changed(self.build_forced(gc))
23386            } else {
23387                TransformResult::Unchanged
23388            }
23389        }
23390        /// Allocate the node unconditionally, changed or not.
23391        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23392            gc.alloc(Node::TupleTypeSpreadElement(self.inner))
23393        }
23394        /// Set the `label` field and mark the builder changed.
23395        pub fn label(&mut self, label: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.label = label; }
23396        /// Set the `type_annotation` field and mark the builder changed.
23397        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23398    }
23399    /// Clone-with-changes builder for [`super::TupleTypeLabeledElement`].
23400    #[derive(Debug)]
23401    pub struct TupleTypeLabeledElement<'gc> {
23402        is_changed: bool,
23403        pub(super) inner: super::TupleTypeLabeledElement<'gc>,
23404    }
23405    impl<'gc> TupleTypeLabeledElement<'gc> {
23406        /// Start from a copy of `node`, with no field changed yet.
23407        pub fn from_node(node: &'gc super::TupleTypeLabeledElement<'gc>) -> Self {
23408            Self {
23409                is_changed: false,
23410                inner: super::TupleTypeLabeledElement {
23411                    metadata: node.metadata.duplicate(),
23412                    label: node.label.duplicate(),
23413                    element_type: node.element_type.duplicate(),
23414                    optional: Cell::new(node.optional.get()),
23415                    variance: node.variance.duplicate(),
23416                },
23417            }
23418        }
23419        /// Allocate the rebuilt node if a setter ran, else
23420        /// `TransformResult::Unchanged`.
23421        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23422            if self.is_changed {
23423                TransformResult::Changed(self.build_forced(gc))
23424            } else {
23425                TransformResult::Unchanged
23426            }
23427        }
23428        /// Allocate the node unconditionally, changed or not.
23429        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23430            gc.alloc(Node::TupleTypeLabeledElement(self.inner))
23431        }
23432        /// Set the `label` field and mark the builder changed.
23433        pub fn label(&mut self, label: &'gc Node<'gc>) { self.is_changed = true; self.inner.label = label; }
23434        /// Set the `element_type` field and mark the builder changed.
23435        pub fn element_type(&mut self, element_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.element_type = element_type; }
23436        /// Set the `variance` field and mark the builder changed.
23437        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
23438    }
23439    /// Clone-with-changes builder for [`super::ArrayTypeAnnotation`].
23440    #[derive(Debug)]
23441    pub struct ArrayTypeAnnotation<'gc> {
23442        is_changed: bool,
23443        pub(super) inner: super::ArrayTypeAnnotation<'gc>,
23444    }
23445    impl<'gc> ArrayTypeAnnotation<'gc> {
23446        /// Start from a copy of `node`, with no field changed yet.
23447        pub fn from_node(node: &'gc super::ArrayTypeAnnotation<'gc>) -> Self {
23448            Self {
23449                is_changed: false,
23450                inner: super::ArrayTypeAnnotation {
23451                    metadata: node.metadata.duplicate(),
23452                    element_type: node.element_type.duplicate(),
23453                },
23454            }
23455        }
23456        /// Allocate the rebuilt node if a setter ran, else
23457        /// `TransformResult::Unchanged`.
23458        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23459            if self.is_changed {
23460                TransformResult::Changed(self.build_forced(gc))
23461            } else {
23462                TransformResult::Unchanged
23463            }
23464        }
23465        /// Allocate the node unconditionally, changed or not.
23466        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23467            gc.alloc(Node::ArrayTypeAnnotation(self.inner))
23468        }
23469        /// Set the `element_type` field and mark the builder changed.
23470        pub fn element_type(&mut self, element_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.element_type = element_type; }
23471    }
23472    /// Clone-with-changes builder for [`super::InferTypeAnnotation`].
23473    #[derive(Debug)]
23474    pub struct InferTypeAnnotation<'gc> {
23475        is_changed: bool,
23476        pub(super) inner: super::InferTypeAnnotation<'gc>,
23477    }
23478    impl<'gc> InferTypeAnnotation<'gc> {
23479        /// Start from a copy of `node`, with no field changed yet.
23480        pub fn from_node(node: &'gc super::InferTypeAnnotation<'gc>) -> Self {
23481            Self {
23482                is_changed: false,
23483                inner: super::InferTypeAnnotation {
23484                    metadata: node.metadata.duplicate(),
23485                    type_parameter: node.type_parameter.duplicate(),
23486                },
23487            }
23488        }
23489        /// Allocate the rebuilt node if a setter ran, else
23490        /// `TransformResult::Unchanged`.
23491        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23492            if self.is_changed {
23493                TransformResult::Changed(self.build_forced(gc))
23494            } else {
23495                TransformResult::Unchanged
23496            }
23497        }
23498        /// Allocate the node unconditionally, changed or not.
23499        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23500            gc.alloc(Node::InferTypeAnnotation(self.inner))
23501        }
23502        /// Set the `type_parameter` field and mark the builder changed.
23503        pub fn type_parameter(&mut self, type_parameter: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_parameter = type_parameter; }
23504    }
23505    /// Clone-with-changes builder for [`super::UnionTypeAnnotation`].
23506    #[derive(Debug)]
23507    pub struct UnionTypeAnnotation<'gc> {
23508        is_changed: bool,
23509        pub(super) inner: super::UnionTypeAnnotation<'gc>,
23510    }
23511    impl<'gc> UnionTypeAnnotation<'gc> {
23512        /// Start from a copy of `node`, with no field changed yet.
23513        pub fn from_node(node: &'gc super::UnionTypeAnnotation<'gc>) -> Self {
23514            Self {
23515                is_changed: false,
23516                inner: super::UnionTypeAnnotation {
23517                    metadata: node.metadata.duplicate(),
23518                    types: node.types.duplicate(),
23519                },
23520            }
23521        }
23522        /// Allocate the rebuilt node if a setter ran, else
23523        /// `TransformResult::Unchanged`.
23524        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23525            if self.is_changed {
23526                TransformResult::Changed(self.build_forced(gc))
23527            } else {
23528                TransformResult::Unchanged
23529            }
23530        }
23531        /// Allocate the node unconditionally, changed or not.
23532        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23533            gc.alloc(Node::UnionTypeAnnotation(self.inner))
23534        }
23535        /// Set the `types` field and mark the builder changed.
23536        pub fn types(&mut self, types: NodeList<'gc>) { self.is_changed = true; self.inner.types = types; }
23537    }
23538    /// Clone-with-changes builder for [`super::IntersectionTypeAnnotation`].
23539    #[derive(Debug)]
23540    pub struct IntersectionTypeAnnotation<'gc> {
23541        is_changed: bool,
23542        pub(super) inner: super::IntersectionTypeAnnotation<'gc>,
23543    }
23544    impl<'gc> IntersectionTypeAnnotation<'gc> {
23545        /// Start from a copy of `node`, with no field changed yet.
23546        pub fn from_node(node: &'gc super::IntersectionTypeAnnotation<'gc>) -> Self {
23547            Self {
23548                is_changed: false,
23549                inner: super::IntersectionTypeAnnotation {
23550                    metadata: node.metadata.duplicate(),
23551                    types: node.types.duplicate(),
23552                },
23553            }
23554        }
23555        /// Allocate the rebuilt node if a setter ran, else
23556        /// `TransformResult::Unchanged`.
23557        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23558            if self.is_changed {
23559                TransformResult::Changed(self.build_forced(gc))
23560            } else {
23561                TransformResult::Unchanged
23562            }
23563        }
23564        /// Allocate the node unconditionally, changed or not.
23565        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23566            gc.alloc(Node::IntersectionTypeAnnotation(self.inner))
23567        }
23568        /// Set the `types` field and mark the builder changed.
23569        pub fn types(&mut self, types: NodeList<'gc>) { self.is_changed = true; self.inner.types = types; }
23570    }
23571    /// Clone-with-changes builder for [`super::GenericTypeAnnotation`].
23572    #[derive(Debug)]
23573    pub struct GenericTypeAnnotation<'gc> {
23574        is_changed: bool,
23575        pub(super) inner: super::GenericTypeAnnotation<'gc>,
23576    }
23577    impl<'gc> GenericTypeAnnotation<'gc> {
23578        /// Start from a copy of `node`, with no field changed yet.
23579        pub fn from_node(node: &'gc super::GenericTypeAnnotation<'gc>) -> Self {
23580            Self {
23581                is_changed: false,
23582                inner: super::GenericTypeAnnotation {
23583                    metadata: node.metadata.duplicate(),
23584                    id: node.id.duplicate(),
23585                    type_parameters: node.type_parameters.duplicate(),
23586                },
23587            }
23588        }
23589        /// Allocate the rebuilt node if a setter ran, else
23590        /// `TransformResult::Unchanged`.
23591        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23592            if self.is_changed {
23593                TransformResult::Changed(self.build_forced(gc))
23594            } else {
23595                TransformResult::Unchanged
23596            }
23597        }
23598        /// Allocate the node unconditionally, changed or not.
23599        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23600            gc.alloc(Node::GenericTypeAnnotation(self.inner))
23601        }
23602        /// Set the `id` field and mark the builder changed.
23603        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23604        /// Set the `type_parameters` field and mark the builder changed.
23605        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
23606    }
23607    /// Clone-with-changes builder for [`super::IndexedAccessType`].
23608    #[derive(Debug)]
23609    pub struct IndexedAccessType<'gc> {
23610        is_changed: bool,
23611        pub(super) inner: super::IndexedAccessType<'gc>,
23612    }
23613    impl<'gc> IndexedAccessType<'gc> {
23614        /// Start from a copy of `node`, with no field changed yet.
23615        pub fn from_node(node: &'gc super::IndexedAccessType<'gc>) -> Self {
23616            Self {
23617                is_changed: false,
23618                inner: super::IndexedAccessType {
23619                    metadata: node.metadata.duplicate(),
23620                    object_type: node.object_type.duplicate(),
23621                    index_type: node.index_type.duplicate(),
23622                },
23623            }
23624        }
23625        /// Allocate the rebuilt node if a setter ran, else
23626        /// `TransformResult::Unchanged`.
23627        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23628            if self.is_changed {
23629                TransformResult::Changed(self.build_forced(gc))
23630            } else {
23631                TransformResult::Unchanged
23632            }
23633        }
23634        /// Allocate the node unconditionally, changed or not.
23635        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23636            gc.alloc(Node::IndexedAccessType(self.inner))
23637        }
23638        /// Set the `object_type` field and mark the builder changed.
23639        pub fn object_type(&mut self, object_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.object_type = object_type; }
23640        /// Set the `index_type` field and mark the builder changed.
23641        pub fn index_type(&mut self, index_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.index_type = index_type; }
23642    }
23643    /// Clone-with-changes builder for [`super::OptionalIndexedAccessType`].
23644    #[derive(Debug)]
23645    pub struct OptionalIndexedAccessType<'gc> {
23646        is_changed: bool,
23647        pub(super) inner: super::OptionalIndexedAccessType<'gc>,
23648    }
23649    impl<'gc> OptionalIndexedAccessType<'gc> {
23650        /// Start from a copy of `node`, with no field changed yet.
23651        pub fn from_node(node: &'gc super::OptionalIndexedAccessType<'gc>) -> Self {
23652            Self {
23653                is_changed: false,
23654                inner: super::OptionalIndexedAccessType {
23655                    metadata: node.metadata.duplicate(),
23656                    object_type: node.object_type.duplicate(),
23657                    index_type: node.index_type.duplicate(),
23658                    optional: Cell::new(node.optional.get()),
23659                },
23660            }
23661        }
23662        /// Allocate the rebuilt node if a setter ran, else
23663        /// `TransformResult::Unchanged`.
23664        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23665            if self.is_changed {
23666                TransformResult::Changed(self.build_forced(gc))
23667            } else {
23668                TransformResult::Unchanged
23669            }
23670        }
23671        /// Allocate the node unconditionally, changed or not.
23672        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23673            gc.alloc(Node::OptionalIndexedAccessType(self.inner))
23674        }
23675        /// Set the `object_type` field and mark the builder changed.
23676        pub fn object_type(&mut self, object_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.object_type = object_type; }
23677        /// Set the `index_type` field and mark the builder changed.
23678        pub fn index_type(&mut self, index_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.index_type = index_type; }
23679    }
23680    /// Clone-with-changes builder for [`super::ConditionalTypeAnnotation`].
23681    #[derive(Debug)]
23682    pub struct ConditionalTypeAnnotation<'gc> {
23683        is_changed: bool,
23684        pub(super) inner: super::ConditionalTypeAnnotation<'gc>,
23685    }
23686    impl<'gc> ConditionalTypeAnnotation<'gc> {
23687        /// Start from a copy of `node`, with no field changed yet.
23688        pub fn from_node(node: &'gc super::ConditionalTypeAnnotation<'gc>) -> Self {
23689            Self {
23690                is_changed: false,
23691                inner: super::ConditionalTypeAnnotation {
23692                    metadata: node.metadata.duplicate(),
23693                    check_type: node.check_type.duplicate(),
23694                    extends_type: node.extends_type.duplicate(),
23695                    true_type: node.true_type.duplicate(),
23696                    false_type: node.false_type.duplicate(),
23697                },
23698            }
23699        }
23700        /// Allocate the rebuilt node if a setter ran, else
23701        /// `TransformResult::Unchanged`.
23702        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23703            if self.is_changed {
23704                TransformResult::Changed(self.build_forced(gc))
23705            } else {
23706                TransformResult::Unchanged
23707            }
23708        }
23709        /// Allocate the node unconditionally, changed or not.
23710        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23711            gc.alloc(Node::ConditionalTypeAnnotation(self.inner))
23712        }
23713        /// Set the `check_type` field and mark the builder changed.
23714        pub fn check_type(&mut self, check_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.check_type = check_type; }
23715        /// Set the `extends_type` field and mark the builder changed.
23716        pub fn extends_type(&mut self, extends_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.extends_type = extends_type; }
23717        /// Set the `true_type` field and mark the builder changed.
23718        pub fn true_type(&mut self, true_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.true_type = true_type; }
23719        /// Set the `false_type` field and mark the builder changed.
23720        pub fn false_type(&mut self, false_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.false_type = false_type; }
23721    }
23722    /// Clone-with-changes builder for [`super::TypePredicate`].
23723    #[derive(Debug)]
23724    pub struct TypePredicate<'gc> {
23725        is_changed: bool,
23726        pub(super) inner: super::TypePredicate<'gc>,
23727    }
23728    impl<'gc> TypePredicate<'gc> {
23729        /// Start from a copy of `node`, with no field changed yet.
23730        pub fn from_node(node: &'gc super::TypePredicate<'gc>) -> Self {
23731            Self {
23732                is_changed: false,
23733                inner: super::TypePredicate {
23734                    metadata: node.metadata.duplicate(),
23735                    parameter_name: node.parameter_name.duplicate(),
23736                    type_annotation: node.type_annotation.duplicate(),
23737                    kind: Cell::new(node.kind.get()),
23738                },
23739            }
23740        }
23741        /// Allocate the rebuilt node if a setter ran, else
23742        /// `TransformResult::Unchanged`.
23743        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23744            if self.is_changed {
23745                TransformResult::Changed(self.build_forced(gc))
23746            } else {
23747                TransformResult::Unchanged
23748            }
23749        }
23750        /// Allocate the node unconditionally, changed or not.
23751        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23752            gc.alloc(Node::TypePredicate(self.inner))
23753        }
23754        /// Set the `parameter_name` field and mark the builder changed.
23755        pub fn parameter_name(&mut self, parameter_name: &'gc Node<'gc>) { self.is_changed = true; self.inner.parameter_name = parameter_name; }
23756        /// Set the `type_annotation` field and mark the builder changed.
23757        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
23758    }
23759    /// Clone-with-changes builder for [`super::InterfaceTypeAnnotation`].
23760    #[derive(Debug)]
23761    pub struct InterfaceTypeAnnotation<'gc> {
23762        is_changed: bool,
23763        pub(super) inner: super::InterfaceTypeAnnotation<'gc>,
23764    }
23765    impl<'gc> InterfaceTypeAnnotation<'gc> {
23766        /// Start from a copy of `node`, with no field changed yet.
23767        pub fn from_node(node: &'gc super::InterfaceTypeAnnotation<'gc>) -> Self {
23768            Self {
23769                is_changed: false,
23770                inner: super::InterfaceTypeAnnotation {
23771                    metadata: node.metadata.duplicate(),
23772                    extends: node.extends.duplicate(),
23773                    body: node.body.duplicate(),
23774                },
23775            }
23776        }
23777        /// Allocate the rebuilt node if a setter ran, else
23778        /// `TransformResult::Unchanged`.
23779        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23780            if self.is_changed {
23781                TransformResult::Changed(self.build_forced(gc))
23782            } else {
23783                TransformResult::Unchanged
23784            }
23785        }
23786        /// Allocate the node unconditionally, changed or not.
23787        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23788            gc.alloc(Node::InterfaceTypeAnnotation(self.inner))
23789        }
23790        /// Set the `extends` field and mark the builder changed.
23791        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
23792        /// Set the `body` field and mark the builder changed.
23793        pub fn body(&mut self, body: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.body = body; }
23794    }
23795    /// Clone-with-changes builder for [`super::TypeAlias`].
23796    #[derive(Debug)]
23797    pub struct TypeAlias<'gc> {
23798        is_changed: bool,
23799        pub(super) inner: super::TypeAlias<'gc>,
23800    }
23801    impl<'gc> TypeAlias<'gc> {
23802        /// Start from a copy of `node`, with no field changed yet.
23803        pub fn from_node(node: &'gc super::TypeAlias<'gc>) -> Self {
23804            Self {
23805                is_changed: false,
23806                inner: super::TypeAlias {
23807                    metadata: node.metadata.duplicate(),
23808                    id: node.id.duplicate(),
23809                    type_parameters: node.type_parameters.duplicate(),
23810                    right: node.right.duplicate(),
23811                },
23812            }
23813        }
23814        /// Allocate the rebuilt node if a setter ran, else
23815        /// `TransformResult::Unchanged`.
23816        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23817            if self.is_changed {
23818                TransformResult::Changed(self.build_forced(gc))
23819            } else {
23820                TransformResult::Unchanged
23821            }
23822        }
23823        /// Allocate the node unconditionally, changed or not.
23824        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23825            gc.alloc(Node::TypeAlias(self.inner))
23826        }
23827        /// Set the `id` field and mark the builder changed.
23828        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23829        /// Set the `type_parameters` field and mark the builder changed.
23830        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
23831        /// Set the `right` field and mark the builder changed.
23832        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
23833    }
23834    /// Clone-with-changes builder for [`super::OpaqueType`].
23835    #[derive(Debug)]
23836    pub struct OpaqueType<'gc> {
23837        is_changed: bool,
23838        pub(super) inner: super::OpaqueType<'gc>,
23839    }
23840    impl<'gc> OpaqueType<'gc> {
23841        /// Start from a copy of `node`, with no field changed yet.
23842        pub fn from_node(node: &'gc super::OpaqueType<'gc>) -> Self {
23843            Self {
23844                is_changed: false,
23845                inner: super::OpaqueType {
23846                    metadata: node.metadata.duplicate(),
23847                    id: node.id.duplicate(),
23848                    type_parameters: node.type_parameters.duplicate(),
23849                    impltype: node.impltype.duplicate(),
23850                    lower_bound: node.lower_bound.duplicate(),
23851                    upper_bound: node.upper_bound.duplicate(),
23852                    supertype: node.supertype.duplicate(),
23853                },
23854            }
23855        }
23856        /// Allocate the rebuilt node if a setter ran, else
23857        /// `TransformResult::Unchanged`.
23858        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23859            if self.is_changed {
23860                TransformResult::Changed(self.build_forced(gc))
23861            } else {
23862                TransformResult::Unchanged
23863            }
23864        }
23865        /// Allocate the node unconditionally, changed or not.
23866        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23867            gc.alloc(Node::OpaqueType(self.inner))
23868        }
23869        /// Set the `id` field and mark the builder changed.
23870        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23871        /// Set the `type_parameters` field and mark the builder changed.
23872        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
23873        /// Set the `impltype` field and mark the builder changed.
23874        pub fn impltype(&mut self, impltype: &'gc Node<'gc>) { self.is_changed = true; self.inner.impltype = impltype; }
23875        /// Set the `lower_bound` field and mark the builder changed.
23876        pub fn lower_bound(&mut self, lower_bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.lower_bound = lower_bound; }
23877        /// Set the `upper_bound` field and mark the builder changed.
23878        pub fn upper_bound(&mut self, upper_bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.upper_bound = upper_bound; }
23879        /// Set the `supertype` field and mark the builder changed.
23880        pub fn supertype(&mut self, supertype: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.supertype = supertype; }
23881    }
23882    /// Clone-with-changes builder for [`super::InterfaceDeclaration`].
23883    #[derive(Debug)]
23884    pub struct InterfaceDeclaration<'gc> {
23885        is_changed: bool,
23886        pub(super) inner: super::InterfaceDeclaration<'gc>,
23887    }
23888    impl<'gc> InterfaceDeclaration<'gc> {
23889        /// Start from a copy of `node`, with no field changed yet.
23890        pub fn from_node(node: &'gc super::InterfaceDeclaration<'gc>) -> Self {
23891            Self {
23892                is_changed: false,
23893                inner: super::InterfaceDeclaration {
23894                    metadata: node.metadata.duplicate(),
23895                    id: node.id.duplicate(),
23896                    type_parameters: node.type_parameters.duplicate(),
23897                    extends: node.extends.duplicate(),
23898                    body: node.body.duplicate(),
23899                },
23900            }
23901        }
23902        /// Allocate the rebuilt node if a setter ran, else
23903        /// `TransformResult::Unchanged`.
23904        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23905            if self.is_changed {
23906                TransformResult::Changed(self.build_forced(gc))
23907            } else {
23908                TransformResult::Unchanged
23909            }
23910        }
23911        /// Allocate the node unconditionally, changed or not.
23912        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23913            gc.alloc(Node::InterfaceDeclaration(self.inner))
23914        }
23915        /// Set the `id` field and mark the builder changed.
23916        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23917        /// Set the `type_parameters` field and mark the builder changed.
23918        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
23919        /// Set the `extends` field and mark the builder changed.
23920        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
23921        /// Set the `body` field and mark the builder changed.
23922        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
23923    }
23924    /// Clone-with-changes builder for [`super::DeclareTypeAlias`].
23925    #[derive(Debug)]
23926    pub struct DeclareTypeAlias<'gc> {
23927        is_changed: bool,
23928        pub(super) inner: super::DeclareTypeAlias<'gc>,
23929    }
23930    impl<'gc> DeclareTypeAlias<'gc> {
23931        /// Start from a copy of `node`, with no field changed yet.
23932        pub fn from_node(node: &'gc super::DeclareTypeAlias<'gc>) -> Self {
23933            Self {
23934                is_changed: false,
23935                inner: super::DeclareTypeAlias {
23936                    metadata: node.metadata.duplicate(),
23937                    id: node.id.duplicate(),
23938                    type_parameters: node.type_parameters.duplicate(),
23939                    right: node.right.duplicate(),
23940                },
23941            }
23942        }
23943        /// Allocate the rebuilt node if a setter ran, else
23944        /// `TransformResult::Unchanged`.
23945        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23946            if self.is_changed {
23947                TransformResult::Changed(self.build_forced(gc))
23948            } else {
23949                TransformResult::Unchanged
23950            }
23951        }
23952        /// Allocate the node unconditionally, changed or not.
23953        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23954            gc.alloc(Node::DeclareTypeAlias(self.inner))
23955        }
23956        /// Set the `id` field and mark the builder changed.
23957        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
23958        /// Set the `type_parameters` field and mark the builder changed.
23959        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
23960        /// Set the `right` field and mark the builder changed.
23961        pub fn right(&mut self, right: &'gc Node<'gc>) { self.is_changed = true; self.inner.right = right; }
23962    }
23963    /// Clone-with-changes builder for [`super::DeclareOpaqueType`].
23964    #[derive(Debug)]
23965    pub struct DeclareOpaqueType<'gc> {
23966        is_changed: bool,
23967        pub(super) inner: super::DeclareOpaqueType<'gc>,
23968    }
23969    impl<'gc> DeclareOpaqueType<'gc> {
23970        /// Start from a copy of `node`, with no field changed yet.
23971        pub fn from_node(node: &'gc super::DeclareOpaqueType<'gc>) -> Self {
23972            Self {
23973                is_changed: false,
23974                inner: super::DeclareOpaqueType {
23975                    metadata: node.metadata.duplicate(),
23976                    id: node.id.duplicate(),
23977                    type_parameters: node.type_parameters.duplicate(),
23978                    impltype: node.impltype.duplicate(),
23979                    lower_bound: node.lower_bound.duplicate(),
23980                    upper_bound: node.upper_bound.duplicate(),
23981                    supertype: node.supertype.duplicate(),
23982                },
23983            }
23984        }
23985        /// Allocate the rebuilt node if a setter ran, else
23986        /// `TransformResult::Unchanged`.
23987        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
23988            if self.is_changed {
23989                TransformResult::Changed(self.build_forced(gc))
23990            } else {
23991                TransformResult::Unchanged
23992            }
23993        }
23994        /// Allocate the node unconditionally, changed or not.
23995        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
23996            gc.alloc(Node::DeclareOpaqueType(self.inner))
23997        }
23998        /// Set the `id` field and mark the builder changed.
23999        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24000        /// Set the `type_parameters` field and mark the builder changed.
24001        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
24002        /// Set the `impltype` field and mark the builder changed.
24003        pub fn impltype(&mut self, impltype: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.impltype = impltype; }
24004        /// Set the `lower_bound` field and mark the builder changed.
24005        pub fn lower_bound(&mut self, lower_bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.lower_bound = lower_bound; }
24006        /// Set the `upper_bound` field and mark the builder changed.
24007        pub fn upper_bound(&mut self, upper_bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.upper_bound = upper_bound; }
24008        /// Set the `supertype` field and mark the builder changed.
24009        pub fn supertype(&mut self, supertype: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.supertype = supertype; }
24010    }
24011    /// Clone-with-changes builder for [`super::DeclareInterface`].
24012    #[derive(Debug)]
24013    pub struct DeclareInterface<'gc> {
24014        is_changed: bool,
24015        pub(super) inner: super::DeclareInterface<'gc>,
24016    }
24017    impl<'gc> DeclareInterface<'gc> {
24018        /// Start from a copy of `node`, with no field changed yet.
24019        pub fn from_node(node: &'gc super::DeclareInterface<'gc>) -> Self {
24020            Self {
24021                is_changed: false,
24022                inner: super::DeclareInterface {
24023                    metadata: node.metadata.duplicate(),
24024                    id: node.id.duplicate(),
24025                    type_parameters: node.type_parameters.duplicate(),
24026                    extends: node.extends.duplicate(),
24027                    body: node.body.duplicate(),
24028                },
24029            }
24030        }
24031        /// Allocate the rebuilt node if a setter ran, else
24032        /// `TransformResult::Unchanged`.
24033        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24034            if self.is_changed {
24035                TransformResult::Changed(self.build_forced(gc))
24036            } else {
24037                TransformResult::Unchanged
24038            }
24039        }
24040        /// Allocate the node unconditionally, changed or not.
24041        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24042            gc.alloc(Node::DeclareInterface(self.inner))
24043        }
24044        /// Set the `id` field and mark the builder changed.
24045        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24046        /// Set the `type_parameters` field and mark the builder changed.
24047        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
24048        /// Set the `extends` field and mark the builder changed.
24049        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
24050        /// Set the `body` field and mark the builder changed.
24051        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
24052    }
24053    /// Clone-with-changes builder for [`super::DeclareClass`].
24054    #[derive(Debug)]
24055    pub struct DeclareClass<'gc> {
24056        is_changed: bool,
24057        pub(super) inner: super::DeclareClass<'gc>,
24058    }
24059    impl<'gc> DeclareClass<'gc> {
24060        /// Start from a copy of `node`, with no field changed yet.
24061        pub fn from_node(node: &'gc super::DeclareClass<'gc>) -> Self {
24062            Self {
24063                is_changed: false,
24064                inner: super::DeclareClass {
24065                    metadata: node.metadata.duplicate(),
24066                    id: node.id.duplicate(),
24067                    type_parameters: node.type_parameters.duplicate(),
24068                    extends: node.extends.duplicate(),
24069                    implements: node.implements.duplicate(),
24070                    mixins: node.mixins.duplicate(),
24071                    body: node.body.duplicate(),
24072                },
24073            }
24074        }
24075        /// Allocate the rebuilt node if a setter ran, else
24076        /// `TransformResult::Unchanged`.
24077        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24078            if self.is_changed {
24079                TransformResult::Changed(self.build_forced(gc))
24080            } else {
24081                TransformResult::Unchanged
24082            }
24083        }
24084        /// Allocate the node unconditionally, changed or not.
24085        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24086            gc.alloc(Node::DeclareClass(self.inner))
24087        }
24088        /// Set the `id` field and mark the builder changed.
24089        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24090        /// Set the `type_parameters` field and mark the builder changed.
24091        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
24092        /// Set the `extends` field and mark the builder changed.
24093        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
24094        /// Set the `implements` field and mark the builder changed.
24095        pub fn implements(&mut self, implements: NodeList<'gc>) { self.is_changed = true; self.inner.implements = implements; }
24096        /// Set the `mixins` field and mark the builder changed.
24097        pub fn mixins(&mut self, mixins: NodeList<'gc>) { self.is_changed = true; self.inner.mixins = mixins; }
24098        /// Set the `body` field and mark the builder changed.
24099        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
24100    }
24101    /// Clone-with-changes builder for [`super::DeclareFunction`].
24102    #[derive(Debug)]
24103    pub struct DeclareFunction<'gc> {
24104        is_changed: bool,
24105        pub(super) inner: super::DeclareFunction<'gc>,
24106    }
24107    impl<'gc> DeclareFunction<'gc> {
24108        /// Start from a copy of `node`, with no field changed yet.
24109        pub fn from_node(node: &'gc super::DeclareFunction<'gc>) -> Self {
24110            Self {
24111                is_changed: false,
24112                inner: super::DeclareFunction {
24113                    metadata: node.metadata.duplicate(),
24114                    id: node.id.duplicate(),
24115                    predicate: node.predicate.duplicate(),
24116                },
24117            }
24118        }
24119        /// Allocate the rebuilt node if a setter ran, else
24120        /// `TransformResult::Unchanged`.
24121        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24122            if self.is_changed {
24123                TransformResult::Changed(self.build_forced(gc))
24124            } else {
24125                TransformResult::Unchanged
24126            }
24127        }
24128        /// Allocate the node unconditionally, changed or not.
24129        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24130            gc.alloc(Node::DeclareFunction(self.inner))
24131        }
24132        /// Set the `id` field and mark the builder changed.
24133        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24134        /// Set the `predicate` field and mark the builder changed.
24135        pub fn predicate(&mut self, predicate: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.predicate = predicate; }
24136    }
24137    /// Clone-with-changes builder for [`super::DeclareHook`].
24138    #[derive(Debug)]
24139    pub struct DeclareHook<'gc> {
24140        is_changed: bool,
24141        pub(super) inner: super::DeclareHook<'gc>,
24142    }
24143    impl<'gc> DeclareHook<'gc> {
24144        /// Start from a copy of `node`, with no field changed yet.
24145        pub fn from_node(node: &'gc super::DeclareHook<'gc>) -> Self {
24146            Self {
24147                is_changed: false,
24148                inner: super::DeclareHook {
24149                    metadata: node.metadata.duplicate(),
24150                    id: node.id.duplicate(),
24151                },
24152            }
24153        }
24154        /// Allocate the rebuilt node if a setter ran, else
24155        /// `TransformResult::Unchanged`.
24156        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24157            if self.is_changed {
24158                TransformResult::Changed(self.build_forced(gc))
24159            } else {
24160                TransformResult::Unchanged
24161            }
24162        }
24163        /// Allocate the node unconditionally, changed or not.
24164        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24165            gc.alloc(Node::DeclareHook(self.inner))
24166        }
24167        /// Set the `id` field and mark the builder changed.
24168        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24169    }
24170    /// Clone-with-changes builder for [`super::DeclareComponent`].
24171    #[derive(Debug)]
24172    pub struct DeclareComponent<'gc> {
24173        is_changed: bool,
24174        pub(super) inner: super::DeclareComponent<'gc>,
24175    }
24176    impl<'gc> DeclareComponent<'gc> {
24177        /// Start from a copy of `node`, with no field changed yet.
24178        pub fn from_node(node: &'gc super::DeclareComponent<'gc>) -> Self {
24179            Self {
24180                is_changed: false,
24181                inner: super::DeclareComponent {
24182                    metadata: node.metadata.duplicate(),
24183                    id: node.id.duplicate(),
24184                    params: node.params.duplicate(),
24185                    rest: node.rest.duplicate(),
24186                    type_parameters: node.type_parameters.duplicate(),
24187                    renders_type: node.renders_type.duplicate(),
24188                },
24189            }
24190        }
24191        /// Allocate the rebuilt node if a setter ran, else
24192        /// `TransformResult::Unchanged`.
24193        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24194            if self.is_changed {
24195                TransformResult::Changed(self.build_forced(gc))
24196            } else {
24197                TransformResult::Unchanged
24198            }
24199        }
24200        /// Allocate the node unconditionally, changed or not.
24201        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24202            gc.alloc(Node::DeclareComponent(self.inner))
24203        }
24204        /// Set the `id` field and mark the builder changed.
24205        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24206        /// Set the `params` field and mark the builder changed.
24207        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
24208        /// Set the `rest` field and mark the builder changed.
24209        pub fn rest(&mut self, rest: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.rest = rest; }
24210        /// Set the `type_parameters` field and mark the builder changed.
24211        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
24212        /// Set the `renders_type` field and mark the builder changed.
24213        pub fn renders_type(&mut self, renders_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.renders_type = renders_type; }
24214    }
24215    /// Clone-with-changes builder for [`super::DeclareVariable`].
24216    #[derive(Debug)]
24217    pub struct DeclareVariable<'gc> {
24218        is_changed: bool,
24219        pub(super) inner: super::DeclareVariable<'gc>,
24220    }
24221    impl<'gc> DeclareVariable<'gc> {
24222        /// Start from a copy of `node`, with no field changed yet.
24223        pub fn from_node(node: &'gc super::DeclareVariable<'gc>) -> Self {
24224            Self {
24225                is_changed: false,
24226                inner: super::DeclareVariable {
24227                    metadata: node.metadata.duplicate(),
24228                    id: node.id.duplicate(),
24229                    kind: Cell::new(node.kind.get()),
24230                },
24231            }
24232        }
24233        /// Allocate the rebuilt node if a setter ran, else
24234        /// `TransformResult::Unchanged`.
24235        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24236            if self.is_changed {
24237                TransformResult::Changed(self.build_forced(gc))
24238            } else {
24239                TransformResult::Unchanged
24240            }
24241        }
24242        /// Allocate the node unconditionally, changed or not.
24243        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24244            gc.alloc(Node::DeclareVariable(self.inner))
24245        }
24246        /// Set the `id` field and mark the builder changed.
24247        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24248    }
24249    /// Clone-with-changes builder for [`super::DeclareEnum`].
24250    #[derive(Debug)]
24251    pub struct DeclareEnum<'gc> {
24252        is_changed: bool,
24253        pub(super) inner: super::DeclareEnum<'gc>,
24254    }
24255    impl<'gc> DeclareEnum<'gc> {
24256        /// Start from a copy of `node`, with no field changed yet.
24257        pub fn from_node(node: &'gc super::DeclareEnum<'gc>) -> Self {
24258            Self {
24259                is_changed: false,
24260                inner: super::DeclareEnum {
24261                    metadata: node.metadata.duplicate(),
24262                    id: node.id.duplicate(),
24263                    body: node.body.duplicate(),
24264                },
24265            }
24266        }
24267        /// Allocate the rebuilt node if a setter ran, else
24268        /// `TransformResult::Unchanged`.
24269        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24270            if self.is_changed {
24271                TransformResult::Changed(self.build_forced(gc))
24272            } else {
24273                TransformResult::Unchanged
24274            }
24275        }
24276        /// Allocate the node unconditionally, changed or not.
24277        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24278            gc.alloc(Node::DeclareEnum(self.inner))
24279        }
24280        /// Set the `id` field and mark the builder changed.
24281        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24282        /// Set the `body` field and mark the builder changed.
24283        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
24284    }
24285    /// Clone-with-changes builder for [`super::DeclareExportDeclaration`].
24286    #[derive(Debug)]
24287    pub struct DeclareExportDeclaration<'gc> {
24288        is_changed: bool,
24289        pub(super) inner: super::DeclareExportDeclaration<'gc>,
24290    }
24291    impl<'gc> DeclareExportDeclaration<'gc> {
24292        /// Start from a copy of `node`, with no field changed yet.
24293        pub fn from_node(node: &'gc super::DeclareExportDeclaration<'gc>) -> Self {
24294            Self {
24295                is_changed: false,
24296                inner: super::DeclareExportDeclaration {
24297                    metadata: node.metadata.duplicate(),
24298                    declaration: node.declaration.duplicate(),
24299                    specifiers: node.specifiers.duplicate(),
24300                    source: node.source.duplicate(),
24301                    default: Cell::new(node.default.get()),
24302                },
24303            }
24304        }
24305        /// Allocate the rebuilt node if a setter ran, else
24306        /// `TransformResult::Unchanged`.
24307        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24308            if self.is_changed {
24309                TransformResult::Changed(self.build_forced(gc))
24310            } else {
24311                TransformResult::Unchanged
24312            }
24313        }
24314        /// Allocate the node unconditionally, changed or not.
24315        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24316            gc.alloc(Node::DeclareExportDeclaration(self.inner))
24317        }
24318        /// Set the `declaration` field and mark the builder changed.
24319        pub fn declaration(&mut self, declaration: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.declaration = declaration; }
24320        /// Set the `specifiers` field and mark the builder changed.
24321        pub fn specifiers(&mut self, specifiers: NodeList<'gc>) { self.is_changed = true; self.inner.specifiers = specifiers; }
24322        /// Set the `source` field and mark the builder changed.
24323        pub fn source(&mut self, source: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.source = source; }
24324    }
24325    /// Clone-with-changes builder for [`super::DeclareExportAllDeclaration`].
24326    #[derive(Debug)]
24327    pub struct DeclareExportAllDeclaration<'gc> {
24328        is_changed: bool,
24329        pub(super) inner: super::DeclareExportAllDeclaration<'gc>,
24330    }
24331    impl<'gc> DeclareExportAllDeclaration<'gc> {
24332        /// Start from a copy of `node`, with no field changed yet.
24333        pub fn from_node(node: &'gc super::DeclareExportAllDeclaration<'gc>) -> Self {
24334            Self {
24335                is_changed: false,
24336                inner: super::DeclareExportAllDeclaration {
24337                    metadata: node.metadata.duplicate(),
24338                    source: node.source.duplicate(),
24339                },
24340            }
24341        }
24342        /// Allocate the rebuilt node if a setter ran, else
24343        /// `TransformResult::Unchanged`.
24344        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24345            if self.is_changed {
24346                TransformResult::Changed(self.build_forced(gc))
24347            } else {
24348                TransformResult::Unchanged
24349            }
24350        }
24351        /// Allocate the node unconditionally, changed or not.
24352        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24353            gc.alloc(Node::DeclareExportAllDeclaration(self.inner))
24354        }
24355        /// Set the `source` field and mark the builder changed.
24356        pub fn source(&mut self, source: &'gc Node<'gc>) { self.is_changed = true; self.inner.source = source; }
24357    }
24358    /// Clone-with-changes builder for [`super::DeclareModule`].
24359    #[derive(Debug)]
24360    pub struct DeclareModule<'gc> {
24361        is_changed: bool,
24362        pub(super) inner: super::DeclareModule<'gc>,
24363    }
24364    impl<'gc> DeclareModule<'gc> {
24365        /// Start from a copy of `node`, with no field changed yet.
24366        pub fn from_node(node: &'gc super::DeclareModule<'gc>) -> Self {
24367            Self {
24368                is_changed: false,
24369                inner: super::DeclareModule {
24370                    metadata: node.metadata.duplicate(),
24371                    id: node.id.duplicate(),
24372                    body: node.body.duplicate(),
24373                },
24374            }
24375        }
24376        /// Allocate the rebuilt node if a setter ran, else
24377        /// `TransformResult::Unchanged`.
24378        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24379            if self.is_changed {
24380                TransformResult::Changed(self.build_forced(gc))
24381            } else {
24382                TransformResult::Unchanged
24383            }
24384        }
24385        /// Allocate the node unconditionally, changed or not.
24386        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24387            gc.alloc(Node::DeclareModule(self.inner))
24388        }
24389        /// Set the `id` field and mark the builder changed.
24390        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24391        /// Set the `body` field and mark the builder changed.
24392        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
24393    }
24394    /// Clone-with-changes builder for [`super::DeclareNamespace`].
24395    #[derive(Debug)]
24396    pub struct DeclareNamespace<'gc> {
24397        is_changed: bool,
24398        pub(super) inner: super::DeclareNamespace<'gc>,
24399    }
24400    impl<'gc> DeclareNamespace<'gc> {
24401        /// Start from a copy of `node`, with no field changed yet.
24402        pub fn from_node(node: &'gc super::DeclareNamespace<'gc>) -> Self {
24403            Self {
24404                is_changed: false,
24405                inner: super::DeclareNamespace {
24406                    metadata: node.metadata.duplicate(),
24407                    id: node.id.duplicate(),
24408                    body: node.body.duplicate(),
24409                },
24410            }
24411        }
24412        /// Allocate the rebuilt node if a setter ran, else
24413        /// `TransformResult::Unchanged`.
24414        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24415            if self.is_changed {
24416                TransformResult::Changed(self.build_forced(gc))
24417            } else {
24418                TransformResult::Unchanged
24419            }
24420        }
24421        /// Allocate the node unconditionally, changed or not.
24422        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24423            gc.alloc(Node::DeclareNamespace(self.inner))
24424        }
24425        /// Set the `id` field and mark the builder changed.
24426        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24427        /// Set the `body` field and mark the builder changed.
24428        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
24429    }
24430    /// Clone-with-changes builder for [`super::DeclareModuleExports`].
24431    #[derive(Debug)]
24432    pub struct DeclareModuleExports<'gc> {
24433        is_changed: bool,
24434        pub(super) inner: super::DeclareModuleExports<'gc>,
24435    }
24436    impl<'gc> DeclareModuleExports<'gc> {
24437        /// Start from a copy of `node`, with no field changed yet.
24438        pub fn from_node(node: &'gc super::DeclareModuleExports<'gc>) -> Self {
24439            Self {
24440                is_changed: false,
24441                inner: super::DeclareModuleExports {
24442                    metadata: node.metadata.duplicate(),
24443                    type_annotation: node.type_annotation.duplicate(),
24444                },
24445            }
24446        }
24447        /// Allocate the rebuilt node if a setter ran, else
24448        /// `TransformResult::Unchanged`.
24449        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24450            if self.is_changed {
24451                TransformResult::Changed(self.build_forced(gc))
24452            } else {
24453                TransformResult::Unchanged
24454            }
24455        }
24456        /// Allocate the node unconditionally, changed or not.
24457        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24458            gc.alloc(Node::DeclareModuleExports(self.inner))
24459        }
24460        /// Set the `type_annotation` field and mark the builder changed.
24461        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
24462    }
24463    /// Clone-with-changes builder for [`super::InterfaceExtends`].
24464    #[derive(Debug)]
24465    pub struct InterfaceExtends<'gc> {
24466        is_changed: bool,
24467        pub(super) inner: super::InterfaceExtends<'gc>,
24468    }
24469    impl<'gc> InterfaceExtends<'gc> {
24470        /// Start from a copy of `node`, with no field changed yet.
24471        pub fn from_node(node: &'gc super::InterfaceExtends<'gc>) -> Self {
24472            Self {
24473                is_changed: false,
24474                inner: super::InterfaceExtends {
24475                    metadata: node.metadata.duplicate(),
24476                    id: node.id.duplicate(),
24477                    type_parameters: node.type_parameters.duplicate(),
24478                },
24479            }
24480        }
24481        /// Allocate the rebuilt node if a setter ran, else
24482        /// `TransformResult::Unchanged`.
24483        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24484            if self.is_changed {
24485                TransformResult::Changed(self.build_forced(gc))
24486            } else {
24487                TransformResult::Unchanged
24488            }
24489        }
24490        /// Allocate the node unconditionally, changed or not.
24491        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24492            gc.alloc(Node::InterfaceExtends(self.inner))
24493        }
24494        /// Set the `id` field and mark the builder changed.
24495        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24496        /// Set the `type_parameters` field and mark the builder changed.
24497        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
24498    }
24499    /// Clone-with-changes builder for [`super::ClassImplements`].
24500    #[derive(Debug)]
24501    pub struct ClassImplements<'gc> {
24502        is_changed: bool,
24503        pub(super) inner: super::ClassImplements<'gc>,
24504    }
24505    impl<'gc> ClassImplements<'gc> {
24506        /// Start from a copy of `node`, with no field changed yet.
24507        pub fn from_node(node: &'gc super::ClassImplements<'gc>) -> Self {
24508            Self {
24509                is_changed: false,
24510                inner: super::ClassImplements {
24511                    metadata: node.metadata.duplicate(),
24512                    id: node.id.duplicate(),
24513                    type_parameters: node.type_parameters.duplicate(),
24514                },
24515            }
24516        }
24517        /// Allocate the rebuilt node if a setter ran, else
24518        /// `TransformResult::Unchanged`.
24519        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24520            if self.is_changed {
24521                TransformResult::Changed(self.build_forced(gc))
24522            } else {
24523                TransformResult::Unchanged
24524            }
24525        }
24526        /// Allocate the node unconditionally, changed or not.
24527        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24528            gc.alloc(Node::ClassImplements(self.inner))
24529        }
24530        /// Set the `id` field and mark the builder changed.
24531        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24532        /// Set the `type_parameters` field and mark the builder changed.
24533        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
24534    }
24535    /// Clone-with-changes builder for [`super::TypeAnnotation`].
24536    #[derive(Debug)]
24537    pub struct TypeAnnotation<'gc> {
24538        is_changed: bool,
24539        pub(super) inner: super::TypeAnnotation<'gc>,
24540    }
24541    impl<'gc> TypeAnnotation<'gc> {
24542        /// Start from a copy of `node`, with no field changed yet.
24543        pub fn from_node(node: &'gc super::TypeAnnotation<'gc>) -> Self {
24544            Self {
24545                is_changed: false,
24546                inner: super::TypeAnnotation {
24547                    metadata: node.metadata.duplicate(),
24548                    type_annotation: node.type_annotation.duplicate(),
24549                },
24550            }
24551        }
24552        /// Allocate the rebuilt node if a setter ran, else
24553        /// `TransformResult::Unchanged`.
24554        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24555            if self.is_changed {
24556                TransformResult::Changed(self.build_forced(gc))
24557            } else {
24558                TransformResult::Unchanged
24559            }
24560        }
24561        /// Allocate the node unconditionally, changed or not.
24562        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24563            gc.alloc(Node::TypeAnnotation(self.inner))
24564        }
24565        /// Set the `type_annotation` field and mark the builder changed.
24566        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
24567    }
24568    /// Clone-with-changes builder for [`super::ObjectTypeAnnotation`].
24569    #[derive(Debug)]
24570    pub struct ObjectTypeAnnotation<'gc> {
24571        is_changed: bool,
24572        pub(super) inner: super::ObjectTypeAnnotation<'gc>,
24573    }
24574    impl<'gc> ObjectTypeAnnotation<'gc> {
24575        /// Start from a copy of `node`, with no field changed yet.
24576        pub fn from_node(node: &'gc super::ObjectTypeAnnotation<'gc>) -> Self {
24577            Self {
24578                is_changed: false,
24579                inner: super::ObjectTypeAnnotation {
24580                    metadata: node.metadata.duplicate(),
24581                    properties: node.properties.duplicate(),
24582                    indexers: node.indexers.duplicate(),
24583                    call_properties: node.call_properties.duplicate(),
24584                    internal_slots: node.internal_slots.duplicate(),
24585                    inexact: Cell::new(node.inexact.get()),
24586                    exact: Cell::new(node.exact.get()),
24587                },
24588            }
24589        }
24590        /// Allocate the rebuilt node if a setter ran, else
24591        /// `TransformResult::Unchanged`.
24592        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24593            if self.is_changed {
24594                TransformResult::Changed(self.build_forced(gc))
24595            } else {
24596                TransformResult::Unchanged
24597            }
24598        }
24599        /// Allocate the node unconditionally, changed or not.
24600        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24601            gc.alloc(Node::ObjectTypeAnnotation(self.inner))
24602        }
24603        /// Set the `properties` field and mark the builder changed.
24604        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
24605        /// Set the `indexers` field and mark the builder changed.
24606        pub fn indexers(&mut self, indexers: NodeList<'gc>) { self.is_changed = true; self.inner.indexers = indexers; }
24607        /// Set the `call_properties` field and mark the builder changed.
24608        pub fn call_properties(&mut self, call_properties: NodeList<'gc>) { self.is_changed = true; self.inner.call_properties = call_properties; }
24609        /// Set the `internal_slots` field and mark the builder changed.
24610        pub fn internal_slots(&mut self, internal_slots: NodeList<'gc>) { self.is_changed = true; self.inner.internal_slots = internal_slots; }
24611    }
24612    /// Clone-with-changes builder for [`super::ObjectTypeProperty`].
24613    #[derive(Debug)]
24614    pub struct ObjectTypeProperty<'gc> {
24615        is_changed: bool,
24616        pub(super) inner: super::ObjectTypeProperty<'gc>,
24617    }
24618    impl<'gc> ObjectTypeProperty<'gc> {
24619        /// Start from a copy of `node`, with no field changed yet.
24620        pub fn from_node(node: &'gc super::ObjectTypeProperty<'gc>) -> Self {
24621            Self {
24622                is_changed: false,
24623                inner: super::ObjectTypeProperty {
24624                    metadata: node.metadata.duplicate(),
24625                    key: node.key.duplicate(),
24626                    value: node.value.duplicate(),
24627                    method: Cell::new(node.method.get()),
24628                    optional: Cell::new(node.optional.get()),
24629                    r#static: Cell::new(node.r#static.get()),
24630                    proto: Cell::new(node.proto.get()),
24631                    variance: node.variance.duplicate(),
24632                    kind: Cell::new(node.kind.get()),
24633                },
24634            }
24635        }
24636        /// Allocate the rebuilt node if a setter ran, else
24637        /// `TransformResult::Unchanged`.
24638        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24639            if self.is_changed {
24640                TransformResult::Changed(self.build_forced(gc))
24641            } else {
24642                TransformResult::Unchanged
24643            }
24644        }
24645        /// Allocate the node unconditionally, changed or not.
24646        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24647            gc.alloc(Node::ObjectTypeProperty(self.inner))
24648        }
24649        /// Set the `key` field and mark the builder changed.
24650        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
24651        /// Set the `value` field and mark the builder changed.
24652        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
24653        /// Set the `variance` field and mark the builder changed.
24654        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
24655    }
24656    /// Clone-with-changes builder for [`super::ObjectTypeSpreadProperty`].
24657    #[derive(Debug)]
24658    pub struct ObjectTypeSpreadProperty<'gc> {
24659        is_changed: bool,
24660        pub(super) inner: super::ObjectTypeSpreadProperty<'gc>,
24661    }
24662    impl<'gc> ObjectTypeSpreadProperty<'gc> {
24663        /// Start from a copy of `node`, with no field changed yet.
24664        pub fn from_node(node: &'gc super::ObjectTypeSpreadProperty<'gc>) -> Self {
24665            Self {
24666                is_changed: false,
24667                inner: super::ObjectTypeSpreadProperty {
24668                    metadata: node.metadata.duplicate(),
24669                    argument: node.argument.duplicate(),
24670                },
24671            }
24672        }
24673        /// Allocate the rebuilt node if a setter ran, else
24674        /// `TransformResult::Unchanged`.
24675        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24676            if self.is_changed {
24677                TransformResult::Changed(self.build_forced(gc))
24678            } else {
24679                TransformResult::Unchanged
24680            }
24681        }
24682        /// Allocate the node unconditionally, changed or not.
24683        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24684            gc.alloc(Node::ObjectTypeSpreadProperty(self.inner))
24685        }
24686        /// Set the `argument` field and mark the builder changed.
24687        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
24688    }
24689    /// Clone-with-changes builder for [`super::ObjectTypeInternalSlot`].
24690    #[derive(Debug)]
24691    pub struct ObjectTypeInternalSlot<'gc> {
24692        is_changed: bool,
24693        pub(super) inner: super::ObjectTypeInternalSlot<'gc>,
24694    }
24695    impl<'gc> ObjectTypeInternalSlot<'gc> {
24696        /// Start from a copy of `node`, with no field changed yet.
24697        pub fn from_node(node: &'gc super::ObjectTypeInternalSlot<'gc>) -> Self {
24698            Self {
24699                is_changed: false,
24700                inner: super::ObjectTypeInternalSlot {
24701                    metadata: node.metadata.duplicate(),
24702                    id: node.id.duplicate(),
24703                    value: node.value.duplicate(),
24704                    optional: Cell::new(node.optional.get()),
24705                    r#static: Cell::new(node.r#static.get()),
24706                    method: Cell::new(node.method.get()),
24707                },
24708            }
24709        }
24710        /// Allocate the rebuilt node if a setter ran, else
24711        /// `TransformResult::Unchanged`.
24712        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24713            if self.is_changed {
24714                TransformResult::Changed(self.build_forced(gc))
24715            } else {
24716                TransformResult::Unchanged
24717            }
24718        }
24719        /// Allocate the node unconditionally, changed or not.
24720        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24721            gc.alloc(Node::ObjectTypeInternalSlot(self.inner))
24722        }
24723        /// Set the `id` field and mark the builder changed.
24724        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
24725        /// Set the `value` field and mark the builder changed.
24726        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
24727    }
24728    /// Clone-with-changes builder for [`super::ObjectTypeCallProperty`].
24729    #[derive(Debug)]
24730    pub struct ObjectTypeCallProperty<'gc> {
24731        is_changed: bool,
24732        pub(super) inner: super::ObjectTypeCallProperty<'gc>,
24733    }
24734    impl<'gc> ObjectTypeCallProperty<'gc> {
24735        /// Start from a copy of `node`, with no field changed yet.
24736        pub fn from_node(node: &'gc super::ObjectTypeCallProperty<'gc>) -> Self {
24737            Self {
24738                is_changed: false,
24739                inner: super::ObjectTypeCallProperty {
24740                    metadata: node.metadata.duplicate(),
24741                    value: node.value.duplicate(),
24742                    r#static: Cell::new(node.r#static.get()),
24743                },
24744            }
24745        }
24746        /// Allocate the rebuilt node if a setter ran, else
24747        /// `TransformResult::Unchanged`.
24748        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24749            if self.is_changed {
24750                TransformResult::Changed(self.build_forced(gc))
24751            } else {
24752                TransformResult::Unchanged
24753            }
24754        }
24755        /// Allocate the node unconditionally, changed or not.
24756        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24757            gc.alloc(Node::ObjectTypeCallProperty(self.inner))
24758        }
24759        /// Set the `value` field and mark the builder changed.
24760        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
24761    }
24762    /// Clone-with-changes builder for [`super::ObjectTypeIndexer`].
24763    #[derive(Debug)]
24764    pub struct ObjectTypeIndexer<'gc> {
24765        is_changed: bool,
24766        pub(super) inner: super::ObjectTypeIndexer<'gc>,
24767    }
24768    impl<'gc> ObjectTypeIndexer<'gc> {
24769        /// Start from a copy of `node`, with no field changed yet.
24770        pub fn from_node(node: &'gc super::ObjectTypeIndexer<'gc>) -> Self {
24771            Self {
24772                is_changed: false,
24773                inner: super::ObjectTypeIndexer {
24774                    metadata: node.metadata.duplicate(),
24775                    id: node.id.duplicate(),
24776                    key: node.key.duplicate(),
24777                    value: node.value.duplicate(),
24778                    r#static: Cell::new(node.r#static.get()),
24779                    variance: node.variance.duplicate(),
24780                },
24781            }
24782        }
24783        /// Allocate the rebuilt node if a setter ran, else
24784        /// `TransformResult::Unchanged`.
24785        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24786            if self.is_changed {
24787                TransformResult::Changed(self.build_forced(gc))
24788            } else {
24789                TransformResult::Unchanged
24790            }
24791        }
24792        /// Allocate the node unconditionally, changed or not.
24793        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24794            gc.alloc(Node::ObjectTypeIndexer(self.inner))
24795        }
24796        /// Set the `id` field and mark the builder changed.
24797        pub fn id(&mut self, id: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.id = id; }
24798        /// Set the `key` field and mark the builder changed.
24799        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
24800        /// Set the `value` field and mark the builder changed.
24801        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
24802        /// Set the `variance` field and mark the builder changed.
24803        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
24804    }
24805    /// Clone-with-changes builder for [`super::ObjectTypeMappedTypeProperty`].
24806    #[derive(Debug)]
24807    pub struct ObjectTypeMappedTypeProperty<'gc> {
24808        is_changed: bool,
24809        pub(super) inner: super::ObjectTypeMappedTypeProperty<'gc>,
24810    }
24811    impl<'gc> ObjectTypeMappedTypeProperty<'gc> {
24812        /// Start from a copy of `node`, with no field changed yet.
24813        pub fn from_node(node: &'gc super::ObjectTypeMappedTypeProperty<'gc>) -> Self {
24814            Self {
24815                is_changed: false,
24816                inner: super::ObjectTypeMappedTypeProperty {
24817                    metadata: node.metadata.duplicate(),
24818                    key_tparam: node.key_tparam.duplicate(),
24819                    prop_type: node.prop_type.duplicate(),
24820                    source_type: node.source_type.duplicate(),
24821                    variance: node.variance.duplicate(),
24822                    optional: Cell::new(node.optional.get()),
24823                },
24824            }
24825        }
24826        /// Allocate the rebuilt node if a setter ran, else
24827        /// `TransformResult::Unchanged`.
24828        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24829            if self.is_changed {
24830                TransformResult::Changed(self.build_forced(gc))
24831            } else {
24832                TransformResult::Unchanged
24833            }
24834        }
24835        /// Allocate the node unconditionally, changed or not.
24836        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24837            gc.alloc(Node::ObjectTypeMappedTypeProperty(self.inner))
24838        }
24839        /// Set the `key_tparam` field and mark the builder changed.
24840        pub fn key_tparam(&mut self, key_tparam: &'gc Node<'gc>) { self.is_changed = true; self.inner.key_tparam = key_tparam; }
24841        /// Set the `prop_type` field and mark the builder changed.
24842        pub fn prop_type(&mut self, prop_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.prop_type = prop_type; }
24843        /// Set the `source_type` field and mark the builder changed.
24844        pub fn source_type(&mut self, source_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.source_type = source_type; }
24845        /// Set the `variance` field and mark the builder changed.
24846        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
24847    }
24848    /// Clone-with-changes builder for [`super::Variance`].
24849    #[derive(Debug)]
24850    pub struct Variance<'gc> {
24851        is_changed: bool,
24852        pub(super) inner: super::Variance<'gc>,
24853    }
24854    impl<'gc> Variance<'gc> {
24855        /// Start from a copy of `node`, with no field changed yet.
24856        pub fn from_node(node: &'gc super::Variance<'gc>) -> Self {
24857            Self {
24858                is_changed: false,
24859                inner: super::Variance {
24860                    metadata: node.metadata.duplicate(),
24861                    kind: Cell::new(node.kind.get()),
24862                },
24863            }
24864        }
24865        /// Allocate the rebuilt node if a setter ran, else
24866        /// `TransformResult::Unchanged`.
24867        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24868            if self.is_changed {
24869                TransformResult::Changed(self.build_forced(gc))
24870            } else {
24871                TransformResult::Unchanged
24872            }
24873        }
24874        /// Allocate the node unconditionally, changed or not.
24875        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24876            gc.alloc(Node::Variance(self.inner))
24877        }
24878    }
24879    /// Clone-with-changes builder for [`super::TypeParameterDeclaration`].
24880    #[derive(Debug)]
24881    pub struct TypeParameterDeclaration<'gc> {
24882        is_changed: bool,
24883        pub(super) inner: super::TypeParameterDeclaration<'gc>,
24884    }
24885    impl<'gc> TypeParameterDeclaration<'gc> {
24886        /// Start from a copy of `node`, with no field changed yet.
24887        pub fn from_node(node: &'gc super::TypeParameterDeclaration<'gc>) -> Self {
24888            Self {
24889                is_changed: false,
24890                inner: super::TypeParameterDeclaration {
24891                    metadata: node.metadata.duplicate(),
24892                    params: node.params.duplicate(),
24893                },
24894            }
24895        }
24896        /// Allocate the rebuilt node if a setter ran, else
24897        /// `TransformResult::Unchanged`.
24898        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24899            if self.is_changed {
24900                TransformResult::Changed(self.build_forced(gc))
24901            } else {
24902                TransformResult::Unchanged
24903            }
24904        }
24905        /// Allocate the node unconditionally, changed or not.
24906        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24907            gc.alloc(Node::TypeParameterDeclaration(self.inner))
24908        }
24909        /// Set the `params` field and mark the builder changed.
24910        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
24911    }
24912    /// Clone-with-changes builder for [`super::TypeParameter`].
24913    #[derive(Debug)]
24914    pub struct TypeParameter<'gc> {
24915        is_changed: bool,
24916        pub(super) inner: super::TypeParameter<'gc>,
24917    }
24918    impl<'gc> TypeParameter<'gc> {
24919        /// Start from a copy of `node`, with no field changed yet.
24920        pub fn from_node(node: &'gc super::TypeParameter<'gc>) -> Self {
24921            Self {
24922                is_changed: false,
24923                inner: super::TypeParameter {
24924                    metadata: node.metadata.duplicate(),
24925                    name: Cell::new(node.name.get()),
24926                    r#const: Cell::new(node.r#const.get()),
24927                    bound: node.bound.duplicate(),
24928                    variance: node.variance.duplicate(),
24929                    default: node.default.duplicate(),
24930                    uses_extends_bound: Cell::new(node.uses_extends_bound.get()),
24931                },
24932            }
24933        }
24934        /// Allocate the rebuilt node if a setter ran, else
24935        /// `TransformResult::Unchanged`.
24936        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24937            if self.is_changed {
24938                TransformResult::Changed(self.build_forced(gc))
24939            } else {
24940                TransformResult::Unchanged
24941            }
24942        }
24943        /// Allocate the node unconditionally, changed or not.
24944        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24945            gc.alloc(Node::TypeParameter(self.inner))
24946        }
24947        /// Set the `bound` field and mark the builder changed.
24948        pub fn bound(&mut self, bound: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.bound = bound; }
24949        /// Set the `variance` field and mark the builder changed.
24950        pub fn variance(&mut self, variance: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.variance = variance; }
24951        /// Set the `default` field and mark the builder changed.
24952        pub fn default(&mut self, default: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.default = default; }
24953    }
24954    /// Clone-with-changes builder for [`super::TypeParameterInstantiation`].
24955    #[derive(Debug)]
24956    pub struct TypeParameterInstantiation<'gc> {
24957        is_changed: bool,
24958        pub(super) inner: super::TypeParameterInstantiation<'gc>,
24959    }
24960    impl<'gc> TypeParameterInstantiation<'gc> {
24961        /// Start from a copy of `node`, with no field changed yet.
24962        pub fn from_node(node: &'gc super::TypeParameterInstantiation<'gc>) -> Self {
24963            Self {
24964                is_changed: false,
24965                inner: super::TypeParameterInstantiation {
24966                    metadata: node.metadata.duplicate(),
24967                    params: node.params.duplicate(),
24968                },
24969            }
24970        }
24971        /// Allocate the rebuilt node if a setter ran, else
24972        /// `TransformResult::Unchanged`.
24973        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
24974            if self.is_changed {
24975                TransformResult::Changed(self.build_forced(gc))
24976            } else {
24977                TransformResult::Unchanged
24978            }
24979        }
24980        /// Allocate the node unconditionally, changed or not.
24981        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
24982            gc.alloc(Node::TypeParameterInstantiation(self.inner))
24983        }
24984        /// Set the `params` field and mark the builder changed.
24985        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
24986    }
24987    /// Clone-with-changes builder for [`super::TypeCastExpression`].
24988    #[derive(Debug)]
24989    pub struct TypeCastExpression<'gc> {
24990        is_changed: bool,
24991        pub(super) inner: super::TypeCastExpression<'gc>,
24992    }
24993    impl<'gc> TypeCastExpression<'gc> {
24994        /// Start from a copy of `node`, with no field changed yet.
24995        pub fn from_node(node: &'gc super::TypeCastExpression<'gc>) -> Self {
24996            Self {
24997                is_changed: false,
24998                inner: super::TypeCastExpression {
24999                    metadata: node.metadata.duplicate(),
25000                    expression: node.expression.duplicate(),
25001                    type_annotation: node.type_annotation.duplicate(),
25002                },
25003            }
25004        }
25005        /// Allocate the rebuilt node if a setter ran, else
25006        /// `TransformResult::Unchanged`.
25007        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25008            if self.is_changed {
25009                TransformResult::Changed(self.build_forced(gc))
25010            } else {
25011                TransformResult::Unchanged
25012            }
25013        }
25014        /// Allocate the node unconditionally, changed or not.
25015        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25016            gc.alloc(Node::TypeCastExpression(self.inner))
25017        }
25018        /// Set the `expression` field and mark the builder changed.
25019        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
25020        /// Set the `type_annotation` field and mark the builder changed.
25021        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25022    }
25023    /// Clone-with-changes builder for [`super::AsExpression`].
25024    #[derive(Debug)]
25025    pub struct AsExpression<'gc> {
25026        is_changed: bool,
25027        pub(super) inner: super::AsExpression<'gc>,
25028    }
25029    impl<'gc> AsExpression<'gc> {
25030        /// Start from a copy of `node`, with no field changed yet.
25031        pub fn from_node(node: &'gc super::AsExpression<'gc>) -> Self {
25032            Self {
25033                is_changed: false,
25034                inner: super::AsExpression {
25035                    metadata: node.metadata.duplicate(),
25036                    expression: node.expression.duplicate(),
25037                    type_annotation: node.type_annotation.duplicate(),
25038                },
25039            }
25040        }
25041        /// Allocate the rebuilt node if a setter ran, else
25042        /// `TransformResult::Unchanged`.
25043        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25044            if self.is_changed {
25045                TransformResult::Changed(self.build_forced(gc))
25046            } else {
25047                TransformResult::Unchanged
25048            }
25049        }
25050        /// Allocate the node unconditionally, changed or not.
25051        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25052            gc.alloc(Node::AsExpression(self.inner))
25053        }
25054        /// Set the `expression` field and mark the builder changed.
25055        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
25056        /// Set the `type_annotation` field and mark the builder changed.
25057        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25058    }
25059    /// Clone-with-changes builder for [`super::AsConstExpression`].
25060    #[derive(Debug)]
25061    pub struct AsConstExpression<'gc> {
25062        is_changed: bool,
25063        pub(super) inner: super::AsConstExpression<'gc>,
25064    }
25065    impl<'gc> AsConstExpression<'gc> {
25066        /// Start from a copy of `node`, with no field changed yet.
25067        pub fn from_node(node: &'gc super::AsConstExpression<'gc>) -> Self {
25068            Self {
25069                is_changed: false,
25070                inner: super::AsConstExpression {
25071                    metadata: node.metadata.duplicate(),
25072                    expression: node.expression.duplicate(),
25073                },
25074            }
25075        }
25076        /// Allocate the rebuilt node if a setter ran, else
25077        /// `TransformResult::Unchanged`.
25078        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25079            if self.is_changed {
25080                TransformResult::Changed(self.build_forced(gc))
25081            } else {
25082                TransformResult::Unchanged
25083            }
25084        }
25085        /// Allocate the node unconditionally, changed or not.
25086        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25087            gc.alloc(Node::AsConstExpression(self.inner))
25088        }
25089        /// Set the `expression` field and mark the builder changed.
25090        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
25091    }
25092    /// Clone-with-changes builder for [`super::InferredPredicate`].
25093    #[derive(Debug)]
25094    pub struct InferredPredicate<'gc> {
25095        is_changed: bool,
25096        pub(super) inner: super::InferredPredicate<'gc>,
25097    }
25098    impl<'gc> InferredPredicate<'gc> {
25099        /// Start from a copy of `node`, with no field changed yet.
25100        pub fn from_node(node: &'gc super::InferredPredicate<'gc>) -> Self {
25101            Self {
25102                is_changed: false,
25103                inner: super::InferredPredicate {
25104                    metadata: node.metadata.duplicate(),
25105                },
25106            }
25107        }
25108        /// Allocate the rebuilt node if a setter ran, else
25109        /// `TransformResult::Unchanged`.
25110        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25111            if self.is_changed {
25112                TransformResult::Changed(self.build_forced(gc))
25113            } else {
25114                TransformResult::Unchanged
25115            }
25116        }
25117        /// Allocate the node unconditionally, changed or not.
25118        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25119            gc.alloc(Node::InferredPredicate(self.inner))
25120        }
25121    }
25122    /// Clone-with-changes builder for [`super::DeclaredPredicate`].
25123    #[derive(Debug)]
25124    pub struct DeclaredPredicate<'gc> {
25125        is_changed: bool,
25126        pub(super) inner: super::DeclaredPredicate<'gc>,
25127    }
25128    impl<'gc> DeclaredPredicate<'gc> {
25129        /// Start from a copy of `node`, with no field changed yet.
25130        pub fn from_node(node: &'gc super::DeclaredPredicate<'gc>) -> Self {
25131            Self {
25132                is_changed: false,
25133                inner: super::DeclaredPredicate {
25134                    metadata: node.metadata.duplicate(),
25135                    value: node.value.duplicate(),
25136                },
25137            }
25138        }
25139        /// Allocate the rebuilt node if a setter ran, else
25140        /// `TransformResult::Unchanged`.
25141        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25142            if self.is_changed {
25143                TransformResult::Changed(self.build_forced(gc))
25144            } else {
25145                TransformResult::Unchanged
25146            }
25147        }
25148        /// Allocate the node unconditionally, changed or not.
25149        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25150            gc.alloc(Node::DeclaredPredicate(self.inner))
25151        }
25152        /// Set the `value` field and mark the builder changed.
25153        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
25154    }
25155    /// Clone-with-changes builder for [`super::EnumDeclaration`].
25156    #[derive(Debug)]
25157    pub struct EnumDeclaration<'gc> {
25158        is_changed: bool,
25159        pub(super) inner: super::EnumDeclaration<'gc>,
25160    }
25161    impl<'gc> EnumDeclaration<'gc> {
25162        /// Start from a copy of `node`, with no field changed yet.
25163        pub fn from_node(node: &'gc super::EnumDeclaration<'gc>) -> Self {
25164            Self {
25165                is_changed: false,
25166                inner: super::EnumDeclaration {
25167                    metadata: node.metadata.duplicate(),
25168                    id: node.id.duplicate(),
25169                    body: node.body.duplicate(),
25170                },
25171            }
25172        }
25173        /// Allocate the rebuilt node if a setter ran, else
25174        /// `TransformResult::Unchanged`.
25175        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25176            if self.is_changed {
25177                TransformResult::Changed(self.build_forced(gc))
25178            } else {
25179                TransformResult::Unchanged
25180            }
25181        }
25182        /// Allocate the node unconditionally, changed or not.
25183        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25184            gc.alloc(Node::EnumDeclaration(self.inner))
25185        }
25186        /// Set the `id` field and mark the builder changed.
25187        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25188        /// Set the `body` field and mark the builder changed.
25189        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
25190    }
25191    /// Clone-with-changes builder for [`super::EnumStringBody`].
25192    #[derive(Debug)]
25193    pub struct EnumStringBody<'gc> {
25194        is_changed: bool,
25195        pub(super) inner: super::EnumStringBody<'gc>,
25196    }
25197    impl<'gc> EnumStringBody<'gc> {
25198        /// Start from a copy of `node`, with no field changed yet.
25199        pub fn from_node(node: &'gc super::EnumStringBody<'gc>) -> Self {
25200            Self {
25201                is_changed: false,
25202                inner: super::EnumStringBody {
25203                    metadata: node.metadata.duplicate(),
25204                    members: node.members.duplicate(),
25205                    explicit_type: Cell::new(node.explicit_type.get()),
25206                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
25207                },
25208            }
25209        }
25210        /// Allocate the rebuilt node if a setter ran, else
25211        /// `TransformResult::Unchanged`.
25212        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25213            if self.is_changed {
25214                TransformResult::Changed(self.build_forced(gc))
25215            } else {
25216                TransformResult::Unchanged
25217            }
25218        }
25219        /// Allocate the node unconditionally, changed or not.
25220        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25221            gc.alloc(Node::EnumStringBody(self.inner))
25222        }
25223        /// Set the `members` field and mark the builder changed.
25224        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
25225    }
25226    /// Clone-with-changes builder for [`super::EnumNumberBody`].
25227    #[derive(Debug)]
25228    pub struct EnumNumberBody<'gc> {
25229        is_changed: bool,
25230        pub(super) inner: super::EnumNumberBody<'gc>,
25231    }
25232    impl<'gc> EnumNumberBody<'gc> {
25233        /// Start from a copy of `node`, with no field changed yet.
25234        pub fn from_node(node: &'gc super::EnumNumberBody<'gc>) -> Self {
25235            Self {
25236                is_changed: false,
25237                inner: super::EnumNumberBody {
25238                    metadata: node.metadata.duplicate(),
25239                    members: node.members.duplicate(),
25240                    explicit_type: Cell::new(node.explicit_type.get()),
25241                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
25242                },
25243            }
25244        }
25245        /// Allocate the rebuilt node if a setter ran, else
25246        /// `TransformResult::Unchanged`.
25247        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25248            if self.is_changed {
25249                TransformResult::Changed(self.build_forced(gc))
25250            } else {
25251                TransformResult::Unchanged
25252            }
25253        }
25254        /// Allocate the node unconditionally, changed or not.
25255        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25256            gc.alloc(Node::EnumNumberBody(self.inner))
25257        }
25258        /// Set the `members` field and mark the builder changed.
25259        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
25260    }
25261    /// Clone-with-changes builder for [`super::EnumBigIntBody`].
25262    #[derive(Debug)]
25263    pub struct EnumBigIntBody<'gc> {
25264        is_changed: bool,
25265        pub(super) inner: super::EnumBigIntBody<'gc>,
25266    }
25267    impl<'gc> EnumBigIntBody<'gc> {
25268        /// Start from a copy of `node`, with no field changed yet.
25269        pub fn from_node(node: &'gc super::EnumBigIntBody<'gc>) -> Self {
25270            Self {
25271                is_changed: false,
25272                inner: super::EnumBigIntBody {
25273                    metadata: node.metadata.duplicate(),
25274                    members: node.members.duplicate(),
25275                    explicit_type: Cell::new(node.explicit_type.get()),
25276                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
25277                },
25278            }
25279        }
25280        /// Allocate the rebuilt node if a setter ran, else
25281        /// `TransformResult::Unchanged`.
25282        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25283            if self.is_changed {
25284                TransformResult::Changed(self.build_forced(gc))
25285            } else {
25286                TransformResult::Unchanged
25287            }
25288        }
25289        /// Allocate the node unconditionally, changed or not.
25290        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25291            gc.alloc(Node::EnumBigIntBody(self.inner))
25292        }
25293        /// Set the `members` field and mark the builder changed.
25294        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
25295    }
25296    /// Clone-with-changes builder for [`super::EnumBooleanBody`].
25297    #[derive(Debug)]
25298    pub struct EnumBooleanBody<'gc> {
25299        is_changed: bool,
25300        pub(super) inner: super::EnumBooleanBody<'gc>,
25301    }
25302    impl<'gc> EnumBooleanBody<'gc> {
25303        /// Start from a copy of `node`, with no field changed yet.
25304        pub fn from_node(node: &'gc super::EnumBooleanBody<'gc>) -> Self {
25305            Self {
25306                is_changed: false,
25307                inner: super::EnumBooleanBody {
25308                    metadata: node.metadata.duplicate(),
25309                    members: node.members.duplicate(),
25310                    explicit_type: Cell::new(node.explicit_type.get()),
25311                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
25312                },
25313            }
25314        }
25315        /// Allocate the rebuilt node if a setter ran, else
25316        /// `TransformResult::Unchanged`.
25317        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25318            if self.is_changed {
25319                TransformResult::Changed(self.build_forced(gc))
25320            } else {
25321                TransformResult::Unchanged
25322            }
25323        }
25324        /// Allocate the node unconditionally, changed or not.
25325        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25326            gc.alloc(Node::EnumBooleanBody(self.inner))
25327        }
25328        /// Set the `members` field and mark the builder changed.
25329        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
25330    }
25331    /// Clone-with-changes builder for [`super::EnumSymbolBody`].
25332    #[derive(Debug)]
25333    pub struct EnumSymbolBody<'gc> {
25334        is_changed: bool,
25335        pub(super) inner: super::EnumSymbolBody<'gc>,
25336    }
25337    impl<'gc> EnumSymbolBody<'gc> {
25338        /// Start from a copy of `node`, with no field changed yet.
25339        pub fn from_node(node: &'gc super::EnumSymbolBody<'gc>) -> Self {
25340            Self {
25341                is_changed: false,
25342                inner: super::EnumSymbolBody {
25343                    metadata: node.metadata.duplicate(),
25344                    members: node.members.duplicate(),
25345                    has_unknown_members: Cell::new(node.has_unknown_members.get()),
25346                },
25347            }
25348        }
25349        /// Allocate the rebuilt node if a setter ran, else
25350        /// `TransformResult::Unchanged`.
25351        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25352            if self.is_changed {
25353                TransformResult::Changed(self.build_forced(gc))
25354            } else {
25355                TransformResult::Unchanged
25356            }
25357        }
25358        /// Allocate the node unconditionally, changed or not.
25359        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25360            gc.alloc(Node::EnumSymbolBody(self.inner))
25361        }
25362        /// Set the `members` field and mark the builder changed.
25363        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
25364    }
25365    /// Clone-with-changes builder for [`super::EnumDefaultedMember`].
25366    #[derive(Debug)]
25367    pub struct EnumDefaultedMember<'gc> {
25368        is_changed: bool,
25369        pub(super) inner: super::EnumDefaultedMember<'gc>,
25370    }
25371    impl<'gc> EnumDefaultedMember<'gc> {
25372        /// Start from a copy of `node`, with no field changed yet.
25373        pub fn from_node(node: &'gc super::EnumDefaultedMember<'gc>) -> Self {
25374            Self {
25375                is_changed: false,
25376                inner: super::EnumDefaultedMember {
25377                    metadata: node.metadata.duplicate(),
25378                    id: node.id.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::EnumDefaultedMember(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    }
25398    /// Clone-with-changes builder for [`super::EnumStringMember`].
25399    #[derive(Debug)]
25400    pub struct EnumStringMember<'gc> {
25401        is_changed: bool,
25402        pub(super) inner: super::EnumStringMember<'gc>,
25403    }
25404    impl<'gc> EnumStringMember<'gc> {
25405        /// Start from a copy of `node`, with no field changed yet.
25406        pub fn from_node(node: &'gc super::EnumStringMember<'gc>) -> Self {
25407            Self {
25408                is_changed: false,
25409                inner: super::EnumStringMember {
25410                    metadata: node.metadata.duplicate(),
25411                    id: node.id.duplicate(),
25412                    init: node.init.duplicate(),
25413                },
25414            }
25415        }
25416        /// Allocate the rebuilt node if a setter ran, else
25417        /// `TransformResult::Unchanged`.
25418        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25419            if self.is_changed {
25420                TransformResult::Changed(self.build_forced(gc))
25421            } else {
25422                TransformResult::Unchanged
25423            }
25424        }
25425        /// Allocate the node unconditionally, changed or not.
25426        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25427            gc.alloc(Node::EnumStringMember(self.inner))
25428        }
25429        /// Set the `id` field and mark the builder changed.
25430        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25431        /// Set the `init` field and mark the builder changed.
25432        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
25433    }
25434    /// Clone-with-changes builder for [`super::EnumNumberMember`].
25435    #[derive(Debug)]
25436    pub struct EnumNumberMember<'gc> {
25437        is_changed: bool,
25438        pub(super) inner: super::EnumNumberMember<'gc>,
25439    }
25440    impl<'gc> EnumNumberMember<'gc> {
25441        /// Start from a copy of `node`, with no field changed yet.
25442        pub fn from_node(node: &'gc super::EnumNumberMember<'gc>) -> Self {
25443            Self {
25444                is_changed: false,
25445                inner: super::EnumNumberMember {
25446                    metadata: node.metadata.duplicate(),
25447                    id: node.id.duplicate(),
25448                    init: node.init.duplicate(),
25449                },
25450            }
25451        }
25452        /// Allocate the rebuilt node if a setter ran, else
25453        /// `TransformResult::Unchanged`.
25454        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25455            if self.is_changed {
25456                TransformResult::Changed(self.build_forced(gc))
25457            } else {
25458                TransformResult::Unchanged
25459            }
25460        }
25461        /// Allocate the node unconditionally, changed or not.
25462        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25463            gc.alloc(Node::EnumNumberMember(self.inner))
25464        }
25465        /// Set the `id` field and mark the builder changed.
25466        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25467        /// Set the `init` field and mark the builder changed.
25468        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
25469    }
25470    /// Clone-with-changes builder for [`super::EnumBigIntMember`].
25471    #[derive(Debug)]
25472    pub struct EnumBigIntMember<'gc> {
25473        is_changed: bool,
25474        pub(super) inner: super::EnumBigIntMember<'gc>,
25475    }
25476    impl<'gc> EnumBigIntMember<'gc> {
25477        /// Start from a copy of `node`, with no field changed yet.
25478        pub fn from_node(node: &'gc super::EnumBigIntMember<'gc>) -> Self {
25479            Self {
25480                is_changed: false,
25481                inner: super::EnumBigIntMember {
25482                    metadata: node.metadata.duplicate(),
25483                    id: node.id.duplicate(),
25484                    init: node.init.duplicate(),
25485                },
25486            }
25487        }
25488        /// Allocate the rebuilt node if a setter ran, else
25489        /// `TransformResult::Unchanged`.
25490        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25491            if self.is_changed {
25492                TransformResult::Changed(self.build_forced(gc))
25493            } else {
25494                TransformResult::Unchanged
25495            }
25496        }
25497        /// Allocate the node unconditionally, changed or not.
25498        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25499            gc.alloc(Node::EnumBigIntMember(self.inner))
25500        }
25501        /// Set the `id` field and mark the builder changed.
25502        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25503        /// Set the `init` field and mark the builder changed.
25504        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
25505    }
25506    /// Clone-with-changes builder for [`super::EnumBooleanMember`].
25507    #[derive(Debug)]
25508    pub struct EnumBooleanMember<'gc> {
25509        is_changed: bool,
25510        pub(super) inner: super::EnumBooleanMember<'gc>,
25511    }
25512    impl<'gc> EnumBooleanMember<'gc> {
25513        /// Start from a copy of `node`, with no field changed yet.
25514        pub fn from_node(node: &'gc super::EnumBooleanMember<'gc>) -> Self {
25515            Self {
25516                is_changed: false,
25517                inner: super::EnumBooleanMember {
25518                    metadata: node.metadata.duplicate(),
25519                    id: node.id.duplicate(),
25520                    init: node.init.duplicate(),
25521                },
25522            }
25523        }
25524        /// Allocate the rebuilt node if a setter ran, else
25525        /// `TransformResult::Unchanged`.
25526        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25527            if self.is_changed {
25528                TransformResult::Changed(self.build_forced(gc))
25529            } else {
25530                TransformResult::Unchanged
25531            }
25532        }
25533        /// Allocate the node unconditionally, changed or not.
25534        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25535            gc.alloc(Node::EnumBooleanMember(self.inner))
25536        }
25537        /// Set the `id` field and mark the builder changed.
25538        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25539        /// Set the `init` field and mark the builder changed.
25540        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
25541    }
25542    /// Clone-with-changes builder for [`super::ComponentParameter`].
25543    #[derive(Debug)]
25544    pub struct ComponentParameter<'gc> {
25545        is_changed: bool,
25546        pub(super) inner: super::ComponentParameter<'gc>,
25547    }
25548    impl<'gc> ComponentParameter<'gc> {
25549        /// Start from a copy of `node`, with no field changed yet.
25550        pub fn from_node(node: &'gc super::ComponentParameter<'gc>) -> Self {
25551            Self {
25552                is_changed: false,
25553                inner: super::ComponentParameter {
25554                    metadata: node.metadata.duplicate(),
25555                    name: node.name.duplicate(),
25556                    local: node.local.duplicate(),
25557                    shorthand: Cell::new(node.shorthand.get()),
25558                },
25559            }
25560        }
25561        /// Allocate the rebuilt node if a setter ran, else
25562        /// `TransformResult::Unchanged`.
25563        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25564            if self.is_changed {
25565                TransformResult::Changed(self.build_forced(gc))
25566            } else {
25567                TransformResult::Unchanged
25568            }
25569        }
25570        /// Allocate the node unconditionally, changed or not.
25571        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25572            gc.alloc(Node::ComponentParameter(self.inner))
25573        }
25574        /// Set the `name` field and mark the builder changed.
25575        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
25576        /// Set the `local` field and mark the builder changed.
25577        pub fn local(&mut self, local: &'gc Node<'gc>) { self.is_changed = true; self.inner.local = local; }
25578    }
25579    /// Clone-with-changes builder for [`super::RecordDeclaration`].
25580    #[derive(Debug)]
25581    pub struct RecordDeclaration<'gc> {
25582        is_changed: bool,
25583        pub(super) inner: super::RecordDeclaration<'gc>,
25584    }
25585    impl<'gc> RecordDeclaration<'gc> {
25586        /// Start from a copy of `node`, with no field changed yet.
25587        pub fn from_node(node: &'gc super::RecordDeclaration<'gc>) -> Self {
25588            Self {
25589                is_changed: false,
25590                inner: super::RecordDeclaration {
25591                    metadata: node.metadata.duplicate(),
25592                    id: node.id.duplicate(),
25593                    type_parameters: node.type_parameters.duplicate(),
25594                    implements: node.implements.duplicate(),
25595                    body: node.body.duplicate(),
25596                },
25597            }
25598        }
25599        /// Allocate the rebuilt node if a setter ran, else
25600        /// `TransformResult::Unchanged`.
25601        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25602            if self.is_changed {
25603                TransformResult::Changed(self.build_forced(gc))
25604            } else {
25605                TransformResult::Unchanged
25606            }
25607        }
25608        /// Allocate the node unconditionally, changed or not.
25609        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25610            gc.alloc(Node::RecordDeclaration(self.inner))
25611        }
25612        /// Set the `id` field and mark the builder changed.
25613        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25614        /// Set the `type_parameters` field and mark the builder changed.
25615        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
25616        /// Set the `implements` field and mark the builder changed.
25617        pub fn implements(&mut self, implements: NodeList<'gc>) { self.is_changed = true; self.inner.implements = implements; }
25618        /// Set the `body` field and mark the builder changed.
25619        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
25620    }
25621    /// Clone-with-changes builder for [`super::RecordDeclarationImplements`].
25622    #[derive(Debug)]
25623    pub struct RecordDeclarationImplements<'gc> {
25624        is_changed: bool,
25625        pub(super) inner: super::RecordDeclarationImplements<'gc>,
25626    }
25627    impl<'gc> RecordDeclarationImplements<'gc> {
25628        /// Start from a copy of `node`, with no field changed yet.
25629        pub fn from_node(node: &'gc super::RecordDeclarationImplements<'gc>) -> Self {
25630            Self {
25631                is_changed: false,
25632                inner: super::RecordDeclarationImplements {
25633                    metadata: node.metadata.duplicate(),
25634                    id: node.id.duplicate(),
25635                    type_arguments: node.type_arguments.duplicate(),
25636                },
25637            }
25638        }
25639        /// Allocate the rebuilt node if a setter ran, else
25640        /// `TransformResult::Unchanged`.
25641        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25642            if self.is_changed {
25643                TransformResult::Changed(self.build_forced(gc))
25644            } else {
25645                TransformResult::Unchanged
25646            }
25647        }
25648        /// Allocate the node unconditionally, changed or not.
25649        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25650            gc.alloc(Node::RecordDeclarationImplements(self.inner))
25651        }
25652        /// Set the `id` field and mark the builder changed.
25653        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
25654        /// Set the `type_arguments` field and mark the builder changed.
25655        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
25656    }
25657    /// Clone-with-changes builder for [`super::RecordDeclarationBody`].
25658    #[derive(Debug)]
25659    pub struct RecordDeclarationBody<'gc> {
25660        is_changed: bool,
25661        pub(super) inner: super::RecordDeclarationBody<'gc>,
25662    }
25663    impl<'gc> RecordDeclarationBody<'gc> {
25664        /// Start from a copy of `node`, with no field changed yet.
25665        pub fn from_node(node: &'gc super::RecordDeclarationBody<'gc>) -> Self {
25666            Self {
25667                is_changed: false,
25668                inner: super::RecordDeclarationBody {
25669                    metadata: node.metadata.duplicate(),
25670                    elements: node.elements.duplicate(),
25671                },
25672            }
25673        }
25674        /// Allocate the rebuilt node if a setter ran, else
25675        /// `TransformResult::Unchanged`.
25676        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25677            if self.is_changed {
25678                TransformResult::Changed(self.build_forced(gc))
25679            } else {
25680                TransformResult::Unchanged
25681            }
25682        }
25683        /// Allocate the node unconditionally, changed or not.
25684        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25685            gc.alloc(Node::RecordDeclarationBody(self.inner))
25686        }
25687        /// Set the `elements` field and mark the builder changed.
25688        pub fn elements(&mut self, elements: NodeList<'gc>) { self.is_changed = true; self.inner.elements = elements; }
25689    }
25690    /// Clone-with-changes builder for [`super::RecordDeclarationProperty`].
25691    #[derive(Debug)]
25692    pub struct RecordDeclarationProperty<'gc> {
25693        is_changed: bool,
25694        pub(super) inner: super::RecordDeclarationProperty<'gc>,
25695    }
25696    impl<'gc> RecordDeclarationProperty<'gc> {
25697        /// Start from a copy of `node`, with no field changed yet.
25698        pub fn from_node(node: &'gc super::RecordDeclarationProperty<'gc>) -> Self {
25699            Self {
25700                is_changed: false,
25701                inner: super::RecordDeclarationProperty {
25702                    metadata: node.metadata.duplicate(),
25703                    key: node.key.duplicate(),
25704                    type_annotation: node.type_annotation.duplicate(),
25705                    default_value: node.default_value.duplicate(),
25706                },
25707            }
25708        }
25709        /// Allocate the rebuilt node if a setter ran, else
25710        /// `TransformResult::Unchanged`.
25711        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25712            if self.is_changed {
25713                TransformResult::Changed(self.build_forced(gc))
25714            } else {
25715                TransformResult::Unchanged
25716            }
25717        }
25718        /// Allocate the node unconditionally, changed or not.
25719        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25720            gc.alloc(Node::RecordDeclarationProperty(self.inner))
25721        }
25722        /// Set the `key` field and mark the builder changed.
25723        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
25724        /// Set the `type_annotation` field and mark the builder changed.
25725        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25726        /// Set the `default_value` field and mark the builder changed.
25727        pub fn default_value(&mut self, default_value: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.default_value = default_value; }
25728    }
25729    /// Clone-with-changes builder for
25730    /// [`super::RecordDeclarationStaticProperty`].
25731    #[derive(Debug)]
25732    pub struct RecordDeclarationStaticProperty<'gc> {
25733        is_changed: bool,
25734        pub(super) inner: super::RecordDeclarationStaticProperty<'gc>,
25735    }
25736    impl<'gc> RecordDeclarationStaticProperty<'gc> {
25737        /// Start from a copy of `node`, with no field changed yet.
25738        pub fn from_node(node: &'gc super::RecordDeclarationStaticProperty<'gc>) -> Self {
25739            Self {
25740                is_changed: false,
25741                inner: super::RecordDeclarationStaticProperty {
25742                    metadata: node.metadata.duplicate(),
25743                    key: node.key.duplicate(),
25744                    type_annotation: node.type_annotation.duplicate(),
25745                    value: node.value.duplicate(),
25746                },
25747            }
25748        }
25749        /// Allocate the rebuilt node if a setter ran, else
25750        /// `TransformResult::Unchanged`.
25751        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25752            if self.is_changed {
25753                TransformResult::Changed(self.build_forced(gc))
25754            } else {
25755                TransformResult::Unchanged
25756            }
25757        }
25758        /// Allocate the node unconditionally, changed or not.
25759        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25760            gc.alloc(Node::RecordDeclarationStaticProperty(self.inner))
25761        }
25762        /// Set the `key` field and mark the builder changed.
25763        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
25764        /// Set the `type_annotation` field and mark the builder changed.
25765        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25766        /// Set the `value` field and mark the builder changed.
25767        pub fn value(&mut self, value: &'gc Node<'gc>) { self.is_changed = true; self.inner.value = value; }
25768    }
25769    /// Clone-with-changes builder for [`super::RecordExpression`].
25770    #[derive(Debug)]
25771    pub struct RecordExpression<'gc> {
25772        is_changed: bool,
25773        pub(super) inner: super::RecordExpression<'gc>,
25774    }
25775    impl<'gc> RecordExpression<'gc> {
25776        /// Start from a copy of `node`, with no field changed yet.
25777        pub fn from_node(node: &'gc super::RecordExpression<'gc>) -> Self {
25778            Self {
25779                is_changed: false,
25780                inner: super::RecordExpression {
25781                    metadata: node.metadata.duplicate(),
25782                    record_constructor: node.record_constructor.duplicate(),
25783                    type_arguments: node.type_arguments.duplicate(),
25784                    properties: node.properties.duplicate(),
25785                },
25786            }
25787        }
25788        /// Allocate the rebuilt node if a setter ran, else
25789        /// `TransformResult::Unchanged`.
25790        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25791            if self.is_changed {
25792                TransformResult::Changed(self.build_forced(gc))
25793            } else {
25794                TransformResult::Unchanged
25795            }
25796        }
25797        /// Allocate the node unconditionally, changed or not.
25798        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25799            gc.alloc(Node::RecordExpression(self.inner))
25800        }
25801        /// Set the `record_constructor` field and mark the builder changed.
25802        pub fn record_constructor(&mut self, record_constructor: &'gc Node<'gc>) { self.is_changed = true; self.inner.record_constructor = record_constructor; }
25803        /// Set the `type_arguments` field and mark the builder changed.
25804        pub fn type_arguments(&mut self, type_arguments: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_arguments = type_arguments; }
25805        /// Set the `properties` field and mark the builder changed.
25806        pub fn properties(&mut self, properties: &'gc Node<'gc>) { self.is_changed = true; self.inner.properties = properties; }
25807    }
25808    /// Clone-with-changes builder for [`super::RecordExpressionProperties`].
25809    #[derive(Debug)]
25810    pub struct RecordExpressionProperties<'gc> {
25811        is_changed: bool,
25812        pub(super) inner: super::RecordExpressionProperties<'gc>,
25813    }
25814    impl<'gc> RecordExpressionProperties<'gc> {
25815        /// Start from a copy of `node`, with no field changed yet.
25816        pub fn from_node(node: &'gc super::RecordExpressionProperties<'gc>) -> Self {
25817            Self {
25818                is_changed: false,
25819                inner: super::RecordExpressionProperties {
25820                    metadata: node.metadata.duplicate(),
25821                    properties: node.properties.duplicate(),
25822                },
25823            }
25824        }
25825        /// Allocate the rebuilt node if a setter ran, else
25826        /// `TransformResult::Unchanged`.
25827        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25828            if self.is_changed {
25829                TransformResult::Changed(self.build_forced(gc))
25830            } else {
25831                TransformResult::Unchanged
25832            }
25833        }
25834        /// Allocate the node unconditionally, changed or not.
25835        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25836            gc.alloc(Node::RecordExpressionProperties(self.inner))
25837        }
25838        /// Set the `properties` field and mark the builder changed.
25839        pub fn properties(&mut self, properties: NodeList<'gc>) { self.is_changed = true; self.inner.properties = properties; }
25840    }
25841    /// Clone-with-changes builder for [`super::TSTypeAnnotation`].
25842    #[derive(Debug)]
25843    pub struct TSTypeAnnotation<'gc> {
25844        is_changed: bool,
25845        pub(super) inner: super::TSTypeAnnotation<'gc>,
25846    }
25847    impl<'gc> TSTypeAnnotation<'gc> {
25848        /// Start from a copy of `node`, with no field changed yet.
25849        pub fn from_node(node: &'gc super::TSTypeAnnotation<'gc>) -> Self {
25850            Self {
25851                is_changed: false,
25852                inner: super::TSTypeAnnotation {
25853                    metadata: node.metadata.duplicate(),
25854                    type_annotation: node.type_annotation.duplicate(),
25855                },
25856            }
25857        }
25858        /// Allocate the rebuilt node if a setter ran, else
25859        /// `TransformResult::Unchanged`.
25860        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25861            if self.is_changed {
25862                TransformResult::Changed(self.build_forced(gc))
25863            } else {
25864                TransformResult::Unchanged
25865            }
25866        }
25867        /// Allocate the node unconditionally, changed or not.
25868        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25869            gc.alloc(Node::TSTypeAnnotation(self.inner))
25870        }
25871        /// Set the `type_annotation` field and mark the builder changed.
25872        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
25873    }
25874    /// Clone-with-changes builder for [`super::TSAnyKeyword`].
25875    #[derive(Debug)]
25876    pub struct TSAnyKeyword<'gc> {
25877        is_changed: bool,
25878        pub(super) inner: super::TSAnyKeyword<'gc>,
25879    }
25880    impl<'gc> TSAnyKeyword<'gc> {
25881        /// Start from a copy of `node`, with no field changed yet.
25882        pub fn from_node(node: &'gc super::TSAnyKeyword<'gc>) -> Self {
25883            Self {
25884                is_changed: false,
25885                inner: super::TSAnyKeyword {
25886                    metadata: node.metadata.duplicate(),
25887                },
25888            }
25889        }
25890        /// Allocate the rebuilt node if a setter ran, else
25891        /// `TransformResult::Unchanged`.
25892        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25893            if self.is_changed {
25894                TransformResult::Changed(self.build_forced(gc))
25895            } else {
25896                TransformResult::Unchanged
25897            }
25898        }
25899        /// Allocate the node unconditionally, changed or not.
25900        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25901            gc.alloc(Node::TSAnyKeyword(self.inner))
25902        }
25903    }
25904    /// Clone-with-changes builder for [`super::TSNumberKeyword`].
25905    #[derive(Debug)]
25906    pub struct TSNumberKeyword<'gc> {
25907        is_changed: bool,
25908        pub(super) inner: super::TSNumberKeyword<'gc>,
25909    }
25910    impl<'gc> TSNumberKeyword<'gc> {
25911        /// Start from a copy of `node`, with no field changed yet.
25912        pub fn from_node(node: &'gc super::TSNumberKeyword<'gc>) -> Self {
25913            Self {
25914                is_changed: false,
25915                inner: super::TSNumberKeyword {
25916                    metadata: node.metadata.duplicate(),
25917                },
25918            }
25919        }
25920        /// Allocate the rebuilt node if a setter ran, else
25921        /// `TransformResult::Unchanged`.
25922        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25923            if self.is_changed {
25924                TransformResult::Changed(self.build_forced(gc))
25925            } else {
25926                TransformResult::Unchanged
25927            }
25928        }
25929        /// Allocate the node unconditionally, changed or not.
25930        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25931            gc.alloc(Node::TSNumberKeyword(self.inner))
25932        }
25933    }
25934    /// Clone-with-changes builder for [`super::TSBooleanKeyword`].
25935    #[derive(Debug)]
25936    pub struct TSBooleanKeyword<'gc> {
25937        is_changed: bool,
25938        pub(super) inner: super::TSBooleanKeyword<'gc>,
25939    }
25940    impl<'gc> TSBooleanKeyword<'gc> {
25941        /// Start from a copy of `node`, with no field changed yet.
25942        pub fn from_node(node: &'gc super::TSBooleanKeyword<'gc>) -> Self {
25943            Self {
25944                is_changed: false,
25945                inner: super::TSBooleanKeyword {
25946                    metadata: node.metadata.duplicate(),
25947                },
25948            }
25949        }
25950        /// Allocate the rebuilt node if a setter ran, else
25951        /// `TransformResult::Unchanged`.
25952        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25953            if self.is_changed {
25954                TransformResult::Changed(self.build_forced(gc))
25955            } else {
25956                TransformResult::Unchanged
25957            }
25958        }
25959        /// Allocate the node unconditionally, changed or not.
25960        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25961            gc.alloc(Node::TSBooleanKeyword(self.inner))
25962        }
25963    }
25964    /// Clone-with-changes builder for [`super::TSStringKeyword`].
25965    #[derive(Debug)]
25966    pub struct TSStringKeyword<'gc> {
25967        is_changed: bool,
25968        pub(super) inner: super::TSStringKeyword<'gc>,
25969    }
25970    impl<'gc> TSStringKeyword<'gc> {
25971        /// Start from a copy of `node`, with no field changed yet.
25972        pub fn from_node(node: &'gc super::TSStringKeyword<'gc>) -> Self {
25973            Self {
25974                is_changed: false,
25975                inner: super::TSStringKeyword {
25976                    metadata: node.metadata.duplicate(),
25977                },
25978            }
25979        }
25980        /// Allocate the rebuilt node if a setter ran, else
25981        /// `TransformResult::Unchanged`.
25982        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
25983            if self.is_changed {
25984                TransformResult::Changed(self.build_forced(gc))
25985            } else {
25986                TransformResult::Unchanged
25987            }
25988        }
25989        /// Allocate the node unconditionally, changed or not.
25990        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
25991            gc.alloc(Node::TSStringKeyword(self.inner))
25992        }
25993    }
25994    /// Clone-with-changes builder for [`super::TSSymbolKeyword`].
25995    #[derive(Debug)]
25996    pub struct TSSymbolKeyword<'gc> {
25997        is_changed: bool,
25998        pub(super) inner: super::TSSymbolKeyword<'gc>,
25999    }
26000    impl<'gc> TSSymbolKeyword<'gc> {
26001        /// Start from a copy of `node`, with no field changed yet.
26002        pub fn from_node(node: &'gc super::TSSymbolKeyword<'gc>) -> Self {
26003            Self {
26004                is_changed: false,
26005                inner: super::TSSymbolKeyword {
26006                    metadata: node.metadata.duplicate(),
26007                },
26008            }
26009        }
26010        /// Allocate the rebuilt node if a setter ran, else
26011        /// `TransformResult::Unchanged`.
26012        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26013            if self.is_changed {
26014                TransformResult::Changed(self.build_forced(gc))
26015            } else {
26016                TransformResult::Unchanged
26017            }
26018        }
26019        /// Allocate the node unconditionally, changed or not.
26020        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26021            gc.alloc(Node::TSSymbolKeyword(self.inner))
26022        }
26023    }
26024    /// Clone-with-changes builder for [`super::TSVoidKeyword`].
26025    #[derive(Debug)]
26026    pub struct TSVoidKeyword<'gc> {
26027        is_changed: bool,
26028        pub(super) inner: super::TSVoidKeyword<'gc>,
26029    }
26030    impl<'gc> TSVoidKeyword<'gc> {
26031        /// Start from a copy of `node`, with no field changed yet.
26032        pub fn from_node(node: &'gc super::TSVoidKeyword<'gc>) -> Self {
26033            Self {
26034                is_changed: false,
26035                inner: super::TSVoidKeyword {
26036                    metadata: node.metadata.duplicate(),
26037                },
26038            }
26039        }
26040        /// Allocate the rebuilt node if a setter ran, else
26041        /// `TransformResult::Unchanged`.
26042        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26043            if self.is_changed {
26044                TransformResult::Changed(self.build_forced(gc))
26045            } else {
26046                TransformResult::Unchanged
26047            }
26048        }
26049        /// Allocate the node unconditionally, changed or not.
26050        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26051            gc.alloc(Node::TSVoidKeyword(self.inner))
26052        }
26053    }
26054    /// Clone-with-changes builder for [`super::TSUndefinedKeyword`].
26055    #[derive(Debug)]
26056    pub struct TSUndefinedKeyword<'gc> {
26057        is_changed: bool,
26058        pub(super) inner: super::TSUndefinedKeyword<'gc>,
26059    }
26060    impl<'gc> TSUndefinedKeyword<'gc> {
26061        /// Start from a copy of `node`, with no field changed yet.
26062        pub fn from_node(node: &'gc super::TSUndefinedKeyword<'gc>) -> Self {
26063            Self {
26064                is_changed: false,
26065                inner: super::TSUndefinedKeyword {
26066                    metadata: node.metadata.duplicate(),
26067                },
26068            }
26069        }
26070        /// Allocate the rebuilt node if a setter ran, else
26071        /// `TransformResult::Unchanged`.
26072        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26073            if self.is_changed {
26074                TransformResult::Changed(self.build_forced(gc))
26075            } else {
26076                TransformResult::Unchanged
26077            }
26078        }
26079        /// Allocate the node unconditionally, changed or not.
26080        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26081            gc.alloc(Node::TSUndefinedKeyword(self.inner))
26082        }
26083    }
26084    /// Clone-with-changes builder for [`super::TSUnknownKeyword`].
26085    #[derive(Debug)]
26086    pub struct TSUnknownKeyword<'gc> {
26087        is_changed: bool,
26088        pub(super) inner: super::TSUnknownKeyword<'gc>,
26089    }
26090    impl<'gc> TSUnknownKeyword<'gc> {
26091        /// Start from a copy of `node`, with no field changed yet.
26092        pub fn from_node(node: &'gc super::TSUnknownKeyword<'gc>) -> Self {
26093            Self {
26094                is_changed: false,
26095                inner: super::TSUnknownKeyword {
26096                    metadata: node.metadata.duplicate(),
26097                },
26098            }
26099        }
26100        /// Allocate the rebuilt node if a setter ran, else
26101        /// `TransformResult::Unchanged`.
26102        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26103            if self.is_changed {
26104                TransformResult::Changed(self.build_forced(gc))
26105            } else {
26106                TransformResult::Unchanged
26107            }
26108        }
26109        /// Allocate the node unconditionally, changed or not.
26110        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26111            gc.alloc(Node::TSUnknownKeyword(self.inner))
26112        }
26113    }
26114    /// Clone-with-changes builder for [`super::TSNeverKeyword`].
26115    #[derive(Debug)]
26116    pub struct TSNeverKeyword<'gc> {
26117        is_changed: bool,
26118        pub(super) inner: super::TSNeverKeyword<'gc>,
26119    }
26120    impl<'gc> TSNeverKeyword<'gc> {
26121        /// Start from a copy of `node`, with no field changed yet.
26122        pub fn from_node(node: &'gc super::TSNeverKeyword<'gc>) -> Self {
26123            Self {
26124                is_changed: false,
26125                inner: super::TSNeverKeyword {
26126                    metadata: node.metadata.duplicate(),
26127                },
26128            }
26129        }
26130        /// Allocate the rebuilt node if a setter ran, else
26131        /// `TransformResult::Unchanged`.
26132        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26133            if self.is_changed {
26134                TransformResult::Changed(self.build_forced(gc))
26135            } else {
26136                TransformResult::Unchanged
26137            }
26138        }
26139        /// Allocate the node unconditionally, changed or not.
26140        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26141            gc.alloc(Node::TSNeverKeyword(self.inner))
26142        }
26143    }
26144    /// Clone-with-changes builder for [`super::TSBigIntKeyword`].
26145    #[derive(Debug)]
26146    pub struct TSBigIntKeyword<'gc> {
26147        is_changed: bool,
26148        pub(super) inner: super::TSBigIntKeyword<'gc>,
26149    }
26150    impl<'gc> TSBigIntKeyword<'gc> {
26151        /// Start from a copy of `node`, with no field changed yet.
26152        pub fn from_node(node: &'gc super::TSBigIntKeyword<'gc>) -> Self {
26153            Self {
26154                is_changed: false,
26155                inner: super::TSBigIntKeyword {
26156                    metadata: node.metadata.duplicate(),
26157                },
26158            }
26159        }
26160        /// Allocate the rebuilt node if a setter ran, else
26161        /// `TransformResult::Unchanged`.
26162        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26163            if self.is_changed {
26164                TransformResult::Changed(self.build_forced(gc))
26165            } else {
26166                TransformResult::Unchanged
26167            }
26168        }
26169        /// Allocate the node unconditionally, changed or not.
26170        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26171            gc.alloc(Node::TSBigIntKeyword(self.inner))
26172        }
26173    }
26174    /// Clone-with-changes builder for [`super::TSThisType`].
26175    #[derive(Debug)]
26176    pub struct TSThisType<'gc> {
26177        is_changed: bool,
26178        pub(super) inner: super::TSThisType<'gc>,
26179    }
26180    impl<'gc> TSThisType<'gc> {
26181        /// Start from a copy of `node`, with no field changed yet.
26182        pub fn from_node(node: &'gc super::TSThisType<'gc>) -> Self {
26183            Self {
26184                is_changed: false,
26185                inner: super::TSThisType {
26186                    metadata: node.metadata.duplicate(),
26187                },
26188            }
26189        }
26190        /// Allocate the rebuilt node if a setter ran, else
26191        /// `TransformResult::Unchanged`.
26192        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26193            if self.is_changed {
26194                TransformResult::Changed(self.build_forced(gc))
26195            } else {
26196                TransformResult::Unchanged
26197            }
26198        }
26199        /// Allocate the node unconditionally, changed or not.
26200        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26201            gc.alloc(Node::TSThisType(self.inner))
26202        }
26203    }
26204    /// Clone-with-changes builder for [`super::TSLiteralType`].
26205    #[derive(Debug)]
26206    pub struct TSLiteralType<'gc> {
26207        is_changed: bool,
26208        pub(super) inner: super::TSLiteralType<'gc>,
26209    }
26210    impl<'gc> TSLiteralType<'gc> {
26211        /// Start from a copy of `node`, with no field changed yet.
26212        pub fn from_node(node: &'gc super::TSLiteralType<'gc>) -> Self {
26213            Self {
26214                is_changed: false,
26215                inner: super::TSLiteralType {
26216                    metadata: node.metadata.duplicate(),
26217                    literal: node.literal.duplicate(),
26218                },
26219            }
26220        }
26221        /// Allocate the rebuilt node if a setter ran, else
26222        /// `TransformResult::Unchanged`.
26223        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26224            if self.is_changed {
26225                TransformResult::Changed(self.build_forced(gc))
26226            } else {
26227                TransformResult::Unchanged
26228            }
26229        }
26230        /// Allocate the node unconditionally, changed or not.
26231        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26232            gc.alloc(Node::TSLiteralType(self.inner))
26233        }
26234        /// Set the `literal` field and mark the builder changed.
26235        pub fn literal(&mut self, literal: &'gc Node<'gc>) { self.is_changed = true; self.inner.literal = literal; }
26236    }
26237    /// Clone-with-changes builder for [`super::TSIndexedAccessType`].
26238    #[derive(Debug)]
26239    pub struct TSIndexedAccessType<'gc> {
26240        is_changed: bool,
26241        pub(super) inner: super::TSIndexedAccessType<'gc>,
26242    }
26243    impl<'gc> TSIndexedAccessType<'gc> {
26244        /// Start from a copy of `node`, with no field changed yet.
26245        pub fn from_node(node: &'gc super::TSIndexedAccessType<'gc>) -> Self {
26246            Self {
26247                is_changed: false,
26248                inner: super::TSIndexedAccessType {
26249                    metadata: node.metadata.duplicate(),
26250                    object_type: node.object_type.duplicate(),
26251                    index_type: node.index_type.duplicate(),
26252                },
26253            }
26254        }
26255        /// Allocate the rebuilt node if a setter ran, else
26256        /// `TransformResult::Unchanged`.
26257        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26258            if self.is_changed {
26259                TransformResult::Changed(self.build_forced(gc))
26260            } else {
26261                TransformResult::Unchanged
26262            }
26263        }
26264        /// Allocate the node unconditionally, changed or not.
26265        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26266            gc.alloc(Node::TSIndexedAccessType(self.inner))
26267        }
26268        /// Set the `object_type` field and mark the builder changed.
26269        pub fn object_type(&mut self, object_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.object_type = object_type; }
26270        /// Set the `index_type` field and mark the builder changed.
26271        pub fn index_type(&mut self, index_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.index_type = index_type; }
26272    }
26273    /// Clone-with-changes builder for [`super::TSArrayType`].
26274    #[derive(Debug)]
26275    pub struct TSArrayType<'gc> {
26276        is_changed: bool,
26277        pub(super) inner: super::TSArrayType<'gc>,
26278    }
26279    impl<'gc> TSArrayType<'gc> {
26280        /// Start from a copy of `node`, with no field changed yet.
26281        pub fn from_node(node: &'gc super::TSArrayType<'gc>) -> Self {
26282            Self {
26283                is_changed: false,
26284                inner: super::TSArrayType {
26285                    metadata: node.metadata.duplicate(),
26286                    element_type: node.element_type.duplicate(),
26287                },
26288            }
26289        }
26290        /// Allocate the rebuilt node if a setter ran, else
26291        /// `TransformResult::Unchanged`.
26292        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26293            if self.is_changed {
26294                TransformResult::Changed(self.build_forced(gc))
26295            } else {
26296                TransformResult::Unchanged
26297            }
26298        }
26299        /// Allocate the node unconditionally, changed or not.
26300        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26301            gc.alloc(Node::TSArrayType(self.inner))
26302        }
26303        /// Set the `element_type` field and mark the builder changed.
26304        pub fn element_type(&mut self, element_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.element_type = element_type; }
26305    }
26306    /// Clone-with-changes builder for [`super::TSTypeReference`].
26307    #[derive(Debug)]
26308    pub struct TSTypeReference<'gc> {
26309        is_changed: bool,
26310        pub(super) inner: super::TSTypeReference<'gc>,
26311    }
26312    impl<'gc> TSTypeReference<'gc> {
26313        /// Start from a copy of `node`, with no field changed yet.
26314        pub fn from_node(node: &'gc super::TSTypeReference<'gc>) -> Self {
26315            Self {
26316                is_changed: false,
26317                inner: super::TSTypeReference {
26318                    metadata: node.metadata.duplicate(),
26319                    type_name: node.type_name.duplicate(),
26320                    type_parameters: node.type_parameters.duplicate(),
26321                },
26322            }
26323        }
26324        /// Allocate the rebuilt node if a setter ran, else
26325        /// `TransformResult::Unchanged`.
26326        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26327            if self.is_changed {
26328                TransformResult::Changed(self.build_forced(gc))
26329            } else {
26330                TransformResult::Unchanged
26331            }
26332        }
26333        /// Allocate the node unconditionally, changed or not.
26334        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26335            gc.alloc(Node::TSTypeReference(self.inner))
26336        }
26337        /// Set the `type_name` field and mark the builder changed.
26338        pub fn type_name(&mut self, type_name: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_name = type_name; }
26339        /// Set the `type_parameters` field and mark the builder changed.
26340        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
26341    }
26342    /// Clone-with-changes builder for [`super::TSQualifiedName`].
26343    #[derive(Debug)]
26344    pub struct TSQualifiedName<'gc> {
26345        is_changed: bool,
26346        pub(super) inner: super::TSQualifiedName<'gc>,
26347    }
26348    impl<'gc> TSQualifiedName<'gc> {
26349        /// Start from a copy of `node`, with no field changed yet.
26350        pub fn from_node(node: &'gc super::TSQualifiedName<'gc>) -> Self {
26351            Self {
26352                is_changed: false,
26353                inner: super::TSQualifiedName {
26354                    metadata: node.metadata.duplicate(),
26355                    left: node.left.duplicate(),
26356                    right: node.right.duplicate(),
26357                },
26358            }
26359        }
26360        /// Allocate the rebuilt node if a setter ran, else
26361        /// `TransformResult::Unchanged`.
26362        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26363            if self.is_changed {
26364                TransformResult::Changed(self.build_forced(gc))
26365            } else {
26366                TransformResult::Unchanged
26367            }
26368        }
26369        /// Allocate the node unconditionally, changed or not.
26370        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26371            gc.alloc(Node::TSQualifiedName(self.inner))
26372        }
26373        /// Set the `left` field and mark the builder changed.
26374        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
26375        /// Set the `right` field and mark the builder changed.
26376        pub fn right(&mut self, right: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.right = right; }
26377    }
26378    /// Clone-with-changes builder for [`super::TSFunctionType`].
26379    #[derive(Debug)]
26380    pub struct TSFunctionType<'gc> {
26381        is_changed: bool,
26382        pub(super) inner: super::TSFunctionType<'gc>,
26383    }
26384    impl<'gc> TSFunctionType<'gc> {
26385        /// Start from a copy of `node`, with no field changed yet.
26386        pub fn from_node(node: &'gc super::TSFunctionType<'gc>) -> Self {
26387            Self {
26388                is_changed: false,
26389                inner: super::TSFunctionType {
26390                    metadata: node.metadata.duplicate(),
26391                    params: node.params.duplicate(),
26392                    return_type: node.return_type.duplicate(),
26393                    type_parameters: node.type_parameters.duplicate(),
26394                },
26395            }
26396        }
26397        /// Allocate the rebuilt node if a setter ran, else
26398        /// `TransformResult::Unchanged`.
26399        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26400            if self.is_changed {
26401                TransformResult::Changed(self.build_forced(gc))
26402            } else {
26403                TransformResult::Unchanged
26404            }
26405        }
26406        /// Allocate the node unconditionally, changed or not.
26407        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26408            gc.alloc(Node::TSFunctionType(self.inner))
26409        }
26410        /// Set the `params` field and mark the builder changed.
26411        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
26412        /// Set the `return_type` field and mark the builder changed.
26413        pub fn return_type(&mut self, return_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.return_type = return_type; }
26414        /// Set the `type_parameters` field and mark the builder changed.
26415        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
26416    }
26417    /// Clone-with-changes builder for [`super::TSConstructorType`].
26418    #[derive(Debug)]
26419    pub struct TSConstructorType<'gc> {
26420        is_changed: bool,
26421        pub(super) inner: super::TSConstructorType<'gc>,
26422    }
26423    impl<'gc> TSConstructorType<'gc> {
26424        /// Start from a copy of `node`, with no field changed yet.
26425        pub fn from_node(node: &'gc super::TSConstructorType<'gc>) -> Self {
26426            Self {
26427                is_changed: false,
26428                inner: super::TSConstructorType {
26429                    metadata: node.metadata.duplicate(),
26430                    params: node.params.duplicate(),
26431                    return_type: node.return_type.duplicate(),
26432                    type_parameters: node.type_parameters.duplicate(),
26433                },
26434            }
26435        }
26436        /// Allocate the rebuilt node if a setter ran, else
26437        /// `TransformResult::Unchanged`.
26438        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26439            if self.is_changed {
26440                TransformResult::Changed(self.build_forced(gc))
26441            } else {
26442                TransformResult::Unchanged
26443            }
26444        }
26445        /// Allocate the node unconditionally, changed or not.
26446        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26447            gc.alloc(Node::TSConstructorType(self.inner))
26448        }
26449        /// Set the `params` field and mark the builder changed.
26450        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
26451        /// Set the `return_type` field and mark the builder changed.
26452        pub fn return_type(&mut self, return_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.return_type = return_type; }
26453        /// Set the `type_parameters` field and mark the builder changed.
26454        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
26455    }
26456    /// Clone-with-changes builder for [`super::TSTypePredicate`].
26457    #[derive(Debug)]
26458    pub struct TSTypePredicate<'gc> {
26459        is_changed: bool,
26460        pub(super) inner: super::TSTypePredicate<'gc>,
26461    }
26462    impl<'gc> TSTypePredicate<'gc> {
26463        /// Start from a copy of `node`, with no field changed yet.
26464        pub fn from_node(node: &'gc super::TSTypePredicate<'gc>) -> Self {
26465            Self {
26466                is_changed: false,
26467                inner: super::TSTypePredicate {
26468                    metadata: node.metadata.duplicate(),
26469                    parameter_name: node.parameter_name.duplicate(),
26470                    type_annotation: node.type_annotation.duplicate(),
26471                },
26472            }
26473        }
26474        /// Allocate the rebuilt node if a setter ran, else
26475        /// `TransformResult::Unchanged`.
26476        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26477            if self.is_changed {
26478                TransformResult::Changed(self.build_forced(gc))
26479            } else {
26480                TransformResult::Unchanged
26481            }
26482        }
26483        /// Allocate the node unconditionally, changed or not.
26484        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26485            gc.alloc(Node::TSTypePredicate(self.inner))
26486        }
26487        /// Set the `parameter_name` field and mark the builder changed.
26488        pub fn parameter_name(&mut self, parameter_name: &'gc Node<'gc>) { self.is_changed = true; self.inner.parameter_name = parameter_name; }
26489        /// Set the `type_annotation` field and mark the builder changed.
26490        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
26491    }
26492    /// Clone-with-changes builder for [`super::TSTupleType`].
26493    #[derive(Debug)]
26494    pub struct TSTupleType<'gc> {
26495        is_changed: bool,
26496        pub(super) inner: super::TSTupleType<'gc>,
26497    }
26498    impl<'gc> TSTupleType<'gc> {
26499        /// Start from a copy of `node`, with no field changed yet.
26500        pub fn from_node(node: &'gc super::TSTupleType<'gc>) -> Self {
26501            Self {
26502                is_changed: false,
26503                inner: super::TSTupleType {
26504                    metadata: node.metadata.duplicate(),
26505                    element_types: node.element_types.duplicate(),
26506                },
26507            }
26508        }
26509        /// Allocate the rebuilt node if a setter ran, else
26510        /// `TransformResult::Unchanged`.
26511        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26512            if self.is_changed {
26513                TransformResult::Changed(self.build_forced(gc))
26514            } else {
26515                TransformResult::Unchanged
26516            }
26517        }
26518        /// Allocate the node unconditionally, changed or not.
26519        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26520            gc.alloc(Node::TSTupleType(self.inner))
26521        }
26522        /// Set the `element_types` field and mark the builder changed.
26523        pub fn element_types(&mut self, element_types: NodeList<'gc>) { self.is_changed = true; self.inner.element_types = element_types; }
26524    }
26525    /// Clone-with-changes builder for [`super::TSTypeAssertion`].
26526    #[derive(Debug)]
26527    pub struct TSTypeAssertion<'gc> {
26528        is_changed: bool,
26529        pub(super) inner: super::TSTypeAssertion<'gc>,
26530    }
26531    impl<'gc> TSTypeAssertion<'gc> {
26532        /// Start from a copy of `node`, with no field changed yet.
26533        pub fn from_node(node: &'gc super::TSTypeAssertion<'gc>) -> Self {
26534            Self {
26535                is_changed: false,
26536                inner: super::TSTypeAssertion {
26537                    metadata: node.metadata.duplicate(),
26538                    type_annotation: node.type_annotation.duplicate(),
26539                    expression: node.expression.duplicate(),
26540                },
26541            }
26542        }
26543        /// Allocate the rebuilt node if a setter ran, else
26544        /// `TransformResult::Unchanged`.
26545        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26546            if self.is_changed {
26547                TransformResult::Changed(self.build_forced(gc))
26548            } else {
26549                TransformResult::Unchanged
26550            }
26551        }
26552        /// Allocate the node unconditionally, changed or not.
26553        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26554            gc.alloc(Node::TSTypeAssertion(self.inner))
26555        }
26556        /// Set the `type_annotation` field and mark the builder changed.
26557        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
26558        /// Set the `expression` field and mark the builder changed.
26559        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
26560    }
26561    /// Clone-with-changes builder for [`super::TSAsExpression`].
26562    #[derive(Debug)]
26563    pub struct TSAsExpression<'gc> {
26564        is_changed: bool,
26565        pub(super) inner: super::TSAsExpression<'gc>,
26566    }
26567    impl<'gc> TSAsExpression<'gc> {
26568        /// Start from a copy of `node`, with no field changed yet.
26569        pub fn from_node(node: &'gc super::TSAsExpression<'gc>) -> Self {
26570            Self {
26571                is_changed: false,
26572                inner: super::TSAsExpression {
26573                    metadata: node.metadata.duplicate(),
26574                    expression: node.expression.duplicate(),
26575                    type_annotation: node.type_annotation.duplicate(),
26576                },
26577            }
26578        }
26579        /// Allocate the rebuilt node if a setter ran, else
26580        /// `TransformResult::Unchanged`.
26581        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26582            if self.is_changed {
26583                TransformResult::Changed(self.build_forced(gc))
26584            } else {
26585                TransformResult::Unchanged
26586            }
26587        }
26588        /// Allocate the node unconditionally, changed or not.
26589        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26590            gc.alloc(Node::TSAsExpression(self.inner))
26591        }
26592        /// Set the `expression` field and mark the builder changed.
26593        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
26594        /// Set the `type_annotation` field and mark the builder changed.
26595        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
26596    }
26597    /// Clone-with-changes builder for [`super::TSParameterProperty`].
26598    #[derive(Debug)]
26599    pub struct TSParameterProperty<'gc> {
26600        is_changed: bool,
26601        pub(super) inner: super::TSParameterProperty<'gc>,
26602    }
26603    impl<'gc> TSParameterProperty<'gc> {
26604        /// Start from a copy of `node`, with no field changed yet.
26605        pub fn from_node(node: &'gc super::TSParameterProperty<'gc>) -> Self {
26606            Self {
26607                is_changed: false,
26608                inner: super::TSParameterProperty {
26609                    metadata: node.metadata.duplicate(),
26610                    parameter: node.parameter.duplicate(),
26611                    accessibility: Cell::new(node.accessibility.get()),
26612                    readonly: Cell::new(node.readonly.get()),
26613                    r#static: Cell::new(node.r#static.get()),
26614                    export: Cell::new(node.export.get()),
26615                },
26616            }
26617        }
26618        /// Allocate the rebuilt node if a setter ran, else
26619        /// `TransformResult::Unchanged`.
26620        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26621            if self.is_changed {
26622                TransformResult::Changed(self.build_forced(gc))
26623            } else {
26624                TransformResult::Unchanged
26625            }
26626        }
26627        /// Allocate the node unconditionally, changed or not.
26628        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26629            gc.alloc(Node::TSParameterProperty(self.inner))
26630        }
26631        /// Set the `parameter` field and mark the builder changed.
26632        pub fn parameter(&mut self, parameter: &'gc Node<'gc>) { self.is_changed = true; self.inner.parameter = parameter; }
26633    }
26634    /// Clone-with-changes builder for [`super::TSTypeAliasDeclaration`].
26635    #[derive(Debug)]
26636    pub struct TSTypeAliasDeclaration<'gc> {
26637        is_changed: bool,
26638        pub(super) inner: super::TSTypeAliasDeclaration<'gc>,
26639    }
26640    impl<'gc> TSTypeAliasDeclaration<'gc> {
26641        /// Start from a copy of `node`, with no field changed yet.
26642        pub fn from_node(node: &'gc super::TSTypeAliasDeclaration<'gc>) -> Self {
26643            Self {
26644                is_changed: false,
26645                inner: super::TSTypeAliasDeclaration {
26646                    metadata: node.metadata.duplicate(),
26647                    id: node.id.duplicate(),
26648                    type_parameters: node.type_parameters.duplicate(),
26649                    type_annotation: node.type_annotation.duplicate(),
26650                },
26651            }
26652        }
26653        /// Allocate the rebuilt node if a setter ran, else
26654        /// `TransformResult::Unchanged`.
26655        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26656            if self.is_changed {
26657                TransformResult::Changed(self.build_forced(gc))
26658            } else {
26659                TransformResult::Unchanged
26660            }
26661        }
26662        /// Allocate the node unconditionally, changed or not.
26663        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26664            gc.alloc(Node::TSTypeAliasDeclaration(self.inner))
26665        }
26666        /// Set the `id` field and mark the builder changed.
26667        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
26668        /// Set the `type_parameters` field and mark the builder changed.
26669        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
26670        /// Set the `type_annotation` field and mark the builder changed.
26671        pub fn type_annotation(&mut self, type_annotation: &'gc Node<'gc>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
26672    }
26673    /// Clone-with-changes builder for [`super::TSInterfaceDeclaration`].
26674    #[derive(Debug)]
26675    pub struct TSInterfaceDeclaration<'gc> {
26676        is_changed: bool,
26677        pub(super) inner: super::TSInterfaceDeclaration<'gc>,
26678    }
26679    impl<'gc> TSInterfaceDeclaration<'gc> {
26680        /// Start from a copy of `node`, with no field changed yet.
26681        pub fn from_node(node: &'gc super::TSInterfaceDeclaration<'gc>) -> Self {
26682            Self {
26683                is_changed: false,
26684                inner: super::TSInterfaceDeclaration {
26685                    metadata: node.metadata.duplicate(),
26686                    id: node.id.duplicate(),
26687                    body: node.body.duplicate(),
26688                    extends: node.extends.duplicate(),
26689                    type_parameters: node.type_parameters.duplicate(),
26690                },
26691            }
26692        }
26693        /// Allocate the rebuilt node if a setter ran, else
26694        /// `TransformResult::Unchanged`.
26695        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26696            if self.is_changed {
26697                TransformResult::Changed(self.build_forced(gc))
26698            } else {
26699                TransformResult::Unchanged
26700            }
26701        }
26702        /// Allocate the node unconditionally, changed or not.
26703        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26704            gc.alloc(Node::TSInterfaceDeclaration(self.inner))
26705        }
26706        /// Set the `id` field and mark the builder changed.
26707        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
26708        /// Set the `body` field and mark the builder changed.
26709        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
26710        /// Set the `extends` field and mark the builder changed.
26711        pub fn extends(&mut self, extends: NodeList<'gc>) { self.is_changed = true; self.inner.extends = extends; }
26712        /// Set the `type_parameters` field and mark the builder changed.
26713        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
26714    }
26715    /// Clone-with-changes builder for [`super::TSInterfaceHeritage`].
26716    #[derive(Debug)]
26717    pub struct TSInterfaceHeritage<'gc> {
26718        is_changed: bool,
26719        pub(super) inner: super::TSInterfaceHeritage<'gc>,
26720    }
26721    impl<'gc> TSInterfaceHeritage<'gc> {
26722        /// Start from a copy of `node`, with no field changed yet.
26723        pub fn from_node(node: &'gc super::TSInterfaceHeritage<'gc>) -> Self {
26724            Self {
26725                is_changed: false,
26726                inner: super::TSInterfaceHeritage {
26727                    metadata: node.metadata.duplicate(),
26728                    expression: node.expression.duplicate(),
26729                    type_parameters: node.type_parameters.duplicate(),
26730                },
26731            }
26732        }
26733        /// Allocate the rebuilt node if a setter ran, else
26734        /// `TransformResult::Unchanged`.
26735        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26736            if self.is_changed {
26737                TransformResult::Changed(self.build_forced(gc))
26738            } else {
26739                TransformResult::Unchanged
26740            }
26741        }
26742        /// Allocate the node unconditionally, changed or not.
26743        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26744            gc.alloc(Node::TSInterfaceHeritage(self.inner))
26745        }
26746        /// Set the `expression` field and mark the builder changed.
26747        pub fn expression(&mut self, expression: &'gc Node<'gc>) { self.is_changed = true; self.inner.expression = expression; }
26748        /// Set the `type_parameters` field and mark the builder changed.
26749        pub fn type_parameters(&mut self, type_parameters: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_parameters = type_parameters; }
26750    }
26751    /// Clone-with-changes builder for [`super::TSInterfaceBody`].
26752    #[derive(Debug)]
26753    pub struct TSInterfaceBody<'gc> {
26754        is_changed: bool,
26755        pub(super) inner: super::TSInterfaceBody<'gc>,
26756    }
26757    impl<'gc> TSInterfaceBody<'gc> {
26758        /// Start from a copy of `node`, with no field changed yet.
26759        pub fn from_node(node: &'gc super::TSInterfaceBody<'gc>) -> Self {
26760            Self {
26761                is_changed: false,
26762                inner: super::TSInterfaceBody {
26763                    metadata: node.metadata.duplicate(),
26764                    body: node.body.duplicate(),
26765                },
26766            }
26767        }
26768        /// Allocate the rebuilt node if a setter ran, else
26769        /// `TransformResult::Unchanged`.
26770        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26771            if self.is_changed {
26772                TransformResult::Changed(self.build_forced(gc))
26773            } else {
26774                TransformResult::Unchanged
26775            }
26776        }
26777        /// Allocate the node unconditionally, changed or not.
26778        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26779            gc.alloc(Node::TSInterfaceBody(self.inner))
26780        }
26781        /// Set the `body` field and mark the builder changed.
26782        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
26783    }
26784    /// Clone-with-changes builder for [`super::TSEnumDeclaration`].
26785    #[derive(Debug)]
26786    pub struct TSEnumDeclaration<'gc> {
26787        is_changed: bool,
26788        pub(super) inner: super::TSEnumDeclaration<'gc>,
26789    }
26790    impl<'gc> TSEnumDeclaration<'gc> {
26791        /// Start from a copy of `node`, with no field changed yet.
26792        pub fn from_node(node: &'gc super::TSEnumDeclaration<'gc>) -> Self {
26793            Self {
26794                is_changed: false,
26795                inner: super::TSEnumDeclaration {
26796                    metadata: node.metadata.duplicate(),
26797                    id: node.id.duplicate(),
26798                    members: node.members.duplicate(),
26799                },
26800            }
26801        }
26802        /// Allocate the rebuilt node if a setter ran, else
26803        /// `TransformResult::Unchanged`.
26804        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26805            if self.is_changed {
26806                TransformResult::Changed(self.build_forced(gc))
26807            } else {
26808                TransformResult::Unchanged
26809            }
26810        }
26811        /// Allocate the node unconditionally, changed or not.
26812        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26813            gc.alloc(Node::TSEnumDeclaration(self.inner))
26814        }
26815        /// Set the `id` field and mark the builder changed.
26816        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
26817        /// Set the `members` field and mark the builder changed.
26818        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
26819    }
26820    /// Clone-with-changes builder for [`super::TSEnumMember`].
26821    #[derive(Debug)]
26822    pub struct TSEnumMember<'gc> {
26823        is_changed: bool,
26824        pub(super) inner: super::TSEnumMember<'gc>,
26825    }
26826    impl<'gc> TSEnumMember<'gc> {
26827        /// Start from a copy of `node`, with no field changed yet.
26828        pub fn from_node(node: &'gc super::TSEnumMember<'gc>) -> Self {
26829            Self {
26830                is_changed: false,
26831                inner: super::TSEnumMember {
26832                    metadata: node.metadata.duplicate(),
26833                    id: node.id.duplicate(),
26834                    initializer: node.initializer.duplicate(),
26835                },
26836            }
26837        }
26838        /// Allocate the rebuilt node if a setter ran, else
26839        /// `TransformResult::Unchanged`.
26840        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26841            if self.is_changed {
26842                TransformResult::Changed(self.build_forced(gc))
26843            } else {
26844                TransformResult::Unchanged
26845            }
26846        }
26847        /// Allocate the node unconditionally, changed or not.
26848        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26849            gc.alloc(Node::TSEnumMember(self.inner))
26850        }
26851        /// Set the `id` field and mark the builder changed.
26852        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
26853        /// Set the `initializer` field and mark the builder changed.
26854        pub fn initializer(&mut self, initializer: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.initializer = initializer; }
26855    }
26856    /// Clone-with-changes builder for [`super::TSModuleDeclaration`].
26857    #[derive(Debug)]
26858    pub struct TSModuleDeclaration<'gc> {
26859        is_changed: bool,
26860        pub(super) inner: super::TSModuleDeclaration<'gc>,
26861    }
26862    impl<'gc> TSModuleDeclaration<'gc> {
26863        /// Start from a copy of `node`, with no field changed yet.
26864        pub fn from_node(node: &'gc super::TSModuleDeclaration<'gc>) -> Self {
26865            Self {
26866                is_changed: false,
26867                inner: super::TSModuleDeclaration {
26868                    metadata: node.metadata.duplicate(),
26869                    id: node.id.duplicate(),
26870                    body: node.body.duplicate(),
26871                },
26872            }
26873        }
26874        /// Allocate the rebuilt node if a setter ran, else
26875        /// `TransformResult::Unchanged`.
26876        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26877            if self.is_changed {
26878                TransformResult::Changed(self.build_forced(gc))
26879            } else {
26880                TransformResult::Unchanged
26881            }
26882        }
26883        /// Allocate the node unconditionally, changed or not.
26884        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26885            gc.alloc(Node::TSModuleDeclaration(self.inner))
26886        }
26887        /// Set the `id` field and mark the builder changed.
26888        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
26889        /// Set the `body` field and mark the builder changed.
26890        pub fn body(&mut self, body: &'gc Node<'gc>) { self.is_changed = true; self.inner.body = body; }
26891    }
26892    /// Clone-with-changes builder for [`super::TSModuleBlock`].
26893    #[derive(Debug)]
26894    pub struct TSModuleBlock<'gc> {
26895        is_changed: bool,
26896        pub(super) inner: super::TSModuleBlock<'gc>,
26897    }
26898    impl<'gc> TSModuleBlock<'gc> {
26899        /// Start from a copy of `node`, with no field changed yet.
26900        pub fn from_node(node: &'gc super::TSModuleBlock<'gc>) -> Self {
26901            Self {
26902                is_changed: false,
26903                inner: super::TSModuleBlock {
26904                    metadata: node.metadata.duplicate(),
26905                    body: node.body.duplicate(),
26906                },
26907            }
26908        }
26909        /// Allocate the rebuilt node if a setter ran, else
26910        /// `TransformResult::Unchanged`.
26911        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26912            if self.is_changed {
26913                TransformResult::Changed(self.build_forced(gc))
26914            } else {
26915                TransformResult::Unchanged
26916            }
26917        }
26918        /// Allocate the node unconditionally, changed or not.
26919        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26920            gc.alloc(Node::TSModuleBlock(self.inner))
26921        }
26922        /// Set the `body` field and mark the builder changed.
26923        pub fn body(&mut self, body: NodeList<'gc>) { self.is_changed = true; self.inner.body = body; }
26924    }
26925    /// Clone-with-changes builder for [`super::TSModuleMember`].
26926    #[derive(Debug)]
26927    pub struct TSModuleMember<'gc> {
26928        is_changed: bool,
26929        pub(super) inner: super::TSModuleMember<'gc>,
26930    }
26931    impl<'gc> TSModuleMember<'gc> {
26932        /// Start from a copy of `node`, with no field changed yet.
26933        pub fn from_node(node: &'gc super::TSModuleMember<'gc>) -> Self {
26934            Self {
26935                is_changed: false,
26936                inner: super::TSModuleMember {
26937                    metadata: node.metadata.duplicate(),
26938                    id: node.id.duplicate(),
26939                    initializer: node.initializer.duplicate(),
26940                },
26941            }
26942        }
26943        /// Allocate the rebuilt node if a setter ran, else
26944        /// `TransformResult::Unchanged`.
26945        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26946            if self.is_changed {
26947                TransformResult::Changed(self.build_forced(gc))
26948            } else {
26949                TransformResult::Unchanged
26950            }
26951        }
26952        /// Allocate the node unconditionally, changed or not.
26953        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26954            gc.alloc(Node::TSModuleMember(self.inner))
26955        }
26956        /// Set the `id` field and mark the builder changed.
26957        pub fn id(&mut self, id: &'gc Node<'gc>) { self.is_changed = true; self.inner.id = id; }
26958        /// Set the `initializer` field and mark the builder changed.
26959        pub fn initializer(&mut self, initializer: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.initializer = initializer; }
26960    }
26961    /// Clone-with-changes builder for [`super::TSTypeParameterDeclaration`].
26962    #[derive(Debug)]
26963    pub struct TSTypeParameterDeclaration<'gc> {
26964        is_changed: bool,
26965        pub(super) inner: super::TSTypeParameterDeclaration<'gc>,
26966    }
26967    impl<'gc> TSTypeParameterDeclaration<'gc> {
26968        /// Start from a copy of `node`, with no field changed yet.
26969        pub fn from_node(node: &'gc super::TSTypeParameterDeclaration<'gc>) -> Self {
26970            Self {
26971                is_changed: false,
26972                inner: super::TSTypeParameterDeclaration {
26973                    metadata: node.metadata.duplicate(),
26974                    params: node.params.duplicate(),
26975                },
26976            }
26977        }
26978        /// Allocate the rebuilt node if a setter ran, else
26979        /// `TransformResult::Unchanged`.
26980        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
26981            if self.is_changed {
26982                TransformResult::Changed(self.build_forced(gc))
26983            } else {
26984                TransformResult::Unchanged
26985            }
26986        }
26987        /// Allocate the node unconditionally, changed or not.
26988        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
26989            gc.alloc(Node::TSTypeParameterDeclaration(self.inner))
26990        }
26991        /// Set the `params` field and mark the builder changed.
26992        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
26993    }
26994    /// Clone-with-changes builder for [`super::TSTypeParameter`].
26995    #[derive(Debug)]
26996    pub struct TSTypeParameter<'gc> {
26997        is_changed: bool,
26998        pub(super) inner: super::TSTypeParameter<'gc>,
26999    }
27000    impl<'gc> TSTypeParameter<'gc> {
27001        /// Start from a copy of `node`, with no field changed yet.
27002        pub fn from_node(node: &'gc super::TSTypeParameter<'gc>) -> Self {
27003            Self {
27004                is_changed: false,
27005                inner: super::TSTypeParameter {
27006                    metadata: node.metadata.duplicate(),
27007                    name: node.name.duplicate(),
27008                    constraint: node.constraint.duplicate(),
27009                    default: node.default.duplicate(),
27010                },
27011            }
27012        }
27013        /// Allocate the rebuilt node if a setter ran, else
27014        /// `TransformResult::Unchanged`.
27015        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27016            if self.is_changed {
27017                TransformResult::Changed(self.build_forced(gc))
27018            } else {
27019                TransformResult::Unchanged
27020            }
27021        }
27022        /// Allocate the node unconditionally, changed or not.
27023        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27024            gc.alloc(Node::TSTypeParameter(self.inner))
27025        }
27026        /// Set the `name` field and mark the builder changed.
27027        pub fn name(&mut self, name: &'gc Node<'gc>) { self.is_changed = true; self.inner.name = name; }
27028        /// Set the `constraint` field and mark the builder changed.
27029        pub fn constraint(&mut self, constraint: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.constraint = constraint; }
27030        /// Set the `default` field and mark the builder changed.
27031        pub fn default(&mut self, default: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.default = default; }
27032    }
27033    /// Clone-with-changes builder for [`super::TSTypeParameterInstantiation`].
27034    #[derive(Debug)]
27035    pub struct TSTypeParameterInstantiation<'gc> {
27036        is_changed: bool,
27037        pub(super) inner: super::TSTypeParameterInstantiation<'gc>,
27038    }
27039    impl<'gc> TSTypeParameterInstantiation<'gc> {
27040        /// Start from a copy of `node`, with no field changed yet.
27041        pub fn from_node(node: &'gc super::TSTypeParameterInstantiation<'gc>) -> Self {
27042            Self {
27043                is_changed: false,
27044                inner: super::TSTypeParameterInstantiation {
27045                    metadata: node.metadata.duplicate(),
27046                    params: node.params.duplicate(),
27047                },
27048            }
27049        }
27050        /// Allocate the rebuilt node if a setter ran, else
27051        /// `TransformResult::Unchanged`.
27052        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27053            if self.is_changed {
27054                TransformResult::Changed(self.build_forced(gc))
27055            } else {
27056                TransformResult::Unchanged
27057            }
27058        }
27059        /// Allocate the node unconditionally, changed or not.
27060        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27061            gc.alloc(Node::TSTypeParameterInstantiation(self.inner))
27062        }
27063        /// Set the `params` field and mark the builder changed.
27064        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
27065    }
27066    /// Clone-with-changes builder for [`super::TSUnionType`].
27067    #[derive(Debug)]
27068    pub struct TSUnionType<'gc> {
27069        is_changed: bool,
27070        pub(super) inner: super::TSUnionType<'gc>,
27071    }
27072    impl<'gc> TSUnionType<'gc> {
27073        /// Start from a copy of `node`, with no field changed yet.
27074        pub fn from_node(node: &'gc super::TSUnionType<'gc>) -> Self {
27075            Self {
27076                is_changed: false,
27077                inner: super::TSUnionType {
27078                    metadata: node.metadata.duplicate(),
27079                    types: node.types.duplicate(),
27080                },
27081            }
27082        }
27083        /// Allocate the rebuilt node if a setter ran, else
27084        /// `TransformResult::Unchanged`.
27085        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27086            if self.is_changed {
27087                TransformResult::Changed(self.build_forced(gc))
27088            } else {
27089                TransformResult::Unchanged
27090            }
27091        }
27092        /// Allocate the node unconditionally, changed or not.
27093        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27094            gc.alloc(Node::TSUnionType(self.inner))
27095        }
27096        /// Set the `types` field and mark the builder changed.
27097        pub fn types(&mut self, types: NodeList<'gc>) { self.is_changed = true; self.inner.types = types; }
27098    }
27099    /// Clone-with-changes builder for [`super::TSIntersectionType`].
27100    #[derive(Debug)]
27101    pub struct TSIntersectionType<'gc> {
27102        is_changed: bool,
27103        pub(super) inner: super::TSIntersectionType<'gc>,
27104    }
27105    impl<'gc> TSIntersectionType<'gc> {
27106        /// Start from a copy of `node`, with no field changed yet.
27107        pub fn from_node(node: &'gc super::TSIntersectionType<'gc>) -> Self {
27108            Self {
27109                is_changed: false,
27110                inner: super::TSIntersectionType {
27111                    metadata: node.metadata.duplicate(),
27112                    types: node.types.duplicate(),
27113                },
27114            }
27115        }
27116        /// Allocate the rebuilt node if a setter ran, else
27117        /// `TransformResult::Unchanged`.
27118        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27119            if self.is_changed {
27120                TransformResult::Changed(self.build_forced(gc))
27121            } else {
27122                TransformResult::Unchanged
27123            }
27124        }
27125        /// Allocate the node unconditionally, changed or not.
27126        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27127            gc.alloc(Node::TSIntersectionType(self.inner))
27128        }
27129        /// Set the `types` field and mark the builder changed.
27130        pub fn types(&mut self, types: NodeList<'gc>) { self.is_changed = true; self.inner.types = types; }
27131    }
27132    /// Clone-with-changes builder for [`super::TSTypeQuery`].
27133    #[derive(Debug)]
27134    pub struct TSTypeQuery<'gc> {
27135        is_changed: bool,
27136        pub(super) inner: super::TSTypeQuery<'gc>,
27137    }
27138    impl<'gc> TSTypeQuery<'gc> {
27139        /// Start from a copy of `node`, with no field changed yet.
27140        pub fn from_node(node: &'gc super::TSTypeQuery<'gc>) -> Self {
27141            Self {
27142                is_changed: false,
27143                inner: super::TSTypeQuery {
27144                    metadata: node.metadata.duplicate(),
27145                    expr_name: node.expr_name.duplicate(),
27146                },
27147            }
27148        }
27149        /// Allocate the rebuilt node if a setter ran, else
27150        /// `TransformResult::Unchanged`.
27151        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27152            if self.is_changed {
27153                TransformResult::Changed(self.build_forced(gc))
27154            } else {
27155                TransformResult::Unchanged
27156            }
27157        }
27158        /// Allocate the node unconditionally, changed or not.
27159        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27160            gc.alloc(Node::TSTypeQuery(self.inner))
27161        }
27162        /// Set the `expr_name` field and mark the builder changed.
27163        pub fn expr_name(&mut self, expr_name: &'gc Node<'gc>) { self.is_changed = true; self.inner.expr_name = expr_name; }
27164    }
27165    /// Clone-with-changes builder for [`super::TSConditionalType`].
27166    #[derive(Debug)]
27167    pub struct TSConditionalType<'gc> {
27168        is_changed: bool,
27169        pub(super) inner: super::TSConditionalType<'gc>,
27170    }
27171    impl<'gc> TSConditionalType<'gc> {
27172        /// Start from a copy of `node`, with no field changed yet.
27173        pub fn from_node(node: &'gc super::TSConditionalType<'gc>) -> Self {
27174            Self {
27175                is_changed: false,
27176                inner: super::TSConditionalType {
27177                    metadata: node.metadata.duplicate(),
27178                    check_type: node.check_type.duplicate(),
27179                    extends_type: node.extends_type.duplicate(),
27180                    true_type: node.true_type.duplicate(),
27181                    false_type: node.false_type.duplicate(),
27182                },
27183            }
27184        }
27185        /// Allocate the rebuilt node if a setter ran, else
27186        /// `TransformResult::Unchanged`.
27187        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27188            if self.is_changed {
27189                TransformResult::Changed(self.build_forced(gc))
27190            } else {
27191                TransformResult::Unchanged
27192            }
27193        }
27194        /// Allocate the node unconditionally, changed or not.
27195        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27196            gc.alloc(Node::TSConditionalType(self.inner))
27197        }
27198        /// Set the `check_type` field and mark the builder changed.
27199        pub fn check_type(&mut self, check_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.check_type = check_type; }
27200        /// Set the `extends_type` field and mark the builder changed.
27201        pub fn extends_type(&mut self, extends_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.extends_type = extends_type; }
27202        /// Set the `true_type` field and mark the builder changed.
27203        pub fn true_type(&mut self, true_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.true_type = true_type; }
27204        /// Set the `false_type` field and mark the builder changed.
27205        pub fn false_type(&mut self, false_type: &'gc Node<'gc>) { self.is_changed = true; self.inner.false_type = false_type; }
27206    }
27207    /// Clone-with-changes builder for [`super::TSTypeLiteral`].
27208    #[derive(Debug)]
27209    pub struct TSTypeLiteral<'gc> {
27210        is_changed: bool,
27211        pub(super) inner: super::TSTypeLiteral<'gc>,
27212    }
27213    impl<'gc> TSTypeLiteral<'gc> {
27214        /// Start from a copy of `node`, with no field changed yet.
27215        pub fn from_node(node: &'gc super::TSTypeLiteral<'gc>) -> Self {
27216            Self {
27217                is_changed: false,
27218                inner: super::TSTypeLiteral {
27219                    metadata: node.metadata.duplicate(),
27220                    members: node.members.duplicate(),
27221                },
27222            }
27223        }
27224        /// Allocate the rebuilt node if a setter ran, else
27225        /// `TransformResult::Unchanged`.
27226        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27227            if self.is_changed {
27228                TransformResult::Changed(self.build_forced(gc))
27229            } else {
27230                TransformResult::Unchanged
27231            }
27232        }
27233        /// Allocate the node unconditionally, changed or not.
27234        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27235            gc.alloc(Node::TSTypeLiteral(self.inner))
27236        }
27237        /// Set the `members` field and mark the builder changed.
27238        pub fn members(&mut self, members: NodeList<'gc>) { self.is_changed = true; self.inner.members = members; }
27239    }
27240    /// Clone-with-changes builder for [`super::TSPropertySignature`].
27241    #[derive(Debug)]
27242    pub struct TSPropertySignature<'gc> {
27243        is_changed: bool,
27244        pub(super) inner: super::TSPropertySignature<'gc>,
27245    }
27246    impl<'gc> TSPropertySignature<'gc> {
27247        /// Start from a copy of `node`, with no field changed yet.
27248        pub fn from_node(node: &'gc super::TSPropertySignature<'gc>) -> Self {
27249            Self {
27250                is_changed: false,
27251                inner: super::TSPropertySignature {
27252                    metadata: node.metadata.duplicate(),
27253                    key: node.key.duplicate(),
27254                    type_annotation: node.type_annotation.duplicate(),
27255                    initializer: node.initializer.duplicate(),
27256                    optional: Cell::new(node.optional.get()),
27257                    computed: Cell::new(node.computed.get()),
27258                    readonly: Cell::new(node.readonly.get()),
27259                    r#static: Cell::new(node.r#static.get()),
27260                    export: Cell::new(node.export.get()),
27261                },
27262            }
27263        }
27264        /// Allocate the rebuilt node if a setter ran, else
27265        /// `TransformResult::Unchanged`.
27266        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27267            if self.is_changed {
27268                TransformResult::Changed(self.build_forced(gc))
27269            } else {
27270                TransformResult::Unchanged
27271            }
27272        }
27273        /// Allocate the node unconditionally, changed or not.
27274        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27275            gc.alloc(Node::TSPropertySignature(self.inner))
27276        }
27277        /// Set the `key` field and mark the builder changed.
27278        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
27279        /// Set the `type_annotation` field and mark the builder changed.
27280        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
27281        /// Set the `initializer` field and mark the builder changed.
27282        pub fn initializer(&mut self, initializer: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.initializer = initializer; }
27283    }
27284    /// Clone-with-changes builder for [`super::TSMethodSignature`].
27285    #[derive(Debug)]
27286    pub struct TSMethodSignature<'gc> {
27287        is_changed: bool,
27288        pub(super) inner: super::TSMethodSignature<'gc>,
27289    }
27290    impl<'gc> TSMethodSignature<'gc> {
27291        /// Start from a copy of `node`, with no field changed yet.
27292        pub fn from_node(node: &'gc super::TSMethodSignature<'gc>) -> Self {
27293            Self {
27294                is_changed: false,
27295                inner: super::TSMethodSignature {
27296                    metadata: node.metadata.duplicate(),
27297                    key: node.key.duplicate(),
27298                    params: node.params.duplicate(),
27299                    return_type: node.return_type.duplicate(),
27300                    computed: Cell::new(node.computed.get()),
27301                },
27302            }
27303        }
27304        /// Allocate the rebuilt node if a setter ran, else
27305        /// `TransformResult::Unchanged`.
27306        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27307            if self.is_changed {
27308                TransformResult::Changed(self.build_forced(gc))
27309            } else {
27310                TransformResult::Unchanged
27311            }
27312        }
27313        /// Allocate the node unconditionally, changed or not.
27314        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27315            gc.alloc(Node::TSMethodSignature(self.inner))
27316        }
27317        /// Set the `key` field and mark the builder changed.
27318        pub fn key(&mut self, key: &'gc Node<'gc>) { self.is_changed = true; self.inner.key = key; }
27319        /// Set the `params` field and mark the builder changed.
27320        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
27321        /// Set the `return_type` field and mark the builder changed.
27322        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
27323    }
27324    /// Clone-with-changes builder for [`super::TSIndexSignature`].
27325    #[derive(Debug)]
27326    pub struct TSIndexSignature<'gc> {
27327        is_changed: bool,
27328        pub(super) inner: super::TSIndexSignature<'gc>,
27329    }
27330    impl<'gc> TSIndexSignature<'gc> {
27331        /// Start from a copy of `node`, with no field changed yet.
27332        pub fn from_node(node: &'gc super::TSIndexSignature<'gc>) -> Self {
27333            Self {
27334                is_changed: false,
27335                inner: super::TSIndexSignature {
27336                    metadata: node.metadata.duplicate(),
27337                    parameters: node.parameters.duplicate(),
27338                    type_annotation: node.type_annotation.duplicate(),
27339                },
27340            }
27341        }
27342        /// Allocate the rebuilt node if a setter ran, else
27343        /// `TransformResult::Unchanged`.
27344        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27345            if self.is_changed {
27346                TransformResult::Changed(self.build_forced(gc))
27347            } else {
27348                TransformResult::Unchanged
27349            }
27350        }
27351        /// Allocate the node unconditionally, changed or not.
27352        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27353            gc.alloc(Node::TSIndexSignature(self.inner))
27354        }
27355        /// Set the `parameters` field and mark the builder changed.
27356        pub fn parameters(&mut self, parameters: NodeList<'gc>) { self.is_changed = true; self.inner.parameters = parameters; }
27357        /// Set the `type_annotation` field and mark the builder changed.
27358        pub fn type_annotation(&mut self, type_annotation: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.type_annotation = type_annotation; }
27359    }
27360    /// Clone-with-changes builder for [`super::TSCallSignatureDeclaration`].
27361    #[derive(Debug)]
27362    pub struct TSCallSignatureDeclaration<'gc> {
27363        is_changed: bool,
27364        pub(super) inner: super::TSCallSignatureDeclaration<'gc>,
27365    }
27366    impl<'gc> TSCallSignatureDeclaration<'gc> {
27367        /// Start from a copy of `node`, with no field changed yet.
27368        pub fn from_node(node: &'gc super::TSCallSignatureDeclaration<'gc>) -> Self {
27369            Self {
27370                is_changed: false,
27371                inner: super::TSCallSignatureDeclaration {
27372                    metadata: node.metadata.duplicate(),
27373                    params: node.params.duplicate(),
27374                    return_type: node.return_type.duplicate(),
27375                },
27376            }
27377        }
27378        /// Allocate the rebuilt node if a setter ran, else
27379        /// `TransformResult::Unchanged`.
27380        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27381            if self.is_changed {
27382                TransformResult::Changed(self.build_forced(gc))
27383            } else {
27384                TransformResult::Unchanged
27385            }
27386        }
27387        /// Allocate the node unconditionally, changed or not.
27388        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27389            gc.alloc(Node::TSCallSignatureDeclaration(self.inner))
27390        }
27391        /// Set the `params` field and mark the builder changed.
27392        pub fn params(&mut self, params: NodeList<'gc>) { self.is_changed = true; self.inner.params = params; }
27393        /// Set the `return_type` field and mark the builder changed.
27394        pub fn return_type(&mut self, return_type: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.return_type = return_type; }
27395    }
27396    /// Clone-with-changes builder for [`super::TSModifiers`].
27397    #[derive(Debug)]
27398    pub struct TSModifiers<'gc> {
27399        is_changed: bool,
27400        pub(super) inner: super::TSModifiers<'gc>,
27401    }
27402    impl<'gc> TSModifiers<'gc> {
27403        /// Start from a copy of `node`, with no field changed yet.
27404        pub fn from_node(node: &'gc super::TSModifiers<'gc>) -> Self {
27405            Self {
27406                is_changed: false,
27407                inner: super::TSModifiers {
27408                    metadata: node.metadata.duplicate(),
27409                    accessibility: Cell::new(node.accessibility.get()),
27410                    readonly: Cell::new(node.readonly.get()),
27411                },
27412            }
27413        }
27414        /// Allocate the rebuilt node if a setter ran, else
27415        /// `TransformResult::Unchanged`.
27416        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27417            if self.is_changed {
27418                TransformResult::Changed(self.build_forced(gc))
27419            } else {
27420                TransformResult::Unchanged
27421            }
27422        }
27423        /// Allocate the node unconditionally, changed or not.
27424        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27425            gc.alloc(Node::TSModifiers(self.inner))
27426        }
27427    }
27428    /// Clone-with-changes builder for [`super::CoverEmptyArgs`].
27429    #[derive(Debug)]
27430    pub struct CoverEmptyArgs<'gc> {
27431        is_changed: bool,
27432        pub(super) inner: super::CoverEmptyArgs<'gc>,
27433    }
27434    impl<'gc> CoverEmptyArgs<'gc> {
27435        /// Start from a copy of `node`, with no field changed yet.
27436        pub fn from_node(node: &'gc super::CoverEmptyArgs<'gc>) -> Self {
27437            Self {
27438                is_changed: false,
27439                inner: super::CoverEmptyArgs {
27440                    metadata: node.metadata.duplicate(),
27441                },
27442            }
27443        }
27444        /// Allocate the rebuilt node if a setter ran, else
27445        /// `TransformResult::Unchanged`.
27446        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27447            if self.is_changed {
27448                TransformResult::Changed(self.build_forced(gc))
27449            } else {
27450                TransformResult::Unchanged
27451            }
27452        }
27453        /// Allocate the node unconditionally, changed or not.
27454        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27455            gc.alloc(Node::CoverEmptyArgs(self.inner))
27456        }
27457    }
27458    /// Clone-with-changes builder for [`super::CoverTrailingComma`].
27459    #[derive(Debug)]
27460    pub struct CoverTrailingComma<'gc> {
27461        is_changed: bool,
27462        pub(super) inner: super::CoverTrailingComma<'gc>,
27463    }
27464    impl<'gc> CoverTrailingComma<'gc> {
27465        /// Start from a copy of `node`, with no field changed yet.
27466        pub fn from_node(node: &'gc super::CoverTrailingComma<'gc>) -> Self {
27467            Self {
27468                is_changed: false,
27469                inner: super::CoverTrailingComma {
27470                    metadata: node.metadata.duplicate(),
27471                },
27472            }
27473        }
27474        /// Allocate the rebuilt node if a setter ran, else
27475        /// `TransformResult::Unchanged`.
27476        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27477            if self.is_changed {
27478                TransformResult::Changed(self.build_forced(gc))
27479            } else {
27480                TransformResult::Unchanged
27481            }
27482        }
27483        /// Allocate the node unconditionally, changed or not.
27484        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27485            gc.alloc(Node::CoverTrailingComma(self.inner))
27486        }
27487    }
27488    /// Clone-with-changes builder for [`super::CoverInitializer`].
27489    #[derive(Debug)]
27490    pub struct CoverInitializer<'gc> {
27491        is_changed: bool,
27492        pub(super) inner: super::CoverInitializer<'gc>,
27493    }
27494    impl<'gc> CoverInitializer<'gc> {
27495        /// Start from a copy of `node`, with no field changed yet.
27496        pub fn from_node(node: &'gc super::CoverInitializer<'gc>) -> Self {
27497            Self {
27498                is_changed: false,
27499                inner: super::CoverInitializer {
27500                    metadata: node.metadata.duplicate(),
27501                    init: node.init.duplicate(),
27502                },
27503            }
27504        }
27505        /// Allocate the rebuilt node if a setter ran, else
27506        /// `TransformResult::Unchanged`.
27507        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27508            if self.is_changed {
27509                TransformResult::Changed(self.build_forced(gc))
27510            } else {
27511                TransformResult::Unchanged
27512            }
27513        }
27514        /// Allocate the node unconditionally, changed or not.
27515        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27516            gc.alloc(Node::CoverInitializer(self.inner))
27517        }
27518        /// Set the `init` field and mark the builder changed.
27519        pub fn init(&mut self, init: &'gc Node<'gc>) { self.is_changed = true; self.inner.init = init; }
27520    }
27521    /// Clone-with-changes builder for [`super::CoverRestElement`].
27522    #[derive(Debug)]
27523    pub struct CoverRestElement<'gc> {
27524        is_changed: bool,
27525        pub(super) inner: super::CoverRestElement<'gc>,
27526    }
27527    impl<'gc> CoverRestElement<'gc> {
27528        /// Start from a copy of `node`, with no field changed yet.
27529        pub fn from_node(node: &'gc super::CoverRestElement<'gc>) -> Self {
27530            Self {
27531                is_changed: false,
27532                inner: super::CoverRestElement {
27533                    metadata: node.metadata.duplicate(),
27534                    rest: node.rest.duplicate(),
27535                },
27536            }
27537        }
27538        /// Allocate the rebuilt node if a setter ran, else
27539        /// `TransformResult::Unchanged`.
27540        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27541            if self.is_changed {
27542                TransformResult::Changed(self.build_forced(gc))
27543            } else {
27544                TransformResult::Unchanged
27545            }
27546        }
27547        /// Allocate the node unconditionally, changed or not.
27548        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27549            gc.alloc(Node::CoverRestElement(self.inner))
27550        }
27551        /// Set the `rest` field and mark the builder changed.
27552        pub fn rest(&mut self, rest: &'gc Node<'gc>) { self.is_changed = true; self.inner.rest = rest; }
27553    }
27554    /// Clone-with-changes builder for [`super::CoverTypedIdentifier`].
27555    #[derive(Debug)]
27556    pub struct CoverTypedIdentifier<'gc> {
27557        is_changed: bool,
27558        pub(super) inner: super::CoverTypedIdentifier<'gc>,
27559    }
27560    impl<'gc> CoverTypedIdentifier<'gc> {
27561        /// Start from a copy of `node`, with no field changed yet.
27562        pub fn from_node(node: &'gc super::CoverTypedIdentifier<'gc>) -> Self {
27563            Self {
27564                is_changed: false,
27565                inner: super::CoverTypedIdentifier {
27566                    metadata: node.metadata.duplicate(),
27567                    left: node.left.duplicate(),
27568                    right: node.right.duplicate(),
27569                    optional: Cell::new(node.optional.get()),
27570                },
27571            }
27572        }
27573        /// Allocate the rebuilt node if a setter ran, else
27574        /// `TransformResult::Unchanged`.
27575        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27576            if self.is_changed {
27577                TransformResult::Changed(self.build_forced(gc))
27578            } else {
27579                TransformResult::Unchanged
27580            }
27581        }
27582        /// Allocate the node unconditionally, changed or not.
27583        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27584            gc.alloc(Node::CoverTypedIdentifier(self.inner))
27585        }
27586        /// Set the `left` field and mark the builder changed.
27587        pub fn left(&mut self, left: &'gc Node<'gc>) { self.is_changed = true; self.inner.left = left; }
27588        /// Set the `right` field and mark the builder changed.
27589        pub fn right(&mut self, right: Option<&'gc Node<'gc>>) { self.is_changed = true; self.inner.right = right; }
27590    }
27591    /// Clone-with-changes builder for [`super::SHBuiltin`].
27592    #[derive(Debug)]
27593    pub struct SHBuiltin<'gc> {
27594        is_changed: bool,
27595        pub(super) inner: super::SHBuiltin<'gc>,
27596    }
27597    impl<'gc> SHBuiltin<'gc> {
27598        /// Start from a copy of `node`, with no field changed yet.
27599        pub fn from_node(node: &'gc super::SHBuiltin<'gc>) -> Self {
27600            Self {
27601                is_changed: false,
27602                inner: super::SHBuiltin {
27603                    metadata: node.metadata.duplicate(),
27604                },
27605            }
27606        }
27607        /// Allocate the rebuilt node if a setter ran, else
27608        /// `TransformResult::Unchanged`.
27609        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27610            if self.is_changed {
27611                TransformResult::Changed(self.build_forced(gc))
27612            } else {
27613                TransformResult::Unchanged
27614            }
27615        }
27616        /// Allocate the node unconditionally, changed or not.
27617        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27618            gc.alloc(Node::SHBuiltin(self.inner))
27619        }
27620    }
27621    /// Clone-with-changes builder for [`super::ImplicitCheckedCast`].
27622    #[derive(Debug)]
27623    pub struct ImplicitCheckedCast<'gc> {
27624        is_changed: bool,
27625        pub(super) inner: super::ImplicitCheckedCast<'gc>,
27626    }
27627    impl<'gc> ImplicitCheckedCast<'gc> {
27628        /// Start from a copy of `node`, with no field changed yet.
27629        pub fn from_node(node: &'gc super::ImplicitCheckedCast<'gc>) -> Self {
27630            Self {
27631                is_changed: false,
27632                inner: super::ImplicitCheckedCast {
27633                    metadata: node.metadata.duplicate(),
27634                    argument: node.argument.duplicate(),
27635                },
27636            }
27637        }
27638        /// Allocate the rebuilt node if a setter ran, else
27639        /// `TransformResult::Unchanged`.
27640        pub fn build(self, gc: &'gc crate::context::GCLock<'_, '_>) -> TransformResult<&'gc Node<'gc>> {
27641            if self.is_changed {
27642                TransformResult::Changed(self.build_forced(gc))
27643            } else {
27644                TransformResult::Unchanged
27645            }
27646        }
27647        /// Allocate the node unconditionally, changed or not.
27648        pub fn build_forced(self, gc: &'gc crate::context::GCLock<'_, '_>) -> &'gc Node<'gc> {
27649            gc.alloc(Node::ImplicitCheckedCast(self.inner))
27650        }
27651        /// Set the `argument` field and mark the builder changed.
27652        pub fn argument(&mut self, argument: &'gc Node<'gc>) { self.is_changed = true; self.inner.argument = argument; }
27653    }
27654}