@ -120,7 +120,7 @@ function showFlaggedDeprecation() {
if ( bufferWarn ) {
if ( bufferWarn ) {
// This is a *pending* deprecation warning. It is not emitted by
// This is a *pending* deprecation warning. It is not emitted by
// default unless the --pending-deprecation command-line flag is
// default unless the --pending-deprecation command-line flag is
// used or the NODE_PENDING_DEPRECATION=1 envvar is set.
// used or the NODE_PENDING_DEPRECATION=1 env var is set.
process . emitWarning ( bufferWarning , 'DeprecationWarning' , 'DEP0005' ) ;
process . emitWarning ( bufferWarning , 'DeprecationWarning' , 'DEP0005' ) ;
bufferWarn = false ;
bufferWarn = false ;
}
}
@ -132,7 +132,7 @@ const doFlaggedDeprecation =
function ( ) { } ;
function ( ) { } ;
/ * *
/ * *
* The Buffer ( ) construtor is deprecated in documentation and should not be
* The Buffer ( ) construc tor is deprecated in documentation and should not be
* used moving forward . Rather , developers should use one of the three new
* used moving forward . Rather , developers should use one of the three new
* factory APIs : Buffer . from ( ) , Buffer . allocUnsafe ( ) or Buffer . alloc ( ) based on
* factory APIs : Buffer . from ( ) , Buffer . allocUnsafe ( ) or Buffer . alloc ( ) based on
* their specific needs . There is no runtime deprecation because of the extent
* their specific needs . There is no runtime deprecation because of the extent
@ -217,7 +217,7 @@ Buffer.alloc = function(size, fill, encoding) {
// Since we are filling anyway, don't zero fill initially.
// Since we are filling anyway, don't zero fill initially.
// Only pay attention to encoding if it's a string. This
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// prevents accidentally sending in a number that would
// be interprett ed as a start offset.
// be interpreted as a start offset.
if ( typeof encoding !== 'string' )
if ( typeof encoding !== 'string' )
encoding = undefined ;
encoding = undefined ;
return createUnsafeBuffer ( size ) . fill ( fill , encoding ) ;
return createUnsafeBuffer ( size ) . fill ( fill , encoding ) ;