Skip to content
Merged
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
7 changes: 5 additions & 2 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2391,19 +2391,22 @@ unavailable when the [permission model][] is enabled.

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/00000
Comment thread
jasnell marked this conversation as resolved.
Outdated
description: End-of-Life.
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/22011
description: Runtime deprecation.
-->

Type: Runtime
Type: End-of-Life

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

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

Expand Down
75 changes: 1 addition & 74 deletions lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const {
} = require('internal/errors');
const {
kStateSymbol,
_createSocketHandle,
newHandle,
} = require('internal/dgram');
const { isIP } = require('internal/net');
Expand All @@ -66,7 +65,7 @@ const {
validateUint32,
} = require('internal/validators');
const { Buffer } = require('buffer');
const { deprecate, guessHandleType, promisify } = require('internal/util');
const { guessHandleType, promisify } = require('internal/util');
const { isArrayBufferView } = require('internal/util/types');
const EventEmitter = require('events');
const { addAbortListener } = require('internal/events/abort_listener');
Expand Down Expand Up @@ -1044,72 +1043,6 @@ Socket.prototype.getSendQueueCount = function() {
return this[kStateSymbol].handle.getSendQueueCount();
};

// Deprecated private APIs.
ObjectDefineProperty(Socket.prototype, '_handle', {
__proto__: null,
get: deprecate(function() {
return this[kStateSymbol].handle;
}, 'Socket.prototype._handle is deprecated', 'DEP0112'),
set: deprecate(function(val) {
this[kStateSymbol].handle = val;
}, 'Socket.prototype._handle is deprecated', 'DEP0112'),
});


ObjectDefineProperty(Socket.prototype, '_receiving', {
__proto__: null,
get: deprecate(function() {
return this[kStateSymbol].receiving;
}, 'Socket.prototype._receiving is deprecated', 'DEP0112'),
set: deprecate(function(val) {
this[kStateSymbol].receiving = val;
}, 'Socket.prototype._receiving is deprecated', 'DEP0112'),
});


ObjectDefineProperty(Socket.prototype, '_bindState', {
__proto__: null,
get: deprecate(function() {
return this[kStateSymbol].bindState;
}, 'Socket.prototype._bindState is deprecated', 'DEP0112'),
set: deprecate(function(val) {
this[kStateSymbol].bindState = val;
}, 'Socket.prototype._bindState is deprecated', 'DEP0112'),
});


ObjectDefineProperty(Socket.prototype, '_queue', {
__proto__: null,
get: deprecate(function() {
return this[kStateSymbol].queue;
}, 'Socket.prototype._queue is deprecated', 'DEP0112'),
set: deprecate(function(val) {
this[kStateSymbol].queue = val;
}, 'Socket.prototype._queue is deprecated', 'DEP0112'),
});


ObjectDefineProperty(Socket.prototype, '_reuseAddr', {
__proto__: null,
get: deprecate(function() {
return this[kStateSymbol].reuseAddr;
}, 'Socket.prototype._reuseAddr is deprecated', 'DEP0112'),
set: deprecate(function(val) {
this[kStateSymbol].reuseAddr = val;
}, 'Socket.prototype._reuseAddr is deprecated', 'DEP0112'),
});


Socket.prototype._healthCheck = deprecate(function() {
healthCheck(this);
}, 'Socket.prototype._healthCheck() is deprecated', 'DEP0112');


Socket.prototype._stopReceiving = deprecate(function() {
stopReceiving(this);
}, 'Socket.prototype._stopReceiving() is deprecated', 'DEP0112');


// Legacy alias on the C++ wrapper object. This is not public API, so we may
// want to runtime-deprecate it at some point. There's no hurry, though.
ObjectDefineProperty(UDP.prototype, 'owner', {
Expand All @@ -1118,13 +1051,7 @@ ObjectDefineProperty(UDP.prototype, 'owner', {
set(v) { return this[owner_symbol] = v; },
});


module.exports = {
_createSocketHandle: deprecate(
_createSocketHandle,
'dgram._createSocketHandle() is deprecated',
'DEP0112',
),
createSocket,
Socket,
};
3 changes: 1 addition & 2 deletions test/parallel/test-dgram-create-socket-handle-fd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ if (common.isWindows)
common.skip('Does not support binding fd on Windows');

const assert = require('assert');
const dgram = require('dgram');
const { _createSocketHandle } = require('internal/dgram');
const { internalBinding } = require('internal/test/binding');
const { UDP } = internalBinding('udp_wrap');
const { TCP, constants } = internalBinding('tcp_wrap');
const _createSocketHandle = dgram._createSocketHandle;

// Return a negative number if the "existing fd" is invalid.
{
Expand Down
84 changes: 0 additions & 84 deletions test/parallel/test-dgram-deprecation-error.js

This file was deleted.

Loading