|
|
@ -273,7 +273,7 @@ impl GcObject { |
|
|
|
pub(crate) fn __delete__(&self, key: &PropertyKey) -> bool { |
|
|
|
pub(crate) fn __delete__(&self, key: &PropertyKey) -> bool { |
|
|
|
match self.__get_own_property__(key) { |
|
|
|
match self.__get_own_property__(key) { |
|
|
|
Some(desc) if desc.configurable() => { |
|
|
|
Some(desc) if desc.configurable() => { |
|
|
|
self.remove(&key); |
|
|
|
self.remove(key); |
|
|
|
true |
|
|
|
true |
|
|
|
} |
|
|
|
} |
|
|
|
Some(_) => false, |
|
|
|
Some(_) => false, |
|
|
@ -458,13 +458,13 @@ impl GcObject { |
|
|
|
// 8.
|
|
|
|
// 8.
|
|
|
|
if !current.configurable() { |
|
|
|
if !current.configurable() { |
|
|
|
if let (Some(current_get), Some(desc_get)) = (current.getter(), desc.getter()) { |
|
|
|
if let (Some(current_get), Some(desc_get)) = (current.getter(), desc.getter()) { |
|
|
|
if !GcObject::equals(¤t_get, &desc_get) { |
|
|
|
if !GcObject::equals(current_get, desc_get) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if let (Some(current_set), Some(desc_set)) = (current.setter(), desc.setter()) { |
|
|
|
if let (Some(current_set), Some(desc_set)) = (current.setter(), desc.setter()) { |
|
|
|
if !GcObject::equals(¤t_set, &desc_set) { |
|
|
|
if !GcObject::equals(current_set, desc_set) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -685,7 +685,7 @@ impl GcObject { |
|
|
|
pub fn ordinary_get_own_property(&self, key: &PropertyKey) -> Option<PropertyDescriptor> { |
|
|
|
pub fn ordinary_get_own_property(&self, key: &PropertyKey) -> Option<PropertyDescriptor> { |
|
|
|
let object = self.borrow(); |
|
|
|
let object = self.borrow(); |
|
|
|
let property = match key { |
|
|
|
let property = match key { |
|
|
|
PropertyKey::Index(index) => object.indexed_properties.get(&index), |
|
|
|
PropertyKey::Index(index) => object.indexed_properties.get(index), |
|
|
|
PropertyKey::String(ref st) => object.string_properties.get(st), |
|
|
|
PropertyKey::String(ref st) => object.string_properties.get(st), |
|
|
|
PropertyKey::Symbol(ref symbol) => object.symbol_properties.get(symbol), |
|
|
|
PropertyKey::Symbol(ref symbol) => object.symbol_properties.get(symbol), |
|
|
|
}; |
|
|
|
}; |
|
|
@ -939,7 +939,7 @@ impl Object { |
|
|
|
#[inline] |
|
|
|
#[inline] |
|
|
|
pub(crate) fn remove(&mut self, key: &PropertyKey) -> Option<PropertyDescriptor> { |
|
|
|
pub(crate) fn remove(&mut self, key: &PropertyKey) -> Option<PropertyDescriptor> { |
|
|
|
match key { |
|
|
|
match key { |
|
|
|
PropertyKey::Index(index) => self.indexed_properties.remove(&index), |
|
|
|
PropertyKey::Index(index) => self.indexed_properties.remove(index), |
|
|
|
PropertyKey::String(ref string) => self.string_properties.remove(string), |
|
|
|
PropertyKey::String(ref string) => self.string_properties.remove(string), |
|
|
|
PropertyKey::Symbol(ref symbol) => self.symbol_properties.remove(symbol), |
|
|
|
PropertyKey::Symbol(ref symbol) => self.symbol_properties.remove(symbol), |
|
|
|
} |
|
|
|
} |
|
|
|