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

fix nodejs 7 DeprecationWarning: calling new Buffer(0) #1156

Closed
wants to merge 1 commit into from

Conversation

isghe
Copy link

@isghe isghe commented Oct 26, 2016

Avoid nodejs 7 warning:
DeprecationWarning: Using Buffer without new will soon stop working.
Use new Buffer(), or preferably Buffer.from(),
Buffer.allocUnsafe() or Buffer.alloc() instead.

Avoid nodejs 7 warning:
DeprecationWarning: Using Buffer without `new` will soon stop working.
Use `new Buffer()`, or preferably `Buffer.from()`,
`Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
@charmander
Copy link
Collaborator

Actually, I guess this is a duplicate of #1154.

@jackycute
Copy link

It would be great if anyone could merge this PR 😄

@alextes
Copy link

alextes commented Nov 30, 2016

It's gotten to the point where there are even duplicate PR's 😓 to fix issue #1163 of node-postgres causing node to emit scary warnings. I get #1154 is in contention. However considering time efficiency and the content of this PR it makes sense to merge this as soon as possible.

I hope one of the maintainers finds the time to take a peek at this!

@runk
Copy link

runk commented Dec 7, 2016

Guys, please merge this trivial but very annoying thing. All users of node 7+ are affected.

@alextes
Copy link

alextes commented Dec 7, 2016

@runk no longer actually! As of yesterday, the 'annoying' deprecation warning has been removed. Just update to Node v7.2.1 . As of yesterday I'd actually say this PR can be closed. After all unsafe use of buffer allocation was never the issue for node-postgres, it was the annoying warning and use of a deprecated API. This PR does little to solve that, going from a deprecated API to another deprecated API.

@SEAPUNK
Copy link

SEAPUNK commented Dec 7, 2016

@alextes What's deprecated about the new Buffer allocation API?

EDIT: nvm, just noticed what the change was. Keeping track of too many PRs, heh.

@brianc
Copy link
Owner

brianc commented Dec 10, 2016

OOOff sorry it took me so long to get to this. I'm going to close this in favor of the more feature-complete approach here:

#1154

Hope to have that merged soon!

@brianc brianc closed this Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants