Skip to content

Commit a818390

Browse files
committed
Added lowercase variants to "Array", "Function", and "Object".
For the tests.
1 parent 2a1bc46 commit a818390

File tree

3 files changed

+202
-298
lines changed

3 files changed

+202
-298
lines changed
Lines changed: 121 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//TODO! Disable missing XML comments.
22
#pragma warning disable CS1591
3+
//Disable lowercase warning.
4+
#pragma warning disable IDE1006
35

46
using CSharpToJavaScript.Utils;
57
using System;
@@ -13,183 +15,141 @@ public partial class Array : ArrayPrototype
1315
{
1416
[To(ToAttribute.FirstCharToLowerCase)]
1517
public static ArrayPrototype Prototype { get; } = new();
18+
public static ArrayPrototype prototype { get; } = new();
1619

1720
[To(ToAttribute.FirstCharToLowerCase)]
1821
public int Length { get; } = 0;
19-
public Array(params dynamic[] values)
20-
{
21-
throw new System.NotImplementedException();
22-
}
22+
public int length { get; } = 0;
23+
24+
public Array(params dynamic[] values) { throw new System.NotImplementedException(); }
25+
2326
//Todo! Function for mapfn?
2427
[To(ToAttribute.FirstCharToLowerCase)]
25-
public static Array From(dynamic items, Action<dynamic>? mapfn = null, dynamic? thisArg = null)
26-
{
27-
throw new System.NotImplementedException();
28-
}
28+
public static Array From(dynamic items, Action<dynamic>? mapfn = null, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
29+
public static Array from(dynamic items, Action<dynamic>? mapfn = null, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
30+
2931
[To(ToAttribute.FirstCharToLowerCase)]
30-
public static bool IsArray(dynamic arg)
31-
{
32-
throw new System.NotImplementedException();
33-
}
32+
public static bool IsArray(dynamic arg) { throw new System.NotImplementedException(); }
33+
public static bool isArray(dynamic arg) { throw new System.NotImplementedException(); }
34+
3435
[To(ToAttribute.FirstCharToLowerCase)]
35-
public static Array Of(params dynamic[] items)
36-
{
37-
throw new System.NotImplementedException();
38-
}
36+
public static Array Of(params dynamic[] items) { throw new System.NotImplementedException(); }
37+
public static Array of(params dynamic[] items) { throw new System.NotImplementedException(); }
3938
}
4039

4140
[To(ToAttribute.FirstCharToLowerCase)]
4241
public partial class ArrayPrototype : FunctionPrototype
4342
{
4443
public ArrayPrototype() { }
45-
public dynamic? At(int index)
46-
{
47-
throw new System.NotImplementedException();
48-
}
49-
public Array CopyWithin(dynamic target, int start,int end = 0)
50-
{
51-
throw new System.NotImplementedException();
52-
}
53-
public List<dynamic> Entries()
54-
{
55-
throw new System.NotImplementedException();
56-
}
57-
public bool Every(Action callbackfn, dynamic? thisArg = null )
58-
{
59-
throw new System.NotImplementedException();
60-
}
61-
public Array Fill(dynamic value, int start = 0, int end = 0 )
62-
{
63-
throw new System.NotImplementedException();
64-
}
65-
public Array Filter(Action callbackfn, dynamic? thisArg = null)
66-
{
67-
throw new System.NotImplementedException();
68-
}
69-
public dynamic? Find(Action predicate, dynamic? thisArg = null)
70-
{
71-
throw new System.NotImplementedException();
72-
}
73-
public int FindIndex(Action predicate, dynamic? thisArg = null)
74-
{
75-
throw new System.NotImplementedException();
76-
}
77-
public dynamic? FindLast(Action predicate, dynamic? thisArg = null)
78-
{
79-
throw new System.NotImplementedException();
80-
}
81-
public int FindLastIndex(Action predicate, dynamic? thisArg = null)
82-
{
83-
throw new System.NotImplementedException();
84-
}
85-
public Array Flat(int depth = 1 )
86-
{
87-
throw new System.NotImplementedException();
88-
}
89-
public Array FlatMap(Action mapperFunction, dynamic? thisArg = null)
90-
{
91-
throw new System.NotImplementedException();
92-
}
93-
public GlobalObject.Undefined ForEach(Action callbackfn, dynamic? thisArg = null)
94-
{
95-
throw new System.NotImplementedException();
96-
}
97-
public bool Includes(dynamic searchElement, int fromIndex = 0)
98-
{
99-
throw new System.NotImplementedException();
100-
}
101-
public int IndexOf(dynamic searchElement, int fromIndex = 0)
102-
{
103-
throw new System.NotImplementedException();
104-
}
105-
public string Join(string separator = ",")
106-
{
107-
throw new System.NotImplementedException();
108-
}
109-
public List<dynamic> Keys()
110-
{
111-
throw new System.NotImplementedException();
112-
}
113-
public int LastIndexOf(dynamic searchElement, int fromIndex = 0)
114-
{
115-
throw new System.NotImplementedException();
116-
}
117-
public Array Map(Action callbackfn,dynamic? thisArg = null )
118-
{
119-
throw new System.NotImplementedException();
120-
}
121-
public dynamic Pop()
122-
{
123-
throw new System.NotImplementedException();
124-
}
125-
public int Push(params dynamic[] tems )
126-
{
127-
throw new System.NotImplementedException();
128-
}
129-
public dynamic Reduce(Action callbackfn, dynamic? initialValue = null)
130-
{
131-
throw new System.NotImplementedException();
132-
}
133-
public dynamic ReduceRight(Action callbackfn, dynamic? initialValue = null)
134-
{
135-
throw new System.NotImplementedException();
136-
}
137-
public Array Reverse()
138-
{
139-
throw new System.NotImplementedException();
140-
}
141-
public dynamic? Shift()
142-
{
143-
throw new System.NotImplementedException();
144-
}
145-
public Array Slice(int start = 0, int end = 0 )
146-
{
147-
throw new System.NotImplementedException();
148-
}
149-
public bool Some(Action callbackfn, dynamic? thisArg = null )
150-
{
151-
throw new System.NotImplementedException();
152-
}
153-
public Array Sort(Action comparefn )
154-
{
155-
throw new System.NotImplementedException();
156-
}
157-
public Array Splice(int start, int deleteCount, params dynamic[] items )
158-
{
159-
throw new System.NotImplementedException();
160-
}
44+
public dynamic? At(int index) { throw new System.NotImplementedException(); }
45+
public dynamic? at(int index) { throw new System.NotImplementedException(); }
46+
47+
public Array CopyWithin(dynamic target, int start,int end = 0) { throw new System.NotImplementedException(); }
48+
public Array copyWithin(dynamic target, int start, int end = 0) { throw new System.NotImplementedException(); }
49+
50+
public List<dynamic> Entries() { throw new System.NotImplementedException(); }
51+
public List<dynamic> entries() { throw new System.NotImplementedException(); }
52+
53+
public bool Every(Action callbackfn, dynamic? thisArg = null ) { throw new System.NotImplementedException(); }
54+
public bool every(Action callbackfn, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
55+
56+
public Array Fill(dynamic value, int start = 0, int end = 0 ) { throw new System.NotImplementedException(); }
57+
public Array fill(dynamic value, int start = 0, int end = 0) { throw new System.NotImplementedException(); }
58+
59+
public Array Filter(Action callbackfn, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
60+
public Array filter(Action callbackfn, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
61+
62+
public dynamic? Find(Action predicate, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
63+
public dynamic? find(Action predicate, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
64+
65+
public int FindIndex(Action predicate, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
66+
public int findIndex(Action predicate, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
67+
68+
public dynamic? FindLast(Action predicate, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
69+
public dynamic? findLast(Action predicate, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
70+
71+
public int FindLastIndex(Action predicate, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
72+
public int findLastIndex(Action predicate, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
73+
74+
public Array Flat(int depth = 1 ) { throw new System.NotImplementedException(); }
75+
public Array flat(int depth = 1) { throw new System.NotImplementedException(); }
76+
77+
public Array FlatMap(Action mapperFunction, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
78+
public Array flatMap(Action mapperFunction, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
79+
80+
public GlobalObject.Undefined ForEach(Action callbackfn, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
81+
public GlobalObject.Undefined forEach(Action callbackfn, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
82+
83+
public bool Includes(dynamic searchElement, int fromIndex = 0) { throw new System.NotImplementedException(); }
84+
public bool includes(dynamic searchElement, int fromIndex = 0) { throw new System.NotImplementedException(); }
85+
86+
public int IndexOf(dynamic searchElement, int fromIndex = 0) { throw new System.NotImplementedException(); }
87+
public int indexOf(dynamic searchElement, int fromIndex = 0) { throw new System.NotImplementedException(); }
88+
89+
public string Join(string separator = ",") { throw new System.NotImplementedException(); }
90+
public string join(string separator = ",") { throw new System.NotImplementedException(); }
91+
92+
public List<dynamic> Keys() { throw new System.NotImplementedException(); }
93+
public List<dynamic> keys() { throw new System.NotImplementedException(); }
94+
95+
public int LastIndexOf(dynamic searchElement, int fromIndex = 0) { throw new System.NotImplementedException(); }
96+
public int lastIndexOf(dynamic searchElement, int fromIndex = 0) { throw new System.NotImplementedException(); }
97+
98+
public Array Map(Action callbackfn, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
99+
public Array map(Action callbackfn, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
100+
101+
public dynamic Pop() { throw new System.NotImplementedException(); }
102+
public dynamic pop() { throw new System.NotImplementedException(); }
103+
104+
public int Push(params dynamic[] tems ) { throw new System.NotImplementedException(); }
105+
public int push(params dynamic[] tems) { throw new System.NotImplementedException(); }
106+
107+
public dynamic Reduce(Action callbackfn, dynamic? initialValue = null) { throw new System.NotImplementedException(); }
108+
public dynamic reduce(Action callbackfn, dynamic? initialValue = null) { throw new System.NotImplementedException(); }
109+
110+
public dynamic ReduceRight(Action callbackfn, dynamic? initialValue = null) { throw new System.NotImplementedException(); }
111+
public dynamic reduceRight(Action callbackfn, dynamic? initialValue = null) { throw new System.NotImplementedException(); }
112+
113+
public Array Reverse() { throw new System.NotImplementedException(); }
114+
public Array reverse() { throw new System.NotImplementedException(); }
115+
116+
public dynamic? Shift() { throw new System.NotImplementedException(); }
117+
public dynamic? shift() { throw new System.NotImplementedException(); }
118+
119+
public Array Slice(int start = 0, int end = 0 ) { throw new System.NotImplementedException(); }
120+
public Array slice(int start = 0, int end = 0) { throw new System.NotImplementedException(); }
121+
122+
public bool Some(Action callbackfn, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
123+
public bool some(Action callbackfn, dynamic? thisArg = null) { throw new System.NotImplementedException(); }
124+
125+
public Array Sort(Action comparefn ) { throw new System.NotImplementedException(); }
126+
public Array sort(Action comparefn) { throw new System.NotImplementedException(); }
127+
128+
public Array Splice(int start, int deleteCount, params dynamic[] items ) { throw new System.NotImplementedException(); }
129+
public Array splice(int start, int deleteCount, params dynamic[] items) { throw new System.NotImplementedException(); }
161130
/*
162131
public string ToLocaleString(dynamic? reserved1 = null, dynamic? reserved2 = null)
163132
{
164133
throw new System.NotImplementedException();
165134
}*/
166-
public Array ToReversed()
167-
{
168-
throw new System.NotImplementedException();
169-
}
170-
public Array ToSorted(Action comparefn )
171-
{
172-
throw new System.NotImplementedException();
173-
}
174-
public Array ToSpliced(int start, int skipCount,params dynamic[] items )
175-
{
176-
throw new System.NotImplementedException();
177-
}
178-
public new string ToString()
179-
{
180-
throw new System.NotImplementedException();
181-
}
182-
public int Unshift(params dynamic[] items )
183-
{
184-
throw new System.NotImplementedException();
185-
}
186-
public List<dynamic> Values()
187-
{
188-
throw new System.NotImplementedException();
189-
}
190-
public Array With(int index, dynamic value )
191-
{
192-
throw new System.NotImplementedException();
193-
194-
}
135+
public Array ToReversed() { throw new System.NotImplementedException(); }
136+
public Array toReversed() { throw new System.NotImplementedException(); }
137+
138+
public Array ToSorted(Action comparefn ) { throw new System.NotImplementedException(); }
139+
public Array toSorted(Action comparefn) { throw new System.NotImplementedException(); }
140+
141+
public Array ToSpliced(int start, int skipCount,params dynamic[] items ) { throw new System.NotImplementedException(); }
142+
public Array toSpliced(int start, int skipCount, params dynamic[] items) { throw new System.NotImplementedException(); }
143+
144+
public new string ToString() { throw new System.NotImplementedException(); }
145+
public new string toString() { throw new System.NotImplementedException(); }
146+
147+
public int Unshift(params dynamic[] items ) { throw new System.NotImplementedException(); }
148+
public int unshift(params dynamic[] items) { throw new System.NotImplementedException(); }
149+
150+
public List<dynamic> Values() { throw new System.NotImplementedException(); }
151+
public List<dynamic> values() { throw new System.NotImplementedException(); }
152+
153+
public Array With(int index, dynamic value ) { throw new System.NotImplementedException(); }
154+
public Array with(int index, dynamic value) { throw new System.NotImplementedException(); }
195155
}
Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//TODO! Disable missing XML comments.
22
#pragma warning disable CS1591
3+
//Disable lowercase warning.
4+
#pragma warning disable IDE1006
35

46
using CSharpToJavaScript.Utils;
57

@@ -11,44 +13,38 @@ public partial class Function : FunctionPrototype
1113
{
1214
[To(ToAttribute.FirstCharToLowerCase)]
1315
public int Length { get; } = 1;
16+
public int length { get; } = 1;
17+
1418
[To(ToAttribute.FirstCharToLowerCase)]
1519
public string Name { get; } = string.Empty;
20+
public string name { get; } = string.Empty;
1621

1722
[To(ToAttribute.FirstCharToLowerCase)]
1823
public static FunctionPrototype Prototype { get; } = new();
19-
24+
public static FunctionPrototype prototype { get; } = new();
2025

2126
//see note!
2227
//https://262.ecma-international.org/14.0/#sec-function-p1-p2-pn-body
2328
[To(ToAttribute.Default)]
24-
public Function(string parameterArgs, string bodyArg)
25-
{
26-
27-
}
29+
public Function(string parameterArgs, string bodyArg) { }
2830
}
2931

3032
[To(ToAttribute.FirstCharToLowerCase)]
3133
public partial class FunctionPrototype : ObjectPrototype
3234
{
3335
public FunctionPrototype() { }
3436

35-
public static dynamic Apply(dynamic thisArg, dynamic argArray)
36-
{
37-
throw new System.NotImplementedException();
38-
}
37+
public static dynamic Apply(dynamic thisArg, dynamic argArray) { throw new System.NotImplementedException(); }
38+
public static dynamic apply(dynamic thisArg, dynamic argArray) { throw new System.NotImplementedException(); }
39+
40+
public static dynamic Bind(dynamic thisArg, params dynamic[] args) { throw new System.NotImplementedException(); }
41+
public static dynamic bind(dynamic thisArg, params dynamic[] args) { throw new System.NotImplementedException(); }
3942

40-
public static dynamic Bind(dynamic thisArg, params dynamic[] args)
41-
{
42-
throw new System.NotImplementedException();
43-
}
44-
public static dynamic Call(dynamic thisArg, params dynamic[] args)
45-
{
46-
throw new System.NotImplementedException();
47-
}
43+
public static dynamic Call(dynamic thisArg, params dynamic[] args) { throw new System.NotImplementedException(); }
44+
public static dynamic call(dynamic thisArg, params dynamic[] args) { throw new System.NotImplementedException(); }
4845

4946
[Value("toString")]
50-
public static string ToStringStatic()
51-
{
52-
throw new System.NotImplementedException();
53-
}
47+
public static string ToStringStatic() { throw new System.NotImplementedException(); }
48+
[Value("toString")]
49+
public static string toStringStatic() { throw new System.NotImplementedException(); }
5450
}

0 commit comments

Comments
 (0)