Skip to content

Commit

Permalink
Merge remote-tracking branch 'us/develop' into feature/vt-indexes-1211
Browse files Browse the repository at this point in the history
  • Loading branch information
dmpas committed Nov 11, 2023
2 parents 163d85b + ef459d7 commit 48ed649
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/ScriptEngine/Machine/Contexts/UnmanagedCOMWrapperContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public override IValue GetPropValue(int propNum)
var result = DispatchUtility.Invoke(Instance, dispId, null);
return CreateIValue(result);
}
catch (System.Reflection.TargetInvocationException e)
catch (TargetInvocationException e)
{
throw e.InnerException ?? e;
}
Expand Down Expand Up @@ -149,16 +149,16 @@ public override void SetPropValue(int propNum, IValue newVal)
}
DispatchUtility.InvokeSetProperty(Instance, dispId, argToPass);
}
catch (System.Reflection.TargetInvocationException e)
catch (TargetInvocationException e)
{
throw e.InnerException ?? e;
}
}
catch (System.MissingMemberException)
catch (MissingMemberException)
{
throw PropertyAccessException.PropNotFoundException(prop.Name);
}
catch (System.MemberAccessException)
catch (MemberAccessException)
{
throw PropertyAccessException.PropIsNotWritableException(prop.Name);
}
Expand Down Expand Up @@ -203,12 +203,12 @@ public override void CallAsProcedure(int methodNumber, IValue[] arguments)
DispatchUtility.Invoke(Instance, dispId, argsData.values, argsData.flags);
RemapOutputParams(arguments, argsData.values, argsData.flags[0], initialValues);
}
catch (System.Reflection.TargetInvocationException e)
catch (TargetInvocationException e)
{
throw e.InnerException ?? e;
}
}
catch (System.MissingMemberException)
catch (MissingMemberException)
{
throw RuntimeException.MethodNotFoundException(method.Name);
}
Expand All @@ -234,12 +234,12 @@ public override void CallAsFunction(int methodNumber, IValue[] arguments, out IV
RemapOutputParams(arguments, argsData.values, argsData.flags[0], initialValues);
retValue = CreateIValue(result);
}
catch (System.Reflection.TargetInvocationException e)
catch (TargetInvocationException e)
{
throw e.InnerException ?? e;
}
}
catch (System.MissingMemberException)
catch (MissingMemberException)
{
throw RuntimeException.MethodNotFoundException(method.Name);
}
Expand All @@ -250,7 +250,10 @@ private void RemapOutputParams(IValue[] arguments, object[] values, ParameterMod
{
for (int i = 0; i < arguments.Length; i++)
{
if (flags[i] && !initialValues[i].Equals(values[i]))
var initialValue = initialValues[i];
var valueAfterCall = values[i];

if (flags[i] && !Equals(initialValue, valueAfterCall))
{
var variable = (IVariable)arguments[i];
variable.Value = CreateIValue(values[i]);
Expand Down

0 comments on commit 48ed649

Please sign in to comment.