mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 20:25:48 +00:00
JS: Fix Currency#is_valid.
Currency.is_valid("USD") returned false, because "USD" is NaN (not a Number).
We should not use NaN as a stand-in value, since it means "not a *JavaScript*
number", whereas our meaning really is "not a BigInteger object". So we should
be using null.
This commit is contained in:
@@ -67,7 +67,7 @@ Currency.prototype.is_native = function () {
|
||||
};
|
||||
|
||||
Currency.prototype.is_valid = function () {
|
||||
return !isNaN(this._value);
|
||||
return 'string' === typeof this._value || !isNaN(this._value);
|
||||
};
|
||||
|
||||
Currency.prototype.to_json = function () {
|
||||
|
||||
Reference in New Issue
Block a user