From: Feross Aboukhadijeh Date: Sat, 9 Jan 2016 14:27:42 +0000 (+0100) Subject: remove saved _set reference X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=707fa6375662c7ae31daaf38662f02b914db2e68;p=buffer.git remove saved _set reference --- diff --git a/index.js b/index.js index d028aa5..1ee0410 100644 --- a/index.js +++ b/index.js @@ -225,7 +225,6 @@ function fromJsonObject (that, object) { if (Buffer.TYPED_ARRAY_SUPPORT) { Buffer.prototype.__proto__ = Uint8Array.prototype - Buffer.prototype._set = Uint8Array.prototype.set // For `copy` below. Buffer.__proto__ = Uint8Array } else { // pre-set for values that may exist in the future @@ -1285,7 +1284,11 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) { target[i + targetStart] = this[i + start] } } else { - target._set(this.subarray(start, start + len), targetStart) + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) } return len @@ -1337,9 +1340,6 @@ Buffer._augment = function _augment (arr) { arr.constructor = Buffer arr._isBuffer = true - // save reference to original Uint8Array set method before overwriting - arr._set = arr.set - // deprecated arr.get = BP.get arr.set = BP.set