mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 08:29:27 +02:00
pastojs: rtti of async function: pfAsync
git-svn-id: trunk@49255 -
(cherry picked from commit 1ab2ad3b06
)
This commit is contained in:
parent
6f64bed140
commit
dff41c209b
@ -2314,6 +2314,7 @@ type
|
|||||||
pfVarargs = 2;
|
pfVarargs = 2;
|
||||||
pfExternal = 4;
|
pfExternal = 4;
|
||||||
pfSafeCall = 8;
|
pfSafeCall = 8;
|
||||||
|
pfAsync = $10;
|
||||||
// PropertyFlag
|
// PropertyFlag
|
||||||
pfGetFunction = 1; // getter is a function
|
pfGetFunction = 1; // getter is a function
|
||||||
pfSetProcedure = 2; // setter is a function
|
pfSetProcedure = 2; // setter is a function
|
||||||
@ -16565,10 +16566,12 @@ begin
|
|||||||
if ResultTypeInfo<>nil then
|
if ResultTypeInfo<>nil then
|
||||||
InnerCall.AddArg(ResultTypeInfo);
|
InnerCall.AddArg(ResultTypeInfo);
|
||||||
end;
|
end;
|
||||||
// add param flags
|
// add procedure flags
|
||||||
Flags:=0;
|
Flags:=0;
|
||||||
if ptmVarargs in El.Modifiers then
|
if ptmVarargs in El.Modifiers then
|
||||||
inc(Flags,pfVarargs);
|
inc(Flags,pfVarargs);
|
||||||
|
if ptmAsync in El.Modifiers then
|
||||||
|
inc(Flags,pfAsync);
|
||||||
if El.CallingConvention=ccSafeCall then
|
if El.CallingConvention=ccSafeCall then
|
||||||
inc(Flags,pfSafeCall);
|
inc(Flags,pfSafeCall);
|
||||||
if Flags>0 then
|
if Flags>0 then
|
||||||
@ -20237,6 +20240,8 @@ begin
|
|||||||
inc(Flags,pfStatic);
|
inc(Flags,pfStatic);
|
||||||
if ptmVarargs in Proc.ProcType.Modifiers then
|
if ptmVarargs in Proc.ProcType.Modifiers then
|
||||||
inc(Flags,pfVarargs);
|
inc(Flags,pfVarargs);
|
||||||
|
if ptmAsync in Proc.ProcType.Modifiers then
|
||||||
|
inc(Flags,pfAsync);
|
||||||
if Proc.IsExternal then
|
if Proc.IsExternal then
|
||||||
inc(Flags,pfExternal);
|
inc(Flags,pfExternal);
|
||||||
if Flags>0 then
|
if Flags>0 then
|
||||||
|
@ -29738,17 +29738,19 @@ procedure TTestModule.TestRTTI_Class_Method;
|
|||||||
begin
|
begin
|
||||||
WithTypeInfo:=true;
|
WithTypeInfo:=true;
|
||||||
StartProgram(false);
|
StartProgram(false);
|
||||||
Add('type');
|
Add([
|
||||||
Add(' TObject = class');
|
'type',
|
||||||
Add(' private');
|
' TObject = class',
|
||||||
Add(' procedure Internal; external name ''$intern'';');
|
' private',
|
||||||
Add(' published');
|
' procedure Internal; external name ''$intern'';',
|
||||||
Add(' procedure Click; virtual; abstract;');
|
' published',
|
||||||
Add(' procedure Notify(Sender: TObject); virtual; abstract;');
|
' procedure Click; virtual; abstract;',
|
||||||
Add(' function GetNotify: boolean; external name ''GetNotify'';');
|
' procedure Notify(Sender: TObject); virtual; abstract;',
|
||||||
Add(' procedure Println(a,b: longint); varargs; virtual; abstract;');
|
' function GetNotify: boolean; external name ''GetNotify'';',
|
||||||
Add(' end;');
|
' procedure Println(a,b: longint); varargs; virtual; abstract;',
|
||||||
Add('begin');
|
' function Fetch(URL: string): word; async; external name ''Fetch'';',
|
||||||
|
' end;',
|
||||||
|
'begin']);
|
||||||
ConvertProgram;
|
ConvertProgram;
|
||||||
CheckSource('TestRTTI_Class_Method',
|
CheckSource('TestRTTI_Class_Method',
|
||||||
LinesToStr([ // statements
|
LinesToStr([ // statements
|
||||||
@ -29764,6 +29766,9 @@ begin
|
|||||||
' $r.addMethod("Println", 0, [["a", rtl.longint], ["b", rtl.longint]], null, {',
|
' $r.addMethod("Println", 0, [["a", rtl.longint], ["b", rtl.longint]], null, {',
|
||||||
' flags: 2',
|
' flags: 2',
|
||||||
' });',
|
' });',
|
||||||
|
' $r.addMethod("Fetch", 1, [["URL", rtl.string]], rtl.word, {',
|
||||||
|
' flags: 20',
|
||||||
|
' });',
|
||||||
'});',
|
'});',
|
||||||
'']),
|
'']),
|
||||||
LinesToStr([ // $mod.$main
|
LinesToStr([ // $mod.$main
|
||||||
|
Loading…
Reference in New Issue
Block a user