Bug fix. Use Name.match for name matching.
diff --git a/js/Name.js b/js/Name.js
index 1874ddd..53495d4 100644
--- a/js/Name.js
+++ b/js/Name.js
@@ -285,3 +285,20 @@
}
return result;
};
+
+Name.prototype.match = function(/*Name*/ name) {
+ var i_name = this.components;
+ var o_name = name.components;
+
+ // The intrest name is longer than the name we are checking it against.
+ if (i_name.length > o_name.length)
+ return false;
+
+ // Check if at least one of given components doesn't match.
+ for (var i = 0; i < i_name.length; ++i) {
+ if (!DataUtils.arraysEqual(i_name[i], o_name[i]))
+ return false;
+ }
+
+ return true;
+};