JS: Fix Amount.copyTo().

This commit is contained in:
Arthur Britto
2012-10-22 21:29:38 -07:00
committed by Stefan Thomas
parent 45c54b6484
commit bbfc348b85

View File

@@ -318,7 +318,11 @@ Amount.prototype.copyTo = function(d, negate) {
d.offset = this.offset; d.offset = this.offset;
d.is_native = this.is_native; d.is_native = this.is_native;
d.is_negative = this.is_native ? undefined : !this.is_negative; d.is_negative = this.is_native
? undefined // Native sign in BigInteger.
: negate
? !this.is_negative // Negating.
: this.is_negative; // Just copying.
this.currency.copyTo(d.currency); this.currency.copyTo(d.currency);
this.issuer.copyTo(d.issuer); this.issuer.copyTo(d.issuer);