Skip to content

Commit ec74ac2

Browse files
committed
Added "Escape" and "Unescape" to the GlobalObject.
1 parent b1c40bf commit ec74ac2

File tree

1 file changed

+32
-19
lines changed

1 file changed

+32
-19
lines changed

CSharpToJavaScript/APIs/JS/Ecma/GlobalObject.cs

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ public partial class GlobalThis : GlobalObject
2929
//Float32Array, Float64Array, Int8Array, Int16Array, Int32Array, Map, Promise,
3030
//Proxy, Set, SharedArrayBuffer, Uint8Array, Uint8ClampedArray, Uint16Array,
3131
//Uint32Array, WeakMap, WeakRef, WeakSet
32-
32+
3333
[To(ToAttribute.Default)]
3434
public static AggregateError AggregateError(object[] errors, string? message = null, object? options = null)
3535
{
3636
throw new System.NotImplementedException();
3737
}
38-
39-
38+
39+
4040
[To(ToAttribute.Default)]
4141
public static Array Array(params dynamic[] values)
4242
{
4343
throw new System.NotImplementedException();
4444
}
45-
46-
45+
46+
4747
[To(ToAttribute.Default)]
4848
public static BigInt BigInt(dynamic value)
4949
{
5050
throw new System.NotImplementedException();
5151
}
52-
52+
5353

5454
[To(ToAttribute.Default)]
5555
public static bool Boolean(dynamic value)
@@ -63,19 +63,19 @@ public static string Date()
6363
throw new System.NotImplementedException();
6464
}
6565

66-
66+
6767
[To(ToAttribute.Default)]
6868
public static Error Error(string message, object? options = null)
6969
{
7070
throw new System.NotImplementedException();
7171
}
7272

73-
73+
7474
[To(ToAttribute.Default)]
7575
public static EvalError EvalError(string message, object? options = null)
7676
{
7777
throw new System.NotImplementedException();
78-
78+
7979
}
8080

8181
//https://262.ecma-international.org/14.0/#sec-function-p1-p2-pn-body
@@ -99,14 +99,14 @@ public static Object Object(dynamic? value = null)
9999
throw new System.NotImplementedException();
100100

101101
}
102-
102+
103103
[To(ToAttribute.Default)]
104104
public static RangeError RangeError(string message, object? options = null)
105105
{
106106
throw new System.NotImplementedException();
107107

108108
}
109-
109+
110110
[To(ToAttribute.Default)]
111111
public static ReferenceError ReferenceError(string message, object? options = null)
112112
{
@@ -120,36 +120,36 @@ public static string RegExp(string pattern, string? flags = null)
120120
throw new System.NotImplementedException();
121121

122122
}
123-
123+
124124
[To(ToAttribute.Default)]
125125
public static string String(dynamic value)
126126
{
127127
throw new System.NotImplementedException();
128128

129129
}
130130

131-
131+
132132
[To(ToAttribute.Default)]
133133
public static Symbol Symbol(dynamic? description = null)
134134
{
135135
throw new System.NotImplementedException();
136136

137137
}
138-
138+
139139
[To(ToAttribute.Default)]
140140
public static SyntaxError SyntaxError(string message, object? options = null)
141141
{
142142
throw new System.NotImplementedException();
143143

144144
}
145-
145+
146146
[To(ToAttribute.Default)]
147147
public static TypeError TypeError(string message, object? options = null)
148148
{
149149
throw new System.NotImplementedException();
150150

151151
}
152-
152+
153153
[To(ToAttribute.Default)]
154154
public static URIError URIError(string message, object? options = null)
155155
{
@@ -171,14 +171,14 @@ public class NaN
171171
}
172172

173173
[To(ToAttribute.FirstCharToLowerCase)]
174-
public class Undefined { }
174+
public class Undefined { }
175175

176176
[To(ToAttribute.FirstCharToLowerCase)]
177-
public static dynamic Eval(string x)
177+
public static dynamic Eval(string x)
178178
{
179179
throw new System.NotImplementedException();
180180
}
181-
181+
182182
[To(ToAttribute.FirstCharToLowerCase)]
183183
public static bool IsFinite(float number)
184184
{
@@ -226,5 +226,18 @@ public static string EncodeURIComponent(string uriComponent)
226226
{
227227
throw new System.NotImplementedException();
228228
}
229+
230+
231+
//https://262.ecma-international.org/5.1/index.html#sec-B.2
232+
[To(ToAttribute.FirstCharToLowerCase)]
233+
public static string Escape(string str)
234+
{
235+
throw new System.NotImplementedException();
236+
}
237+
[To(ToAttribute.FirstCharToLowerCase)]
238+
public static string Unescape(string str)
239+
{
240+
throw new System.NotImplementedException();
241+
}
229242
}
230243

0 commit comments

Comments
 (0)