fcl-passrc: renamed bsMethodCallChecks to bsObjectChecks

git-svn-id: trunk@38008 -
This commit is contained in:
Mattias Gaertner 2018-01-19 09:35:29 +00:00
parent 37a9467603
commit afb4add9c7
4 changed files with 23 additions and 22 deletions

View File

@ -303,7 +303,7 @@ type
bsWarnings, bsWarnings,
bsMacro, bsMacro,
bsScopedEnums, bsScopedEnums,
bsMethodCallChecks // check type of Self bsObjectChecks // check methods 'Self' and object type casts
); );
TBoolSwitches = set of TBoolSwitch; TBoolSwitches = set of TBoolSwitch;
const const
@ -972,7 +972,7 @@ const
'Warnings', 'Warnings',
'Macro', 'Macro',
'ScopedEnums', 'ScopedEnums',
'MethodCallChecks' 'ObjectChecks'
); );
const const

View File

@ -854,7 +854,7 @@ const
bsWarnings, bsWarnings,
bsMacro, bsMacro,
bsScopedEnums, bsScopedEnums,
bsMethodCallChecks bsObjectChecks
]; ];
btAllJSBaseTypes = [ btAllJSBaseTypes = [
@ -5981,7 +5981,7 @@ begin
Result:=ConvertElement(Param,AContext); Result:=ConvertElement(Param,AContext);
if bsMethodCallChecks in AContext.ScannerBoolSwitches then if bsObjectChecks in AContext.ScannerBoolSwitches then
begin begin
if (C=TPasClassType) if (C=TPasClassType)
or (C=TPasClassOfType) then or (C=TPasClassOfType) then
@ -9256,7 +9256,7 @@ begin
end; end;
BodyPas:=ImplProc.Body; BodyPas:=ImplProc.Body;
if (BodyPas<>nil) or (bsMethodCallChecks in ImplProcScope.ScannerBoolSwitches) then if (BodyPas<>nil) or (bsObjectChecks in ImplProcScope.ScannerBoolSwitches) then
begin begin
PosEl:=BodyPas; PosEl:=BodyPas;
if PosEl=nil then if PosEl=nil then
@ -9271,7 +9271,7 @@ begin
begin begin
// method or class method // method or class method
FuncContext.ThisPas:=ProcScope.ClassScope.Element; FuncContext.ThisPas:=ProcScope.ClassScope.Element;
if bsMethodCallChecks in FuncContext.ScannerBoolSwitches then if bsObjectChecks in FuncContext.ScannerBoolSwitches then
begin begin
// rtl.checkMethodCall(this,<class>) // rtl.checkMethodCall(this,<class>)
Call:=CreateCallExpression(PosEl); Call:=CreateCallExpression(PosEl);

View File

@ -89,9 +89,9 @@ type
coShowUsedTools, coShowUsedTools,
coShowMessageNumbers, // not in "show all" coShowMessageNumbers, // not in "show all"
coShowDebug, // not in "show all" coShowDebug, // not in "show all"
coOverflowChecking, coOverflowChecks,
coRangeChecking, coRangeChecks,
coMethodCallChecking, coObjectChecks,
coAssertions, coAssertions,
coAllowCAssignments, coAllowCAssignments,
coLowerCase, coLowerCase,
@ -719,12 +719,12 @@ begin
Scanner.CurrentModeSwitches:=p2jsMode_SwitchSets[Compiler.Mode]; Scanner.CurrentModeSwitches:=p2jsMode_SwitchSets[Compiler.Mode];
Scanner.AllowedBoolSwitches:=msAllPas2jsBoolSwitches; Scanner.AllowedBoolSwitches:=msAllPas2jsBoolSwitches;
bs:=[]; bs:=[];
if coOverflowChecking in Compiler.Options then if coOverflowChecks in Compiler.Options then
Include(bs,bsOverflowChecks); Include(bs,bsOverflowChecks);
if coRangeChecking in Compiler.Options then if coRangeChecks in Compiler.Options then
Include(bs,bsRangeChecks); Include(bs,bsRangeChecks);
if coMethodCallChecking in Compiler.Options then if coObjectChecks in Compiler.Options then
Include(bs,bsMethodCallChecks); Include(bs,bsObjectChecks);
if coAssertions in Compiler.Options then if coAssertions in Compiler.Options then
Include(bs,bsAssertions); Include(bs,bsAssertions);
if coShowHints in Compiler.Options then if coShowHints in Compiler.Options then
@ -2618,16 +2618,16 @@ begin
ReadSingleLetterOptions(Param,p,'orR',Enabled,Disabled); ReadSingleLetterOptions(Param,p,'orR',Enabled,Disabled);
for i:=1 to length(Enabled) do begin for i:=1 to length(Enabled) do begin
case Enabled[i] of case Enabled[i] of
'o': Options:=Options+[coOverflowChecking]; 'o': Options:=Options+[coOverflowChecks];
'r': Options:=Options+[coRangeChecking]; 'r': Options:=Options+[coRangeChecks];
'R': Options:=Options+[coMethodCallChecking]; 'R': Options:=Options+[coObjectChecks];
end; end;
end; end;
for i:=1 to length(Disabled) do begin for i:=1 to length(Disabled) do begin
case Disabled[i] of case Disabled[i] of
'o': Options:=Options-[coOverflowChecking]; 'o': Options:=Options-[coOverflowChecks];
'r': Options:=Options-[coRangeChecking]; 'r': Options:=Options-[coRangeChecks];
'R': Options:=Options-[coMethodCallChecking]; 'R': Options:=Options-[coObjectChecks];
end; end;
end; end;
end; end;
@ -3149,7 +3149,7 @@ begin
l(' -C<x> : Code generation options. <x> is a combination of the following letters:'); l(' -C<x> : Code generation options. <x> is a combination of the following letters:');
l(' o : Overflow checking'); l(' o : Overflow checking');
l(' r : Range checking'); l(' r : Range checking');
l(' R : Verify object method calls and object type casts'); l(' R : Object checks. Verify method calls and object type casts.');
l(' -F... Set file names and paths:'); l(' -F... Set file names and paths:');
l(' -Fe<x> : Redirect output to <x>. UTF-8 encoded.'); l(' -Fe<x> : Redirect output to <x>. UTF-8 encoded.');
l(' -Fi<x> : Add <x> to include paths'); l(' -Fi<x> : Add <x> to include paths');

View File

@ -131,7 +131,7 @@ Put + after a boolean switch option to enable it, - to disable it
-C&lt;x&gt; : Code generation options. &lt;x&gt; is a combination of the following letters: -C&lt;x&gt; : Code generation options. &lt;x&gt; is a combination of the following letters:
o : Overflow checking o : Overflow checking
r : Range checking r : Range checking
R : Verify object method call and object type casts R : Object checks. Verify method calls and object type casts.
-F... Set file names and paths: -F... Set file names and paths:
-Fe&lt;x&gt; : Redirect output to &lt;x&gt; -Fe&lt;x&gt; : Redirect output to &lt;x&gt;
-Fi&lt;x&gt; : Add &lt;x&gt; to include paths -Fi&lt;x&gt; : Add &lt;x&gt; to include paths
@ -2380,10 +2380,11 @@ End.
Note that <i>new Boolean(false)</i> is not <i>null</i> and the condition is true. Note that <i>new Boolean(false)</i> is not <i>null</i> and the condition is true.
</li> </li>
<li><i>function Assigned(V: jsvalue): boolean</i> returns true if<br> <li><i>function Assigned(V: jsvalue): boolean</i> returns true if<br>
<i>(V!=undefined) && (V!=null) && (!rtl.isArray(V) || (V.length > 0))</i></li> <i>(V!=undefined) && (V!=null) && (!rtl.isArray(V) || (V.length > 0))</i></li>
<li><i>function StrictEqual(const A: jsvalue; const B): boolean</i></li> <li><i>function StrictEqual(const A: jsvalue; const B): boolean</i></li>
<li><i>function StrictInequal(const A: jsvalue; const B): boolean</i></li> <li><i>function StrictInequal(const A: jsvalue; const B): boolean</i></li>
<li>Any array can be assigned to an <i>array of jsvalue</i>.</li> <li>Any array can be assigned to an <i>array of jsvalue</i>.</li>
<li>is-operator: <i>jsvalue is class-type</i>, <i>jsvalue is class-of-type</i><br>
<li>The unit JS provides many utility functions for JSValue, like <i>hasString, <li>The unit JS provides many utility functions for JSValue, like <i>hasString,
hasValue, isBoolean, isNumber, isInteger, isObject, isClass, isClassInstance, etc..</i></li> hasValue, isBoolean, isNumber, isInteger, isObject, isClass, isClassInstance, etc..</i></li>
</ul> </ul>