-
-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Description
Refs: nodejs/node#8169, nodejs/node#7152.
Two options here:
- Use the new Buffer API —
Buffer.alloc()
/Buffer.from()
/Buffer.allocUnsafe()
(requires a shim for v0.10/v0.12 and older v4.x versions prior to v4.5.0). - Use
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:
- https://github.com/ChALkeR/notes/blob/master/Lets-fix-Buffer-API.md
- https://github.com/ChALkeR/notes/blob/master/Buffer-knows-everything.md
- buffer: runtime-deprecate Buffer constructor nodejs/node#7152 (comment)
Quick grep (you should better re-check):
deep-equal-1.0.1.tgz/test/cmp.js:82: t.ok(equal(Buffer('xyz'), Buffer('xyz')));
The grep above only includes the lines that call Buffer()
without the new
keyword, if you choose to move to the new API — you should probably also replace new Buffer(…)
calls.
Metadata
Metadata
Assignees
Labels
No labels