Skip to content

Commit

Permalink
FIX: method discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
rPraml committed Jan 2, 2024
1 parent 6a5c919 commit 99f6d09
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/org/mozilla/javascript/NativeJavaMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,15 @@ private static int preferSignature(
break;
}
}
if (totalPreference == PREFERENCE_EQUAL && vararg1 != vararg2) {
// It could happen that we have found two methods, that may fit
// In this case, we will take the no-vararg one, if possible
if (vararg1) {
totalPreference = PREFERENCE_SECOND_ARG;
} else {
totalPreference = PREFERENCE_FIRST_ARG;
}
}
return totalPreference;
}

Expand Down

0 comments on commit 99f6d09

Please sign in to comment.