diff --git a/Jenkinsfile b/Jenkinsfile index 02305ed7e..1d25e47c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { agent none environment { - ReleaseNumber = '1.9.0' + ReleaseNumber = '1.9.1' outputEnc = '65001' } diff --git a/src/ScriptEngine.HostedScript/Library/Reflector.cs b/src/ScriptEngine.HostedScript/Library/Reflector.cs index 557865d3d..6bcce0eea 100644 --- a/src/ScriptEngine.HostedScript/Library/Reflector.cs +++ b/src/ScriptEngine.HostedScript/Library/Reflector.cs @@ -40,7 +40,10 @@ public IValue CallMethod(IRuntimeContextInstance target, string methodName, Arra var methodIdx = target.FindMethod(methodName); var methInfo = target.GetMethodInfo(methodIdx); - var argsToPass = GetArgsToPass(arguments, methInfo); + var argValues = arguments?.ToArray() ?? Array.Empty(); + // ArrayImpl не может (не должен!) содержать null или NotAValidValue + + var argsToPass = target.DynamicMethodSignatures ? argValues : GetArgsToPass(argValues, methInfo); IValue retValue = ValueFactory.Create(); if (methInfo.IsFunction) @@ -66,11 +69,8 @@ public IValue CallMethod(IRuntimeContextInstance target, string methodName, Arra return retValue; } - private static IValue[] GetArgsToPass(ArrayImpl arguments, MethodInfo methInfo) + private static IValue[] GetArgsToPass(IValue[] argValues, MethodInfo methInfo) { - var argValues = arguments?.ToArray() ?? Array.Empty(); - // ArrayImpl не может (не должен!) содержать null или NotAValidValue - var methArgCount = methInfo.ArgCount; if (argValues.Length > methArgCount) throw RuntimeException.TooManyArgumentsPassed();