pub struct Class {
pub name: Option<Ident>,
pub super_class: Option<Box<Expr>>,
pub elements: Vec<ClassElement>,
pub span: Span,
pub body_end: Position,
}Expand description
A class body.
Fields§
§name: Option<Ident>Class name: required for declarations, optional for expressions.
super_class: Option<Box<Expr>>extends clause.
elements: Vec<ClassElement>Members, in source order.
span: SpanSource range.
body_end: PositionThe closing } of the body.
A class that writes no constructor still gets one, and the reference creates that
synthetic function at the closing brace: js_parse_class_default_ctor runs with
the } as its current token and hands s->token.ptr to js_new_function_def. The
position is the function’s own source_pos, which is the first entry of its
line table — so class B extends BigInt {} constructed as new B(1) reports its
frame at the }, not at class. span.end cannot stand in: it is one past the
brace, and the brace may be the last character of a line.
Trait Implementations§
impl StructuralPartialEq for Class
Auto Trait Implementations§
impl Forget for Class
impl Freeze for Classwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const Expr is !null: Freeze,
PhantomData<Expr>: Freeze,
PhantomData<ClassElement>: Freeze,
impl Move for Class
impl RefUnwindSafe for Class
impl Send for Classwhere
RawVecInner: Send,
BoxRaw<Expr>: Send,
BoxRaw<Function>: Send,
BoxRaw<Stmt>: Send,
BoxRaw<RestElement>: Send,
BoxRaw<Pattern>: Send,
BoxRaw<MemberPattern>: Send,
BoxRaw<Class>: Send,
BoxRaw<ImportDecl>: Send,
BoxRaw<ExportDecl>: Send,
impl Sync for Classwhere
RawVecInner: Sync,
BoxRaw<Expr>: Sync,
BoxRaw<Function>: Sync,
BoxRaw<Stmt>: Sync,
BoxRaw<RestElement>: Sync,
BoxRaw<Pattern>: Sync,
BoxRaw<MemberPattern>: Sync,
BoxRaw<Class>: Sync,
BoxRaw<ImportDecl>: Sync,
BoxRaw<ExportDecl>: Sync,
impl Unpin for Class
impl UnsafeUnpin for Classwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const Expr is !null: UnsafeUnpin,
PhantomData<Expr>: UnsafeUnpin,
PhantomData<ClassElement>: UnsafeUnpin,
impl UnwindSafe for Classwhere
RawVecInner: UnwindSafe,
BoxRaw<Expr>: UnwindSafe,
BoxRaw<Function>: UnwindSafe,
BoxRaw<Stmt>: UnwindSafe,
BoxRaw<RestElement>: UnwindSafe,
BoxRaw<Pattern>: UnwindSafe,
BoxRaw<MemberPattern>: UnwindSafe,
BoxRaw<Class>: UnwindSafe,
BoxRaw<ImportDecl>: UnwindSafe,
BoxRaw<ExportDecl>: UnwindSafe,
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