Skip to content

Commit 20747ca

Browse files
committed
более абстрактный тип для динамического поика методов
1 parent 11aecaf commit 20747ca

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/OneScript.Core/Exceptions/IExceptionInfoFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace OneScript.Exceptions
1616
/// </summary>
1717
public interface IExceptionInfoFactory
1818
{
19-
BslObjectValue GetExceptionInfo(Exception exception);
19+
BslValue GetExceptionInfo(Exception exception);
2020

2121
string GetExceptionDescription(IRuntimeContextInstance exceptionInfo);
2222

src/OneScript.Native/Compiler/MethodCompiler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,9 @@ private Expression GetRuntimeExceptionDescription()
13631363
var excVariable = _blocks.GetCurrentBlock().CurrentException;
13641364
Expression factoryArgument;
13651365
// нас вызвали вне попытки-исключения
1366-
factoryArgument = excVariable == null ? Expression.Constant(null, typeof(IRuntimeContextInstance)) : GetRuntimeExceptionObject();
1366+
//factoryArgument = excVariable == null ? Expression.Constant(null, typeof(IRuntimeContextInstance)) : GetRuntimeExceptionObject();
1367+
factoryArgument = excVariable == null ? Expression.Constant(null, typeof(IRuntimeContextInstance))
1368+
: ExpressionHelpers.ConvertToType(GetRuntimeExceptionObject(), typeof(IRuntimeContextInstance));
13671369

13681370
var factory = Expression.Constant(ExceptionInfoFactory);
13691371
return ExpressionHelpers.CallOfInstanceMethod(

src/OneScript.Native/Runtime/DynamicOperations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static T StrictConstructorCall<T>(ITypeManager typeManager, IServiceConta
134134
where T : BslValue
135135
=> (T)ConstructorCall(typeManager, services, typeName, process, args);
136136

137-
public static BslObjectValue GetExceptionInfo(IExceptionInfoFactory factory, Exception e)
137+
public static BslValue GetExceptionInfo(IExceptionInfoFactory factory, Exception e)
138138
=> factory.GetExceptionInfo(e);
139139

140140
public static BslTypeValue GetTypeByName(ITypeManager manager, string name)

src/ScriptEngine/Machine/ExceptionInfoFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public ExceptionInfoFactory(IBslProcessFactory processFactory)
2727
_processFactory = processFactory;
2828
}
2929

30-
public BslObjectValue GetExceptionInfo(Exception exception)
30+
public BslValue GetExceptionInfo(Exception exception)
3131
{
3232
if (exception == null)
3333
{

0 commit comments

Comments
 (0)