summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattias <mattias@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-03-08 20:29:55 +0000
committermattias <mattias@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-03-08 20:29:55 +0000
commit7583ad7e90f541acbcbc1457abd3ab30cf2657aa (patch)
tree2ea71937521481f85ac0f9f3ba3f0fcc14444a72
parentee3ed29064311809f8c6b802d3ba7316ef994b62 (diff)
downloadfpc-7583ad7e90f541acbcbc1457abd3ab30cf2657aa.tar.gz
pastojs: fixed creating enum shortrefs for precompiled code
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@48924 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--packages/pastojs/src/fppas2js.pp16
-rw-r--r--packages/pastojs/src/pas2jsfiler.pp5
2 files changed, 10 insertions, 11 deletions
diff --git a/packages/pastojs/src/fppas2js.pp b/packages/pastojs/src/fppas2js.pp
index a0fd7c6ecf..21498b9f86 100644
--- a/packages/pastojs/src/fppas2js.pp
+++ b/packages/pastojs/src/fppas2js.pp
@@ -8183,7 +8183,7 @@ Var
HasImplUsesClause, ok, NeedRTLCheckVersion: Boolean;
Prg: TPasProgram;
Lib: TPasLibrary;
- AssignSt: TJSSimpleAssignStatement;
+ ImplFuncAssignSt: TJSSimpleAssignStatement;
IntfSecCtx: TInterfaceSectionContext;
ModScope: TPas2JSModuleScope;
begin
@@ -8290,10 +8290,10 @@ begin
ImplFunc:=CreateImplementationSection(El,IntfSecCtx);
// add $mod.$implcode = ImplFunc;
- AssignSt:=TJSSimpleAssignStatement(CreateElement(TJSSimpleAssignStatement,El));
- AssignSt.LHS:=CreateMemberExpression([ModVarName,GetBIName(pbivnImplCode)]);
- AssignSt.Expr:=ImplFunc;
- AddToSourceElements(Src,AssignSt);
+ ImplFuncAssignSt:=TJSSimpleAssignStatement(CreateElement(TJSSimpleAssignStatement,El));
+ ImplFuncAssignSt.LHS:=CreateMemberExpression([ModVarName,GetBIName(pbivnImplCode)]);
+ ImplFuncAssignSt.Expr:=ImplFunc;
+ AddToSourceElements(Src,ImplFuncAssignSt);
// append initialization section
CreateInitSection(El,Src,IntfSecCtx);
@@ -8305,7 +8305,7 @@ begin
// remove unneeded $impl from interface
RemoveFromSourceElements(Src,ImplVarSt);
// remove unneeded $mod.$implcode = function(){}
- RemoveFromSourceElements(Src,AssignSt);
+ RemoveFromSourceElements(Src,ImplFuncAssignSt);
HasImplUsesClause:=(El.ImplementationSection<>nil)
and (length(El.ImplementationSection.UsesClause)>0);
end
@@ -27078,8 +27078,8 @@ begin
for i:=0 to ElRefList.Count-1 do
begin
El:=TPasElement(ElRefList[i]);
- if ElNeedsGlobalAlias(El) then
- CreateGlobalElPath(El,SectionContext);
+ // Note: they are all needed by precompiled code, do not check ElNeedsGlobalAlias
+ CreateGlobalElPath(El,SectionContext);
end;
end;
diff --git a/packages/pastojs/src/pas2jsfiler.pp b/packages/pastojs/src/pas2jsfiler.pp
index 4a28a96f78..6e9660b891 100644
--- a/packages/pastojs/src/pas2jsfiler.pp
+++ b/packages/pastojs/src/pas2jsfiler.pp
@@ -46,8 +46,6 @@ Works:
- gzipped json
- write final switches
- srcmaps for precompiled js
-
-ToDo:
- generics:
- generic proc bodies are stored with all elements, but without resolver customdata
- specializations are stored like external elements
@@ -70,8 +68,9 @@ ToDo:
- TPCUReader.ReadExternalSpecialized
-
- TPCUReader.ReadSpecializeType reads a TPasSpecializeType and creates specialized type
- - TPCUReader.ReadInlineSpecializeExpr: ToDo create specialized type
+ - TPCUReader.ReadInlineSpecializeExpr: create specialized type
+Todo:
- store used GUIDs
- distinguish reader errors in fatal and error
- when pcu is bad, unload and use src