-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
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.
Actually, I guess this is a duplicate of #1154. |
It would be great if anyone could merge this PR 😄 |
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! |
Guys, please merge this trivial but very annoying thing. All users of node 7+ are affected. |
@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. |
@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. |
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: Hope to have that merged soon! |
Avoid nodejs 7 warning:
DeprecationWarning: Using Buffer without
new
will soon stop working.Use
new Buffer()
, or preferablyBuffer.from()
,Buffer.allocUnsafe()
orBuffer.alloc()
instead.