Open ChALkeR opened 8 years ago
Note: the deprecation was landed and will start printing warnings in Node.js 7.0.
node 7 is bad. This is a bad upstream change.
This can be closed because the deprecation was reverted in a later 7.x release.
I think this can be closed now since new Buffer
only gets called if Buffer.from
does not exist.
Refs: https://github.com/nodejs/node/pull/8169, https://github.com/nodejs/node/pull/7152.
Two options here:
Buffer.alloc()
/Buffer.from()
/Buffer.allocUnsafe()
(requires a shim for v0.10/v0.12 and older v4.x versions prior to v4.5.0).new Buffer()
for the time being — just add thenew
keyword everywhere. You should manually check that everything is safe in this case, see the links below for more explanation. That might be hard-deprecated at some later point.More background:
Quick grep (you should better re-check):
The grep above only includes the lines that call
Buffer()
without thenew
keyword, if you choose to move to the new API — you should probably also replacenew Buffer(…)
calls.