diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSSignatureContext.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSSignatureContext.cs index 3f058a5c7eeb4..f59bb25bca0f5 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSSignatureContext.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSSignatureContext.cs @@ -48,6 +48,7 @@ public static JSSignatureContext Create( // there could be multiple method signatures with the same name, get unique signature name uint hash = 17; + int typesHash; unchecked { foreach (var param in sigContext.ElementTypeInformation) @@ -57,8 +58,8 @@ public static JSSignatureContext Create( foreach (char c in param.ManagedType.FullTypeName) hash = hash * 31 + c; } + typesHash = (int)(hash & int.MaxValue); }; - int typesHash = Math.Abs((int)hash); var fullName = $"{method.ContainingType.ToDisplayString()}.{method.Name}"; string qualifiedName = GetFullyQualifiedMethodName(env, method);