pastojs: fixed diable optimization using fpc syntax prepend No, issue #38045

git-svn-id: trunk@47334 -
This commit is contained in:
Mattias Gaertner 2020-11-07 10:56:30 +00:00
parent f7050ef41a
commit 280c0d90f7
3 changed files with 11 additions and 0 deletions

View File

@ -3424,6 +3424,12 @@ begin
if p=StartP then
Error(nWarnIllegalCompilerDirectiveX,sWarnIllegalCompilerDirectiveX,['optimization']);
OptName:=copy(Param,StartP,p-StartP);
if lowercase(LeftStr(OptName,2))='no' then
begin
Delete(OptName,1,2);
DoHandleOptimization(OptName,'-');
exit;
end;
// skip whitespace
while (p<=l) and (Param[p] in [' ',#9,#10,#13]) do
inc(p);

View File

@ -2943,6 +2943,10 @@ procedure TPas2jsPasScanner.DoHandleOptimization(OptName, OptValue: string);
begin
case lowercase(OptName) of
'enumnumbers':
HandleBoolean(coEnumNumbers,true);
'usestrict':
HandleBoolean(coUseStrict,true);
'jsshortrefglobals':
HandleBoolean(coShortRefGlobals,true);
else

View File

@ -3254,6 +3254,7 @@ end.
</li>
<li>{$DispatchField Msg}: enable checking <i>message number</i> methods for record field name "Msg"</li>
<li>{$DispatchStrField MsgStr}: enable checking <i>message string</i> methods for record field name "Msg"</li>
<li>{$Optimization Name}: same as command line option -OoName</li>
</ul>
Defines:
<ul>