Skip to content

Commit b9d0416

Browse files
committed
c# object -> js Object, c# string.Empty -> js String raw``, c# List constructor -> js Array constructor
1 parent b4e4827 commit b9d0416

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

CSharpToJavaScript/Utils/NETAPI.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
internal class NETAPI
88
{
9-
private readonly TypeName[] _TypeNames = new TypeName[8];
9+
private readonly TypeName[] _TypeNames = new TypeName[9];
1010

1111
public NETAPI()
1212
{
@@ -38,6 +38,7 @@ public NETAPI()
3838
_TypeNames[2].Name = nameof(System.Collections.Generic.List<object>);
3939
_TypeNames[2].JSName = "Array";
4040

41+
_TypeNames[2].SymbolNames.Add(".ctor", "Array");
4142
_TypeNames[2].SymbolNames.Add(nameof(System.Collections.Generic.List<object>.Sort), "sort");
4243
_TypeNames[2].SymbolNames.Add(nameof(System.Collections.Generic.List<object>.FindLast), "findLast");
4344
_TypeNames[2].SymbolNames.Add(nameof(System.Collections.Generic.List<object>.Count), "length");
@@ -60,7 +61,7 @@ public NETAPI()
6061
//
6162
_TypeNames[4] = new();
6263
_TypeNames[4].Name = nameof(System.String);
63-
_TypeNames[4].JSName = "string";
64+
_TypeNames[4].JSName = "String";
6465

6566
_TypeNames[4].SymbolNames.Add(nameof(string.Contains), "includes");
6667
_TypeNames[4].SymbolNames.Add(nameof(string.Length), "length");
@@ -73,6 +74,7 @@ public NETAPI()
7374
_TypeNames[4].SymbolNames.Add(nameof(string.ToUpper), "toUpperCase");
7475
_TypeNames[4].SymbolNames.Add(nameof(string.ToLower), "toLowerCase");
7576
_TypeNames[4].SymbolNames.Add(nameof(string.EndsWith), "endsWith");
77+
_TypeNames[4].SymbolNames.Add(nameof(string.Empty), "raw``");
7678

7779
//
7880
//
@@ -104,6 +106,13 @@ public NETAPI()
104106
_TypeNames[7].SymbolNames.Add(nameof(System.Math.Exp), "exp");
105107
_TypeNames[7].SymbolNames.Add(nameof(System.Math.Abs), "abs");
106108
_TypeNames[7].SymbolNames.Add(nameof(System.Math.Max), "max");
109+
110+
//
111+
//
112+
//
113+
_TypeNames[8] = new();
114+
_TypeNames[8].Name = nameof(System.Object);
115+
_TypeNames[8].JSName = "Object";
107116
}
108117

109118
public string? ReturnJSString(string typeName, string? symbolName = null)

0 commit comments

Comments
 (0)