dgram: remove usage of public require('util') · nodejs/node@dae1e30 (original) (raw)

`@@ -46,6 +46,7 @@ const {

`

46

46

`} = require('internal/validators');

`

47

47

`const { Buffer } = require('buffer');

`

48

48

`const util = require('util');

`

``

49

`+

const { deprecate } = require('internal/util');

`

49

50

`const { isUint8Array } = require('internal/util/types');

`

50

51

`const EventEmitter = require('events');

`

51

52

`const {

`

`@@ -728,61 +729,61 @@ Socket.prototype.getSendBufferSize = function() {

`

728

729

``

729

730

`// Deprecated private APIs.

`

730

731

`Object.defineProperty(Socket.prototype, '_handle', {

`

731

``

`-

get: util.deprecate(function() {

`

``

732

`+

get: deprecate(function() {

`

732

733

`return this[kStateSymbol].handle;

`

733

734

`}, 'Socket.prototype._handle is deprecated', 'DEP0112'),

`

734

``

`-

set: util.deprecate(function(val) {

`

``

735

`+

set: deprecate(function(val) {

`

735

736

`this[kStateSymbol].handle = val;

`

736

737

`}, 'Socket.prototype._handle is deprecated', 'DEP0112')

`

737

738

`});

`

738

739

``

739

740

``

740

741

`Object.defineProperty(Socket.prototype, '_receiving', {

`

741

``

`-

get: util.deprecate(function() {

`

``

742

`+

get: deprecate(function() {

`

742

743

`return this[kStateSymbol].receiving;

`

743

744

`}, 'Socket.prototype._receiving is deprecated', 'DEP0112'),

`

744

``

`-

set: util.deprecate(function(val) {

`

``

745

`+

set: deprecate(function(val) {

`

745

746

`this[kStateSymbol].receiving = val;

`

746

747

`}, 'Socket.prototype._receiving is deprecated', 'DEP0112')

`

747

748

`});

`

748

749

``

749

750

``

750

751

`Object.defineProperty(Socket.prototype, '_bindState', {

`

751

``

`-

get: util.deprecate(function() {

`

``

752

`+

get: deprecate(function() {

`

752

753

`return this[kStateSymbol].bindState;

`

753

754

`}, 'Socket.prototype._bindState is deprecated', 'DEP0112'),

`

754

``

`-

set: util.deprecate(function(val) {

`

``

755

`+

set: deprecate(function(val) {

`

755

756

`this[kStateSymbol].bindState = val;

`

756

757

`}, 'Socket.prototype._bindState is deprecated', 'DEP0112')

`

757

758

`});

`

758

759

``

759

760

``

760

761

`Object.defineProperty(Socket.prototype, '_queue', {

`

761

``

`-

get: util.deprecate(function() {

`

``

762

`+

get: deprecate(function() {

`

762

763

`return this[kStateSymbol].queue;

`

763

764

`}, 'Socket.prototype._queue is deprecated', 'DEP0112'),

`

764

``

`-

set: util.deprecate(function(val) {

`

``

765

`+

set: deprecate(function(val) {

`

765

766

`this[kStateSymbol].queue = val;

`

766

767

`}, 'Socket.prototype._queue is deprecated', 'DEP0112')

`

767

768

`});

`

768

769

``

769

770

``

770

771

`Object.defineProperty(Socket.prototype, '_reuseAddr', {

`

771

``

`-

get: util.deprecate(function() {

`

``

772

`+

get: deprecate(function() {

`

772

773

`return this[kStateSymbol].reuseAddr;

`

773

774

`}, 'Socket.prototype._reuseAddr is deprecated', 'DEP0112'),

`

774

``

`-

set: util.deprecate(function(val) {

`

``

775

`+

set: deprecate(function(val) {

`

775

776

`this[kStateSymbol].reuseAddr = val;

`

776

777

`}, 'Socket.prototype._reuseAddr is deprecated', 'DEP0112')

`

777

778

`});

`

778

779

``

779

780

``

780

``

`-

Socket.prototype._healthCheck = util.deprecate(function() {

`

``

781

`+

Socket.prototype._healthCheck = deprecate(function() {

`

781

782

`healthCheck(this);

`

782

783

`}, 'Socket.prototype._healthCheck() is deprecated', 'DEP0112');

`

783

784

``

784

785

``

785

``

`-

Socket.prototype._stopReceiving = util.deprecate(function() {

`

``

786

`+

Socket.prototype._stopReceiving = deprecate(function() {

`

786

787

`stopReceiving(this);

`

787

788

`}, 'Socket.prototype._stopReceiving() is deprecated', 'DEP0112');

`

788

789

``

`@@ -796,7 +797,7 @@ Object.defineProperty(UDP.prototype, 'owner', {

`

796

797

``

797

798

``

798

799

`module.exports = {

`

799

``

`-

_createSocketHandle: util.deprecate(

`

``

800

`+

_createSocketHandle: deprecate(

`

800

801

`_createSocketHandle,

`

801

802

`'dgram._createSocketHandle() is deprecated',

`

802

803

`'DEP0112'

`