summaryrefslogtreecommitdiff
path: root/packages/pastojs/tests/tcmodules.pas
diff options
context:
space:
mode:
Diffstat (limited to 'packages/pastojs/tests/tcmodules.pas')
-rw-r--r--packages/pastojs/tests/tcmodules.pas75
1 files changed, 38 insertions, 37 deletions
diff --git a/packages/pastojs/tests/tcmodules.pas b/packages/pastojs/tests/tcmodules.pas
index d3f5908660..26afc5744c 100644
--- a/packages/pastojs/tests/tcmodules.pas
+++ b/packages/pastojs/tests/tcmodules.pas
@@ -29256,20 +29256,20 @@ begin
CheckSource('TestRTTI_ProcType',
LinesToStr([ // statements
'this.$rtti.$ProcVar("TProcA", {',
- ' procsig: rtl.newTIProcSig(null)',
+ ' procsig: rtl.newTIProcSig([])',
'});',
'this.$rtti.$MethodVar("TMethodB", {',
- ' procsig: rtl.newTIProcSig(null),',
+ ' procsig: rtl.newTIProcSig([]),',
' methodkind: 0',
'});',
'this.$rtti.$ProcVar("TProcC", {',
- ' procsig: rtl.newTIProcSig(null, 2)',
+ ' procsig: rtl.newTIProcSig([], null, 2)',
'});',
'this.$rtti.$ProcVar("TProcD", {',
' procsig: rtl.newTIProcSig([["i", rtl.longint], ["j", rtl.string, 2], ["c", rtl.char, 1], ["d", rtl.double, 4]])',
'});',
'this.$rtti.$ProcVar("TProcE", {',
- ' procsig: rtl.newTIProcSig(null, rtl.nativeint)',
+ ' procsig: rtl.newTIProcSig([], rtl.nativeint)',
'});',
'this.$rtti.$ProcVar("TProcF", {',
' procsig: rtl.newTIProcSig([["p", this.$rtti["TProcA"], 2]], rtl.nativeuint)',
@@ -29578,13 +29578,13 @@ begin
' this.Fly = function () {',
' };',
' var $r = this.$rtti;',
- ' $r.addMethod("Fly", 0, null);',
+ ' $r.addMethod("Fly", 0, []);',
'});',
'rtl.createClass(this, "TEagle", this.TBird, function () {',
' this.Fly = function () {',
' };',
' var $r = this.$rtti;',
- ' $r.addMethod("Fly", 0, null);',
+ ' $r.addMethod("Fly", 0, []);',
'});',
'']),
LinesToStr([ // $mod.$main
@@ -29738,17 +29738,19 @@ procedure TTestModule.TestRTTI_Class_Method;
begin
WithTypeInfo:=true;
StartProgram(false);
- Add('type');
- Add(' TObject = class');
- Add(' private');
- Add(' procedure Internal; external name ''$intern'';');
- Add(' published');
- Add(' procedure Click; virtual; abstract;');
- Add(' procedure Notify(Sender: TObject); virtual; abstract;');
- Add(' function GetNotify: boolean; external name ''GetNotify'';');
- Add(' procedure Println(a,b: longint); varargs; virtual; abstract;');
- Add(' end;');
- Add('begin');
+ Add([
+ 'type',
+ ' TObject = class',
+ ' private',
+ ' procedure Internal; external name ''$intern'';',
+ ' published',
+ ' procedure Click; virtual; abstract;',
+ ' procedure Notify(Sender: TObject); virtual; abstract;',
+ ' function GetNotify: boolean; external name ''GetNotify'';',
+ ' procedure Println(a,b: longint); varargs; virtual; abstract;',
+ ' function Fetch(URL: string): word; async; external name ''Fetch'';',
+ ' end;',
+ 'begin']);
ConvertProgram;
CheckSource('TestRTTI_Class_Method',
LinesToStr([ // statements
@@ -29758,12 +29760,11 @@ begin
' this.$final = function () {',
' };',
' var $r = this.$rtti;',
- ' $r.addMethod("Click", 0, null);',
+ ' $r.addMethod("Click", 0, []);',
' $r.addMethod("Notify", 0, [["Sender", $r]]);',
- ' $r.addMethod("GetNotify", 1, null, rtl.boolean,{flags: 4});',
- ' $r.addMethod("Println", 0, [["a", rtl.longint], ["b", rtl.longint]], null, {',
- ' flags: 2',
- ' });',
+ ' $r.addMethod("GetNotify", 1, [], rtl.boolean, 4);',
+ ' $r.addMethod("Println", 0, [["a", rtl.longint], ["b", rtl.longint]], null, 2);',
+ ' $r.addMethod("Fetch", 1, [["URL", rtl.string]], rtl.word, 20);',
'});',
'']),
LinesToStr([ // $mod.$main
@@ -30507,7 +30508,7 @@ begin
' this.$final = function () {',
' };',
' var $r = this.$rtti;',
- ' $r.addMethod("DoIt", 0, null);',
+ ' $r.addMethod("DoIt", 0, []);',
'});',
'rtl.createClass(this, "TSky", this.TObject, function () {',
' this.DoIt = function () {',
@@ -30549,14 +30550,14 @@ begin
' this.DoIt = function () {',
' };',
' var $r = this.$rtti;',
- ' $r.addMethod("DoIt", 0, null);',
+ ' $r.addMethod("DoIt", 0, []);',
'});',
'rtl.createClass(this, "TSky", this.TObject, function () {',
' this.DoIt = function () {',
' $mod.TObject.DoIt.call(this);',
' };',
' var $r = this.$rtti;',
- ' $r.addMethod("DoIt", 0, null);',
+ ' $r.addMethod("DoIt", 0, []);',
'});',
'']),
LinesToStr([ // $mod.$main
@@ -30633,7 +30634,7 @@ begin
'});',
'this.$rtti.$Class("TBridge");',
'this.$rtti.$ProcVar("TProc", {',
- ' procsig: rtl.newTIProcSig(null, this.$rtti["TBridge"])',
+ ' procsig: rtl.newTIProcSig([], this.$rtti["TBridge"])',
'});',
'rtl.createClass(this, "TOger", this.TObject, function () {',
' this.$init = function () {',
@@ -30696,7 +30697,7 @@ begin
' instancetype: this.$rtti["TObject"]',
'});',
'this.$rtti.$ProcVar("TProcA", {',
- ' procsig: rtl.newTIProcSig(null, this.$rtti["TClass"])',
+ ' procsig: rtl.newTIProcSig([], this.$rtti["TClass"])',
'});',
'rtl.createClass(this, "TObject", null, function () {',
' this.$init = function () {',
@@ -31169,10 +31170,10 @@ begin
' eltype: rtl.string',
'});',
'this.$rtti.$ProcVar("TProc", {',
- ' procsig: rtl.newTIProcSig(null)',
+ ' procsig: rtl.newTIProcSig([])',
'});',
'this.$rtti.$MethodVar("TMethod", {',
- ' procsig: rtl.newTIProcSig(null),',
+ ' procsig: rtl.newTIProcSig([]),',
' methodkind: 0',
'});',
'this.StaticArray = rtl.arraySetLength(null,"",2);',
@@ -31457,7 +31458,7 @@ begin
' null,',
' function () {',
' var $r = this.$rtti;',
- ' $r.addMethod("GetItem", 1, null, rtl.longint);',
+ ' $r.addMethod("GetItem", 1, [], rtl.longint);',
' $r.addMethod("SetItem", 0, [["Value", rtl.longint]]);',
' $r.addProperty("Item", 3, rtl.longint, "GetItem", "SetItem");',
' }',
@@ -31524,8 +31525,8 @@ begin
' this.$kind = "com";',
' var $r = this.$rtti;',
' $r.addMethod("QueryInterface", 1, [["iid", $mod.$rtti["TGuid"], 2], ["obj", null, 4]], rtl.longint);',
- ' $r.addMethod("_AddRef", 1, null, rtl.longint);',
- ' $r.addMethod("_Release", 1, null, rtl.longint);',
+ ' $r.addMethod("_AddRef", 1, [], rtl.longint);',
+ ' $r.addMethod("_Release", 1, [], rtl.longint);',
' }',
');',
'rtl.createInterface(',
@@ -31536,7 +31537,7 @@ begin
' this.IUnknown,',
' function () {',
' var $r = this.$rtti;',
- ' $r.addMethod("GetItem", 1, null, rtl.longint);',
+ ' $r.addMethod("GetItem", 1, [], rtl.longint);',
' $r.addMethod("SetItem", 0, [["Value", rtl.longint]]);',
' $r.addProperty("Item", 3, rtl.longint, "GetItem", "SetItem");',
' }',
@@ -31588,7 +31589,7 @@ begin
' return Result;',
' };',
' var $r = this.$rtti;',
- ' $r.addMethod("GetItem", 1, null, rtl.longint);',
+ ' $r.addMethod("GetItem", 1, [], rtl.longint);',
' $r.addProperty("Item", 1, rtl.longint, "GetItem", "");',
'});',
'this.t = null;',
@@ -31676,8 +31677,8 @@ begin
' pas.system.IUnknown,',
' function () {',
' var $r = this.$rtti;',
- ' $r.addMethod("Swoop", 1, null, pas.unit2.$rtti["TWordArray"]);',
- ' $r.addMethod("Glide", 1, null, pas.unit2.$rtti["TArray<System.Word>"]);',
+ ' $r.addMethod("Swoop", 1, [], pas.unit2.$rtti["TWordArray"]);',
+ ' $r.addMethod("Glide", 1, [], pas.unit2.$rtti["TArray<System.Word>"]);',
' }',
');',
'this.Fly = function () {',
@@ -31882,7 +31883,7 @@ begin
' attr: [$mod.TCustomAttribute, "Create$1", [14]]',
' }',
' );',
- ' $r.addMethod("Fly", 0, null, null, {',
+ ' $r.addMethod("Fly", 0, [], null, 0, {',
' attr: [$mod.TCustomAttribute, "Create$1", [15]]',
' });',
'});',