Permalink
Browse files

Override equals and compare on map item

  • Loading branch information...
kriskowal committed Dec 29, 2012
1 parent f03d1a6 commit e14cf49343cff39ef50c75e07e8942b099962f34
Showing with 8 additions and 0 deletions.
  1. +8 −0 generic-map.js
View
@@ -157,3 +157,11 @@ function Item(key, value) {
this.value = value;
}
+Item.prototype.equals = function (that) {
+ return Object.equals(this.key, that.key) && Object.equals(this.value, that.value);
+};
+
+Item.prototype.compare = function (that) {
+ return Object.compare(this.key, that.key);
+};
+

0 comments on commit e14cf49

Please sign in to comment.