|
|
@ -69,8 +69,8 @@ impl GcObject { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// [[Get]]
|
|
|
|
/// `[[Get]]`
|
|
|
|
/// https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver
|
|
|
|
/// <https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver>
|
|
|
|
pub fn get(&self, key: &PropertyKey) -> Value { |
|
|
|
pub fn get(&self, key: &PropertyKey) -> Value { |
|
|
|
match self.get_own_property(key) { |
|
|
|
match self.get_own_property(key) { |
|
|
|
None => { |
|
|
|
None => { |
|
|
@ -90,7 +90,7 @@ impl GcObject { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// [[Set]]
|
|
|
|
/// `[[Set]]`
|
|
|
|
/// <https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver>
|
|
|
|
/// <https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver>
|
|
|
|
pub fn set(&mut self, key: PropertyKey, val: Value) -> bool { |
|
|
|
pub fn set(&mut self, key: PropertyKey, val: Value) -> bool { |
|
|
|
let _timer = BoaProfiler::global().start_event("Object::set", "object"); |
|
|
|
let _timer = BoaProfiler::global().start_event("Object::set", "object"); |
|
|
@ -239,7 +239,7 @@ impl GcObject { |
|
|
|
/// More information:
|
|
|
|
/// More information:
|
|
|
|
/// - [ECMAScript reference][spec]
|
|
|
|
/// - [ECMAScript reference][spec]
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// [spec](https://tc39.es/ecma262/#table-essential-internal-methods)
|
|
|
|
/// [spec]: https://tc39.es/ecma262/#table-essential-internal-methods
|
|
|
|
#[inline] |
|
|
|
#[inline] |
|
|
|
pub fn own_property_keys(&self) -> Vec<PropertyKey> { |
|
|
|
pub fn own_property_keys(&self) -> Vec<PropertyKey> { |
|
|
|
self.borrow().keys().collect() |
|
|
|
self.borrow().keys().collect() |
|
|
@ -323,6 +323,7 @@ impl GcObject { |
|
|
|
/// - [MDN documentation][mdn]
|
|
|
|
/// - [MDN documentation][mdn]
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// [spec]: https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-getprototypeof
|
|
|
|
/// [spec]: https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-getprototypeof
|
|
|
|
|
|
|
|
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf
|
|
|
|
#[inline] |
|
|
|
#[inline] |
|
|
|
pub fn get_prototype_of(&self) -> Value { |
|
|
|
pub fn get_prototype_of(&self) -> Value { |
|
|
|
self.borrow().prototype.clone() |
|
|
|
self.borrow().prototype.clone() |
|
|
@ -362,7 +363,7 @@ impl GcObject { |
|
|
|
self.insert(key.into(), DataDescriptor::new(value, attribute)) |
|
|
|
self.insert(key.into(), DataDescriptor::new(value, attribute)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// It determines if Object is a callable function with a [[Call]] internal method.
|
|
|
|
/// It determines if Object is a callable function with a `[[Call]]` internal method.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// More information:
|
|
|
|
/// More information:
|
|
|
|
/// - [EcmaScript reference][spec]
|
|
|
|
/// - [EcmaScript reference][spec]
|
|
|
@ -374,7 +375,7 @@ impl GcObject { |
|
|
|
self.borrow().is_callable() |
|
|
|
self.borrow().is_callable() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// It determines if Object is a function object with a [[Construct]] internal method.
|
|
|
|
/// It determines if Object is a function object with a `[[Construct]]` internal method.
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// More information:
|
|
|
|
/// More information:
|
|
|
|
/// - [EcmaScript reference][spec]
|
|
|
|
/// - [EcmaScript reference][spec]
|
|
|
|