Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove buffer.get and buffer.set #4587

Closed
feross opened this issue Jan 8, 2016 · 4 comments
Closed

Remove buffer.get and buffer.set #4587

feross opened this issue Jan 8, 2016 · 4 comments
Labels
buffer Issues and PRs related to the buffer subsystem.

Comments

@feross
Copy link
Contributor

feross commented Jan 8, 2016

These have been deprecated since Apr 27, 2013, and the plan was to remove them in "node v0.13", according to the comments.

buffer.get(index) is superseded by buffer[index].

buffer.set(index, value) is superseded by buffer[index] = value.

I haven't seen these used in real code, ever. They also have never been documented at any point in node's history, according to the git commit history for doc/api/buffer.markdown.

I think it is safe to finally remove these.

Thoughts?

@feross
Copy link
Contributor Author

feross commented Jan 8, 2016

Another advantage of removing these is that they'll stop shadowing the underlying TypedArray.prototype.set function.

@jasnell
Copy link
Member

jasnell commented Jan 8, 2016

@trevnorris

@feross feross changed the title Deprecate buffer.get and buffer.set Remove buffer.get and buffer.set Jan 8, 2016
@trevnorris
Copy link
Contributor

Can be removed whenever. It never gets in the way of anything, so I keep forgetting about them. Wouldn't even say it's a major change. Not documented and have been fully deprecated going on 3 years (as @feross mentioned).

@mscdex mscdex added the buffer Issues and PRs related to the buffer subsystem. label Jan 8, 2016
@feross
Copy link
Contributor Author

feross commented Jan 8, 2016

@trevnorris Okay, PR sent: #4594

scovetta pushed a commit to scovetta/node that referenced this issue Apr 2, 2016
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 <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Roman Reiss <me@silverwind.io>
bookercodes pushed a commit to coolaj86/node-bufferjs that referenced this issue Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem.
Projects
None yet
Development

No branches or pull requests

4 participants