|
@@ -41,6 +41,7 @@ type
|
|
property TypeInfo: TTypeInfo read FTypeInfo;
|
|
property TypeInfo: TTypeInfo read FTypeInfo;
|
|
|
|
|
|
property IsEmpty: boolean read GetIsEmpty; // check if nil or undefined
|
|
property IsEmpty: boolean read GetIsEmpty; // check if nil or undefined
|
|
|
|
+ generic function AsType<T>: T;
|
|
function IsObject: boolean;
|
|
function IsObject: boolean;
|
|
function AsObject: TObject;
|
|
function AsObject: TObject;
|
|
function IsObjectInstance: boolean;
|
|
function IsObjectInstance: boolean;
|
|
@@ -539,6 +540,11 @@ begin
|
|
Result:=FTypeInfo.Kind;
|
|
Result:=FTypeInfo.Kind;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+generic function TValue.AsType<T>: T;
|
|
|
|
+begin
|
|
|
|
+ Result := T(AsJSValue)
|
|
|
|
+end;
|
|
|
|
+
|
|
generic class function TValue.From<T>(const Value: T): TValue;
|
|
generic class function TValue.From<T>(const Value: T): TValue;
|
|
begin
|
|
begin
|
|
Result := Make(System.TypeInfo(T), Value);
|
|
Result := Make(System.TypeInfo(T), Value);
|