Skip to content

Commit 6715097

Browse files
committed
"NormalizeWhitespace" applies before "KeepBraceOnTheSameLine".
Updated "Microsoft.CodeAnalysis.CSharp" to 4.9.2. c# bitwise and shift operators -> js bitwise and shift operators. c# try-catch-finally -> js try-catch-finally. c# do...while -> js do...while. Updated generated xml docs. Updated generated c#.
1 parent 73855de commit 6715097

File tree

12,663 files changed

+25813
-108680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

12,663 files changed

+25813
-108680
lines changed

CSharpToJavaScript/APIs/JS/Document.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace CSharpToJavaScript.APIs.JS
99
{
10+
1011
public partial class Document
1112
{
1213
[To(ToAttribute.FirstCharToLowerCase)]

CSharpToJavaScript/APIs/JS/Ecma/GlobalObject.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public static EvalError EvalError(dynamic message, dynamic? options = null)
8181
public static Function Function(dynamic parameterArgs, dynamic? bodyArg = null)
8282
{
8383
throw new System.NotImplementedException();
84-
8584
}
8685

8786
[To(ToAttribute.Default)]

CSharpToJavaScript/APIs/JS/EventTarget.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ namespace CSharpToJavaScript.APIs.JS
88
{
99
public partial class EventTarget
1010
{
11-
public CSharpToJavaScript.Utils.Unsupported /*undefined*/ AddEventListener(string type, Action? callback, Union41 options) { throw new System.NotImplementedException(); }
12-
public CSharpToJavaScript.Utils.Unsupported /*undefined*/ AddEventListener(string type, Action<MouseEvent>? callback, Union41 options) { throw new System.NotImplementedException(); }
13-
public CSharpToJavaScript.Utils.Unsupported /*undefined*/ AddEventListener(string type, Action<Event>? callback, Union41 options) { throw new System.NotImplementedException(); }
11+
12+
public Utils.Unsupported /*undefined*/ AddEventListener(string type, Action? callback, Union41 options) { throw new System.NotImplementedException(); }
13+
public Utils.Unsupported /*undefined*/ AddEventListener(string type, Action<MouseEvent>? callback, Union41 options) { throw new System.NotImplementedException(); }
14+
public Utils.Unsupported /*undefined*/ AddEventListener(string type, Action<Event>? callback, Union41 options) { throw new System.NotImplementedException(); }
1415

15-
public CSharpToJavaScript.Utils.Unsupported /*undefined*/ RemoveEventListener(string type, Action? callback, Union2 options) { throw new System.NotImplementedException(); }
16+
public Utils.Unsupported /*undefined*/ RemoveEventListener(string type, Action? callback, Union2 options) { throw new System.NotImplementedException(); }
17+
1618
}
1719
}

CSharpToJavaScript/APIs/JS/Generated/JS.generated.cs

Lines changed: 13114 additions & 12777 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace CSharpToJavaScript.APIs.JS
8+
{
9+
public partial interface ParentNode
10+
{
11+
///<include file='Utils/Docs/ElementQuerySelector/ElementQuerySelector.generated.xml' path='docs/ElementQuerySelector/*'/>
12+
public T? QuerySelector<T>(string selectors) where T : Element { throw new System.NotImplementedException(); }
13+
}
14+
}

CSharpToJavaScript/CSTOJS.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public CSTOJS(CSTOJSOptions options)
6161
/// <param name="path">Full path to cs file or to the folder with cs files.</param>
6262
/// <param name="filename">Optional! Filename of a js file if you generating one file!</param>
6363
/// <returns>empty Task</returns>
64+
/// <exception cref="DirectoryNotFoundException"></exception>
6465
public async Task GenerateOneAsync(string path, string? filename = null)
6566
{
66-
6767
Assembly? assembly = Assembly.GetEntryAssembly();
6868
List<FileInfo> files = new();
6969

@@ -73,6 +73,9 @@ public async Task GenerateOneAsync(string path, string? filename = null)
7373
}
7474
else
7575
{
76+
if (!Directory.Exists(path))
77+
throw new DirectoryNotFoundException(path);
78+
7679
DirectoryInfo folder = new(path);
7780

7881
files = folder.GetFiles("*.cs").ToList();
@@ -116,6 +119,7 @@ public async Task GenerateOneAsync(string path, string? filename = null)
116119
/// </summary>
117120
/// <param name="path">Full path to cs file or to the folder with cs files.</param>
118121
/// <returns>List of StringBuilder</returns>
122+
/// <exception cref="DirectoryNotFoundException"></exception>
119123
public List<StringBuilder> GenerateOne(string path)
120124
{
121125
Assembly? assembly = Assembly.GetEntryAssembly();
@@ -128,6 +132,9 @@ public List<StringBuilder> GenerateOne(string path)
128132
}
129133
else
130134
{
135+
if (!Directory.Exists(path))
136+
throw new DirectoryNotFoundException(path);
137+
131138
DirectoryInfo folder = new(path);
132139

133140
files = folder.GetFiles("*.cs").ToList();
@@ -414,6 +421,9 @@ private void Generate(SyntaxTree? tree, Assembly? assembly, List<MetadataReferen
414421
)
415422
).AddUsings(oldUsing);
416423

424+
if (_Options.NormalizeWhitespace)
425+
trueRoot = trueRoot.NormalizeWhitespace();
426+
417427
if (_Options.KeepBraceOnTheSameLine)
418428
{
419429
//
@@ -447,10 +457,6 @@ private void Generate(SyntaxTree? tree, Assembly? assembly, List<MetadataReferen
447457

448458
}
449459

450-
if (_Options.NormalizeWhitespace)
451-
trueRoot = trueRoot.NormalizeWhitespace();
452-
453-
454460
if (rtPath != null && rtPath != string.Empty)
455461
{
456462
if (File.Exists(Path.Combine(rtPath, "System.dll")))

CSharpToJavaScript/CSTOJSOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public record class CSTOJSOptions
5656
/// Keep Brace <c>{</c> on the same line.
5757
/// </summary>
5858
/// <remarks>
59-
/// <blockquote class="NOTE"><h5>NOTE</h5>Note: It is better write from the start in c#, then using this option.</blockquote>
59+
/// <blockquote class="NOTE"><h5>NOTE</h5><para>Note: It is better write from the start in c#, then using this option.</para></blockquote>
6060
/// </remarks>
6161
/// <value>
6262
/// Default: <c>false</c>
@@ -66,8 +66,8 @@ public record class CSTOJSOptions
6666
/// <summary>
6767
/// Self-explanatory, Normalize Whitespace. />
6868
/// </summary>
69-
/// /// <remarks>
70-
/// <blockquote class="NOTE"><h5>NOTE</h5>Note: Do not use with <see cref="CSTOJSOptions.KeepBraceOnTheSameLine" /></blockquote>
69+
/// <remarks>
70+
/// <blockquote class="NOTE"><h5>NOTE</h5><para>Note: If using with <see cref="CSTOJSOptions.KeepBraceOnTheSameLine" />. Normalization running before <see cref="CSTOJSOptions.KeepBraceOnTheSameLine" />.</para></blockquote>
7171
/// </remarks>
7272
/// <value>
7373
/// Default: <c>false</c>

CSharpToJavaScript/CSharpToJavaScript.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</PropertyGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
23+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
2424
</ItemGroup>
2525

2626
<ItemGroup>
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<docs>
2-
<XSLTTransforming_XML_with_XSLTThe_Netscape_XSLT_XPath_ReferenceAxesSelf>
2+
<XSLTProcessorGenerating_HTML>
33
<summary>
4-
The self axis indicates the context node itself. It can be abbreviated as a single period (<c>.</c>).
4+
One common application of XSLT in the browser is transforming XML into HTML on the client. This example will transform the input document (example2.xml), which contains information about an article, into an HTML document.
55
</summary>
66
<remarks>
7-
<para><seealso href="https://developer.mozilla.org/en-US/docs/Web/XSLT/Transforming_XML_with_XSLT/The_Netscape_XSLT_XPath_Reference/Axes/self"> <em>See also on MDN</em> </seealso></para>
7+
<para>The <c>&amp;lt;body&amp;gt;</c> element of the article now contains HTML elements (a <c>&amp;lt;b&amp;gt;</c> and <c>&amp;lt;u&amp;gt;</c> tag). The XML document contains both HTML elements and XML elements, but only one namespace is needed, namely for the XML elements. Since there is no HTML namespace, and using the XHTML namespace would force the XSL to create an XML document that would not behave like an HTML document, the <c>xsl:output</c> in the XSL Stylesheet will make sure the resulting document will be handled as HTML. For the XML elements, our own namespace is needed, <c>http://devedge.netscape.com/2002/de</c>, and it is given the prefix myNS <c>(xmlns:myNS=&amp;quot;http://devedge.netscape.com/2002/de&amp;quot;)</c>.</para>
8+
<para><seealso href="https://developer.mozilla.org/en-US/docs/Web/API/XSLTProcessor/Generating_HTML"> <em>See also on MDN</em> </seealso></para>
89
</remarks>
9-
</XSLTTransforming_XML_with_XSLTThe_Netscape_XSLT_XPath_ReferenceAxesSelf>
10+
</XSLTProcessorGenerating_HTML>
1011
</docs>

CSharpToJavaScript/Utils/Docs/Abortcontroller/Abortcontroller.generated.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
The <strong><c>AbortController</c></strong> interface represents a controller object that allows you to abort one or more Web requests as and when desired.
55
</summary>
66
<remarks>
7-
<para>You can create a new <c>AbortController</c> object using the <see cref="AbortController.AbortController"/> constructor. Communicating with a DOM request is done using an <see cref="AbortSignal"/> object.</para>
7+
<para>You can create a new <c>AbortController</c> object using the <see cref="AbortController.AbortController."/> constructor. Communicating with an asynchronous operation is done using an <see cref="AbortSignal."/> object.</para>
88
<para>-<see href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">Fetch API</see><br/>-<see href="https://developer.chrome.com/blog/abortable-fetch/">Abortable Fetch</see> by Jake Archibald<br/></para>
99
<para><seealso href="https://developer.mozilla.org/en-US/docs/Web/API/AbortController"> <em>See also on MDN</em> </seealso></para>
1010
</remarks>

0 commit comments

Comments
 (0)