From 0ff1ba7120299d780c80919127bdc2980853f6d3 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Mon, 10 Feb 2020 23:28:05 -0500 Subject: [PATCH] Multiname resolution is another object method. --- core/src/avm2/object.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/avm2/object.rs b/core/src/avm2/object.rs index ea2ca29dc..e89d3a9da 100644 --- a/core/src/avm2/object.rs +++ b/core/src/avm2/object.rs @@ -1,7 +1,7 @@ //! AVM2 objects. 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::script_object::ScriptObject; use crate::avm2::value::Value; @@ -54,6 +54,12 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into> + Clone + Copy Ok(()) } + /// Resolve a multiname into a single QName, if any of the namespaces + /// match. + fn resolve_multiname(self, _multiname: &Multiname) -> Option { + None + } + /// Indicates whether or not a property exists on an object. fn has_property(self, _name: &QName) -> bool { false @@ -73,7 +79,7 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into> + Clone + Copy /// Delete a named property from the object. /// /// 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 }