mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-13 16:49:22 +02:00
pastojs: fixed -OoShortRefGlobals
This commit is contained in:
parent
dab747c65d
commit
c24f8c9a35
@ -15372,7 +15372,7 @@ var
|
||||
C: TClass;
|
||||
AssignSt: TJSSimpleAssignStatement;
|
||||
NeedInitFunction, HasConstructor, IsJSFunction, NeedClassExt,
|
||||
SpecializeDelay: Boolean;
|
||||
SpecializeDelay, NeedTypeInfo: Boolean;
|
||||
Proc: TPasProcedure;
|
||||
begin
|
||||
Result:=nil;
|
||||
@ -15481,6 +15481,7 @@ begin
|
||||
end;
|
||||
|
||||
NeedInitFunction:=true;
|
||||
NeedTypeInfo:=(pcsfPublished in Scope.Flags) or HasTypeInfo(El,AContext);
|
||||
IntfKind:='';
|
||||
if El.ObjKind=okInterface then
|
||||
begin
|
||||
@ -15491,8 +15492,7 @@ begin
|
||||
else
|
||||
RaiseNotSupported(El,AContext,20180405093512);
|
||||
end;
|
||||
NeedInitFunction:=(pcsfPublished in Scope.Flags) or HasTypeInfo(El,AContext)
|
||||
or (IntfKind<>'') or (coShortRefGlobals in Options);
|
||||
NeedInitFunction:=NeedTypeInfo or (IntfKind<>'') or (coShortRefGlobals in Options);
|
||||
end;
|
||||
|
||||
if NeedInitFunction then
|
||||
@ -15634,11 +15634,14 @@ begin
|
||||
AddClassSupportedInterfaces(El,Src,FuncContext);
|
||||
AddClassMessageIds(El,Src,FuncContext,pbivnMessageInt);
|
||||
AddClassMessageIds(El,Src,FuncContext,pbivnMessageStr);
|
||||
// add RTTI init function
|
||||
if SpecializeDelay then
|
||||
AddClassRTTI(El,DelaySrc,DelayFuncContext)
|
||||
else
|
||||
AddClassRTTI(El,Src,FuncContext);
|
||||
if NeedTypeInfo then
|
||||
begin
|
||||
// add RTTI init function
|
||||
if SpecializeDelay then
|
||||
AddClassRTTI(El,DelaySrc,DelayFuncContext)
|
||||
else
|
||||
AddClassRTTI(El,Src,FuncContext);
|
||||
end;
|
||||
end;
|
||||
|
||||
end;// end of init function
|
||||
|
@ -3763,7 +3763,7 @@ begin
|
||||
'enumnumbers': SetOption(coEnumValuesAsNumbers,Enable);
|
||||
'removenotusedprivates': SetOption(coKeepNotUsedPrivates,not Enable);
|
||||
'removenotuseddeclarations': SetOption(coKeepNotUsedDeclarationsWPO,not Enable);
|
||||
'shortrefglobals': SetOption(coShortRefGlobals,not Enable);
|
||||
'shortrefglobals': SetOption(coShortRefGlobals,Enable);
|
||||
else
|
||||
Log.LogMsgIgnoreFilter(nUnknownOptimizationOption,[QuoteStr(aValue)]);
|
||||
end;
|
||||
|
@ -130,6 +130,7 @@ begin
|
||||
Params.AddStrings(SharedParams);
|
||||
if SecondRunParams<>nil then
|
||||
Params.AddStrings(SecondRunParams);
|
||||
writeln('BBB1 TCustomTestCLI_Precompile.CheckPrecompile ',Params.Text);
|
||||
Compile([MainFile,'-FU'+UnitOutputDir],ExpExitCode);
|
||||
if ExpExitCode=0 then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user