mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 00:19:38 +02:00
pastojs: filer: restore method decl SelfArg
git-svn-id: trunk@47706 -
This commit is contained in:
parent
bf5a2a46de
commit
54627fe1e7
packages/pastojs/src
@ -21166,7 +21166,12 @@ var
|
||||
if ProcScope.ImplProc<>nil then
|
||||
ProcScope:=ProcScope.ImplProc.CustomData as TPas2JSProcedureScope;
|
||||
if ProcScope.SelfArg=nil then
|
||||
begin
|
||||
{$IFDEF VerbosePas2JS}
|
||||
writeln('CreateReference Proc=',GetObjPath(Proc),' Left=',GetObjPath(Left),' LeftResolved=',GetResolverResultDbg(LeftResolved),' ProcScope.DeclarationProc=',GetObjPath(ProcScope.DeclarationProc));
|
||||
{$ENDIF}
|
||||
RaiseNotSupported(PosEl,AContext,20190209214906,GetObjName(Proc));
|
||||
end;
|
||||
Result:=CreateProcCallArgRef(Left,LeftResolved,ProcScope.SelfArg,AContext);
|
||||
end;
|
||||
end;
|
||||
|
@ -4576,10 +4576,9 @@ begin
|
||||
RaiseMsg(20180219135933,Scope.Element);
|
||||
AddReferenceToObj(Obj,'ImplProc',Scope.ImplProc);
|
||||
AddReferenceToObj(Obj,'Overridden',Scope.OverriddenProc);
|
||||
// ClassOrRecordScope: TPasClassScope; auto derived
|
||||
if Scope.SelfArg<>nil then
|
||||
RaiseMsg(20180211180457,Scope.Element); // SelfArg only valid for method implementation
|
||||
// Mode: TModeSwitch: auto derived
|
||||
// ClassOrRecordScope is auto derived
|
||||
// SelfArg is auto derived
|
||||
// Mode is auto derived
|
||||
WriteProcScopeFlags(Obj,'SFlags',Scope.Flags,[]);
|
||||
WriteBoolSwitches(Obj,'BoolSwitches',Scope.BoolSwitches,aContext.BoolSwitches);
|
||||
WriteModeSwitches(Obj,'ModeSwitches',Scope.ModeSwitches,aContext.ModeSwitches);
|
||||
@ -9492,12 +9491,15 @@ begin
|
||||
Scope.ClassRecScope:=Proc.Parent.CustomData as TPasClassOrRecordScope // no AddRef
|
||||
else
|
||||
; // set via Set_ProcedureScope_ImplProc
|
||||
// Scope.SelfArg only valid for method implementation
|
||||
|
||||
Scope.Flags:=ReadProcScopeFlags(Obj,Proc,'SFlags',[]);
|
||||
Scope.BoolSwitches:=ReadBoolSwitches(Obj,Proc,'BoolSwitches',aContext.BoolSwitches);
|
||||
Scope.ModeSwitches:=ReadModeSwitches(Obj,Proc,'ModeSwitches',aContext.ModeSwitches);
|
||||
|
||||
// Scope.SelfArg
|
||||
if (Scope.ClassRecScope<>nil) and (Scope.DeclarationProc=nil) then
|
||||
Resolver.CreateProcSelfArg(Proc);
|
||||
|
||||
//ReadIdentifierScope(Obj,Scope,aContext);
|
||||
end;
|
||||
|
||||
@ -9628,17 +9630,6 @@ begin
|
||||
|
||||
El.ProcType:=TPasProcedureType(CreateElement(TPasProcedureTypeClass(DeclProc.ProcType.ClassType),'',El));
|
||||
El.Modifiers:=ReadProcedureModifiers(Obj,El,'PMods',DeclProc.Modifiers*PCUProcedureModifiersImplProc);
|
||||
|
||||
if HasBody then
|
||||
begin
|
||||
// not a precompiled proc -> copy signature
|
||||
//if El.ProcType is TPasFunctionType then
|
||||
// begin
|
||||
// FuncType:=TPasFunctionType(El.ProcType);
|
||||
// FuncType.ResultEl:=TPasResultElement(CreateElement(TPasResultElement,
|
||||
// TPasFunctionType(DeclProc.ProcType).ResultEl.Name,FuncType));
|
||||
// end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -9671,6 +9662,7 @@ begin
|
||||
end;
|
||||
DefProcMods:=GetDefaultProcModifiers(El);
|
||||
El.Modifiers:=ReadProcedureModifiers(Obj,El,'PMods',DefProcMods);
|
||||
|
||||
// read ProcType after El.Modifiers
|
||||
El.ProcType:=TPasProcedureType(ReadElementProperty(
|
||||
Obj,El,'ProcType',TPasProcedureType,aContext));
|
||||
|
Loading…
Reference in New Issue
Block a user