mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-13 16:49:22 +02:00
* Patch from Henrique Werlang to add Delphi compatible From<>
This commit is contained in:
parent
6b2457c67b
commit
219a749aa3
@ -34,6 +34,7 @@ type
|
||||
function GetIsEmpty: boolean;
|
||||
function GetTypeKind: TTypeKind;
|
||||
public
|
||||
generic class function From<T>(const Value: T): TValue; static;
|
||||
class function FromJSValue(v: JSValue): TValue; static;
|
||||
|
||||
property Kind: TTypeKind read GetTypeKind;
|
||||
@ -502,6 +503,11 @@ begin
|
||||
Result:=FTypeInfo.Kind;
|
||||
end;
|
||||
|
||||
generic class function TValue.From<T>(const Value: T): TValue;
|
||||
begin
|
||||
Result := FromJSValue(Value);
|
||||
end;
|
||||
|
||||
class function TValue.FromJSValue(v: JSValue): TValue;
|
||||
var
|
||||
i: NativeInt;
|
||||
|
Loading…
Reference in New Issue
Block a user