@@ -127,7 +127,7 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
127
127
case KnownManagedType . DateTime when jsType == JSTypeFlags . Missing :
128
128
case KnownManagedType . DateTimeOffset when jsType == JSTypeFlags . Missing :
129
129
case KnownManagedType . Object when jsType == JSTypeFlags . Missing :
130
- throw failWithReason ( string . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
130
+ throw failWithReason ( SR . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
131
131
132
132
// nullable
133
133
case KnownManagedType . Nullable when argumentTypes [ 0 ] == KnownManagedType . Boolean && jsType == JSTypeFlags . Boolean : return new NullableJSGenerator ( MarshalerType . Boolean ) ;
@@ -157,10 +157,10 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
157
157
case KnownManagedType . Nullable when argumentTypes [ 0 ] == KnownManagedType . Int64 && jsType == JSTypeFlags . Missing :
158
158
case KnownManagedType . Nullable when argumentTypes [ 0 ] == KnownManagedType . DateTime && jsType == JSTypeFlags . Missing :
159
159
case KnownManagedType . Nullable when argumentTypes [ 0 ] == KnownManagedType . DateTimeOffset && jsType == JSTypeFlags . Missing :
160
- throw failWithReason ( string . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
160
+ throw failWithReason ( SR . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
161
161
162
162
case KnownManagedType . Nullable :
163
- throw failWithReason ( string . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
163
+ throw failWithReason ( SR . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
164
164
165
165
// task
166
166
case KnownManagedType . Task when jsType == JSTypeFlags . Promise && jsTypeArguments . Length == 1 && argumentTypes . Length == 0 && jsTypeArguments [ 0 ] == JSTypeFlags . Void : return new TaskJSGenerator ( MarshalerType . Void ) ;
@@ -200,10 +200,10 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
200
200
case KnownManagedType . Task when argumentTypes [ 0 ] == KnownManagedType . DateTime && jsType == JSTypeFlags . Missing :
201
201
case KnownManagedType . Task when argumentTypes [ 0 ] == KnownManagedType . DateTimeOffset && jsType == JSTypeFlags . Missing :
202
202
case KnownManagedType . Task when argumentTypes [ 0 ] == KnownManagedType . Object && jsType == JSTypeFlags . Missing :
203
- throw failWithReason ( string . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
203
+ throw failWithReason ( SR . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
204
204
205
205
case KnownManagedType . Task when jsType == JSTypeFlags . Promise && jsTypeArguments . Length == 1 :
206
- throw failWithReason ( string . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
206
+ throw failWithReason ( SR . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
207
207
208
208
// array
209
209
case KnownManagedType . Array when jsType == JSTypeFlags . Array && jsTypeArguments . Length == 1 && argumentTypes [ 0 ] == KnownManagedType . Byte && jsTypeArguments [ 0 ] == JSTypeFlags . Number : return new ArrayJSGenerator ( MarshalerType . Byte ) ;
@@ -220,11 +220,11 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
220
220
case KnownManagedType . Array when argumentTypes [ 0 ] == KnownManagedType . Int32 && jsType == JSTypeFlags . Missing : return new ArrayJSGenerator ( MarshalerType . Int32 ) ;
221
221
case KnownManagedType . Array when argumentTypes [ 0 ] == KnownManagedType . JSObject && jsType == JSTypeFlags . Missing : return new ArrayJSGenerator ( MarshalerType . JSObject ) ;
222
222
case KnownManagedType . Array when jsType == JSTypeFlags . Array && jsTypeArguments . Length == 1 :
223
- throw failWithReason ( string . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
223
+ throw failWithReason ( SR . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
224
224
225
225
// array forced
226
226
case KnownManagedType . Array when argumentTypes [ 0 ] == KnownManagedType . Object && jsType == JSTypeFlags . Missing :
227
- throw failWithReason ( string . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
227
+ throw failWithReason ( SR . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
228
228
229
229
// span view
230
230
case KnownManagedType . Span when jsType == JSTypeFlags . MemoryView && jsTypeArguments . Length != 0 :
@@ -234,13 +234,13 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
234
234
case KnownManagedType . Span when jsType == JSTypeFlags . MemoryView && argumentTypes [ 0 ] == KnownManagedType . Double : return new SpanJSGenerator ( MarshalerType . Double ) ;
235
235
236
236
case KnownManagedType . Span when jsType == JSTypeFlags . MemoryView :
237
- throw failWithReason ( string . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
237
+ throw failWithReason ( SR . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
238
238
239
239
// span forced
240
240
case KnownManagedType . Span when argumentTypes [ 0 ] == KnownManagedType . Byte && jsType == JSTypeFlags . Missing :
241
241
case KnownManagedType . Span when argumentTypes [ 0 ] == KnownManagedType . Int32 && jsType == JSTypeFlags . Missing :
242
242
case KnownManagedType . Span when argumentTypes [ 0 ] == KnownManagedType . Double && jsType == JSTypeFlags . Missing :
243
- throw failWithReason ( string . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
243
+ throw failWithReason ( SR . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
244
244
245
245
// segment view
246
246
case KnownManagedType . ArraySegment when jsType == JSTypeFlags . MemoryView && jsTypeArguments . Length != 0 :
@@ -249,13 +249,13 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
249
249
case KnownManagedType . ArraySegment when jsType == JSTypeFlags . MemoryView && argumentTypes [ 0 ] == KnownManagedType . Int32 : return new ArraySegmentJSGenerator ( MarshalerType . Int32 ) ;
250
250
case KnownManagedType . ArraySegment when jsType == JSTypeFlags . MemoryView && argumentTypes [ 0 ] == KnownManagedType . Double : return new ArraySegmentJSGenerator ( MarshalerType . Double ) ;
251
251
case KnownManagedType . ArraySegment when jsType == JSTypeFlags . MemoryView :
252
- throw failWithReason ( string . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
252
+ throw failWithReason ( SR . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
253
253
254
254
// segment forced
255
255
case KnownManagedType . ArraySegment when argumentTypes [ 0 ] == KnownManagedType . Byte && jsType == JSTypeFlags . Missing :
256
256
case KnownManagedType . ArraySegment when argumentTypes [ 0 ] == KnownManagedType . Int32 && jsType == JSTypeFlags . Missing :
257
257
case KnownManagedType . ArraySegment when argumentTypes [ 0 ] == KnownManagedType . Double && jsType == JSTypeFlags . Missing :
258
- throw failWithReason ( string . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
258
+ throw failWithReason ( SR . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
259
259
260
260
// function + action
261
261
case KnownManagedType . Function when jsType == JSTypeFlags . Function && jsTypeArguments . Length == argumentTypes . Length :
@@ -273,7 +273,7 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
273
273
|| argumentTypes [ i ] == KnownManagedType . Unknown
274
274
)
275
275
{
276
- throw failWithReason ( string . Format ( SR . FuncArgumentNotSupported , argumentTypes [ i ] ) ) ;
276
+ throw failWithReason ( SR . Format ( SR . FuncArgumentNotSupported , argumentTypes [ i ] ) ) ;
277
277
}
278
278
var gen = Create ( info , isToJs ^ ( ! isReturn ) , argumentTypes [ i ] , Array . Empty < KnownManagedType > ( ) , jsTypeArguments [ i ] , Array . Empty < JSTypeFlags > ( ) , failWithReason ) ;
279
279
argsMarshalers . Add ( gen . Type ) ;
@@ -297,13 +297,13 @@ internal static BaseJSGenerator Create(TypePositionInfo info, bool isToJs, Known
297
297
|| argumentTypes [ i ] == KnownManagedType . Unknown
298
298
)
299
299
{
300
- throw failWithReason ( string . Format ( SR . FuncArgumentNotSupported , argumentTypes [ i ] ) ) ;
300
+ throw failWithReason ( SR . Format ( SR . FuncArgumentNotSupported , argumentTypes [ i ] ) ) ;
301
301
}
302
302
}
303
- throw failWithReason ( string . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
303
+ throw failWithReason ( SR . Format ( SR . UseJSMarshalAsAttribute , info . ManagedType . FullTypeName ) ) ;
304
304
305
305
default :
306
- throw failWithReason ( string . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
306
+ throw failWithReason ( SR . Format ( SR . TypeNotSupportedName , info . ManagedType . FullTypeName ) ) ;
307
307
}
308
308
}
309
309
}
0 commit comments