From bbfc348b8566ebc78831af3410a64c884977cac8 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Mon, 22 Oct 2012 21:29:38 -0700 Subject: [PATCH] JS: Fix Amount.copyTo(). --- js/amount.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/amount.js b/js/amount.js index a01eb168..ad58e44c 100644 --- a/js/amount.js +++ b/js/amount.js @@ -318,7 +318,11 @@ Amount.prototype.copyTo = function(d, negate) { d.offset = this.offset; 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.issuer.copyTo(d.issuer);