web binding: fix equals()

Node.equals() used to always return true. Now it works.
Also added unit tests for it.
This commit is contained in:
Joel Spadin 2020-11-26 14:43:27 -06:00
parent 2bf9c0113b
commit 7ef73b2e08
2 changed files with 21 additions and 5 deletions

View file

@ -258,11 +258,7 @@ class Node {
}
equals(other) {
if (this === other) return true;
for (let i = 0; i < 5; i++) {
if (this[i] !== other[i]) return false;
}
return true;
return this.id === other.id;
}
child(index) {