From 87972cd76fa6ce0dfbd604c3faee19c212ef608e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 29 Mar 2018 21:06:38 -0700 Subject: [PATCH] buffer: remove "new" from deprecation message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change removes "new" as a description for `Buffer` construction methods. They are arguably not "new" anymore and they certainly won't be "new" anymore at some point. PR-URL: https://github.com/nodejs/node/pull/19687 Reviewed-By: Luigi Pinca Reviewed-By: Michaël Zasso Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Trivikram Kamat Reviewed-By: Nikolai Vavilov Reviewed-By: Vse Mozhet Byt Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- lib/buffer.js | 2 +- test/parallel/test-buffer-pending-deprecation.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/buffer.js b/lib/buffer.js index 09afc4d713bd9b..42862c02da98d8 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -142,7 +142,7 @@ 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 new Buffer.alloc(), ' + + 'concerns. Please use the Buffer.alloc(), ' + 'Buffer.allocUnsafe(), or Buffer.from() construction ' + 'methods instead.'; diff --git a/test/parallel/test-buffer-pending-deprecation.js b/test/parallel/test-buffer-pending-deprecation.js index 15b5a5140e184a..ba9f1b7bd7b592 100644 --- a/test/parallel/test-buffer-pending-deprecation.js +++ b/test/parallel/test-buffer-pending-deprecation.js @@ -5,7 +5,7 @@ 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 new Buffer.alloc(), ' + + 'concerns. Please use the Buffer.alloc(), ' + 'Buffer.allocUnsafe(), or Buffer.from() construction ' + 'methods instead.';