GeezerVison is showing github.com — process: add --pending-deprecation to `process.binding()` · nodejs/node@ceebbfb
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/deprecations.md +4-1Lines changed: 4 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2110,9 +2110,12 @@ changes: |
2110 | 2110 | - version: v10.9.0 |
2111 | 2111 | pr-url: https://github.com/nodejs/node/pull/22004 |
2112 | 2112 | description: Documentation-only deprecation. |
| 2113 | + - version: REPLACEME |
| 2114 | + pr-url: https://github.com/nodejs/node/pull/26500 |
| 2115 | + description: Added support for `--pending-deprecation`. |
2113 | 2116 | --> |
2114 | 2117 |
|
2115 | | -Type: Documentation-only |
| 2118 | +Type: Documentation-only (supports [`--pending-deprecation`][]) |
2116 | 2119 |
|
2117 | 2120 | `process.binding()` is for use by Node.js internal code only. |
2118 | 2121 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/pre_execution.js +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -149,6 +149,12 @@ function initializeDeprecations() { |
149 | 149 | value: noBrowserGlobals |
150 | 150 | }); |
151 | 151 | } |
| 152 | + |
| 153 | + if (pendingDeprecation) { |
| 154 | + process.binding = deprecate(process.binding, |
| 155 | + 'process.binding() is deprecated. ' + |
| 156 | + 'Please use public APIs instead.', 'DEP0111'); |
| 157 | + } |
152 | 158 | } |
153 | 159 |
|
154 | 160 | function setupChildProcessIpcChannel() { |
|
Collapse file
Copy file name to clipboardExpand all lines: test/parallel/test-err-name-deprecation.js +9-6Lines changed: 9 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3,11 +3,14 @@ const common = require('../common'); |
3 | 3 |
|
4 | 4 | // Flags: --pending-deprecation |
5 | 5 |
|
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 | +}); |
12 | 15 |
|
13 | 16 | process.binding('uv').errname(-1); |