mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 06:10:38 +02:00
pastojs: record complex only for records with class vars
git-svn-id: trunk@48131 -
This commit is contained in:
parent
5c2303a76b
commit
22864b47e4
@ -26464,7 +26464,7 @@ begin
|
|||||||
if (C=TPasConstructor)
|
if (C=TPasConstructor)
|
||||||
or ((aResolver<>nil) and aResolver.IsClassMethod(P)
|
or ((aResolver<>nil) and aResolver.IsClassMethod(P)
|
||||||
and not aResolver.MethodIsStatic(TPasProcedure(P))) then
|
and not aResolver.MethodIsStatic(TPasProcedure(P))) then
|
||||||
IsComplex:=true; // needs $record
|
; //IsComplex:=true; // needs $record
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else if C=TPasAttributes then
|
else if C=TPasAttributes then
|
||||||
|
@ -12339,12 +12339,20 @@ begin
|
|||||||
'type',
|
'type',
|
||||||
' TPoint = record',
|
' TPoint = record',
|
||||||
' x,y: longint;',
|
' x,y: longint;',
|
||||||
|
' class procedure Run(w: longint = 13); static;',
|
||||||
' constructor Create(ax: longint; ay: longint = -1);',
|
' constructor Create(ax: longint; ay: longint = -1);',
|
||||||
' end;',
|
' end;',
|
||||||
|
'class procedure tpoint.run(w: longint);',
|
||||||
|
'begin',
|
||||||
|
' run;',
|
||||||
|
' run();',
|
||||||
|
'end;',
|
||||||
'constructor tpoint.create(ax,ay: longint);',
|
'constructor tpoint.create(ax,ay: longint);',
|
||||||
'begin',
|
'begin',
|
||||||
' x:=ax;',
|
' x:=ax;',
|
||||||
' self.y:=ay;',
|
' self.y:=ay;',
|
||||||
|
' run;',
|
||||||
|
' run(ax);',
|
||||||
'end;',
|
'end;',
|
||||||
'var r: TPoint;',
|
'var r: TPoint;',
|
||||||
'begin',
|
'begin',
|
||||||
@ -12367,12 +12375,18 @@ begin
|
|||||||
' this.y = s.y;',
|
' this.y = s.y;',
|
||||||
' return this;',
|
' return this;',
|
||||||
' };',
|
' };',
|
||||||
|
' this.Run = function (w) {',
|
||||||
|
' $mod.TPoint.Run(13);',
|
||||||
|
' $mod.TPoint.Run(13);',
|
||||||
|
' };',
|
||||||
' this.Create = function (ax, ay) {',
|
' this.Create = function (ax, ay) {',
|
||||||
' this.x = ax;',
|
' this.x = ax;',
|
||||||
' this.y = ay;',
|
' this.y = ay;',
|
||||||
|
' this.Run(13);',
|
||||||
|
' this.Run(ax);',
|
||||||
' return this;',
|
' return this;',
|
||||||
' };',
|
' };',
|
||||||
'}, true);',
|
'});',
|
||||||
'this.r = this.TPoint.$new();',
|
'this.r = this.TPoint.$new();',
|
||||||
'']),
|
'']),
|
||||||
LinesToStr([ // $mod.$main
|
LinesToStr([ // $mod.$main
|
||||||
@ -23288,7 +23302,7 @@ begin
|
|||||||
' $mod.THelper.$new("NewHlp", [3]);',
|
' $mod.THelper.$new("NewHlp", [3]);',
|
||||||
' return this;',
|
' return this;',
|
||||||
' };',
|
' };',
|
||||||
'}, true);',
|
'});',
|
||||||
'rtl.createHelper(this, "THelper", null, function () {',
|
'rtl.createHelper(this, "THelper", null, function () {',
|
||||||
' this.NewHlp = function (w) {',
|
' this.NewHlp = function (w) {',
|
||||||
' this.Create(2);',
|
' this.Create(2);',
|
||||||
|
Loading…
Reference in New Issue
Block a user