Closed wj1918 closed 4 years ago
Hello @wj1918, First of all, thanks for your feedback.
They've been some discussions about how should be transpiled hashCode and equals. There is no unique solution given that JS and Java equality mechanism are pretty different.
The current compromise (the output you posted) is IMHO a good way of providing compatibility with existing Java code and at the same time being easy to understand.
There won't be any more modifications of this behavior for now.
Strict comparison should be used for same type comparison.
For example, the following java code
should convert to
current output is
Further more, use == for different type comparison.
According to the MDN document