@@ -84,7 +84,7 @@ const { getOptionValue } = require('internal/options');
8484const binding = internalBinding ( 'util' ) ;
8585
8686const {
87- deprecate,
87+ deprecate : internalDeprecate ,
8888 getLazy,
8989 getSystemErrorMap,
9090 getSystemErrorName : internalErrorName ,
@@ -459,11 +459,16 @@ function getCallSites(frameCount = 10, options) {
459459 return binding . getCallSites ( frameCount ) ;
460460} ;
461461
462+ // Public util.deprecate API
463+ function deprecate ( fn , msg , code , { modifyPrototype } = { } ) {
464+ return internalDeprecate ( fn , msg , code , undefined , modifyPrototype ) ;
465+ }
466+
462467// Keep the `exports =` so that various functions can still be monkeypatched
463468module . exports = {
464469 _errnoException,
465470 _exceptionWithHostPort,
466- _extend : deprecate ( _extend ,
471+ _extend : internalDeprecate ( _extend ,
467472 'The `util._extend` API is deprecated. Please use Object.assign() instead.' ,
468473 'DEP0060' ) ,
469474 callbackify,
@@ -479,7 +484,7 @@ module.exports = {
479484 getSystemErrorMessage,
480485 inherits,
481486 inspect,
482- isArray : deprecate ( ArrayIsArray ,
487+ isArray : internalDeprecate ( ArrayIsArray ,
483488 'The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.' ,
484489 'DEP0044' ) ,
485490 isDeepStrictEqual ( a , b , skipPrototype ) {
0 commit comments