61 references to Constants
Microsoft.Interop.JavaScript.JSImportGenerator (61)
Analyzers\JSExportDiagnosticsAnalyzer.cs (1)
18
protected override string AttributeMetadataName =>
Constants
.JSExportAttribute;
Analyzers\JSImportDiagnosticsAnalyzer.cs (1)
18
protected override string AttributeMetadataName =>
Constants
.JSImportAttribute;
JSExportGenerator.cs (24)
34
.ForAttributeWithMetadataName(
Constants
.JSExportAttribute,
91
&& attr.AttributeClass.ToDisplayString() ==
Constants
.JSExportAttribute)
119
writer.WriteLine($"[{
Constants
.CompilerGeneratedAttributeGlobal}]");
123
writer.WriteLine($"[{
Constants
.ThreadStaticGlobal}]");
126
writer.WriteLine($"[{
Constants
.ModuleInitializerAttributeGlobal}, {
Constants
.DynamicDependencyAttributeGlobal}({
Constants
.DynamicallyAccessedMemberTypesGlobal}.PublicMethods | {
Constants
.DynamicallyAccessedMemberTypesGlobal}.NonPublicMethods, {CodeWriterHelpers.StringLiteral(GeneratedNamespace + "." + InitializerClass)}, {CodeWriterHelpers.StringLiteral(assemblyName)})]");
140
writer.WriteLine($"if (initialized || {
Constants
.OSArchitectureGlobal} != {
Constants
.ArchitectureWasmGlobal})");
159
new ReferenceTypeInfo(
Constants
.ExceptionGlobal,
Constants
.ExceptionGlobal),
160
new JSMarshallingInfo(NoMarshallingInfo.Instance, new JSSimpleTypeInfo(KnownManagedType.Exception,
Constants
.ExceptionGlobal))
165
InstanceIdentifier =
Constants
.ArgumentException,
201
string registration = $"{
Constants
.JSFunctionSignatureGlobal}.{
Constants
.BindCSFunctionMethod}({CodeWriterHelpers.StringLiteral(signature.QualifiedMethodName)}, {signature.TypesHash.ToString(CultureInfo.InvariantCulture)}, {signatures});";
202
string attribute = $"{
Constants
.DynamicDependencyAttributeGlobal}({CodeWriterHelpers.StringLiteral(signature.WrapperName)}, {CodeWriterHelpers.StringLiteral(signature.StubTypeFullName)}, {CodeWriterHelpers.StringLiteral(signature.AssemblyName)})";
213
writer.WriteLine($"[{
Constants
.DebuggerNonUserCodeAttribute}]");
214
writer.WriteLine($"internal static unsafe void {context.SignatureContext.WrapperName}({
Constants
.JSMarshalerArgumentGlobal}* {
Constants
.ArgumentsBuffer})");
222
writer.WriteLine($"[{
Constants
.DebuggerNonUserCodeAttribute}]");
243
writer.Write($"{
Constants
.ArgumentsBuffer}[{nativeArgument.NativeIndex + 2}], ");
245
writer.Write(
Constants
.ArgumentsBuffer);
248
writer.Write($", {
Constants
.ArgumentsBuffer} + 1");
JSImportGenerator.cs (19)
38
.ForAttributeWithMetadataName(
Constants
.JSImportAttribute,
91
&& attr.AttributeClass.ToDisplayString() ==
Constants
.JSImportAttribute)
125
InstanceIdentifier =
Constants
.ArgumentException,
130
InstanceIdentifier =
Constants
.ArgumentReturn,
180
writer.WriteLine($"[{
Constants
.DebuggerNonUserCodeAttribute}]");
181
writer.WriteLine($"[{
Constants
.SupportedOSPlatformAttribute}({CodeWriterHelpers.StringLiteral(
Constants
.BrowserPlatform)})]");
197
writer.WriteLine($"static {
Constants
.JSFunctionSignatureGlobal} {context.SignatureContext.BindingName};");
208
writer.WriteLine($"{signature.BindingName} = {
Constants
.JSFunctionSignatureGlobal}.{
Constants
.BindJSFunctionMethod}({functionName}, {moduleName}, {signatures});");
220
writer.WriteLine($"[{
Constants
.DebuggerNonUserCodeAttribute}]");
221
writer.WriteLine($"{(hasReturn ?
Constants
.JSMarshalerArgumentGlobal : "void")} {functionName}{signature.ParameterList}");
226
writer.WriteLine($"{
Constants
.SpanGlobal}<{
Constants
.JSMarshalerArgumentGlobal}> {
Constants
.ArgumentsBuffer} = {arguments};");
227
writer.WriteLine($"{
Constants
.JSFunctionSignatureGlobal}.InvokeJS({signatureContext.BindingName}, {
Constants
.ArgumentsBuffer});");
228
writer.WriteLine($"return {
Constants
.ArgumentsBuffer}[1];");
232
writer.WriteLine($"{
Constants
.JSFunctionSignatureGlobal}.InvokeJS({signatureContext.BindingName}, {arguments});");
JSManagedTypeInfo.cs (7)
68
case ITypeSymbol when fullTypeName ==
Constants
.TaskGlobal:
70
case INamedTypeSymbol { TypeArguments.Length: 1 } taskType when fullTypeName.StartsWith(
Constants
.TaskGlobal, StringComparison.Ordinal):
78
case INamedTypeSymbol { TypeArguments.Length: 1 } spanType when fullTypeName.StartsWith(
Constants
.SpanGlobal, StringComparison.Ordinal):
86
case INamedTypeSymbol { TypeArguments.Length: 1 } arraySegmentType when fullTypeName.StartsWith(
Constants
.ArraySegmentGlobal, StringComparison.Ordinal):
94
case ITypeSymbol when fullTypeName ==
Constants
.ActionGlobal:
96
case INamedTypeSymbol actionType when fullTypeName.StartsWith(
Constants
.ActionGlobal, StringComparison.Ordinal):
107
case INamedTypeSymbol funcType when fullTypeName.StartsWith(
Constants
.FuncGlobal, StringComparison.Ordinal):
JSMarshalAsAttributeInfoParser.cs (1)
19
_jsMarshalAsAttribute = compilation.GetTypeByMetadataName(
Constants
.JSMarshalAsAttribute)!.ConstructUnboundGenericType();
Marshaling\BaseJSGenerator.cs (7)
10
private static readonly ValueTypeInfo s_jsMarshalerArgument = new(
Constants
.JSMarshalerArgumentGlobal,
Constants
.JSMarshalerArgument, IsByRefLike: false);
44
return marshalerType == MarshalerType.BigInt64 ?
Constants
.ToManagedBigMethod :
Constants
.ToManagedMethod;
49
return marshalerType == MarshalerType.BigInt64 ?
Constants
.ToJSBigMethod :
Constants
.ToJSMethod;
62
writer.WriteLine($"static (ref {
Constants
.JSMarshalerArgumentGlobal} {argumentIdentifier}, {modifier}{sourceType} {managedIdentifier}) =>");
SignatureBindingHelpers.cs (1)
40
return
Constants
.JSMarshalerTypeGlobalDot + marshalerType;