JS backend: fix equality check for nullable types

* Generate simple check when compare with `null` literal.
* Use Kotlin.equals if type of receiver or argument is nullable.
* Don't call equals method if any of receiver or argument is null (at runtime, not only literal). For more information see KT-4356.

 #KT-7530 fixed
 #KT-7916 fixed
This commit is contained in:
Zalim Bashorov
2015-06-02 20:07:48 +03:00
parent 6aaccae6a9
commit 92457543bc
6 changed files with 133 additions and 1 deletions
+4
View File
@@ -47,6 +47,10 @@
return obj2 == null;
}
if (obj2 == null) {
return false;
}
if (Array.isArray(obj1)) {
return Kotlin.arrayEquals(obj1, obj2);
}