diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 8f1e2996416814..dbf58a866bf876 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -105,6 +105,10 @@ const internalBindingAllowlist = new SafeSet([ 'zlib', ]); +const runtimeDeprecatedList = new SafeSet([ + 'async_wrap', +]); + // Set up process.binding() and process._linkedBinding(). { const bindingObj = ObjectCreate(null); @@ -114,6 +118,13 @@ const internalBindingAllowlist = new SafeSet([ // Deprecated specific process.binding() modules, but not all, allow // selective fallback to internalBinding for the deprecated ones. if (internalBindingAllowlist.has(module)) { + if (runtimeDeprecatedList.has(module)) { + runtimeDeprecatedList.delete(module); + process.emitWarning( + `Access to process.binding('${module}') is deprecated.`, + 'DeprecationWarning', + 'DEP0111'); + } return internalBinding(module); } // eslint-disable-next-line no-restricted-syntax