#[repr(C)]pub struct ClassDeclaration<'gc> {
pub metadata: NodeMetadata<'gc>,
pub id: Option<&'gc Node<'gc>>,
pub type_parameters: Option<&'gc Node<'gc>>,
pub super_class: Option<&'gc Node<'gc>>,
pub super_type_arguments: Option<&'gc Node<'gc>>,
pub implements: NodeList<'gc>,
pub decorators: NodeList<'gc>,
pub body: &'gc Node<'gc>,
pub scope: Cell<Option<SemaId>>,
pub implicit_ctor_function_info: Cell<Option<SemaId>>,
pub instance_elements_init_function_info: Cell<Option<SemaId>>,
pub static_elements_init_function_info: Cell<Option<SemaId>>,
}Expand description
The ClassDeclaration AST node.
Fields§
§metadata: NodeMetadata<'gc>Source range, debug location, paren count, and node id.
id: Option<&'gc Node<'gc>>ESTree id property.
type_parameters: Option<&'gc Node<'gc>>ESTree typeParameters property.
super_class: Option<&'gc Node<'gc>>ESTree superClass property.
super_type_arguments: Option<&'gc Node<'gc>>ESTree superTypeArguments property.
implements: NodeList<'gc>ESTree implements property.
decorators: NodeList<'gc>ESTree decorators property.
body: &'gc Node<'gc>ESTree body property.
scope: Cell<Option<SemaId>>Sema: the lexical scope created by this node, if any.
implicit_ctor_function_info: Cell<Option<SemaId>>Sema: FunctionInfo of the synthetic implicit constructor, if the
class has one.
instance_elements_init_function_info: Cell<Option<SemaId>>Sema: FunctionInfo of the synthetic function that initializes the
instance elements, if the class needs one.
static_elements_init_function_info: Cell<Option<SemaId>>Sema: FunctionInfo of the synthetic function that runs the static
field initializers, if the class has any.
Implementations§
Source§impl<'gc> ClassDeclaration<'gc>
impl<'gc> ClassDeclaration<'gc>
Sourcepub fn new(
metadata: NodeMetadata<'gc>,
id: Option<&'gc Node<'gc>>,
type_parameters: Option<&'gc Node<'gc>>,
super_class: Option<&'gc Node<'gc>>,
super_type_arguments: Option<&'gc Node<'gc>>,
implements: NodeList<'gc>,
decorators: NodeList<'gc>,
body: &'gc Node<'gc>,
) -> Self
pub fn new( metadata: NodeMetadata<'gc>, id: Option<&'gc Node<'gc>>, type_parameters: Option<&'gc Node<'gc>>, super_class: Option<&'gc Node<'gc>>, super_type_arguments: Option<&'gc Node<'gc>>, implements: NodeList<'gc>, decorators: NodeList<'gc>, body: &'gc Node<'gc>, ) -> Self
Build ClassDeclaration from its metadata and ESTree.def fields.
Decoration fields start at their defaults.
Trait Implementations§
Auto Trait Implementations§
impl<'gc> !Freeze for ClassDeclaration<'gc>
impl<'gc> !RefUnwindSafe for ClassDeclaration<'gc>
impl<'gc> !Send for ClassDeclaration<'gc>
impl<'gc> !Sync for ClassDeclaration<'gc>
impl<'gc> !UnwindSafe for ClassDeclaration<'gc>
impl<'gc> Unpin for ClassDeclaration<'gc>
impl<'gc> UnsafeUnpin for ClassDeclaration<'gc>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more