Swap out `has_property`'s stub impl.

This commit is contained in:
David Wendt 2020-02-11 19:42:47 -05:00
parent e5142e85e9
commit 984e701142
3 changed files with 13 additions and 3 deletions

View File

@ -114,6 +114,10 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
.set_property(name, value, avm, context)
}
fn has_property(self, name: &QName) -> bool {
self.0.read().base.has_property(name)
}
fn as_ptr(&self) -> *const ObjectPtr {
self.0.as_ptr() as *const ObjectPtr
}

View File

@ -65,9 +65,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
}
/// Indicates whether or not a property exists on an object.
fn has_property(self, _name: &QName) -> bool {
false
}
fn has_property(self, _name: &QName) -> bool;
/// Indicates whether or not a property exists on an object and is not part
/// of the prototype chain.

View File

@ -44,6 +44,10 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
.set_property(name, value, avm, context)
}
fn has_property(self, name: &QName) -> bool {
self.0.read().has_property(name)
}
fn as_ptr(&self) -> *const ObjectPtr {
self.0.as_ptr() as *const ObjectPtr
}
@ -91,4 +95,8 @@ impl<'gc> ScriptObjectData<'gc> {
Ok(())
}
pub fn has_property(&self, name: &QName) -> bool {
self.values.get(name).is_some()
}
}