avm1: Expose NativeObjects through SuperObject - fixes g2conline
This commit is contained in:
parent
dfd9a26a7b
commit
b8c1263f9e
|
@ -7,7 +7,7 @@ use crate::avm1::error::Error;
|
||||||
use crate::avm1::function::ExecutionReason;
|
use crate::avm1::function::ExecutionReason;
|
||||||
use crate::avm1::object::{search_prototype, ExecutionName};
|
use crate::avm1::object::{search_prototype, ExecutionName};
|
||||||
use crate::avm1::property::Attribute;
|
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::display_object::DisplayObject;
|
||||||
use crate::string::AvmString;
|
use crate::string::AvmString;
|
||||||
use gc_arena::{Collect, Gc, Mutation};
|
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
|
//`super` actually can be used to invoke MovieClip methods
|
||||||
self.0.this.as_display_object()
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
class CustomNetConnection extends NetConnection {
|
||||||
|
public function call() {
|
||||||
|
// To make sure `super` works for NativeObjects
|
||||||
|
super.call.apply(super,arguments);
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue