Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ changes:
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Documentation-only (supports [`--pending-deprecation`][])
Comment thread
addaleax marked this conversation as resolved.

`process.binding()` is for use by Node.js internal code only.

Expand Down
6 changes: 6 additions & 0 deletions lib/internal/bootstrap/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ function initializeDeprecations() {
value: noBrowserGlobals
});
}

if (pendingDeprecation) {
process.binding = deprecate(process.binding,
'`process.binding()` is deprecated. ' +
Comment thread
addaleax marked this conversation as resolved.
Outdated
'Please use public APIs instead.', 'DEP0111');
}
}

function setupChildProcessIpcChannel() {
Expand Down
15 changes: 9 additions & 6 deletions test/parallel/test-err-name-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ const common = require('../common');

// Flags: --pending-deprecation

common.expectWarning(
'DeprecationWarning',
'Directly calling process.binding(\'uv\').errname(<val>) is being ' +
'deprecated. Please make sure to use util.getSystemErrorName() instead.',
'DEP0119'
);
common.expectWarning({
DeprecationWarning: [
['`process.binding()` is deprecated. Please use public APIs instead.',
'DEP0111'],
['Directly calling process.binding(\'uv\').errname(<val>) is being ' +
'deprecated. Please make sure to use util.getSystemErrorName() instead.',
'DEP0119']
]
});

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