mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-09-28 11:09:06 +02:00
pastojs: fixed diable optimization using fpc syntax prepend No, issue 38045
This commit is contained in:
parent
3dfa40f9a8
commit
e760b9bd79
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user