Browse Source

* Patch from Henrique Werlang to expose JSValue (bug ID 37597)

michael 5 years ago
parent
commit
5ceedc6bc3
1 changed files with 6 additions and 0 deletions
  1. 6 0
      packages/rtl/rtti.pas

+ 6 - 0
packages/rtl/rtti.pas

@@ -61,6 +61,7 @@ type
     function GetArrayElement(aIndex: SizeInt): TValue;
     function GetArrayElement(aIndex: SizeInt): TValue;
     //ToDo: procedure SetArrayElement(aIndex: SizeInt; constref AValue: TValue);
     //ToDo: procedure SetArrayElement(aIndex: SizeInt; constref AValue: TValue);
     function IsType(ATypeInfo: PTypeInfo): boolean;
     function IsType(ATypeInfo: PTypeInfo): boolean;
+    function AsJSValue: JSValue;
   end;
   end;
 
 
   TRttiType = class;
   TRttiType = class;
@@ -511,6 +512,11 @@ begin
   end;
   end;
 end;
 end;
 
 
+function TValue.AsJSValue: JSValue;
+begin
+  Result := FData;
+end;
+
 { TRttiInstanceType }
 { TRttiInstanceType }
 
 
 function TRttiInstanceType.GetClassTypeInfo: TTypeInfoClass;
 function TRttiInstanceType.GetClassTypeInfo: TTypeInfoClass;