Don't overwrite MatchersUtil methods with ones that were added to Array.prototype, esp. contains

Fixes #1849.
This commit is contained in:
Steve Gravrock
2020-09-01 15:18:53 -07:00
parent 53d8073707
commit 8cb44582bc
3 changed files with 51 additions and 5 deletions

View File

@@ -66,7 +66,9 @@ getJasmineRequireObj().asymmetricEqualityTesterArgCompatShim = function(j$) {
for (i = 0; i < props.length; i++) {
k = props[i];
if (k !== 'length') {
// Skip length (dealt with above), and anything that collides with
// MatchesUtil e.g. an Array.prototype.contains method added by user code
if (k !== 'length' && !self[k]) {
copy(self, Array.prototype, k);
}
}