Skip to content

Commit e1129b7

Browse files
committed
Added the rest of ecma objects.
1 parent f6c2643 commit e1129b7

File tree

12 files changed

+353
-2
lines changed

12 files changed

+353
-2
lines changed

CSharpToJavaScript/APIs/JS/Ecma/Array.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
using CSharpToJavaScript.Utils;
55
using System;
6-
using System.Collections;
76
using System.Collections.Generic;
8-
using System.Reflection;
97

108
namespace CSharpToJavaScript.APIs.JS.Ecma;
119

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//TODO! Disable missing XML comments.
2+
#pragma warning disable CS1591
3+
4+
using CSharpToJavaScript.Utils;
5+
6+
7+
namespace CSharpToJavaScript.APIs.JS.Ecma;
8+
9+
//https://262.ecma-international.org/14.0/#sec-async-function-objects
10+
[To(ToAttribute.Default)]
11+
public partial class AsyncFunction : Function
12+
{
13+
public AsyncFunction(string parameterArgs, string bodyArg) : base(parameterArgs, bodyArg)
14+
{
15+
}
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//TODO! Disable missing XML comments.
2+
#pragma warning disable CS1591
3+
using CSharpToJavaScript.Utils;
4+
5+
namespace CSharpToJavaScript.APIs.JS.Ecma;
6+
7+
//https://262.ecma-international.org/14.0/#sec-asyncgenerator-objects
8+
[To(ToAttribute.Default)]
9+
public partial class AsyncGenerator : AsyncIterator
10+
{
11+
12+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//TODO! Disable missing XML comments.
2+
#pragma warning disable CS1591
3+
using CSharpToJavaScript.Utils;
4+
5+
namespace CSharpToJavaScript.APIs.JS.Ecma;
6+
7+
//Todo?
8+
//https://262.ecma-international.org/14.0/#sec-asyncgeneratorfunction-objects
9+
[To(ToAttribute.Default)]
10+
public partial class AsyncGeneratorFunction : Function
11+
{
12+
public AsyncGeneratorFunction(string parameterArgs, string bodyArg) : base(parameterArgs, bodyArg)
13+
{
14+
}
15+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//TODO! Disable missing XML comments.
2+
#pragma warning disable CS1591
3+
4+
5+
using CSharpToJavaScript.Utils;
6+
using System;
7+
8+
namespace CSharpToJavaScript.APIs.JS.Ecma;
9+
10+
//https://262.ecma-international.org/14.0/#sec-finalization-registry-objects
11+
[To(ToAttribute.Default)]
12+
public partial class FinalizationRegistry : FinalizationRegistryPrototype
13+
{
14+
[To(ToAttribute.FirstCharToLowerCase)]
15+
public static FinalizationRegistryPrototype Prototype { get; } = new();
16+
public FinalizationRegistry(Action cleanupCallback) { }
17+
}
18+
[To(ToAttribute.FirstCharToLowerCase)]
19+
public class FinalizationRegistryPrototype : FunctionPrototype
20+
{
21+
public FinalizationRegistryPrototype() { }
22+
public GlobalObject.Undefined Register(dynamic target, dynamic heldValue, dynamic? unregisterToken = null)
23+
{
24+
throw new System.NotImplementedException();
25+
}
26+
public bool Unregister(dynamic unregisterToken)
27+
{
28+
throw new System.NotImplementedException();
29+
}
30+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//TODO! Disable missing XML comments.
2+
#pragma warning disable CS1591
3+
4+
using CSharpToJavaScript.Utils;
5+
6+
namespace CSharpToJavaScript.APIs.JS.Ecma;
7+
8+
//https://262.ecma-international.org/14.0/#sec-generator-objects
9+
[To(ToAttribute.Default)]
10+
public partial class Generator : Iterator
11+
{
12+
13+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//TODO! Disable missing XML comments.
2+
#pragma warning disable CS1591
3+
4+
using CSharpToJavaScript.Utils;
5+
6+
namespace CSharpToJavaScript.APIs.JS.Ecma;
7+
8+
//Todo?
9+
//https://262.ecma-international.org/14.0/#sec-generatorfunction-objects
10+
[To(ToAttribute.Default)]
11+
public partial class GeneratorFunction : Function
12+
{
13+
public GeneratorFunction(string parameterArgs, string bodyArg) : base(parameterArgs, bodyArg)
14+
{
15+
}
16+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
//TODO! Disable missing XML comments.
2+
#pragma warning disable CS1591
3+
4+
using CSharpToJavaScript.Utils;
5+
using System;
6+
7+
namespace CSharpToJavaScript.APIs.JS.Ecma;
8+
9+
//Todo? interfaces?
10+
//https://262.ecma-international.org/14.0/#sec-common-iteration-interfaces
11+
[To(ToAttribute.Default)]
12+
public partial class Iterator : ObjectPrototype
13+
{
14+
[To(ToAttribute.FirstCharToLowerCase)]
15+
public IteratorResult Next()
16+
{
17+
throw new System.NotImplementedException();
18+
}
19+
[To(ToAttribute.FirstCharToLowerCase)]
20+
public IteratorResult Return(dynamic value)
21+
{
22+
throw new System.NotImplementedException();
23+
}
24+
[To(ToAttribute.FirstCharToLowerCase)]
25+
public IteratorResult Throw(dynamic exception)
26+
{
27+
throw new System.NotImplementedException();
28+
}
29+
}
30+
31+
[To(ToAttribute.Default)]
32+
public partial class AsyncIterator : ObjectPrototype
33+
{
34+
[To(ToAttribute.FirstCharToLowerCase)]
35+
public IteratorResult Next()
36+
{
37+
throw new System.NotImplementedException();
38+
}
39+
[To(ToAttribute.FirstCharToLowerCase)]
40+
public IteratorResult Return(dynamic value)
41+
{
42+
throw new System.NotImplementedException();
43+
}
44+
[To(ToAttribute.FirstCharToLowerCase)]
45+
public IteratorResult Throw(dynamic exception)
46+
{
47+
throw new System.NotImplementedException();
48+
}
49+
}
50+
51+
[To(ToAttribute.None)]
52+
public class IteratorResult
53+
{
54+
[To(ToAttribute.FirstCharToLowerCase)]
55+
public bool Done { get; set; } = true;
56+
[To(ToAttribute.FirstCharToLowerCase)]
57+
public dynamic? Value { get; set; } = null;
58+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//TODO! Disable missing XML comments.
2+
#pragma warning disable CS1591
3+
4+
using CSharpToJavaScript.Utils;
5+
using System;
6+
7+
namespace CSharpToJavaScript.APIs.JS.Ecma;
8+
9+
//https://262.ecma-international.org/14.0/#sec-promise-objects
10+
[To(ToAttribute.Default)]
11+
public partial class Promise : PromisePrototype
12+
{
13+
[To(ToAttribute.FirstCharToLowerCase)]
14+
public static PromisePrototype Prototype { get; } = new();
15+
public Promise(Action executor) { }
16+
17+
[To(ToAttribute.FirstCharToLowerCase)]
18+
public static Promise All(Array iterable)
19+
{
20+
throw new System.NotImplementedException();
21+
}
22+
[To(ToAttribute.FirstCharToLowerCase)]
23+
public static Promise AllSettled(Array iterable)
24+
{
25+
throw new System.NotImplementedException();
26+
}
27+
[To(ToAttribute.FirstCharToLowerCase)]
28+
public static Promise Any(Array iterable)
29+
{
30+
throw new System.NotImplementedException();
31+
}
32+
[To(ToAttribute.FirstCharToLowerCase)]
33+
public static Promise Race(Array iterable)
34+
{
35+
throw new System.NotImplementedException();
36+
}
37+
[To(ToAttribute.FirstCharToLowerCase)]
38+
public static Promise Reject(dynamic r)
39+
{
40+
throw new System.NotImplementedException();
41+
}
42+
[To(ToAttribute.FirstCharToLowerCase)]
43+
public static Promise Resolve(dynamic x)
44+
{
45+
throw new System.NotImplementedException();
46+
}
47+
}
48+
49+
[To(ToAttribute.FirstCharToLowerCase)]
50+
public class PromisePrototype : FunctionPrototype
51+
{
52+
public PromisePrototype() { }
53+
54+
public Promise Catch(Action onRejected)
55+
{
56+
throw new System.NotImplementedException();
57+
}
58+
public Promise Finally (Action onFinally)
59+
{
60+
throw new System.NotImplementedException();
61+
}
62+
public Promise Then(Action onFulfilled, Action? onRejected = null)
63+
{
64+
throw new System.NotImplementedException();
65+
}
66+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//TODO! Disable missing XML comments.
2+
#pragma warning disable CS1591
3+
4+
using CSharpToJavaScript.Utils;
5+
6+
namespace CSharpToJavaScript.APIs.JS.Ecma;
7+
8+
//Todo! handler!
9+
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy
10+
11+
//https://262.ecma-international.org/14.0/#sec-proxy-objects
12+
[To(ToAttribute.Default)]
13+
public partial class Proxy : FunctionPrototype
14+
{
15+
public Proxy(dynamic target, dynamic handler )
16+
{
17+
18+
}
19+
[To(ToAttribute.FirstCharToLowerCase)]
20+
public static dynamic Revocable(dynamic target, dynamic handler)
21+
{
22+
throw new System.NotImplementedException();
23+
}
24+
}

0 commit comments

Comments
 (0)