Multiname resolution is another object method.

This commit is contained in:
David Wendt 2020-02-10 23:28:05 -05:00
parent 376d1a8ca6
commit 0ff1ba7120
1 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,7 @@
//! AVM2 objects. //! AVM2 objects.
use crate::avm2::function::FunctionObject; use crate::avm2::function::FunctionObject;
use crate::avm2::names::QName; use crate::avm2::names::{Multiname, QName};
use crate::avm2::return_value::ReturnValue; use crate::avm2::return_value::ReturnValue;
use crate::avm2::script_object::ScriptObject; use crate::avm2::script_object::ScriptObject;
use crate::avm2::value::Value; use crate::avm2::value::Value;
@ -54,6 +54,12 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
Ok(()) Ok(())
} }
/// Resolve a multiname into a single QName, if any of the namespaces
/// match.
fn resolve_multiname(self, _multiname: &Multiname) -> Option<QName> {
None
}
/// Indicates whether or not a property exists on an object. /// Indicates whether or not a property exists on an object.
fn has_property(self, _name: &QName) -> bool { fn has_property(self, _name: &QName) -> bool {
false false
@ -73,7 +79,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
/// Delete a named property from the object. /// Delete a named property from the object.
/// ///
/// Returns false if the property cannot be deleted. /// Returns false if the property cannot be deleted.
fn delete(&self, gc_context: MutationContext<'gc, '_>, name: &QName) -> bool { fn delete(&self, gc_context: MutationContext<'gc, '_>, multiname: &QName) -> bool {
false false
} }