From 148254744134793cd6556c9749658f3872b03d00 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 25 Feb 2019 22:28:35 +0100 Subject: process: add --pending-deprecation to `process.binding()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Print a deprecation warning for `process.binding()` when using `--pending-deprecation`. PR-URL: https://github.com/nodejs/node/pull/26500 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: Gus Caplan Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Minwoo Jung Reviewed-By: Michaël Zasso Reviewed-By: Masashi Hirano Reviewed-By: Ruben Bridgewater Reviewed-By: Tobias Nießen Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Anto Aravinth --- lib/internal/bootstrap/pre_execution.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/internal/bootstrap/pre_execution.js') diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 30c0d89a4a..936dc4673c 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -195,6 +195,12 @@ function initializeDeprecations() { value: noBrowserGlobals }); } + + if (pendingDeprecation) { + process.binding = deprecate(process.binding, + 'process.binding() is deprecated. ' + + 'Please use public APIs instead.', 'DEP0111'); + } } function setupChildProcessIpcChannel() { -- cgit v1.2.3