diff --git a/core/src/avm1/function.rs b/core/src/avm1/function.rs index 03704a7bc..37e256f4a 100644 --- a/core/src/avm1/function.rs +++ b/core/src/avm1/function.rs @@ -621,7 +621,7 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> { let prototype = self .get("prototype", activation, context)? .coerce_to_object(activation, context); - let this = prototype.create_bare_object(activation, context, prototype, args)?; + let this = prototype.create_bare_object(activation, context, prototype)?; self.construct_on_existing(activation, context, this, args)?; Ok(this) } @@ -642,7 +642,6 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> { _activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, prototype: Object<'gc>, - _args: &[Value<'gc>], ) -> Result, Error<'gc>> { let base = ScriptObject::object(context.gc_context, Some(prototype)); let fn_object = FunctionObject { diff --git a/core/src/avm1/object.rs b/core/src/avm1/object.rs index 122821f6e..1c3ffda7f 100644 --- a/core/src/avm1/object.rs +++ b/core/src/avm1/object.rs @@ -185,16 +185,11 @@ pub trait TObject<'gc>: 'gc + Collect + Debug + Into> + Clone + Copy /// object implementation it wants, with itself as the new object's proto. /// Then, the constructor is `call`ed with the new object as `this` to /// initialize the object. - /// - /// The arguments passed to the constructor are provided here; however, all - /// object construction should happen in `call`, not `new`. `new` exists - /// purely so that host objects can be constructed by the VM. fn create_bare_object( &self, activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, this: Object<'gc>, - args: &[Value<'gc>], ) -> Result, Error<'gc>>; /// Delete a named property from the object. diff --git a/core/src/avm1/object/color_transform_object.rs b/core/src/avm1/object/color_transform_object.rs index c0c7d7df5..d004daf34 100644 --- a/core/src/avm1/object/color_transform_object.rs +++ b/core/src/avm1/object/color_transform_object.rs @@ -123,7 +123,6 @@ impl<'gc> TObject<'gc> for ColorTransformObject<'gc> { activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, _this: Object<'gc>, - _args: &[Value<'gc>], ) -> Result, Error<'gc>> { Ok(ColorTransformObject::empty_color_transform_object( context.gc_context, diff --git a/core/src/avm1/object/script_object.rs b/core/src/avm1/object/script_object.rs index c05085d63..660cbf56a 100644 --- a/core/src/avm1/object/script_object.rs +++ b/core/src/avm1/object/script_object.rs @@ -508,7 +508,6 @@ impl<'gc> TObject<'gc> for ScriptObject<'gc> { _activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, this: Object<'gc>, - _args: &[Value<'gc>], ) -> Result, Error<'gc>> { match self.0.read().array { ArrayStorage::Vector(_) => { diff --git a/core/src/avm1/object/shared_object.rs b/core/src/avm1/object/shared_object.rs index f324b4736..106f2a2c1 100644 --- a/core/src/avm1/object/shared_object.rs +++ b/core/src/avm1/object/shared_object.rs @@ -3,7 +3,7 @@ use gc_arena::{Collect, GcCell, MutationContext}; use crate::avm1::activation::Activation; use crate::avm1::error::Error; -use crate::avm1::{Object, ScriptObject, TObject, Value}; +use crate::avm1::{Object, ScriptObject, TObject}; use crate::context::UpdateContext; use std::fmt; @@ -69,7 +69,6 @@ impl<'gc> TObject<'gc> for SharedObject<'gc> { activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, _this: Object<'gc>, - _args: &[Value<'gc>], ) -> Result, Error<'gc>> { Ok(SharedObject::empty_shared_obj( context.gc_context, diff --git a/core/src/avm1/object/sound_object.rs b/core/src/avm1/object/sound_object.rs index b58fd99ef..29ae8c8d7 100644 --- a/core/src/avm1/object/sound_object.rs +++ b/core/src/avm1/object/sound_object.rs @@ -2,7 +2,7 @@ use crate::avm1::activation::Activation; use crate::avm1::error::Error; -use crate::avm1::{Object, ScriptObject, TObject, Value}; +use crate::avm1::{Object, ScriptObject, TObject}; use crate::backend::audio::{SoundHandle, SoundInstanceHandle}; use crate::context::UpdateContext; use crate::display_object::DisplayObject; @@ -132,7 +132,6 @@ impl<'gc> TObject<'gc> for SoundObject<'gc> { activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, _this: Object<'gc>, - _args: &[Value<'gc>], ) -> Result, Error<'gc>> { Ok( SoundObject::empty_sound(context.gc_context, Some(activation.avm.prototypes.sound)) diff --git a/core/src/avm1/object/stage_object.rs b/core/src/avm1/object/stage_object.rs index 471e6e752..c086a0a5b 100644 --- a/core/src/avm1/object/stage_object.rs +++ b/core/src/avm1/object/stage_object.rs @@ -253,13 +253,12 @@ impl<'gc> TObject<'gc> for StageObject<'gc> { activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, this: Object<'gc>, - args: &[Value<'gc>], ) -> Result, Error<'gc>> { //TODO: Create a StageObject of some kind self.0 .read() .base - .create_bare_object(activation, context, this, args) + .create_bare_object(activation, context, this) } fn delete( diff --git a/core/src/avm1/object/super_object.rs b/core/src/avm1/object/super_object.rs index 01907fe56..e50e96256 100644 --- a/core/src/avm1/object/super_object.rs +++ b/core/src/avm1/object/super_object.rs @@ -164,17 +164,16 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> { activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, this: Object<'gc>, - args: &[Value<'gc>], ) -> Result, Error<'gc>> { if let Some(proto) = self.proto() { - proto.create_bare_object(activation, context, this, args) + proto.create_bare_object(activation, context, this) } else { // TODO: What happens when you `new super` but there's no // super? Is this code even reachable?! self.0 .read() .child - .create_bare_object(activation, context, this, args) + .create_bare_object(activation, context, this) } } diff --git a/core/src/avm1/object/value_object.rs b/core/src/avm1/object/value_object.rs index dfdb3a7c8..0e2cae4fb 100644 --- a/core/src/avm1/object/value_object.rs +++ b/core/src/avm1/object/value_object.rs @@ -137,7 +137,6 @@ impl<'gc> TObject<'gc> for ValueObject<'gc> { _activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, this: Object<'gc>, - _args: &[Value<'gc>], ) -> Result, Error<'gc>> { Ok(ValueObject::empty_box(context.gc_context, Some(this))) } diff --git a/core/src/avm1/object/xml_attributes_object.rs b/core/src/avm1/object/xml_attributes_object.rs index 6499ebdbc..7b215ccb4 100644 --- a/core/src/avm1/object/xml_attributes_object.rs +++ b/core/src/avm1/object/xml_attributes_object.rs @@ -114,7 +114,6 @@ impl<'gc> TObject<'gc> for XMLAttributesObject<'gc> { activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, _this: Object<'gc>, - _args: &[Value<'gc>], ) -> Result, Error<'gc>> { //TODO: `new xmlnode.attributes()` returns undefined, not an object avm_warn!(activation, "Cannot create new XML Attributes object"); diff --git a/core/src/avm1/object/xml_idmap_object.rs b/core/src/avm1/object/xml_idmap_object.rs index f2baa4e23..7939e584f 100644 --- a/core/src/avm1/object/xml_idmap_object.rs +++ b/core/src/avm1/object/xml_idmap_object.rs @@ -114,7 +114,6 @@ impl<'gc> TObject<'gc> for XMLIDMapObject<'gc> { activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, _this: Object<'gc>, - _args: &[Value<'gc>], ) -> Result, Error<'gc>> { //TODO: `new xmlnode.attributes()` returns undefined, not an object avm_warn!(activation, "Cannot create new XML Attributes object"); diff --git a/core/src/avm1/object/xml_object.rs b/core/src/avm1/object/xml_object.rs index 47f280483..3248dad30 100644 --- a/core/src/avm1/object/xml_object.rs +++ b/core/src/avm1/object/xml_object.rs @@ -3,7 +3,7 @@ use crate::avm1::activation::Activation; use crate::avm1::error::Error; use crate::avm1::object::TObject; -use crate::avm1::{Object, ScriptObject, UpdateContext, Value}; +use crate::avm1::{Object, ScriptObject, UpdateContext}; use crate::impl_custom_object; use crate::xml::{XMLDocument, XMLNode}; use gc_arena::{Collect, GcCell, MutationContext}; @@ -80,7 +80,6 @@ impl<'gc> TObject<'gc> for XMLObject<'gc> { _activation: &mut Activation<'_, 'gc>, context: &mut UpdateContext<'_, 'gc, '_>, this: Object<'gc>, - _args: &[Value<'gc>], ) -> Result, Error<'gc>> { Ok(XMLObject::empty_node(context.gc_context, Some(this))) }