Handle unnamed functions better
This commit is contained in:
@@ -53,8 +53,17 @@ namespace Upsilon.BaseTypes.ScriptFunction
|
||||
object result;
|
||||
try
|
||||
{
|
||||
result = _object.GetType().InvokeMember(_method.Name, BindingFlags.InvokeMethod, UpsilonBinder.Default,
|
||||
_object, objects.ToArray());
|
||||
if (_object == null)
|
||||
{
|
||||
var array = objects.ToArray();
|
||||
var methodInfo = _method.GetMethod(ref array);
|
||||
result = methodInfo.Invoke(null, array);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = _object.GetType().InvokeMember(_method.Name, BindingFlags.InvokeMethod, UpsilonBinder.Default,
|
||||
_object, objects.ToArray());
|
||||
}
|
||||
}
|
||||
catch (TargetInvocationException e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user