Skip to content

Commit 3d61e14

Browse files
committedApr 4, 2018
buffer: shorten deprecation warning
Shorten the deprecation warning for Buffer constructor. PR-URL: #19741 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]>
1 parent de0053c commit 3d61e14

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed
 

Diff for: ‎lib/buffer.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,9 @@ function alignPool() {
140140
}
141141

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

149147
function showFlaggedDeprecation() {
150148
if (bufferWarn) {

Diff for: ‎test/parallel/test-buffer-pending-deprecation.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

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

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

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

0 commit comments

Comments
 (0)