From ef74c7ca11e6bc86c81a5645acb1c4bca446a2eb Mon Sep 17 00:00:00 2001 From: wltsmrz Date: Tue, 15 Jul 2014 00:38:58 -0700 Subject: [PATCH] Clone options in Amount.ratio_human --- src/js/ripple/amount.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/ripple/amount.js b/src/js/ripple/amount.js index 1e959c9d..ad1551d8 100644 --- a/src/js/ripple/amount.js +++ b/src/js/ripple/amount.js @@ -1,6 +1,7 @@ // Represent Ripple amounts and currencies. // - Numbers in hex are big-endian. +var extend = require('extend'); var utils = require('./utils'); var sjcl = utils.sjcl; var bn = sjcl.bn; @@ -377,8 +378,9 @@ Amount.prototype.divide = function(d) { * should be applied. Can be given as JavaScript Date or int for Ripple epoch. * @return {Amount} The resulting ratio. Unit will be the same as numerator. */ + Amount.prototype.ratio_human = function(denominator, opts) { - opts = opts || {}; + opts = extend({ }, opts); if (typeof denominator === 'number' && parseInt(denominator, 10) === denominator) { // Special handling of integer arguments