diff --git a/Jint/Runtime/Interop/DelegateWrapper.cs b/Jint/Runtime/Interop/DelegateWrapper.cs index 2356d0a161..93ca948d94 100644 --- a/Jint/Runtime/Interop/DelegateWrapper.cs +++ b/Jint/Runtime/Interop/DelegateWrapper.cs @@ -13,7 +13,7 @@ namespace Jint.Runtime.Interop public sealed class DelegateWrapper : FunctionInstance { private static readonly JsString _name = new JsString("delegate"); - private static readonly Type _voidTaskResultType = Task.CompletedTask.GetType.GetGenericArguments()[0]; + private static readonly Type _voidTaskResultType = Task.CompletedTask.GetType().GetGenericArguments()[0]; private readonly Delegate _d; private readonly bool _delegateContainsParamsArgument; @@ -164,7 +164,7 @@ private JsValue ConvertTaskToPromise(Task task) // Special case: Marshal `async Task` as undefined, as this is `Task` at runtime // See https://github.com/sebastienros/jint/pull/1567#issuecomment-1681987702 - if (taskType.IsGenericType && taskType.GetGenericArguments()[0] == _voidTaskResult) + if (taskType.IsGenericType && taskType.GetGenericArguments()[0] == _voidTaskResultType) { resolve(FromObject(Engine, JsValue.Undefined)); return;