JS: More fixes and tests for Amount.negate().

This commit is contained in:
Arthur Britto
2012-10-21 21:45:04 -07:00
parent e92f2f38c1
commit bd0dc68a22
2 changed files with 34 additions and 18 deletions

View File

@@ -193,7 +193,7 @@ Amount.prototype.copyTo = function(d, negate) {
if ('object' === typeof this.value)
{
if (this.is_native && negate)
this.value.negate.copyTo(d.value);
this.value.negate().copyTo(d.value);
else
this.value.copyTo(d.value);
}
@@ -204,7 +204,7 @@ Amount.prototype.copyTo = function(d, negate) {
d.offset = this.offset;
d.is_native = this.is_native;
d.is_negative = this.is_negative ? undefined : !this.is_negative;
d.is_negative = this.is_native ? undefined : !this.is_negative;
this.currency.copyTo(d.currency);
this.issuer.copyTo(d.issuer);