JS backend: use 0 as init value when calculating hashCode in data classes as in JVM backend.

This commit is contained in:
Zalim Bashorov
2014-10-09 12:54:05 +04:00
parent ae39524a95
commit 2d634931f6
@@ -123,8 +123,7 @@ class JsDataClassGenerator extends DataClassMethodGenerator {
JsName varName = functionObj.getScope().declareName("result");
int typeHash = context.getQualifiedReference(getClassDescriptor()).toString().hashCode();
statements.add(new JsVars(new JsVars.JsVar(varName, jsProgram.getNumberLiteral(typeHash))));
statements.add(new JsVars(new JsVars.JsVar(varName, JsNumberLiteral.ZERO)));
for (PropertyDescriptor prop : classProperties) {
// TODO: we should statically check that we can call hashCode method directly.