Skip to content

Commit be900b5

Browse files
committed
fixed EvilBeaver#1479 Исправлен возврат объекта внешней компоненты из bsl-метода
1 parent dbaac06 commit be900b5

File tree

2 files changed

+6
-101
lines changed

2 files changed

+6
-101
lines changed

src/OneScript.StandardLibrary/NativeApi/NativeApiComponent.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@ namespace OneScript.StandardLibrary.NativeApi
1717
/// <summary>
1818
/// Экземпляр внешней компоненты Native API
1919
/// </summary>
20-
class NativeApiComponent : NativeApiValue, IRuntimeContextInstance, IDisposable
20+
class NativeApiComponent : BslObjectValue, IRuntimeContextInstance, IDisposable
2121
{
2222
private IntPtr _object;
23-
24-
public override IRuntimeContextInstance AsObject()
25-
{
26-
return this;
27-
}
23+
private TypeDescriptor _type;
2824

2925
public event OnComponentEvent OnComponentEvent;
3026

@@ -93,8 +89,11 @@ public NativeApiComponent(object host, NativeApiLibrary library, TypeDescriptor
9389
OnComponentStatusText?.Invoke(S(status));
9490
}
9591
);
96-
DefineType(typeDef);
92+
_type = typeDef;
9793
}
94+
95+
// ReSharper disable once ConvertToAutoProperty
96+
public override TypeDescriptor SystemType => _type;
9897

9998
public bool IsIndexed => true;
10099

src/OneScript.StandardLibrary/NativeApi/NativeApiValue.cs

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)