File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ package {
1111 };
1212 }
1313
14+ public static native function getErrorMessage(id: int ): String ;
15+
1416 [Ruffle (NativeAccessible)]
1517 public var name: String = "Error" ;
1618
Original file line number Diff line number Diff line change 11use crate :: avm2:: activation:: Activation ;
22pub use crate :: avm2:: object:: error_allocator;
3+ use crate :: avm2:: parameters:: ParametersExt ;
34use crate :: avm2:: string:: AvmString ;
45use crate :: avm2:: value:: Value ;
56use crate :: avm2:: Error ;
6- use crate :: PlayerMode ;
7+ use crate :: { avm2_stub_method, PlayerMode } ;
8+
9+ pub fn get_error_message < ' gc > (
10+ activation : & mut Activation < ' _ , ' gc > ,
11+ _this : Value < ' gc > ,
12+ args : & [ Value < ' gc > ] ,
13+ ) -> Result < Value < ' gc > , Error < ' gc > > {
14+ avm2_stub_method ! ( activation, "Error" , "getErrorMessage" ) ;
15+
16+ let id = args. get_i32 ( 0 ) ;
17+ let message = format ! ( "Error #{id}" ) ;
18+ Ok ( AvmString :: new_utf8 ( activation. gc ( ) , message) . into ( ) )
19+ }
720
821pub fn get_stack_trace < ' gc > (
922 activation : & mut Activation < ' _ , ' gc > ,
You can’t perform that action at this time.
0 commit comments