diff --git a/lib/buffer.js b/lib/buffer.js index b2325098bcbb9d..f4d16f41fc93dd 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -72,17 +72,7 @@ function alignPool() { * much breakage at this time. It's not likely that the Buffer constructors * would ever actually be removed. **/ -var newBufferWarned = false; function Buffer(arg, encodingOrOffset, length) { - if (!new.target && !newBufferWarned) { - newBufferWarned = true; - process.emitWarning( - 'Using Buffer without `new` will soon stop working. ' + - 'Use `new Buffer()`, or preferably ' + - '`Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.', - 'DeprecationWarning' - ); - } // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { diff --git a/test/parallel/test-buffer-deprecated.js b/test/parallel/test-buffer-deprecated.js deleted file mode 100644 index ec49321de43941..00000000000000 --- a/test/parallel/test-buffer-deprecated.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -const common = require('../common'); - -const expected = - 'Using Buffer without `new` will soon stop working. ' + - 'Use `new Buffer()`, or preferably ' + - '`Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.'; -common.expectWarning('DeprecationWarning', expected); - -Buffer(1); -Buffer(1);