Skip to content

Commit b185a3d

Browse files
committed
All JS-interop methods return object (per discussion in sq/JSIL#925)
1 parent 85c0caf commit b185a3d

2 files changed

Lines changed: 14 additions & 158 deletions

File tree

Builtins.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public sealed class JSGlobal {
1111
/// Retrieves a name from the global namespace (note that this is the global namespace at the time that the JSIL runtime was loaded).
1212
/// </summary>
1313
/// <param name="name">The name to retrieve. This may be a literal, or a string-producing expression.</param>
14-
public dynamic this[string name] {
14+
public object this[string name] {
1515
get {
1616
return null;
1717
}
@@ -23,7 +23,7 @@ public sealed class JSLocal {
2323
/// Retrieves a name from the local namespace.
2424
/// </summary>
2525
/// <param name="name">The name to retrieve. This must be a string literal!</param>
26-
public dynamic this[string name] {
26+
public object this[string name] {
2727
get {
2828
return null;
2929
}
@@ -67,7 +67,7 @@ public static bool IsFalsy (dynamic value) {
6767
/// <summary>
6868
/// When running as javascript, this property evaluates to the current scope's this-reference.
6969
/// </summary>
70-
public static dynamic This {
70+
public static object This {
7171
get {
7272
return null;
7373
}
@@ -89,7 +89,7 @@ public static class Services {
8989
/// When running as JavaScript this method returns a reference to the named runtime service.
9090
/// </summary>
9191
/// <param name="serviceName">The name of the runtime service.</param>
92-
public static dynamic Get (string serviceName, bool throwIfMissing = true) {
92+
public static object Get (string serviceName, bool throwIfMissing = true) {
9393
if (throwIfMissing)
9494
throw new NotImplementedException("Services.get is only available at runtime and you passed true for throwIfMissing.");
9595
else

Verbatim.cs

Lines changed: 10 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static class Verbatim {
1414
/// When running as JavaScript, the passed-in script code replaces this method call.
1515
/// </summary>
1616
/// <param name="javascript">The script expression.</param>
17-
public static dynamic Expression (string javascript) {
17+
public static object Expression (string javascript) {
1818
return null;
1919
}
2020

@@ -25,7 +25,7 @@ public static dynamic Expression (string javascript) {
2525
/// </summary>
2626
/// <param name="javascript">The script expression.</param>
2727
/// <param name="variables">The variables to insert into the expression.</param>
28-
public static dynamic Expression (string javascript, params object[] variables) {
28+
public static object Expression (string javascript, params object[] variables) {
2929
return null;
3030
}
3131

@@ -36,7 +36,7 @@ public static dynamic Expression (string javascript, params object[] variables)
3636
/// </summary>
3737
/// <param name="javascript">The script expression.</param>
3838
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
39-
public static dynamic Expression<TArg0>(string javascript, TArg0 arg0)
39+
public static object Expression<TArg0>(string javascript, TArg0 arg0)
4040
{
4141
return null;
4242
}
@@ -49,7 +49,7 @@ public static dynamic Expression<TArg0>(string javascript, TArg0 arg0)
4949
/// <param name="javascript">The script expression.</param>
5050
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
5151
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
52-
public static dynamic Expression<TArg0, TArg1>(string javascript, TArg0 arg0, TArg1 arg1)
52+
public static object Expression<TArg0, TArg1>(string javascript, TArg0 arg0, TArg1 arg1)
5353
{
5454
return null;
5555
}
@@ -63,7 +63,7 @@ public static dynamic Expression<TArg0, TArg1>(string javascript, TArg0 arg0, TA
6363
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
6464
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
6565
/// <param name="arg2">The variables to insert into '$2' placeholder in the expression.</param>
66-
public static dynamic Expression<TArg0, TArg1, TArg2>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2)
66+
public static object Expression<TArg0, TArg1, TArg2>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2)
6767
{
6868
return null;
6969
}
@@ -78,7 +78,7 @@ public static dynamic Expression<TArg0, TArg1, TArg2>(string javascript, TArg0 a
7878
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
7979
/// <param name="arg2">The variables to insert into '$2' placeholder in the expression.</param>
8080
/// <param name="arg3">The variables to insert into '$3' placeholder in the expression.</param>
81-
public static dynamic Expression<TArg0, TArg1, TArg2, TArg3>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3)
81+
public static object Expression<TArg0, TArg1, TArg2, TArg3>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3)
8282
{
8383
return null;
8484
}
@@ -94,7 +94,7 @@ public static dynamic Expression<TArg0, TArg1, TArg2, TArg3>(string javascript,
9494
/// <param name="arg2">The variables to insert into '$2' placeholder in the expression.</param>
9595
/// <param name="arg3">The variables to insert into '$3' placeholder in the expression.</param>
9696
/// <param name="arg4">The variables to insert into '$4' placeholder in the expression.</param>
97-
public static dynamic Expression<TArg0, TArg1, TArg2, TArg3, TArg4>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
97+
public static object Expression<TArg0, TArg1, TArg2, TArg3, TArg4>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
9898
{
9999
return null;
100100
}
@@ -111,7 +111,7 @@ public static dynamic Expression<TArg0, TArg1, TArg2, TArg3, TArg4>(string javas
111111
/// <param name="arg3">The variables to insert into '$3' placeholder in the expression.</param>
112112
/// <param name="arg4">The variables to insert into '$4' placeholder in the expression.</param>
113113
/// <param name="arg5">The variables to insert into '$5' placeholder in the expression.</param>
114-
public static dynamic Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
114+
public static object Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
115115
{
116116
return null;
117117
}
@@ -129,7 +129,7 @@ public static dynamic Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5>(strin
129129
/// <param name="arg4">The variables to insert into '$4' placeholder in the expression.</param>
130130
/// <param name="arg5">The variables to insert into '$5' placeholder in the expression.</param>
131131
/// <param name="arg6">The variables to insert into '$6' placeholder in the expression.</param>
132-
public static dynamic Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
132+
public static object Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
133133
{
134134
return null;
135135
}
@@ -148,153 +148,9 @@ public static dynamic Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6
148148
/// <param name="arg5">The variables to insert into '$5' placeholder in the expression.</param>
149149
/// <param name="arg6">The variables to insert into '$6' placeholder in the expression.</param>
150150
/// <param name="arg7">The variables to insert into '$7' placeholder in the expression.</param>
151-
public static dynamic Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7)
151+
public static object Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7)
152152
{
153153
return null;
154154
}
155-
156-
/// <summary>
157-
/// When running as C#, this method does nothing and returns null.
158-
/// When running as JavaScript, the passed-in script code replaces this method call.
159-
/// </summary>
160-
/// <param name="javascript">The script expression.</param>
161-
public static T Expression<T> (string javascript) {
162-
return default(T);
163-
}
164-
165-
/// <summary>
166-
/// When running as C#, this method does nothing and returns null.
167-
/// When running as JavaScript, the passed-in script code replaces this method call.
168-
/// Variables can be referenced by index. '$0' is the first variable.
169-
/// </summary>
170-
/// <param name="javascript">The script expression.</param>
171-
/// <param name="variables">The variables to insert into the expression.</param>
172-
public static T Expression<T> (string javascript, params object[] variables) {
173-
return default(T);
174-
}
175-
176-
/// <summary>
177-
/// When running as C#, this method does nothing and returns null.
178-
/// When running as JavaScript, the passed-in script code replaces this method call.
179-
/// Variables can be referenced by index. '$0' is the first variable.
180-
/// </summary>
181-
/// <param name="javascript">The script expression.</param>
182-
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
183-
public static TResult Expression<TArg0, TResult>(string javascript, TArg0 arg0)
184-
{
185-
return default(TResult);
186-
}
187-
188-
/// <summary>
189-
/// When running as C#, this method does nothing and returns null.
190-
/// When running as JavaScript, the passed-in script code replaces this method call.
191-
/// Variables can be referenced by index. '$0' is the first variable.
192-
/// </summary>
193-
/// <param name="javascript">The script expression.</param>
194-
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
195-
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
196-
public static TResult Expression<TArg0, TArg1, TResult>(string javascript, TArg0 arg0, TArg1 arg1)
197-
{
198-
return default(TResult);
199-
}
200-
201-
/// <summary>
202-
/// When running as C#, this method does nothing and returns null.
203-
/// When running as JavaScript, the passed-in script code replaces this method call.
204-
/// Variables can be referenced by index. '$0' is the first variable.
205-
/// </summary>
206-
/// <param name="javascript">The script expression.</param>
207-
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
208-
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
209-
/// <param name="arg2">The variables to insert into '$2' placeholder in the expression.</param>
210-
public static TResult Expression<TArg0, TArg1, TArg2, TResult>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2)
211-
{
212-
return default(TResult);
213-
}
214-
215-
/// <summary>
216-
/// When running as C#, this method does nothing and returns null.
217-
/// When running as JavaScript, the passed-in script code replaces this method call.
218-
/// Variables can be referenced by index. '$0' is the first variable.
219-
/// </summary>
220-
/// <param name="javascript">The script expression.</param>
221-
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
222-
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
223-
/// <param name="arg2">The variables to insert into '$2' placeholder in the expression.</param>
224-
/// <param name="arg3">The variables to insert into '$3' placeholder in the expression.</param>
225-
public static TResult Expression<TArg0, TArg1, TArg2, TArg3, TResult>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3)
226-
{
227-
return default(TResult);
228-
}
229-
230-
/// <summary>
231-
/// When running as C#, this method does nothing and returns null.
232-
/// When running as JavaScript, the passed-in script code replaces this method call.
233-
/// Variables can be referenced by index. '$0' is the first variable.
234-
/// </summary>
235-
/// <param name="javascript">The script expression.</param>
236-
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
237-
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
238-
/// <param name="arg2">The variables to insert into '$2' placeholder in the expression.</param>
239-
/// <param name="arg3">The variables to insert into '$3' placeholder in the expression.</param>
240-
/// <param name="arg4">The variables to insert into '$4' placeholder in the expression.</param>
241-
public static TResult Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TResult>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4)
242-
{
243-
return default(TResult);
244-
}
245-
246-
/// <summary>
247-
/// When running as C#, this method does nothing and returns null.
248-
/// When running as JavaScript, the passed-in script code replaces this method call.
249-
/// Variables can be referenced by index. '$0' is the first variable.
250-
/// </summary>
251-
/// <param name="javascript">The script expression.</param>
252-
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
253-
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
254-
/// <param name="arg2">The variables to insert into '$2' placeholder in the expression.</param>
255-
/// <param name="arg3">The variables to insert into '$3' placeholder in the expression.</param>
256-
/// <param name="arg4">The variables to insert into '$4' placeholder in the expression.</param>
257-
/// <param name="arg5">The variables to insert into '$5' placeholder in the expression.</param>
258-
public static TResult Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
259-
{
260-
return default(TResult);
261-
}
262-
263-
/// <summary>
264-
/// When running as C#, this method does nothing and returns null.
265-
/// When running as JavaScript, the passed-in script code replaces this method call.
266-
/// Variables can be referenced by index. '$0' is the first variable.
267-
/// </summary>
268-
/// <param name="javascript">The script expression.</param>
269-
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
270-
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
271-
/// <param name="arg2">The variables to insert into '$2' placeholder in the expression.</param>
272-
/// <param name="arg3">The variables to insert into '$3' placeholder in the expression.</param>
273-
/// <param name="arg4">The variables to insert into '$4' placeholder in the expression.</param>
274-
/// <param name="arg5">The variables to insert into '$5' placeholder in the expression.</param>
275-
/// <param name="arg6">The variables to insert into '$6' placeholder in the expression.</param>
276-
public static TResult Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
277-
{
278-
return default(TResult);
279-
}
280-
281-
/// <summary>
282-
/// When running as C#, this method does nothing and returns null.
283-
/// When running as JavaScript, the passed-in script code replaces this method call.
284-
/// Variables can be referenced by index. '$0' is the first variable.
285-
/// </summary>
286-
/// <param name="javascript">The script expression.</param>
287-
/// <param name="arg0">The variables to insert into '$0' placeholder in the expression.</param>
288-
/// <param name="arg1">The variables to insert into '$1' placeholder in the expression.</param>
289-
/// <param name="arg2">The variables to insert into '$2' placeholder in the expression.</param>
290-
/// <param name="arg3">The variables to insert into '$3' placeholder in the expression.</param>
291-
/// <param name="arg4">The variables to insert into '$4' placeholder in the expression.</param>
292-
/// <param name="arg5">The variables to insert into '$5' placeholder in the expression.</param>
293-
/// <param name="arg6">The variables to insert into '$6' placeholder in the expression.</param>
294-
/// <param name="arg7">The variables to insert into '$7' placeholder in the expression.</param>
295-
public static TResult Expression<TArg0, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(string javascript, TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7)
296-
{
297-
return default(TResult);
298-
}
299155
}
300156
}

0 commit comments

Comments
 (0)