From 03b37c090911c60875e97e0c63ab2175aa668e2d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 7 Apr 2014 23:36:14 -0700 Subject: [PATCH] expose augment as Buffer._augment --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 911507b..6ddb57c 100644 --- a/index.js +++ b/index.js @@ -81,7 +81,7 @@ function Buffer (subject, encoding, noZero) { var buf if (Buffer._useTypedArrays) { // Preferred: Return an augmented `Uint8Array` instance for best performance - buf = augment(new Uint8Array(length)) + buf = Buffer._augment(new Uint8Array(length)) } else { // Fallback: Return THIS instance of Buffer (created by `new`) buf = this @@ -465,7 +465,7 @@ Buffer.prototype.slice = function (start, end) { end = clamp(end, len, len) if (Buffer._useTypedArrays) { - return augment(this.subarray(start, end)) + return Buffer._augment(this.subarray(start, end)) } else { var sliceLen = end - start var newBuf = new Buffer(sliceLen, undefined, true) @@ -935,7 +935,7 @@ var BP = Buffer.prototype /** * Augment the Uint8Array *instance* (not the class!) with Buffer methods */ -function augment (arr) { +Buffer._augment = function (arr) { arr._isBuffer = true // save reference to original Uint8Array get/set methods before overwriting -- 2.34.1