File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,17 @@ describe('iterableEquality', () => {
241241 ) . toBe ( false ) ;
242242 } ) ;
243243
244+ test ( 'returns true when given circular Set shape' , ( ) => {
245+ const a1 = new Set ( ) ;
246+ const a2 = new Set ( ) ;
247+ a1 . add ( a2 ) ;
248+ a2 . add ( a1 ) ;
249+ const b = new Set ( ) ;
250+ b . add ( b ) ;
251+
252+ expect ( iterableEquality ( a1 , b ) ) . toBe ( true ) ;
253+ } ) ;
254+
244255 test ( 'returns true when given circular key in Map' , ( ) => {
245256 const a = new Map ( ) ;
246257 a . set ( a , 'a' ) ;
Original file line number Diff line number Diff line change @@ -166,8 +166,6 @@ export const iterableEquality = (
166166 // circular reference is not equal to non-circular one
167167 if ( aStack [ length ] === a ) {
168168 return bStack [ length ] === b ;
169- } else if ( bStack [ length ] === b ) {
170- return false ;
171169 }
172170 }
173171 aStack . push ( a ) ;
You can’t perform that action at this time.
0 commit comments