So much logic on one line! Two thoughts: can we split these out into multiple lines? And, instead of this special-case handling of records, can we make use of obj.isEqual (I think) or SC.isEqual (I think)? There's a great deal of infrastructure in place already to allow objects to determine equality, and we ought to be able to make use of it.