Skip to content

Commit

Permalink
HScriptInterp call->fcall
Browse files Browse the repository at this point in the history
  • Loading branch information
filt3rek committed Oct 13, 2022
1 parent 2e89619 commit 5f0d7e8
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions ftk/format/template/Interp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ class InterpError {

// "_" added to prevent https://github.com/HaxeFoundation/haxe/issues/10820
class _HScriptInterp extends hscript.Interp{
override function call( o : Dynamic, f : Dynamic, args : Array<Dynamic> ) : Dynamic {
function _call(){
try{
return Reflect.callMethod(o,f,args);
}catch( e ){
// Get errors infos
error( ECustom( e.toString() ) );
return null;
}
override function fcall( o : Dynamic, f : Dynamic, args : Array<Dynamic> ) : Dynamic {
try{
return call(o, get(o, f), args);
}catch( e ){
// Get errors infos
error( ECustom( e.toString() ), true );
return null;
}
return _call();
}
}

Expand Down

0 comments on commit 5f0d7e8

Please sign in to comment.