diff --git a/__tests__/Repeat.ts b/__tests__/Repeat.ts index 156a4c68db..5236a5b8e8 100644 --- a/__tests__/Repeat.ts +++ b/__tests__/Repeat.ts @@ -11,4 +11,8 @@ describe('Repeat', () => { expect(v.toArray()).toEqual(['wtf', 'wtf', 'wtf']); expect(v.join()).toEqual('wtf,wtf,wtf'); }); + + it('does not claim to be equal to undefined', () => { + expect(Repeat(1).equals(undefined)).toEqual(false); + }); }); diff --git a/src/Repeat.js b/src/Repeat.js index 59cffdc26a..77786caf45 100644 --- a/src/Repeat.js +++ b/src/Repeat.js @@ -93,7 +93,7 @@ export class Repeat extends IndexedSeq { equals(other) { return other instanceof Repeat ? is(this._value, other._value) - : deepEqual(other); + : deepEqual(this, other); } }