File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,13 @@ class Client
203203 default :
204204 }
205205
206+ switch LocalFunctionExceptions .testHostClassMethodOnHostReturn () {
207+ case Error (message ):
208+ Common .status = ' Failed test for running host class method on returned value: ' + message ;
209+ return ;
210+ default :
211+ }
212+
206213 // regression test for #926
207214 var x : Dynamic = 3 ;
208215 x * = 5 ;
Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ class Common
88 public static var callbackSet : Int = 0 ;
99 public static var callback : Void -> Void ;
1010
11+ public function dummyMethod () {}
1112}
Original file line number Diff line number Diff line change @@ -105,4 +105,22 @@ class LocalFunctionExceptions {
105105
106106 return Error (" No exception caught" );
107107 }
108+
109+ public static function testHostClassMethodOnHostReturn (): Status {
110+ function localFunction () {
111+ (staticFunction () : Common ).dummyMethod ();
112+ }
113+
114+ try {
115+ localFunction ();
116+ } catch (e : String ) {
117+ if (e == ' Thrown from static' ) {
118+ return Ok ;
119+ } else {
120+ return Error (" Incorrect exception caught from local function call: " + e );
121+ }
122+ }
123+
124+ return Error (" No exception caught" );
125+ }
108126}
You can’t perform that action at this time.
0 commit comments