JS: prevent Any.equals from mangling

This commit is contained in:
Alexey Andreev
2016-12-07 18:43:21 +03:00
parent a2d45153ba
commit cc819928de
7 changed files with 61 additions and 19 deletions
+10
View File
@@ -0,0 +1,10 @@
function foo(first, second) {
return first.equals(second);
}
function B(value) {
this.value = value;
}
B.prototype.equals = function(other) {
return other instanceof B && other.value == this.value;
};