diff options
author | Marek FiĊĦera <mara@neptuo.com> | 2022-08-31 15:53:50 +0300 |
---|---|---|
committer | github-actions <github-actions@github.com> | 2022-08-31 22:53:23 +0300 |
commit | 8f978749541d71cfca7bb74d9041d38f2a8046eb (patch) | |
tree | 233243d9fde30246ca3701b638da5cf24d0b5a52 | |
parent | 9407fa6380be1daa5c5b9c4e3cfd30ff465551cf (diff) |
Feedback.backport/pr-74763-to-release/7.0
2 files changed, 15 insertions, 9 deletions
diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportStubContext.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportStubContext.cs index 58590f7f210..005e30581af 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportStubContext.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportStubContext.cs @@ -18,12 +18,9 @@ namespace Microsoft.Interop.JavaScript { internal sealed class JSSignatureContext : IEquatable<JSSignatureContext> { - private static SymbolDisplayFormat typeNameFormat { get; } = new SymbolDisplayFormat( + private static SymbolDisplayFormat s_typeNameFormat { get; } = new SymbolDisplayFormat( globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted, - typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypes, - miscellaneousOptions: - SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers | - SymbolDisplayMiscellaneousOptions.UseSpecialTypes + typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypes ); internal static readonly string GeneratorName = typeof(JSImportGenerator).Assembly.GetName().Name; @@ -150,7 +147,7 @@ namespace Microsoft.Interop.JavaScript private static string GetFullyQualifiedMethodName(StubEnvironment env, IMethodSymbol method) { // Mono style nested class name format. - string typeName = method.ContainingType.ToDisplayString(typeNameFormat).Replace(".", "/"); + string typeName = method.ContainingType.ToDisplayString(s_typeNameFormat).Replace(".", "/"); if (!method.ContainingType.ContainingNamespace.IsGlobalNamespace) typeName = $"{method.ContainingType.ContainingNamespace.ToDisplayString()}.{typeName}"; diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.cs index da3039cf3e4..b5a89b7f48f 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.cs @@ -943,7 +943,10 @@ namespace JavaScriptTestHelperNamespace public partial class JavaScriptTestHelper { [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "11"; + public static string EchoString(string message) + { + return message + "11"; + } public partial class NestedClass { @@ -1014,7 +1017,10 @@ namespace JavaScriptTestHelperNamespace public partial struct NestedStruct { [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "24"; + public static string EchoString(string message) + { + return message + "24"; + } } public partial record struct NestedRecordStruct @@ -1080,7 +1086,10 @@ namespace JavaScriptTestHelperNamespace public partial record struct NestedRecordStruct { [System.Runtime.InteropServices.JavaScript.JSExport] - public static string EchoString(string message) => message + "45"; + public static string EchoString(string message) + { + return message + "45"; + } } } } |