Skip to content

Commit

Permalink
Merge branch 'latest' into release/latest
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilBeaver committed Apr 5, 2024
2 parents 80590dd + 1ddd39a commit 91230eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
agent none

environment {
ReleaseNumber = '1.9.0'
ReleaseNumber = '1.9.1'
outputEnc = '65001'
}

Expand Down
10 changes: 5 additions & 5 deletions src/ScriptEngine.HostedScript/Library/Reflector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IValue>();
// ArrayImpl не может (не должен!) содержать null или NotAValidValue

var argsToPass = target.DynamicMethodSignatures ? argValues : GetArgsToPass(argValues, methInfo);

IValue retValue = ValueFactory.Create();
if (methInfo.IsFunction)
Expand All @@ -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<IValue>();
// ArrayImpl не может (не должен!) содержать null или NotAValidValue

var methArgCount = methInfo.ArgCount;
if (argValues.Length > methArgCount)
throw RuntimeException.TooManyArgumentsPassed();
Expand Down

0 comments on commit 91230eb

Please sign in to comment.