Skip to content

Commit ec7eca4

Browse files
committed
Renamed "TranslateFile" to "DisableTranslation".
Defaults to false. Renamed "ProcessNameOfExpression" to "DisableNameOfProcessing". Defaults to false.
1 parent 76012b1 commit ec7eca4

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

CSharpToJavaScript/CSTOJS.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static FileData[] Translate(FileData[] files, MetadataReference[]? refere
8181

8282
for (int i = 0; i < files.Length; i++)
8383
{
84-
if (files[i].OptionsForFile.TranslateFile == false)
84+
if (files[i].OptionsForFile.DisableTranslation)
8585
continue;
8686

8787
SemanticModel _model = compilation.GetSemanticModel(trees[i]);

CSharpToJavaScript/CSTOJSOptions.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,40 +88,40 @@ public class CSTOJSOptions
8888
public bool NormalizeWhitespace { get; set; } = false;
8989

9090
/// <summary>
91-
/// Translate current <see cref="FileData" />. If false, walker will not be called.
91+
/// Do not translate current <see cref="FileData" />. If true, walkers/rewriters will not be called.
9292
/// </summary>
9393
/// <remarks>
9494
/// <blockquote class="NOTE"><h5>NOTE</h5>
9595
/// <para>
96-
/// cstojs_options.xml: &lt;Option TranslateFile=&quot;true&quot; /&gt;
96+
/// cstojs_options.xml: &lt;Option DisableTranslation=&quot;false&quot; /&gt;
9797
/// </para>
9898
/// </blockquote>
9999
/// </remarks>
100100
/// <value>
101-
/// Default: <c>true</c>
101+
/// Default: <c>false</c>
102102
/// </value>
103-
public bool TranslateFile { get; set; } = true;
103+
public bool DisableTranslation { get; set; } = false;
104104

105105
/// <summary>
106-
/// Process the nameof expression.
106+
/// Disable processing of the nameof expression.
107107
/// </summary>
108108
/// <remarks>
109109
/// <blockquote class="NOTE"><h5>NOTE</h5>
110110
/// <para>
111-
/// cstojs_options.xml: &lt;Option ProcessNameOfExpression=&quot;true&quot; /&gt;
111+
/// cstojs_options.xml: &lt;Option DisableNameOfProcessing=&quot;false&quot; /&gt;
112112
/// </para>
113113
/// </blockquote>
114114
/// For example:
115115
/// <c>nameof(List&lt;int&gt;.Add);</c>
116-
/// If true, the expression will be translated as:
116+
/// If false, the expression will be translated as:
117117
/// <c>"push"</c>
118-
/// If false:
118+
/// If true:
119119
/// <c>"Add"</c>
120120
/// </remarks>
121121
/// <value>
122-
/// Default: <c>true</c>
122+
/// Default: <c>false</c>
123123
/// </value>
124-
public bool ProcessNameOfExpression { get; set; } = true;
124+
public bool DisableNameOfProcessing { get; set; } = false;
125125

126126
/// <summary>
127127
/// Make properties enumerable, needed if you want to use JSON.stringify.

CSharpToJavaScript/WithSemanticWalker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public override void VisitArgument(ArgumentSyntax node)
244244
public override void VisitInvocationExpression(InvocationExpressionSyntax node)
245245
{
246246
//With an early return, we won't process the nameof expression.
247-
if(!_Options.ProcessNameOfExpression)
247+
if(_Options.DisableNameOfProcessing)
248248
{
249249
if (node.Expression is IdentifierNameSyntax identifier)
250250
{

0 commit comments

Comments
 (0)