diff --git a/core/src/avm1/object/super_object.rs b/core/src/avm1/object/super_object.rs index c59ded232..094bde04e 100644 --- a/core/src/avm1/object/super_object.rs +++ b/core/src/avm1/object/super_object.rs @@ -7,7 +7,7 @@ use crate::avm1::error::Error; use crate::avm1::function::ExecutionReason; use crate::avm1::object::{search_prototype, ExecutionName}; use crate::avm1::property::Attribute; -use crate::avm1::{Object, ObjectPtr, ScriptObject, TObject, Value}; +use crate::avm1::{NativeObject, Object, ObjectPtr, ScriptObject, TObject, Value}; use crate::display_object::DisplayObject; use crate::string::AvmString; use gc_arena::{Collect, Gc, Mutation}; @@ -282,4 +282,12 @@ impl<'gc> TObject<'gc> for SuperObject<'gc> { //`super` actually can be used to invoke MovieClip methods self.0.this.as_display_object() } + + fn native(&self) -> NativeObject<'gc> { + self.0.this.native() + } + + fn set_native(&self, gc_context: &Mutation<'gc>, native: NativeObject<'gc>) { + self.0.this.set_native(gc_context, native); + } } diff --git a/tests/tests/swfs/avm1/netconnection_send_remote/CustomNetConnection.as b/tests/tests/swfs/avm1/netconnection_send_remote/CustomNetConnection.as new file mode 100644 index 000000000..f10fec966 --- /dev/null +++ b/tests/tests/swfs/avm1/netconnection_send_remote/CustomNetConnection.as @@ -0,0 +1,6 @@ +class CustomNetConnection extends NetConnection { + public function call() { + // To make sure `super` works for NativeObjects + super.call.apply(super,arguments); + } +} \ No newline at end of file diff --git a/tests/tests/swfs/avm1/netconnection_send_remote/test.fla b/tests/tests/swfs/avm1/netconnection_send_remote/test.fla index 06d6b2331..f15552153 100644 Binary files a/tests/tests/swfs/avm1/netconnection_send_remote/test.fla and b/tests/tests/swfs/avm1/netconnection_send_remote/test.fla differ diff --git a/tests/tests/swfs/avm1/netconnection_send_remote/test.swf b/tests/tests/swfs/avm1/netconnection_send_remote/test.swf index f2163bee6..5d9c35f36 100644 Binary files a/tests/tests/swfs/avm1/netconnection_send_remote/test.swf and b/tests/tests/swfs/avm1/netconnection_send_remote/test.swf differ