mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-31 22:10:51 +02:00
pastojs: fixed intf function
git-svn-id: trunk@37254 -
This commit is contained in:
parent
f0a0526b68
commit
2d33a8d949
@ -1134,7 +1134,7 @@ type
|
||||
FTargetProcessor: TPasToJsProcessor;
|
||||
Function CreatePrimitiveDotExpr(AName: string; Src: TPasElement = nil): TJSElement;
|
||||
Function CreateSubDeclNameExpr(El: TPasElement; const Name: string;
|
||||
AContext: TConvertContext): TJSElement;
|
||||
AContext: TConvertContext; PosEl: TPasElement = nil): TJSElement;
|
||||
Function CreateIdentifierExpr(El: TPasElement; AContext: TConvertContext): TJSElement;
|
||||
Function CreateIdentifierExpr(AName: string; El: TPasElement; AContext: TConvertContext): TJSElement;
|
||||
Function CreateSwitchStatement(El: TPasImplCaseOf; AContext: TConvertContext): TJSElement;
|
||||
@ -4445,16 +4445,18 @@ begin
|
||||
end;
|
||||
|
||||
function TPasToJSConverter.CreateSubDeclNameExpr(El: TPasElement;
|
||||
const Name: string; AContext: TConvertContext): TJSElement;
|
||||
const Name: string; AContext: TConvertContext; PosEl: TPasElement
|
||||
): TJSElement;
|
||||
var
|
||||
CurName, ParentName: String;
|
||||
begin
|
||||
if PosEl=nil then PosEl:=El;
|
||||
CurName:=TransformVariableName(El,Name,AContext);
|
||||
ParentName:=AContext.GetLocalName(El.Parent);
|
||||
if ParentName='' then
|
||||
ParentName:='this';
|
||||
CurName:=ParentName+'.'+CurName;
|
||||
Result:=CreatePrimitiveDotExpr(CurName,El);
|
||||
Result:=CreatePrimitiveDotExpr(CurName,PosEl);
|
||||
end;
|
||||
|
||||
function TPasToJSConverter.ConvertPrimitiveExpression(El: TPrimitiveExpr;
|
||||
@ -8620,7 +8622,7 @@ begin
|
||||
begin
|
||||
AssignSt:=TJSSimpleAssignStatement(CreateElement(TJSSimpleAssignStatement,ImplProc));
|
||||
Result:=AssignSt;
|
||||
AssignSt.LHS:=CreateSubDeclNameExpr(ImplProc,El.Name,AContext);
|
||||
AssignSt.LHS:=CreateSubDeclNameExpr(El,El.Name,AContext,ImplProc);
|
||||
end;
|
||||
|
||||
FS:=CreateFunction(ImplProc,ImplProc.Body<>nil);
|
||||
|
Loading…
Reference in New Issue
Block a user