Skip to content

Commit

Permalink
avm2: Remove dead init_display_object fn
Browse files Browse the repository at this point in the history
  • Loading branch information
evilpie authored and Aaron1011 committed Nov 25, 2023
1 parent 5920a64 commit a2021cd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions core/src/avm2/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1236,13 +1236,6 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into<Object<'gc>> + Clone + Copy
None
}

/// Associate this object with a display object, if it can support such an
/// association.
///
/// If not, then this function does nothing.
fn init_display_object(&self, _context: &mut UpdateContext<'_, 'gc>, _obj: DisplayObject<'gc>) {
}

fn init_application_domain(&self, _mc: &Mutation<'gc>, _domain: Domain<'gc>) {
panic!("Tried to init an application domain on a non-ApplicationDomain object!")
}
Expand Down
7 changes: 0 additions & 7 deletions core/src/avm2/object/stage_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use crate::avm2::object::script_object::ScriptObjectData;
use crate::avm2::object::{ClassObject, Object, ObjectPtr, TObject};
use crate::avm2::value::Value;
use crate::avm2::Error;
use crate::context::UpdateContext;
use crate::display_object::DisplayObject;
use crate::display_object::TDisplayObject;
use gc_arena::{Collect, GcCell, GcWeakCell, Mutation};
use std::cell::{Ref, RefMut};
use std::fmt::Debug;
Expand Down Expand Up @@ -128,11 +126,6 @@ impl<'gc> TObject<'gc> for StageObject<'gc> {
self.0.read().display_object
}

fn init_display_object(&self, context: &mut UpdateContext<'_, 'gc>, obj: DisplayObject<'gc>) {
self.0.write(context.gc_context).display_object = Some(obj);
obj.set_object2(context, (*self).into());
}

fn value_of(&self, _mc: &Mutation<'gc>) -> Result<Value<'gc>, Error<'gc>> {
Ok(Value::Object(Object::from(*self)))
}
Expand Down

0 comments on commit a2021cd

Please sign in to comment.