avm2: Drop seemingly-unused set_class_object()

This commit is contained in:
Adrian Wielgosik 2021-09-18 11:36:00 +02:00 committed by Adrian Wielgosik
parent f3ab6c9da3
commit 1d22009c6b
5 changed files with 0 additions and 32 deletions

View File

@ -1094,13 +1094,6 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
None
}
/// Associate the object with a particular class object.
///
/// This turns the object into an instance of that class. It should only be
/// used in situations where the object cannot be made an instance of the
/// class at allocation time, such as during early runtime setup.
fn set_class_object(self, mc: MutationContext<'gc, '_>, class_object: Object<'gc>);
/// Get this class's instance allocator.
fn instance_allocator(self) -> Option<AllocatorFn> {
None

View File

@ -498,10 +498,6 @@ impl<'gc> TObject<'gc> for ClassObject<'gc> {
self.0.read().base.instance_of()
}
fn set_class_object(self, _mc: MutationContext<'gc, '_>, _class_object: Object<'gc>) {
//Do nothing, as classes cannot be turned into instances.
}
fn set_local_property_is_enumerable(
&self,
mc: MutationContext<'gc, '_>,

View File

@ -122,10 +122,6 @@ macro_rules! impl_avm2_custom_object_instance {
self.0.read().$field.instance_of()
}
fn set_class_object(self, mc: MutationContext<'gc, '_>, class_object: Object<'gc>) {
self.0.write(mc).$field.set_class_object(class_object);
}
fn set_local_property_is_enumerable(
&self,
mc: MutationContext<'gc, '_>,

View File

@ -308,10 +308,6 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> {
self.0.read().as_class_object()
}
fn set_class_object(self, mc: MutationContext<'gc, '_>, class_object: Object<'gc>) {
self.0.write(mc).set_class_object(class_object);
}
fn instance_of(&self) -> Option<Object<'gc>> {
self.0.read().instance_of()
}
@ -845,13 +841,4 @@ impl<'gc> ScriptObjectData<'gc> {
pub fn instance_of(&self) -> Option<Object<'gc>> {
self.instance_of
}
/// Associate the object with a particular class object.
///
/// This turns the object into an instance of that class. It should only be
/// used in situations where the object cannot be made an instance of the
/// class at allocation time, such as during early runtime setup.
pub fn set_class_object(&mut self, class_object: Object<'gc>) {
self.instance_of = Some(class_object)
}
}

View File

@ -294,10 +294,6 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
self.0.read().base.as_class_object()
}
fn set_class_object(self, mc: MutationContext<'gc, '_>, class_object: Object<'gc>) {
self.0.write(mc).base.set_class_object(class_object);
}
fn instance_of(&self) -> Option<Object<'gc>> {
self.0.read().base.instance_of()
}