mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-06 07:07:54 +02:00
pastojs: filer: fixed restoring overload names of specialized methods
This commit is contained in:
parent
cc7c15f35e
commit
758492a59c
@ -1872,7 +1872,7 @@ type
|
||||
procedure SpecializeElArray(GenEl, SpecEl: TPasElement;
|
||||
GenList: TPasElementArray; var SpecList: TPasElementArray; AllowReferences: boolean
|
||||
{$IFDEF CheckPasTreeRefCount}; const RefId: string{$ENDIF});
|
||||
procedure SpecializeProcedure(GenEl, SpecEl: TPasProcedure; SpecializedItem: TPRSpecializedItem);
|
||||
procedure SpecializeProcedure(GenEl, SpecEl: TPasProcedure; SpecializedItem: TPRSpecializedItem); virtual;
|
||||
procedure SpecializeOperator(GenEl, SpecEl: TPasOperator);
|
||||
procedure SpecializeProcedureType(GenEl, SpecEl: TPasProcedureType; SpecializedItem: TPRSpecializedItem);
|
||||
procedure SpecializeProcedureBody(GenEl, SpecEl: TProcedureBody);
|
||||
|
@ -1557,6 +1557,8 @@ type
|
||||
override;
|
||||
procedure SpecializeGenericImpl(SpecializedItem: TPRSpecializedItem);
|
||||
override;
|
||||
procedure SpecializeProcedure(GenEl, SpecEl: TPasProcedure;
|
||||
SpecializedItem: TPRSpecializedItem); override;
|
||||
function SpecializeParamsNeedDelay(SpecializedItem: TPRSpecializedItem): TPasElement; virtual;
|
||||
function IsSpecializedNonStaticMethod(ProcType: TPasProcedureType): boolean;
|
||||
protected
|
||||
@ -5260,6 +5262,22 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPas2JSResolver.SpecializeProcedure(GenEl, SpecEl: TPasProcedure;
|
||||
SpecializedItem: TPRSpecializedItem);
|
||||
var
|
||||
GenProcScope, SpecProcScope: TPas2JSProcedureScope;
|
||||
begin
|
||||
GenProcScope:=GenEl.CustomData as TPas2JSProcedureScope;
|
||||
SpecProcScope:=SpecEl.CustomData as TPas2JSProcedureScope;
|
||||
if SpecializedItem=nil then
|
||||
begin
|
||||
SpecProcScope.OverloadName:=GenProcScope.OverloadName;
|
||||
SpecProcScope.JSName:=GenProcScope.JSName;
|
||||
// SpecProcScope.ResultVarName is set on demand
|
||||
end;
|
||||
inherited SpecializeProcedure(GenEl, SpecEl, SpecializedItem);
|
||||
end;
|
||||
|
||||
function TPas2JSResolver.SpecializeParamsNeedDelay(
|
||||
SpecializedItem: TPRSpecializedItem): TPasElement;
|
||||
// finds first specialize param defined later than the generic
|
||||
|
@ -4589,6 +4589,7 @@ var
|
||||
OldInGeneric: Boolean;
|
||||
begin
|
||||
WritePasElement(Obj,El,aContext);
|
||||
|
||||
Scope:=El.CustomData as TPas2JSProcedureScope;
|
||||
//writeln('TPCUWriter.WriteProcedure ',GetObjName(El),' ',GetObjName(Scope),' ',Resolver.GetElementSourcePosStr(El));
|
||||
|
||||
@ -6675,7 +6676,7 @@ begin
|
||||
if not ReadInteger(Obj,'Id',Id,GenEl) then
|
||||
RaiseMsg(20200531085133,GenEl);
|
||||
if not ReadString(Obj,'SpecName',SpecName,GenEl) then
|
||||
RaiseMsg(20200531085133,GenEl);
|
||||
RaiseMsg(20200531085134,GenEl);
|
||||
|
||||
PendSpec:=PromiseSpecialize(Id,SpecName,nil,GenEl);
|
||||
PendSpec.Obj:=Obj;
|
||||
|
Loading…
Reference in New Issue
Block a user