Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marek-safar/a59a5c58e459e717e6e4612bed23e8ae to your computer and use it in GitHub Desktop.
Save marek-safar/a59a5c58e459e717e6e4612bed23e8ae to your computer and use it in GitHub Desktop.
if (task.Exception == null)
{
object result;
Type task_type = task.GetType();
if (task_type == typeof(Task))
{
result = Array.Empty<object>();
}
else
{
if (s_taskResult == null) {
s_taskResult = task_type.GetMethod("get_Result");
result = s_taskResult.Invoke(task) ?? Array.Empty<object>());
}
continuationObj.Invoke("resolve", result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment