Skip to content

Commit 968e2f4

Browse files
authored
dgram: move deprecated APIs to EOL
Seven years is long enough to be deprecated. PR-URL: #58474 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 705bcc2 commit 968e2f4

File tree

4 files changed

+7
-162
lines changed

4 files changed

+7
-162
lines changed

doc/api/deprecations.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,19 +2394,22 @@ unavailable when the [permission model][] is enabled.
23942394

23952395
<!-- YAML
23962396
changes:
2397+
- version: REPLACEME
2398+
pr-url: https://github.com/nodejs/node/pull/58474
2399+
description: End-of-Life.
23972400
- version: v11.0.0
23982401
pr-url: https://github.com/nodejs/node/pull/22011
23992402
description: Runtime deprecation.
24002403
-->
24012404

2402-
Type: Runtime
2405+
Type: End-of-Life
24032406

24042407
The `node:dgram` module previously contained several APIs that were never meant
24052408
to accessed outside of Node.js core: `Socket.prototype._handle`,
24062409
`Socket.prototype._receiving`, `Socket.prototype._bindState`,
24072410
`Socket.prototype._queue`, `Socket.prototype._reuseAddr`,
24082411
`Socket.prototype._healthCheck()`, `Socket.prototype._stopReceiving()`, and
2409-
`dgram._createSocketHandle()`.
2412+
`dgram._createSocketHandle()`. These have been removed.
24102413

24112414
### DEP0113: `Cipher.setAuthTag()`, `Decipher.getAuthTag()`
24122415

lib/dgram.js

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const {
5353
} = require('internal/errors');
5454
const {
5555
kStateSymbol,
56-
_createSocketHandle,
5756
newHandle,
5857
} = require('internal/dgram');
5958
const { isIP } = require('internal/net');
@@ -66,7 +65,7 @@ const {
6665
validateUint32,
6766
} = require('internal/validators');
6867
const { Buffer } = require('buffer');
69-
const { deprecate, guessHandleType, promisify } = require('internal/util');
68+
const { guessHandleType, promisify } = require('internal/util');
7069
const { isArrayBufferView } = require('internal/util/types');
7170
const EventEmitter = require('events');
7271
const { addAbortListener } = require('internal/events/abort_listener');
@@ -1044,72 +1043,6 @@ Socket.prototype.getSendQueueCount = function() {
10441043
return this[kStateSymbol].handle.getSendQueueCount();
10451044
};
10461045

1047-
// Deprecated private APIs.
1048-
ObjectDefineProperty(Socket.prototype, '_handle', {
1049-
__proto__: null,
1050-
get: deprecate(function() {
1051-
return this[kStateSymbol].handle;
1052-
}, 'Socket.prototype._handle is deprecated', 'DEP0112'),
1053-
set: deprecate(function(val) {
1054-
this[kStateSymbol].handle = val;
1055-
}, 'Socket.prototype._handle is deprecated', 'DEP0112'),
1056-
});
1057-
1058-
1059-
ObjectDefineProperty(Socket.prototype, '_receiving', {
1060-
__proto__: null,
1061-
get: deprecate(function() {
1062-
return this[kStateSymbol].receiving;
1063-
}, 'Socket.prototype._receiving is deprecated', 'DEP0112'),
1064-
set: deprecate(function(val) {
1065-
this[kStateSymbol].receiving = val;
1066-
}, 'Socket.prototype._receiving is deprecated', 'DEP0112'),
1067-
});
1068-
1069-
1070-
ObjectDefineProperty(Socket.prototype, '_bindState', {
1071-
__proto__: null,
1072-
get: deprecate(function() {
1073-
return this[kStateSymbol].bindState;
1074-
}, 'Socket.prototype._bindState is deprecated', 'DEP0112'),
1075-
set: deprecate(function(val) {
1076-
this[kStateSymbol].bindState = val;
1077-
}, 'Socket.prototype._bindState is deprecated', 'DEP0112'),
1078-
});
1079-
1080-
1081-
ObjectDefineProperty(Socket.prototype, '_queue', {
1082-
__proto__: null,
1083-
get: deprecate(function() {
1084-
return this[kStateSymbol].queue;
1085-
}, 'Socket.prototype._queue is deprecated', 'DEP0112'),
1086-
set: deprecate(function(val) {
1087-
this[kStateSymbol].queue = val;
1088-
}, 'Socket.prototype._queue is deprecated', 'DEP0112'),
1089-
});
1090-
1091-
1092-
ObjectDefineProperty(Socket.prototype, '_reuseAddr', {
1093-
__proto__: null,
1094-
get: deprecate(function() {
1095-
return this[kStateSymbol].reuseAddr;
1096-
}, 'Socket.prototype._reuseAddr is deprecated', 'DEP0112'),
1097-
set: deprecate(function(val) {
1098-
this[kStateSymbol].reuseAddr = val;
1099-
}, 'Socket.prototype._reuseAddr is deprecated', 'DEP0112'),
1100-
});
1101-
1102-
1103-
Socket.prototype._healthCheck = deprecate(function() {
1104-
healthCheck(this);
1105-
}, 'Socket.prototype._healthCheck() is deprecated', 'DEP0112');
1106-
1107-
1108-
Socket.prototype._stopReceiving = deprecate(function() {
1109-
stopReceiving(this);
1110-
}, 'Socket.prototype._stopReceiving() is deprecated', 'DEP0112');
1111-
1112-
11131046
// Legacy alias on the C++ wrapper object. This is not public API, so we may
11141047
// want to runtime-deprecate it at some point. There's no hurry, though.
11151048
ObjectDefineProperty(UDP.prototype, 'owner', {
@@ -1118,13 +1051,7 @@ ObjectDefineProperty(UDP.prototype, 'owner', {
11181051
set(v) { return this[owner_symbol] = v; },
11191052
});
11201053

1121-
11221054
module.exports = {
1123-
_createSocketHandle: deprecate(
1124-
_createSocketHandle,
1125-
'dgram._createSocketHandle() is deprecated',
1126-
'DEP0112',
1127-
),
11281055
createSocket,
11291056
Socket,
11301057
};

test/parallel/test-dgram-create-socket-handle-fd.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ if (common.isWindows)
55
common.skip('Does not support binding fd on Windows');
66

77
const assert = require('assert');
8-
const dgram = require('dgram');
8+
const { _createSocketHandle } = require('internal/dgram');
99
const { internalBinding } = require('internal/test/binding');
1010
const { UDP } = internalBinding('udp_wrap');
1111
const { TCP, constants } = internalBinding('tcp_wrap');
12-
const _createSocketHandle = dgram._createSocketHandle;
1312

1413
// Return a negative number if the "existing fd" is invalid.
1514
{

test/parallel/test-dgram-deprecation-error.js

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)