|
@@ -60,13 +60,24 @@ namespace Jint.Runtime.Interop
|
|
|
{
|
|
|
static int CreateComparison(MethodDescriptor d1, MethodDescriptor d2)
|
|
|
{
|
|
|
+ // if its a generic method, put it on the end
|
|
|
+ if (d1.Method.IsGenericMethod && !d2.Method.IsGenericMethod)
|
|
|
+ {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (d2.Method.IsGenericMethod && !d1.Method.IsGenericMethod)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
// put params versions to end, they can be tricky to match and can cause trouble / extra overhead
|
|
|
- if (d1.HasParams)
|
|
|
+ if (d1.HasParams && !d2.HasParams)
|
|
|
{
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
- if (d2.HasParams)
|
|
|
+ if (d2.HasParams && !d1.HasParams)
|
|
|
{
|
|
|
return -1;
|
|
|
}
|