From 1d22009c6bfca8e65de250482c6bb46fb95899b6 Mon Sep 17 00:00:00 2001 From: Adrian Wielgosik Date: Sat, 18 Sep 2021 11:36:00 +0200 Subject: [PATCH] avm2: Drop seemingly-unused set_class_object() --- core/src/avm2/object.rs | 7 ------- core/src/avm2/object/class_object.rs | 4 ---- core/src/avm2/object/custom_object.rs | 4 ---- core/src/avm2/object/script_object.rs | 13 ------------- core/src/avm2/object/stage_object.rs | 4 ---- 5 files changed, 32 deletions(-) diff --git a/core/src/avm2/object.rs b/core/src/avm2/object.rs index 1dedf95ed..f30619cab 100644 --- a/core/src/avm2/object.rs +++ b/core/src/avm2/object.rs @@ -1094,13 +1094,6 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into> + 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 { None diff --git a/core/src/avm2/object/class_object.rs b/core/src/avm2/object/class_object.rs index 1b525d900..226725a99 100644 --- a/core/src/avm2/object/class_object.rs +++ b/core/src/avm2/object/class_object.rs @@ -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, '_>, diff --git a/core/src/avm2/object/custom_object.rs b/core/src/avm2/object/custom_object.rs index fb5eb1123..293d07376 100644 --- a/core/src/avm2/object/custom_object.rs +++ b/core/src/avm2/object/custom_object.rs @@ -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, '_>, diff --git a/core/src/avm2/object/script_object.rs b/core/src/avm2/object/script_object.rs index a65d63044..643a95502 100644 --- a/core/src/avm2/object/script_object.rs +++ b/core/src/avm2/object/script_object.rs @@ -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> { self.0.read().instance_of() } @@ -845,13 +841,4 @@ impl<'gc> ScriptObjectData<'gc> { pub fn instance_of(&self) -> Option> { 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) - } } diff --git a/core/src/avm2/object/stage_object.rs b/core/src/avm2/object/stage_object.rs index f13f46bb8..d96acd4d6 100644 --- a/core/src/avm2/object/stage_object.rs +++ b/core/src/avm2/object/stage_object.rs @@ -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> { self.0.read().base.instance_of() }