pub(crate) struct Scope<'a> {
Show 23 fields parent: Option<&'a Scope<'a>>, kind: ScopeKind, pub declaring: Vec<Id>, pub declaring_parameters: Vec<Id>, pub declared_return_type: Option<Type>, pub declaring_type_params: FxHashSet<Id>, pub(super) vars: FxHashMap<Id, VarInfo>, types: FxHashMap<Id, Type>, pub(super) facts: CondFacts, pub(super) declaring_fn: Option<Id>, pub(super) declaring_prop: Option<Id>, pub(super) this: Option<Type>, pub(super) this_class_name: Option<Id>, pub(super) this_class_members: Vec<(usize, ClassMember)>, pub(super) this_object_members: Vec<TypeElement>, pub(super) super_class: Option<Box<Type>>, pub(super) return_values: ReturnValues, expand_triage_depth: u8, pub(super) is_call_arg_count_unknown: bool, pub(super) type_params: FxHashMap<Id, Type>, pub(super) cur_module_name: Option<Id>, pub(super) class: ClassState, pub(super) destructure_vars: FxHashMap<DestructureId, Type>,
}

Fields

parent: Option<&'a Scope<'a>>kind: ScopeKinddeclaring: Vec<Id>declaring_parameters: Vec<Id>declared_return_type: Option<Type>declaring_type_params: FxHashSet<Id>vars: FxHashMap<Id, VarInfo>types: FxHashMap<Id, Type>facts: CondFactsdeclaring_fn: Option<Id>declaring_prop: Option<Id>

Some while declaring a class property or a property of an object literal.

this: Option<Type>this_class_name: Option<Id>

Used while validating super class and static class properties. Otherwise None.

Required to handle static properties.

this_class_members: Vec<(usize, ClassMember)>

Only contains instance members.

The value of usize should be ignored by methods except Validate<Class>

this_object_members: Vec<TypeElement>super_class: Option<Box<Type>>return_values: ReturnValuesexpand_triage_depth: u8

0 if we are not trying to expand it.

is_call_arg_count_unknown: bool

Used to handle ...any in calls.

type_params: FxHashMap<Id, Type>cur_module_name: Option<Id>

If two modules have same name, the latter can reference exported members from other modules.

It means we need a way to know which module we are in, and this field is used to store module name.

class: ClassState

All states related to validation of a class.

destructure_vars: FxHashMap<DestructureId, Type>

Save All destructure state

Implementations

If filter returns Some, this method returns it.

If filter returns Some, this method returns it.

Get scope of computed property names.

Returns true if a scope exists for storing

Get members of current class.

Get members of the current object literal.

This method does not search for parent scope.

Add a type to the scope.

Returns true if this (from javascript) is a reference to an object literal.

Returns true if this (from javascript) is a reference to a class.

This method does not handle imported types.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more