Fixes for require

This commit is contained in:
2018-12-06 15:32:07 +01:00
parent 520cd1ffcc
commit 7996420ee5
7 changed files with 39 additions and 9 deletions

View File

@@ -62,18 +62,20 @@ namespace Upsilon.BaseTypes.ScriptFunction
}
}
object result;
try
{
var result = method.Invoke(_object, objects.ToArray());
if (_directTypeManipulation)
return (ScriptType)result;
return result.ToScriptType();
result = method.Invoke(_object, objects.ToArray());
}
catch (TargetInvocationException e)
{
if (e.InnerException != null) throw e.InnerException;
throw;
}
if (_directTypeManipulation)
return (ScriptType)result;
return result.ToScriptType();
}
}
}