Skip to main content

ClassExpression

Struct ClassExpression 

Source
#[repr(C)]
pub struct ClassExpression<'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 ClassExpression 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> ClassExpression<'gc>

Source

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 ClassExpression from its metadata and ESTree.def fields. Decoration fields start at their defaults.

Trait Implementations§

Source§

impl<'gc> Debug for ClassExpression<'gc>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'gc> !Freeze for ClassExpression<'gc>

§

impl<'gc> !RefUnwindSafe for ClassExpression<'gc>

§

impl<'gc> !Send for ClassExpression<'gc>

§

impl<'gc> !Sync for ClassExpression<'gc>

§

impl<'gc> !UnwindSafe for ClassExpression<'gc>

§

impl<'gc> Unpin for ClassExpression<'gc>

§

impl<'gc> UnsafeUnpin for ClassExpression<'gc>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.