kevinsawicki/tantamount — pull request #2 by nathansobo (2013-11-19 10:42:47+00:00)
Title: Allow custom isEqual functions to be cycle-aware

This commit passes the aStack and bStack arrays into user defined
isEqual methods as a second and third argument. When calling isEqual
recursively, the custom isEqual method can pass these stacks back to
tantamount to prevent stack overflows in the presence of cycles.

Since jasmine passes random arguments to its equality testers, the
isEqual will only forward the stack arguments through if they are both
arrays. There's still a small chance that 2 arrays will accidentally
be passed in, but I think having cycle detection work with custom
methods is worth it.