|
|
@ -47,13 +47,13 @@ pub struct Object { |
|
|
|
/// The type of the object.
|
|
|
|
/// The type of the object.
|
|
|
|
pub kind: ObjectKind, |
|
|
|
pub kind: ObjectKind, |
|
|
|
/// Intfiernal Slots
|
|
|
|
/// Intfiernal Slots
|
|
|
|
pub internal_slots: Box<FxHashMap<String, Value>>, |
|
|
|
pub internal_slots: FxHashMap<String, Value>, |
|
|
|
/// Properties
|
|
|
|
/// Properties
|
|
|
|
pub properties: Box<FxHashMap<String, Property>>, |
|
|
|
pub properties: FxHashMap<String, Property>, |
|
|
|
/// Symbol Properties
|
|
|
|
/// Symbol Properties
|
|
|
|
pub sym_properties: Box<FxHashMap<i32, Property>>, |
|
|
|
pub sym_properties: FxHashMap<i32, Property>, |
|
|
|
/// Some rust object that stores internal state
|
|
|
|
/// Some rust object that stores internal state
|
|
|
|
pub state: Option<Box<InternalStateCell>>, |
|
|
|
pub state: Option<InternalStateCell>, |
|
|
|
/// [[Call]]
|
|
|
|
/// [[Call]]
|
|
|
|
pub call: Option<Function>, |
|
|
|
pub call: Option<Function>, |
|
|
|
/// [[Construct]]
|
|
|
|
/// [[Construct]]
|
|
|
@ -338,9 +338,9 @@ impl Object { |
|
|
|
pub fn default() -> Self { |
|
|
|
pub fn default() -> Self { |
|
|
|
let mut object = Self { |
|
|
|
let mut object = Self { |
|
|
|
kind: ObjectKind::Ordinary, |
|
|
|
kind: ObjectKind::Ordinary, |
|
|
|
internal_slots: Box::new(FxHashMap::default()), |
|
|
|
internal_slots: FxHashMap::default(), |
|
|
|
properties: Box::new(FxHashMap::default()), |
|
|
|
properties: FxHashMap::default(), |
|
|
|
sym_properties: Box::new(FxHashMap::default()), |
|
|
|
sym_properties: FxHashMap::default(), |
|
|
|
state: None, |
|
|
|
state: None, |
|
|
|
call: None, |
|
|
|
call: None, |
|
|
|
construct: None, |
|
|
|
construct: None, |
|
|
@ -354,9 +354,9 @@ impl Object { |
|
|
|
pub fn function() -> Self { |
|
|
|
pub fn function() -> Self { |
|
|
|
let mut object = Self { |
|
|
|
let mut object = Self { |
|
|
|
kind: ObjectKind::Function, |
|
|
|
kind: ObjectKind::Function, |
|
|
|
internal_slots: Box::new(FxHashMap::default()), |
|
|
|
internal_slots: FxHashMap::default(), |
|
|
|
properties: Box::new(FxHashMap::default()), |
|
|
|
properties: FxHashMap::default(), |
|
|
|
sym_properties: Box::new(FxHashMap::default()), |
|
|
|
sym_properties: FxHashMap::default(), |
|
|
|
state: None, |
|
|
|
state: None, |
|
|
|
call: None, |
|
|
|
call: None, |
|
|
|
construct: None, |
|
|
|
construct: None, |
|
|
@ -396,9 +396,9 @@ impl Object { |
|
|
|
fn from_boolean(argument: &Value) -> Self { |
|
|
|
fn from_boolean(argument: &Value) -> Self { |
|
|
|
let mut obj = Self { |
|
|
|
let mut obj = Self { |
|
|
|
kind: ObjectKind::Boolean, |
|
|
|
kind: ObjectKind::Boolean, |
|
|
|
internal_slots: Box::new(FxHashMap::default()), |
|
|
|
internal_slots: FxHashMap::default(), |
|
|
|
properties: Box::new(FxHashMap::default()), |
|
|
|
properties: FxHashMap::default(), |
|
|
|
sym_properties: Box::new(FxHashMap::default()), |
|
|
|
sym_properties: FxHashMap::default(), |
|
|
|
state: None, |
|
|
|
state: None, |
|
|
|
call: None, |
|
|
|
call: None, |
|
|
|
construct: None, |
|
|
|
construct: None, |
|
|
@ -413,9 +413,9 @@ impl Object { |
|
|
|
fn from_number(argument: &Value) -> Self { |
|
|
|
fn from_number(argument: &Value) -> Self { |
|
|
|
let mut obj = Self { |
|
|
|
let mut obj = Self { |
|
|
|
kind: ObjectKind::Number, |
|
|
|
kind: ObjectKind::Number, |
|
|
|
internal_slots: Box::new(FxHashMap::default()), |
|
|
|
internal_slots: FxHashMap::default(), |
|
|
|
properties: Box::new(FxHashMap::default()), |
|
|
|
properties: FxHashMap::default(), |
|
|
|
sym_properties: Box::new(FxHashMap::default()), |
|
|
|
sym_properties: FxHashMap::default(), |
|
|
|
state: None, |
|
|
|
state: None, |
|
|
|
call: None, |
|
|
|
call: None, |
|
|
|
construct: None, |
|
|
|
construct: None, |
|
|
@ -430,9 +430,9 @@ impl Object { |
|
|
|
fn from_string(argument: &Value) -> Self { |
|
|
|
fn from_string(argument: &Value) -> Self { |
|
|
|
let mut obj = Self { |
|
|
|
let mut obj = Self { |
|
|
|
kind: ObjectKind::String, |
|
|
|
kind: ObjectKind::String, |
|
|
|
internal_slots: Box::new(FxHashMap::default()), |
|
|
|
internal_slots: FxHashMap::default(), |
|
|
|
properties: Box::new(FxHashMap::default()), |
|
|
|
properties: FxHashMap::default(), |
|
|
|
sym_properties: Box::new(FxHashMap::default()), |
|
|
|
sym_properties: FxHashMap::default(), |
|
|
|
state: None, |
|
|
|
state: None, |
|
|
|
call: None, |
|
|
|
call: None, |
|
|
|
construct: None, |
|
|
|
construct: None, |
|
|
|