mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-19 22:19:22 +02:00
fcl-passrc, pastojs: renamed modeswitch multiplescopehelpers to multihelpers
This commit is contained in:
parent
b58d2cdcac
commit
557d181ec9
@ -16897,7 +16897,7 @@ begin
|
||||
Scope.Add(HelperScope);
|
||||
HelperScope:=HelperScope.AncestorScope;
|
||||
end;
|
||||
if not (msMultipleScopeHelpers in CurrentParser.CurrentModeswitches) then
|
||||
if not (msMultiHelpers in CurrentParser.CurrentModeswitches) then
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
@ -295,7 +295,7 @@ type
|
||||
msPrefixedAttributes, { Allow attributes, disable proc modifier [] }
|
||||
msIgnoreAttributes, { workaround til resolver/converter supports attributes }
|
||||
msOmitRTTI, { treat class section 'published' as 'public' and typeinfo does not work on symbols declared with this switch }
|
||||
msMultipleScopeHelpers { off=only one helper per type, on=all }
|
||||
msMultiHelpers { off=only one helper per type, on=all }
|
||||
);
|
||||
TModeSwitches = Set of TModeSwitch;
|
||||
|
||||
@ -1040,7 +1040,7 @@ const
|
||||
'PREFIXEDATTRIBUTES',
|
||||
'IGNOREATTRIBUTES',
|
||||
'OMITRTTI',
|
||||
'MULTIPLESCOPEHELPERS'
|
||||
'MULTIHELPERS'
|
||||
);
|
||||
|
||||
LetterSwitchNames: array['A'..'Z'] of string=(
|
||||
|
@ -907,7 +907,7 @@ type
|
||||
Procedure TestClassHelper_ReintroduceHides_CallFail;
|
||||
Procedure TestClassHelper_DefaultProperty;
|
||||
Procedure TestClassHelper_DefaultClassProperty;
|
||||
Procedure TestClassHelper_MultipleScopeHelpers;
|
||||
Procedure TestClassHelper_MultiHelpers;
|
||||
Procedure TestRecordHelper;
|
||||
Procedure TestRecordHelper_ForByteFail;
|
||||
Procedure TestRecordHelper_ClassNonStaticFail;
|
||||
@ -16764,11 +16764,11 @@ begin
|
||||
ParseProgram;
|
||||
end;
|
||||
|
||||
procedure TTestResolver.TestClassHelper_MultipleScopeHelpers;
|
||||
procedure TTestResolver.TestClassHelper_MultiHelpers;
|
||||
begin
|
||||
StartProgram(false);
|
||||
Add([
|
||||
'{$modeswitch multiplescopehelpers}',
|
||||
'{$modeswitch multihelpers}',
|
||||
'type',
|
||||
' TObject = class',
|
||||
' end;',
|
||||
|
@ -1160,7 +1160,7 @@ const
|
||||
msArrayOperators,
|
||||
msIgnoreAttributes,
|
||||
msOmitRTTI,
|
||||
msMultipleScopeHelpers];
|
||||
msMultiHelpers];
|
||||
|
||||
msAllPas2jsBoolSwitchesReadOnly = [
|
||||
bsLongStrings
|
||||
|
@ -170,7 +170,7 @@ const
|
||||
'PrefixedAttributes',
|
||||
'IgnoreAttributes',
|
||||
'OmitRTTI',
|
||||
'MultipleScopeHelpers'
|
||||
'MultiHelpers'
|
||||
);
|
||||
|
||||
PCUDefaultBoolSwitches: TBoolSwitches = [
|
||||
@ -1385,8 +1385,10 @@ begin
|
||||
msISOLikeMod: Result:=43;
|
||||
msExternalClass: Result:=44;
|
||||
msPrefixedAttributes: Result:=45;
|
||||
// msIgnoreInterfaces: Result:=46;
|
||||
// was: msIgnoreInterfaces: Result:=46;
|
||||
msIgnoreAttributes: Result:=47;
|
||||
msOmitRTTI: Result:=48;
|
||||
msMultiHelpers: Result:=49;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -4892,6 +4894,8 @@ begin
|
||||
begin
|
||||
s:=Names[i];
|
||||
Found:=false;
|
||||
if (FileVersion<5) and (SameText(s,'multiplescopehelpers')) then
|
||||
s:=PCUModeSwitchNames[msMultiHelpers];
|
||||
for f in TModeSwitch do
|
||||
if s=PCUModeSwitchNames[f] then
|
||||
begin
|
||||
|
@ -1858,7 +1858,7 @@ function(){
|
||||
If there are multiple helpers for the same type, the last helper in scope wins.<br>
|
||||
A class with ancestors can have one active helper per ancestor type, so
|
||||
multiple helpers can be active, same as FPC/Delphi.<br>
|
||||
Using <b>{$modeswitch multiplescopehelpers}</b> you can activate all helpers
|
||||
Using <b>{$modeswitch multihelpers}</b> you can activate all helpers
|
||||
within scope.
|
||||
</li>
|
||||
<li>Nested helpers (e.g. <i>TDemo.TSub.THelper</i>) are elevated.
|
||||
|
Loading…
Reference in New Issue
Block a user