Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dgram: remove usage of public require('util') #26770

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
28 changes: 14 additions & 14 deletions lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const {
validateNumber
} = require('internal/validators');
const { Buffer } = require('buffer');
const util = require('util');
const { deprecate } = require('internal/util');
const { isUint8Array } = require('internal/util/types');
const EventEmitter = require('events');
const {
Expand Down Expand Up @@ -729,61 +729,61 @@ Socket.prototype.getSendBufferSize = function() {

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


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


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


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


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


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


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

Expand All @@ -797,7 +797,7 @@ Object.defineProperty(UDP.prototype, 'owner', {


module.exports = {
_createSocketHandle: util.deprecate(
_createSocketHandle: deprecate(
_createSocketHandle,
'dgram._createSocketHandle() is deprecated',
'DEP0112'
Expand Down