I propose to change how equality works in 4.0 to be more structural by default, the idea would be:
1) consider plain objects, arrays, sets and maps structurally
2) consider non plain objects (prototype !== Object.prototype) by reference
3) provide a byReference function backed by a weakmap to consider an instance of an object as by reference
We previously backed off from structural by default due to errors with circular structures but this was mainly due to considering ALL objects structurally (i.e. also custom classes). We should also be able to deal with circular structures by detecting loops.
I propose to change how equality works in 4.0 to be more structural by default, the idea would be:
1) consider plain objects, arrays, sets and maps structurally 2) consider non plain objects (prototype !== Object.prototype) by reference 3) provide a byReference function backed by a weakmap to consider an instance of an object as by reference
We previously backed off from structural by default due to errors with circular structures but this was mainly due to considering ALL objects structurally (i.e. also custom classes). We should also be able to deal with circular structures by detecting loops.