264 references to KnownManagedType
Microsoft.Interop.JavaScript.JSImportGenerator (264)
JSExportGenerator.cs (1)
333
new JSMarshallingInfo(NoMarshallingInfo.Instance, new JSSimpleTypeInfo(
KnownManagedType
.Exception, ParseTypeName(Constants.ExceptionGlobal)))
JSGeneratorFactory.cs (231)
77
case { TypeInfo: JSTaskTypeInfo(JSSimpleTypeInfo(
KnownManagedType
.Void)) task }:
91
private static ResolvedGeneratorAndType Create(TypePositionInfo info, StubCodeContext context, bool isToJs,
KnownManagedType
marshaledType,
KnownManagedType
[] argumentTypes, JSTypeFlags jsType, JSTypeFlags[] jsTypeArguments)
96
(
KnownManagedType
.Void, JSTypeFlags.Void, _, _) => resolved(new Forwarder().Bind(info, context), MarshalerType.Void),
97
(
KnownManagedType
.Void, JSTypeFlags.None or JSTypeFlags.Discard, _, _) => resolved(new Forwarder().Bind(info, context), MarshalerType.Discard),
98
(
KnownManagedType
.Void, JSTypeFlags.DiscardNoWait, _, _) => resolved(new Forwarder().Bind(info, context), MarshalerType.DiscardNoWait),
101
(
KnownManagedType
.Void, JSTypeFlags.Missing, _, _) => resolved(new Forwarder().Bind(info, context), MarshalerType.Discard),
104
(
KnownManagedType
.Boolean, JSTypeFlags.Boolean, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Boolean), MarshalerType.Boolean),
105
(
KnownManagedType
.Byte, JSTypeFlags.Number, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Byte), MarshalerType.Byte),
106
(
KnownManagedType
.Char, JSTypeFlags.String, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Char), MarshalerType.Char),
107
(
KnownManagedType
.Int16, JSTypeFlags.Number, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int16), MarshalerType.Int16),
108
(
KnownManagedType
.Int32, JSTypeFlags.Number, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int32), MarshalerType.Int32),
109
(
KnownManagedType
.Int64, JSTypeFlags.Number, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int52), MarshalerType.Int52),
110
(
KnownManagedType
.Int64, JSTypeFlags.BigInt, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.BigInt64), MarshalerType.BigInt64),
111
(
KnownManagedType
.Single, JSTypeFlags.Number, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Single), MarshalerType.Single),
112
(
KnownManagedType
.Double, JSTypeFlags.Number, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Double), MarshalerType.Double),
113
(
KnownManagedType
.IntPtr, JSTypeFlags.Number, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.IntPtr), MarshalerType.IntPtr),
114
(
KnownManagedType
.DateTime, JSTypeFlags.Date, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.DateTime), MarshalerType.DateTime),
115
(
KnownManagedType
.DateTimeOffset, JSTypeFlags.Date, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.DateTimeOffset), MarshalerType.DateTimeOffset),
116
(
KnownManagedType
.Exception, JSTypeFlags.Error, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Exception), MarshalerType.Exception),
117
(
KnownManagedType
.JSObject, JSTypeFlags.Object, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.JSObject), MarshalerType.JSObject),
118
(
KnownManagedType
.String, JSTypeFlags.String, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.String), MarshalerType.String),
119
(
KnownManagedType
.Object, JSTypeFlags.Any, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Object), MarshalerType.Object),
122
(
KnownManagedType
.Boolean, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Boolean), MarshalerType.Boolean),
123
(
KnownManagedType
.Byte, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Byte), MarshalerType.Byte),
124
(
KnownManagedType
.Char, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Char), MarshalerType.Char),
125
(
KnownManagedType
.Int16, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int16), MarshalerType.Int16),
126
(
KnownManagedType
.Int32, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int32), MarshalerType.Int32),
127
(
KnownManagedType
.Single, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Single), MarshalerType.Single),
128
(
KnownManagedType
.Double, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Double), MarshalerType.Double),
129
(
KnownManagedType
.IntPtr, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.IntPtr), MarshalerType.IntPtr),
130
(
KnownManagedType
.Exception, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Exception), MarshalerType.Exception),
131
(
KnownManagedType
.JSObject, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.JSObject), MarshalerType.JSObject),
132
(
KnownManagedType
.String, JSTypeFlags.Missing, _, _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.String), MarshalerType.String),
135
(
KnownManagedType
.Int64, JSTypeFlags.Missing, _, _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
136
(
KnownManagedType
.DateTime, JSTypeFlags.Missing, _, _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
137
(
KnownManagedType
.DateTimeOffset, JSTypeFlags.Missing, _, _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
138
(
KnownManagedType
.Object, JSTypeFlags.Missing, _, _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
141
(
KnownManagedType
.Nullable, JSTypeFlags.Boolean, [
KnownManagedType
.Boolean], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Boolean), MarshalerType.Nullable, [MarshalerType.Boolean]),
142
(
KnownManagedType
.Nullable, JSTypeFlags.Number, [
KnownManagedType
.Byte], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Byte), MarshalerType.Nullable, [MarshalerType.Byte]),
143
(
KnownManagedType
.Nullable, JSTypeFlags.String, [
KnownManagedType
.Char], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Char), MarshalerType.Nullable, [MarshalerType.Char]),
144
(
KnownManagedType
.Nullable, JSTypeFlags.Number, [
KnownManagedType
.Int16], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int16), MarshalerType.Nullable, [MarshalerType.Int16]),
145
(
KnownManagedType
.Nullable, JSTypeFlags.Number, [
KnownManagedType
.Int32], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int32), MarshalerType.Nullable, [MarshalerType.Int32]),
146
(
KnownManagedType
.Nullable, JSTypeFlags.Number, [
KnownManagedType
.Int64], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int52), MarshalerType.Nullable, [MarshalerType.Int52]),
147
(
KnownManagedType
.Nullable, JSTypeFlags.BigInt, [
KnownManagedType
.Int64], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.BigInt64), MarshalerType.Nullable, [MarshalerType.BigInt64]),
148
(
KnownManagedType
.Nullable, JSTypeFlags.Number, [
KnownManagedType
.Single], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Single), MarshalerType.Nullable, [MarshalerType.Single]),
149
(
KnownManagedType
.Nullable, JSTypeFlags.Number, [
KnownManagedType
.Double], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Double), MarshalerType.Nullable, [MarshalerType.Double]),
150
(
KnownManagedType
.Nullable, JSTypeFlags.Number, [
KnownManagedType
.IntPtr], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.IntPtr), MarshalerType.Nullable, [MarshalerType.IntPtr]),
151
(
KnownManagedType
.Nullable, JSTypeFlags.Date, [
KnownManagedType
.DateTime], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.DateTime), MarshalerType.Nullable, [MarshalerType.DateTime]),
152
(
KnownManagedType
.Nullable, JSTypeFlags.Date, [
KnownManagedType
.DateTimeOffset], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.DateTimeOffset), MarshalerType.Nullable, [MarshalerType.DateTimeOffset]),
155
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.Boolean], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Boolean), MarshalerType.Nullable, [MarshalerType.Boolean]),
156
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.Byte], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Byte), MarshalerType.Nullable, [MarshalerType.Byte]),
157
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.Char], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Char), MarshalerType.Nullable, [MarshalerType.Char]),
158
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.Int16], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int16), MarshalerType.Nullable, [MarshalerType.Int16]),
159
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.Int32], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Int32), MarshalerType.Nullable, [MarshalerType.Int32]),
160
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.Single], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Single), MarshalerType.Nullable, [MarshalerType.Single]),
161
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.Double], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Double), MarshalerType.Nullable, [MarshalerType.Double]),
162
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.IntPtr], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.IntPtr), MarshalerType.Nullable, [MarshalerType.IntPtr]),
165
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.Int64], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
166
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.DateTime], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
167
(
KnownManagedType
.Nullable, JSTypeFlags.Missing, [
KnownManagedType
.DateTimeOffset], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
169
(
KnownManagedType
.Nullable, _, _, _) => failWithReason(SR.Format(SR.TypeNotSupportedName, info.ManagedType.FullTypeName)),
173
(
KnownManagedType
.Task, JSTypeFlags.Promise, [], [JSTypeFlags.Void]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Void), MarshalerType.Task, []),
174
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Boolean], [JSTypeFlags.Boolean]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Boolean), MarshalerType.Task, [MarshalerType.Boolean]),
175
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Byte], [JSTypeFlags.Number]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Byte), MarshalerType.Task, [MarshalerType.Byte]),
176
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Char], [JSTypeFlags.String]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Char), MarshalerType.Task, [MarshalerType.Char]),
177
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Int16], [JSTypeFlags.Number]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Int16), MarshalerType.Task, [MarshalerType.Int16]),
178
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Int32], [JSTypeFlags.Number]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Int32), MarshalerType.Task, [MarshalerType.Int32]),
179
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Int64], [JSTypeFlags.Number]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Int52), MarshalerType.Task, [MarshalerType.Int52]),
180
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Int64], [JSTypeFlags.BigInt]) => resolved(new TaskJSGenerator(info, context, MarshalerType.BigInt64), MarshalerType.Task, [MarshalerType.BigInt64]),
181
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Single], [JSTypeFlags.Number]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Single), MarshalerType.Task, [MarshalerType.Single]),
182
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Double], [JSTypeFlags.Number]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Double), MarshalerType.Task, [MarshalerType.Double]),
183
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.IntPtr], [JSTypeFlags.Number]) => resolved(new TaskJSGenerator(info, context, MarshalerType.IntPtr), MarshalerType.Task, [MarshalerType.IntPtr]),
184
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.DateTime], [JSTypeFlags.Date]) => resolved(new TaskJSGenerator(info, context, MarshalerType.DateTime), MarshalerType.Task, [MarshalerType.DateTime]),
185
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.DateTimeOffset], [JSTypeFlags.Date]) => resolved(new TaskJSGenerator(info, context, MarshalerType.DateTimeOffset), MarshalerType.Task, [MarshalerType.DateTimeOffset]),
186
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Exception], [JSTypeFlags.Error]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Exception), MarshalerType.Task, [MarshalerType.Exception]),
187
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.JSObject], [JSTypeFlags.Object]) => resolved(new TaskJSGenerator(info, context, MarshalerType.JSObject), MarshalerType.Task, [MarshalerType.JSObject]),
188
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.String], [JSTypeFlags.String]) => resolved(new TaskJSGenerator(info, context, MarshalerType.String), MarshalerType.Task, [MarshalerType.String]),
189
(
KnownManagedType
.Task, JSTypeFlags.Promise, [
KnownManagedType
.Object], [JSTypeFlags.Any]) => resolved(new TaskJSGenerator(info, context, MarshalerType.Object), MarshalerType.Task, [MarshalerType.Object]),
192
(
KnownManagedType
.Task, JSTypeFlags.Missing, [], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.Void), MarshalerType.Task, []),
193
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Boolean], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.Boolean), MarshalerType.Task, [MarshalerType.Boolean]),
194
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Byte], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.Byte), MarshalerType.Task, [MarshalerType.Byte]),
195
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Char], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.Char), MarshalerType.Task, [MarshalerType.Char]),
196
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Int16], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.Int16), MarshalerType.Task, [MarshalerType.Int16]),
197
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Int32], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.Int32), MarshalerType.Task, [MarshalerType.Int32]),
198
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Single], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.Single), MarshalerType.Task, [MarshalerType.Single]),
199
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Double], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.Double), MarshalerType.Task, [MarshalerType.Double]),
200
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.IntPtr], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.IntPtr), MarshalerType.Task, [MarshalerType.IntPtr]),
201
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Exception], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.Exception), MarshalerType.Task, [MarshalerType.Exception]),
202
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.JSObject], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.JSObject), MarshalerType.Task, [MarshalerType.JSObject]),
203
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.String], _) => resolved(new TaskJSGenerator(info, context, MarshalerType.String), MarshalerType.Task, [MarshalerType.String]),
206
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Int64], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
207
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.DateTime], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
208
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.DateTimeOffset], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
209
(
KnownManagedType
.Task, JSTypeFlags.Missing, [
KnownManagedType
.Object], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
211
(
KnownManagedType
.Task, JSTypeFlags.Promise, _, [_]) => failWithReason(SR.Format(SR.TypeNotSupportedName, info.ManagedType.FullTypeName)),
214
(
KnownManagedType
.Array, JSTypeFlags.Array, [
KnownManagedType
.Byte], [JSTypeFlags.Number]) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.Byte]),
215
(
KnownManagedType
.Array, JSTypeFlags.Array, [
KnownManagedType
.String], [JSTypeFlags.String]) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.String]),
216
(
KnownManagedType
.Array, JSTypeFlags.Array, [
KnownManagedType
.Double], [JSTypeFlags.Number]) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.Double]),
217
(
KnownManagedType
.Array, JSTypeFlags.Array, [
KnownManagedType
.Int32], [JSTypeFlags.Number]) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.Int32]),
218
(
KnownManagedType
.Array, JSTypeFlags.Array, [
KnownManagedType
.JSObject], [JSTypeFlags.Object]) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.JSObject]),
219
(
KnownManagedType
.Array, JSTypeFlags.Array, [
KnownManagedType
.Object], [JSTypeFlags.Any]) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.Object]),
222
(
KnownManagedType
.Array, JSTypeFlags.Missing, [
KnownManagedType
.Byte], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.Byte]),
223
(
KnownManagedType
.Array, JSTypeFlags.Missing, [
KnownManagedType
.String], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.String]),
224
(
KnownManagedType
.Array, JSTypeFlags.Missing, [
KnownManagedType
.Double], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.Double]),
225
(
KnownManagedType
.Array, JSTypeFlags.Missing, [
KnownManagedType
.Int32], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.Int32]),
226
(
KnownManagedType
.Array, JSTypeFlags.Missing, [
KnownManagedType
.JSObject], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Array), MarshalerType.Array, [MarshalerType.JSObject]),
228
(
KnownManagedType
.Array, JSTypeFlags.Array, _, [_]) => failWithReason(SR.Format(SR.TypeNotSupportedName, info.ManagedType.FullTypeName)),
231
(
KnownManagedType
.Array, JSTypeFlags.Missing, [
KnownManagedType
.Object], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
234
(
KnownManagedType
.Span, JSTypeFlags.MemoryView, _, [_]) => failWithReason(null!),
235
(
KnownManagedType
.Span, JSTypeFlags.MemoryView, [
KnownManagedType
.Byte], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Span), MarshalerType.Span, [MarshalerType.Byte]),
236
(
KnownManagedType
.Span, JSTypeFlags.MemoryView, [
KnownManagedType
.Int32], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Span), MarshalerType.Span, [MarshalerType.Int32]),
237
(
KnownManagedType
.Span, JSTypeFlags.MemoryView, [
KnownManagedType
.Double], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.Span), MarshalerType.Span, [MarshalerType.Double]),
239
(
KnownManagedType
.Span, JSTypeFlags.MemoryView, _, _) => failWithReason(SR.Format(SR.TypeNotSupportedName, info.ManagedType.FullTypeName)),
242
(
KnownManagedType
.Span, JSTypeFlags.Missing, [
KnownManagedType
.Byte], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
243
(
KnownManagedType
.Span, JSTypeFlags.Missing, [
KnownManagedType
.Int32], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
244
(
KnownManagedType
.Span, JSTypeFlags.Missing, [
KnownManagedType
.Double], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
247
(
KnownManagedType
.ArraySegment, JSTypeFlags.MemoryView, _, [_]) => failWithReason(null!),
248
(
KnownManagedType
.ArraySegment, JSTypeFlags.MemoryView, [
KnownManagedType
.Byte], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.ArraySegment), MarshalerType.ArraySegment, [MarshalerType.Byte]),
249
(
KnownManagedType
.ArraySegment, JSTypeFlags.MemoryView, [
KnownManagedType
.Int32], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.ArraySegment), MarshalerType.ArraySegment, [MarshalerType.Int32]),
250
(
KnownManagedType
.ArraySegment, JSTypeFlags.MemoryView, [
KnownManagedType
.Double], _) => resolved(new PrimitiveJSGenerator(info, context, MarshalerType.ArraySegment), MarshalerType.ArraySegment, [MarshalerType.Double]),
252
(
KnownManagedType
.ArraySegment, JSTypeFlags.MemoryView, _, _) => failWithReason(SR.Format(SR.TypeNotSupportedName, info.ManagedType.FullTypeName)),
255
(
KnownManagedType
.ArraySegment, JSTypeFlags.Missing, [
KnownManagedType
.Byte], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
256
(
KnownManagedType
.ArraySegment, JSTypeFlags.Missing, [
KnownManagedType
.Int32], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
257
(
KnownManagedType
.ArraySegment, JSTypeFlags.Missing, [
KnownManagedType
.Double], _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
260
(
KnownManagedType
.Function or
KnownManagedType
.Action, JSTypeFlags.Function, var argTypes, var argJSTypes) when argTypes.Length != argJSTypes.Length
263
(
KnownManagedType
.Function or
KnownManagedType
.Action, JSTypeFlags.Function or JSTypeFlags.Missing, var argTypes, _) when FindFirstInvalidArgType(argTypes) is
KnownManagedType
invalidArgType
266
(
KnownManagedType
.Function or
KnownManagedType
.Action, JSTypeFlags.Function, var argTypes, var argJSTypes) => ResolveCallback(marshaledType, argTypes, argJSTypes),
269
(
KnownManagedType
.Function or
KnownManagedType
.Action, JSTypeFlags.Missing, _, _) => failWithReason(SR.Format(SR.UseJSMarshalAsAttribute, info.ManagedType.FullTypeName)),
272
(not
KnownManagedType
.Void, JSTypeFlags.Discard, _, _) => failWithReason(SR.DiscardOnlyVoid),
273
(not
KnownManagedType
.Void, JSTypeFlags.DiscardNoWait, _, _) => failWithReason(SR.DiscardNoWaitOnlyVoid),
279
KnownManagedType
? FindFirstInvalidArgType(
KnownManagedType
[] argumentTypes)
281
foreach (
KnownManagedType
type in argumentTypes)
283
if (type is
KnownManagedType
.Array
284
or
KnownManagedType
.Span
285
or
KnownManagedType
.ArraySegment
286
or
KnownManagedType
.Task
287
or
KnownManagedType
.Function
288
or
KnownManagedType
.Action
289
or
KnownManagedType
.Unknown
298
ResolvedGeneratorAndType ResolveCallback(
KnownManagedType
managedType,
KnownManagedType
[] argTypes, JSTypeFlags[] argJSTypes)
303
var isReturn = managedType ==
KnownManagedType
.Function && i == argJSTypes.Length - 1;
305
var gen = Create(info, context, isToJs ^ (!isReturn), argTypes[i], Array.Empty<
KnownManagedType
>(), argJSTypes[i], Array.Empty<JSTypeFlags>());
308
var maxArgs = managedType ==
KnownManagedType
.Action ? 3 : 4;
315
new FuncJSGenerator(info, context, managedType ==
KnownManagedType
.Action, argsMarshallerTypes),
316
managedType ==
KnownManagedType
.Action ? MarshalerType.Action : MarshalerType.Function,
JSManagedTypeInfo.cs (28)
12
internal abstract record JSTypeInfo(
KnownManagedType
KnownType)
20
return new JSSimpleTypeInfo(
KnownManagedType
.Void)
25
return new JSSimpleTypeInfo(
KnownManagedType
.Boolean)
30
return new JSSimpleTypeInfo(
KnownManagedType
.Byte)
35
return new JSSimpleTypeInfo(
KnownManagedType
.Char)
40
return new JSSimpleTypeInfo(
KnownManagedType
.Int16)
45
return new JSSimpleTypeInfo(
KnownManagedType
.Int32)
50
return new JSSimpleTypeInfo(
KnownManagedType
.Int64)
55
return new JSSimpleTypeInfo(
KnownManagedType
.Single)
60
return new JSSimpleTypeInfo(
KnownManagedType
.Double)
66
return new JSSimpleTypeInfo(
KnownManagedType
.IntPtr)
71
return new JSSimpleTypeInfo(
KnownManagedType
.DateTime)
76
return new JSSimpleTypeInfo(
KnownManagedType
.DateTimeOffset)
81
return new JSSimpleTypeInfo(
KnownManagedType
.Exception)
86
return new JSSimpleTypeInfo(
KnownManagedType
.Object)
91
return new JSSimpleTypeInfo(
KnownManagedType
.String)
96
return new JSSimpleTypeInfo(
KnownManagedType
.JSObject)
119
return new JSTaskTypeInfo(new JSSimpleTypeInfo(
KnownManagedType
.Void, SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.VoidKeyword))));
175
internal sealed record JSInvalidTypeInfo() : JSSimpleTypeInfo(
KnownManagedType
.None);
177
internal record JSSimpleTypeInfo(
KnownManagedType
KnownType) : JSTypeInfo(KnownType)
179
public JSSimpleTypeInfo(
KnownManagedType
knownType, TypeSyntax syntax)
187
internal sealed record JSArrayTypeInfo(JSSimpleTypeInfo ElementTypeInfo) : JSTypeInfo(
KnownManagedType
.Array);
189
internal sealed record JSSpanTypeInfo(JSSimpleTypeInfo ElementTypeInfo) : JSTypeInfo(
KnownManagedType
.Span);
191
internal sealed record JSArraySegmentTypeInfo(JSSimpleTypeInfo ElementTypeInfo) : JSTypeInfo(
KnownManagedType
.ArraySegment);
193
internal sealed record JSTaskTypeInfo(JSSimpleTypeInfo ResultTypeInfo) : JSTypeInfo(
KnownManagedType
.Task);
195
internal sealed record JSNullableTypeInfo(JSSimpleTypeInfo ResultTypeInfo) : JSTypeInfo(
KnownManagedType
.Nullable);
197
internal sealed record JSFunctionTypeInfo(bool IsAction, JSSimpleTypeInfo[] ArgsTypeInfo) : JSTypeInfo(IsAction ?
KnownManagedType
.Action :
KnownManagedType
.Function);
Marshaling\TaskJSGenerator.cs (4)
27
yield return jsty.ResultTypeInfo is JSSimpleTypeInfo(
KnownManagedType
.Void)
34
yield return jsty.ResultTypeInfo is JSSimpleTypeInfo(
KnownManagedType
.Void)
41
yield return jsty.ResultTypeInfo is JSSimpleTypeInfo(
KnownManagedType
.Void)
48
yield return jsty.ResultTypeInfo is JSSimpleTypeInfo(
KnownManagedType
.Void)