Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,9 @@ function alignPool() {
}

var bufferWarn = true;
const bufferWarning = 'The Buffer() and new Buffer() constructors are not ' +
'recommended for use due to security and usability ' +
'concerns. Please use the Buffer.alloc(), ' +
'Buffer.allocUnsafe(), or Buffer.from() construction ' +
'methods instead.';
const bufferWarning = 'Buffer() is deprecated due to security and usability ' +
'issues. Please use the Buffer.alloc(), ' +
'Buffer.allocUnsafe(), or Buffer.from() methods instead.';

function showFlaggedDeprecation() {
if (bufferWarn) {
Expand Down
8 changes: 3 additions & 5 deletions test/parallel/test-buffer-pending-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

const common = require('../common');

const bufferWarning = 'The Buffer() and new Buffer() constructors are not ' +
'recommended for use due to security and usability ' +
'concerns. Please use the Buffer.alloc(), ' +
'Buffer.allocUnsafe(), or Buffer.from() construction ' +
'methods instead.';
const bufferWarning = 'Buffer() is deprecated due to security and usability ' +
'issues. Please use the Buffer.alloc(), ' +
'Buffer.allocUnsafe(), or Buffer.from() methods instead.';

common.expectWarning('DeprecationWarning', bufferWarning, 'DEP0005');

Expand Down