Skip to content

Commit e0e62d1

Browse files
committed
Revert "buffer: runtime deprecation of calling Buffer without new"
This reverts commit f2fe558 (#8169) as the original justification for the runtime-deprecation does not appear to justify the disruption to Node’s existing ecosystem. Futhermore, the possibility of deprecating the Buffer constructor entirely in v8.0 might lead to people having to change their code twice. PR-URL: #9529 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Nikolai Vavilov <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent d06f010 commit e0e62d1

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

lib/buffer.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,7 @@ function alignPool() {
7272
* much breakage at this time. It's not likely that the Buffer constructors
7373
* would ever actually be removed.
7474
**/
75-
var newBufferWarned = false;
7675
function Buffer(arg, encodingOrOffset, length) {
77-
if (!new.target && !newBufferWarned) {
78-
newBufferWarned = true;
79-
process.emitWarning(
80-
'Using Buffer without `new` will soon stop working. ' +
81-
'Use `new Buffer()`, or preferably ' +
82-
'`Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.',
83-
'DeprecationWarning'
84-
);
85-
}
8676
// Common case.
8777
if (typeof arg === 'number') {
8878
if (typeof encodingOrOffset === 'string') {

test/parallel/test-buffer-deprecated.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)