From 101bca988cebce584d5b6098c316a6e7bf89b69d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 8 Jan 2016 21:18:33 +0100 Subject: [PATCH] buffer: remove deprecated buffer.get/.set methods These have been deprecated since Apr 27, 2013, and the plan was to remove them in "node v0.13". buffer.get(index) is superseded by buffer[index]. buffer.set(index, value) is superseded by buffer[index] = value. These have never been documented at any point in node's history. PR-URL: https://github.com/nodejs/node/pull/4594 Fixes: https://github.com/nodejs/node/issues/4587 Reviewed-By: Colin Ihrig Reviewed-By: Trevor Norris Reviewed-By: Brian White Reviewed-By: Roman Reiss --- lib/buffer.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib/buffer.js b/lib/buffer.js index 00be048d4a6..6600cda0388 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -523,24 +523,6 @@ Buffer.prototype.fill = function fill(val, start, end) { }; -// XXX remove in v0.13 -Buffer.prototype.get = internalUtil.deprecate(function get(offset) { - offset = ~~offset; - if (offset < 0 || offset >= this.length) - throw new RangeError('Index out of range'); - return this[offset]; -}, 'Buffer.get is deprecated. Use array indexes instead.'); - - -// XXX remove in v0.13 -Buffer.prototype.set = internalUtil.deprecate(function set(offset, v) { - offset = ~~offset; - if (offset < 0 || offset >= this.length) - throw new RangeError('Index out of range'); - return this[offset] = v; -}, 'Buffer.set is deprecated. Use array indexes instead.'); - - // TODO(trevnorris): fix these checks to follow new standard // write(string, offset = 0, length = buffer.length, encoding = 'utf8') var writeWarned = false;