diff --git a/src/jsbn/jsbn.js b/src/jsbn/jsbn.js index 61b4d0b..7e49c0a 100644 --- a/src/jsbn/jsbn.js +++ b/src/jsbn/jsbn.js @@ -1201,9 +1201,7 @@ BigInteger.valueOf = nbv; */ BigInteger.fromByteArrayUnsigned = function(ba) { // FIXME: BigInteger doesn't yet support Buffers - if (Buffer.isBuffer(ba)) { - ba = Array.prototype.map.bind(ba, function(x) { return x })() - } + if (Buffer.isBuffer(ba)) ba = Array.prototype.slice.call(ba) if (!ba.length) { return new BigInteger.valueOf(0); diff --git a/src/script.js b/src/script.js index deeea9a..f36a605 100644 --- a/src/script.js +++ b/src/script.js @@ -339,9 +339,7 @@ Script.prototype.writeOp = function(opcode) { */ Script.prototype.writeBytes = function(data) { // FIXME: Script module doesn't support buffers yet - if (Buffer.isBuffer(data)) { - data = Array.prototype.map.bind(data, function(x) { return x })() - } + if (Buffer.isBuffer(data)) data = Array.prototype.slice.call(data) if (data.length < Opcode.map.OP_PUSHDATA1) { this.buffer.push(data.length)