Skip to content

Commit ceebbfb

Browse files
addaleaxBridgeAR
authored andcommitted
process: add --pending-deprecation to process.binding()
Print a deprecation warning for `process.binding()` when using `--pending-deprecation`. PR-URL: #26500 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Masashi Hirano <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
1 parent fdad4d2 commit ceebbfb

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

Diff for: doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2110,9 +2110,12 @@ changes:
21102110
- version: v10.9.0
21112111
pr-url: https://github.com/nodejs/node/pull/22004
21122112
description: Documentation-only deprecation.
2113+
- version: REPLACEME
2114+
pr-url: https://github.com/nodejs/node/pull/26500
2115+
description: Added support for `--pending-deprecation`.
21132116
-->
21142117
2115-
Type: Documentation-only
2118+
Type: Documentation-only (supports [`--pending-deprecation`][])
21162119
21172120
`process.binding()` is for use by Node.js internal code only.
21182121

Diff for: lib/internal/bootstrap/pre_execution.js

+6
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ function initializeDeprecations() {
149149
value: noBrowserGlobals
150150
});
151151
}
152+
153+
if (pendingDeprecation) {
154+
process.binding = deprecate(process.binding,
155+
'process.binding() is deprecated. ' +
156+
'Please use public APIs instead.', 'DEP0111');
157+
}
152158
}
153159

154160
function setupChildProcessIpcChannel() {

Diff for: test/parallel/test-err-name-deprecation.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ const common = require('../common');
33

44
// Flags: --pending-deprecation
55

6-
common.expectWarning(
7-
'DeprecationWarning',
8-
'Directly calling process.binding(\'uv\').errname(<val>) is being ' +
9-
'deprecated. Please make sure to use util.getSystemErrorName() instead.',
10-
'DEP0119'
11-
);
6+
common.expectWarning({
7+
DeprecationWarning: [
8+
['process.binding() is deprecated. Please use public APIs instead.',
9+
'DEP0111'],
10+
['Directly calling process.binding(\'uv\').errname(<val>) is being ' +
11+
'deprecated. Please make sure to use util.getSystemErrorName() instead.',
12+
'DEP0119']
13+
]
14+
});
1215

1316
process.binding('uv').errname(-1);

0 commit comments

Comments
 (0)