JS backend: use 0 as init value when calculating hashCode in data classes as in JVM backend.
This commit is contained in:
+1
-2
@@ -123,8 +123,7 @@ class JsDataClassGenerator extends DataClassMethodGenerator {
|
|||||||
|
|
||||||
JsName varName = functionObj.getScope().declareName("result");
|
JsName varName = functionObj.getScope().declareName("result");
|
||||||
|
|
||||||
int typeHash = context.getQualifiedReference(getClassDescriptor()).toString().hashCode();
|
statements.add(new JsVars(new JsVars.JsVar(varName, JsNumberLiteral.ZERO)));
|
||||||
statements.add(new JsVars(new JsVars.JsVar(varName, jsProgram.getNumberLiteral(typeHash))));
|
|
||||||
|
|
||||||
for (PropertyDescriptor prop : classProperties) {
|
for (PropertyDescriptor prop : classProperties) {
|
||||||
// TODO: we should statically check that we can call hashCode method directly.
|
// TODO: we should statically check that we can call hashCode method directly.
|
||||||
|
|||||||
Reference in New Issue
Block a user