From 3dfa40f9a8be05adba28b5955d0a040c2ab5ca87 Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 7 Nov 2020 10:25:55 +0000 Subject: [PATCH] pastojs: fixed diable optimization using fpc syntax prepend No, issue 38045 --- compiler/packages/pastojs/src/pas2jscompiler.pp | 7 ++++++- compiler/utils/pas2js/docs/translation.html | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/packages/pastojs/src/pas2jscompiler.pp b/compiler/packages/pastojs/src/pas2jscompiler.pp index 73861d9..71d0e83 100644 --- a/compiler/packages/pastojs/src/pas2jscompiler.pp +++ b/compiler/packages/pastojs/src/pas2jscompiler.pp @@ -3756,6 +3756,10 @@ begin begin Enable:=c='+'; Delete(aValue,length(aValue),1); + end + else if lowercase(LeftStr(aValue,2))='no' then begin + Enable:=false; + Delete(aValue,1,2); end; Case LowerCase(aValue) of 'enumnumbers': SetOption(coEnumValuesAsNumbers,Enable); @@ -4738,7 +4742,8 @@ begin w(' -OoEnumNumbers[-]: write enum value as number instead of name. Default in -O1.'); w(' -OoRemoveNotUsedPrivates[-]: Default is enabled'); w(' -OoRemoveNotUsedDeclarations[-]: Default enabled for programs with -Jc'); - w(' -OoShortRefGlobals[-]: Insert JS local var for types and modules. Default enabled in -O2'); + w(' -OoRemoveNotUsedPublished[-] : Default is disabled'); + w(' -OoShortRefGlobals[-]: Insert JS local var for types, modules and static functions. Default enabled in -O2'); w(' -P : Set target processor. Case insensitive:'); w(' -Pecmascript5: default'); w(' -Pecmascript6'); diff --git a/compiler/utils/pas2js/docs/translation.html b/compiler/utils/pas2js/docs/translation.html index b7f930f..b1fef9f 100644 --- a/compiler/utils/pas2js/docs/translation.html +++ b/compiler/utils/pas2js/docs/translation.html @@ -198,7 +198,7 @@ Put + after a boolean switch option to enable it, - to disable it -OoRemoveNotUsedPrivates[-] : Default is enabled -OoRemoveNotUsedDeclarations[-] : Default enabled for programs with -Jc -OoRemoveNotUsedPublished[-] : Default is disabled - -OoShortRefGlobals[-]: Insert JS local var for types and modules. Default enabled in -O2 + -OoShortRefGlobals[-]: Insert JS local var for types, modules and static functions. Default enabled in -O2 -P<x> : Set target processor. Case insensitive: -Pecmascript5 : default -Pecmascript6