Skip to content

Commit

Permalink
buffer: remove deprecated buffer.get/.set methods
Browse files Browse the repository at this point in the history
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: nodejs#4594
Fixes: nodejs#4587
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
  • Loading branch information
feross authored and Michael Scovetta committed Apr 2, 2016
1 parent ac96253 commit 0097b6a
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0097b6a

Please sign in to comment.