[][src]Struct boa::builtins::object::Object

pub struct Object {
    pub kind: ObjectKind,
    pub internal_slots: Box<HashMap<String, Value>>,
    pub properties: Box<HashMap<String, Property>>,
    pub sym_properties: Box<HashMap<i32, Property>>,
    pub state: Option<Box<InternalStateCell>>,
}

ObjectData is the representation of an object in JavaScript

Fields

kind: ObjectKind

Kind

internal_slots: Box<HashMap<String, Value>>

Internal Slots

properties: Box<HashMap<String, Property>>

Properties

sym_properties: Box<HashMap<i32, Property>>

Symbol Properties

state: Option<Box<InternalStateCell>>

Some rust object that stores internal state

Implementations

impl Object[src]

pub fn default() -> Self[src]

Return a new ObjectData struct, with kind set to Ordinary

pub fn create(proto: Value) -> Object[src]

ObjectCreate is used to specify the runtime creation of new ordinary objects

https://tc39.es/ecma262/#sec-objectcreate

pub fn get_internal_slot(&self, name: &str) -> Value[src]

Utility function to get an immutable internal slot or Null

pub fn set_internal_slot(&mut self, name: &str, val: Value)[src]

Utility function to set an internal slot

pub fn set_internal_method(&mut self, name: &str, val: NativeFunctionData)[src]

Utility function to set an internal slot which is a function

pub fn set_method(&mut self, name: &str, val: NativeFunctionData)[src]

Utility function to set a method on this object The native function will live in the properties field of the Object

pub fn from(value: &Value) -> Result<Self, ()>[src]

pub fn get_prototype_of(&self) -> Value[src]

Returns either the prototype or null https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-getprototypeof

pub fn set_prototype_of(&mut self, val: Value) -> bool[src]

https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-setprototypeof-v

pub fn is_extensible(&self) -> bool[src]

https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-isextensible

pub fn prevent_extensions(&mut self) -> bool[src]

https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-preventextensions

pub fn get_own_property(&self, prop: &Value) -> Property[src]

https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-getownproperty-p The specification returns a Property Descriptor or Undefined. These are 2 separate types and we can't do that here.

pub fn has_property(&self, val: &Value) -> bool[src]

https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-hasproperty-p

pub fn define_own_property(
    &mut self,
    property_key: String,
    desc: Property
) -> bool
[src]

pub fn delete(&mut self, prop_key: &Value) -> bool[src]

pub fn get(&self, val: &Value) -> Value[src]

pub fn set(&mut self, field: Value, val: Value) -> bool[src]

Trait Implementations

impl Clone for Object[src]

impl Debug for Object[src]

impl Drop for Object[src]

impl Finalize for Object[src]

impl FromValue for Object[src]

impl ToValue for Object[src]

impl Trace for Object[src]

Auto Trait Implementations

impl !RefUnwindSafe for Object

impl !Send for Object

impl !Sync for Object

impl Unpin for Object

impl !UnwindSafe for Object

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,