fix Amount compare bug

return 0 if values not comparable
This commit is contained in:
Ivan Tivonenko
2015-09-01 01:29:37 +03:00
parent 572c945274
commit 806547dd15

View File

@@ -388,7 +388,7 @@ Amount.prototype._copy = function(value) {
Amount.prototype.compareTo = function(to) {
var toAmount = Amount.from_json(to);
if (!this.is_comparable(toAmount)) {
return new Amount(NaN);
return 0;
}
return this._value.comparedTo(toAmount._value);
};