They only need a unique id for the object, they can't hash based on the object contents because those can change and because two objects with exactly the same properties are not equal in JS:
assert({} === {}); // throws