readonly() breaks comparison between objects
Version
3.2.21
Problem
I had an object A that used some data from a readonly object B, but after reassigning the props from object A and try to compare the prop to the equivalent data from object B, the result of the comparison was false when I expected to be true.
I managed to work around this by comparing the internal properties from both objects, but I'd like to know what it's expected to return in the case bellow
Steps to reproduce
class Type {
constructor(code) {
this.code = code;
}
getCode() {
return this.code;
}
}
simpler = readonly({ a: new Type(0), b: new Type(1) });
moreComplex = reactive({ a: simpler.a, b: simpler.b });
console.log(`Before: ${moreComplex.a === simpler.a}`);
moreComplex.a = simpler.b;
moreComplex.a = simpler.a;
console.log(`After: ${moreComplex.a === simpler.a}`);
Hello, thank you for taking time filling this issue!
However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).
I hope to see your helper-created issue very soon!