pub struct Reference {
pub base: ReferenceBase,
pub referenced_name: String,
pub strict: bool,
pub this_value: Option<JsValue>,
}Expand description
Reference type. Used for identifier resolution and property access.
Fields§
§base: ReferenceBaseThe base value (object or environment).
referenced_name: StringThe referenced name (property name or identifier).
strict: boolWhether this is a strict mode reference.
this_value: Option<JsValue>The this value for super references.
Implementations§
Source§impl Reference
impl Reference
Sourcepub fn property(base: JsValue, name: impl Into<String>, strict: bool) -> Self
pub fn property(base: JsValue, name: impl Into<String>, strict: bool) -> Self
Create a new reference to a property on an object.
Sourcepub fn environment(
env_name: impl Into<String>,
binding_name: impl Into<String>,
strict: bool,
) -> Self
pub fn environment( env_name: impl Into<String>, binding_name: impl Into<String>, strict: bool, ) -> Self
Create a new reference to an environment binding.
Sourcepub fn unresolvable(name: impl Into<String>, strict: bool) -> Self
pub fn unresolvable(name: impl Into<String>, strict: bool) -> Self
Create an unresolvable reference.
Sourcepub fn has_primitive_base(&self) -> bool
pub fn has_primitive_base(&self) -> bool
Check if this reference has a primitive base.
Sourcepub fn is_property_reference(&self) -> bool
pub fn is_property_reference(&self) -> bool
Check if this is a property reference.
Sourcepub fn is_unresolvable(&self) -> bool
pub fn is_unresolvable(&self) -> bool
Check if this reference is unresolvable.
Sourcepub fn is_super_reference(&self) -> bool
pub fn is_super_reference(&self) -> bool
Check if this is a super reference.
Sourcepub fn get_this_value(&self) -> JsValue
pub fn get_this_value(&self) -> JsValue
Get the this value for method calls.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reference
impl !RefUnwindSafe for Reference
impl !Send for Reference
impl !Sync for Reference
impl Unpin for Reference
impl !UnwindSafe for Reference
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