mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
lib: remove internalBinding('config').pendingDeprecation
Instead use `require('internal/options').getOptionValue('--pending-deprecation')` PR-URL: https://github.com/nodejs/node/pull/24962 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
6a24014ee5
commit
b32e5e08b2
4 changed files with 24 additions and 19 deletions
|
@ -48,9 +48,7 @@ const {
|
|||
isArrayBufferView,
|
||||
isUint8Array
|
||||
} = require('internal/util/types');
|
||||
const {
|
||||
pendingDeprecation
|
||||
} = internalBinding('config');
|
||||
|
||||
const {
|
||||
ERR_BUFFER_OUT_OF_BOUNDS,
|
||||
ERR_OUT_OF_RANGE,
|
||||
|
@ -138,7 +136,7 @@ const bufferWarning = 'Buffer() is deprecated due to security and usability ' +
|
|||
function showFlaggedDeprecation() {
|
||||
if (bufferWarningAlreadyEmitted ||
|
||||
++nodeModulesCheckCounter > 10000 ||
|
||||
(!pendingDeprecation &&
|
||||
(!require('internal/options').getOptionValue('--pending-deprecation') &&
|
||||
isInsideNodeModules())) {
|
||||
// We don't emit a warning, because we either:
|
||||
// - Already did so, or
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue