buffer: shorten deprecation warning
Shorten the deprecation warning for Buffer constructor. PR-URL: https://github.com/nodejs/node/pull/19741 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
This commit is contained in:
parent
de0053cc32
commit
3d61e14704
@ -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) {
|
||||
|
@ -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');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user