File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 318318 for ( var i = 0 ; i < arguments . length ; i ++ )
319319 this . push ( arguments [ i ] ) ;
320320 }
321+
322+ // Deprecated specific process.binding() modules, but not all, allow
323+ // selective fallback to internalBinding for the deprecated ones.
324+ const processBinding = process . binding ;
325+ const internalBindingWhitelist = new Set ( [ 'uv' ] ) ;
326+ const internalBindingWarned = new Set ( ) ;
327+ process . binding = function binding ( name ) {
328+ if ( internalBindingWhitelist . has ( name ) ) {
329+ if ( ! internalBindingWarned . has ( name ) ) {
330+ process . emitWarning (
331+ `Use of process.binding('${ name } ') is deprecated.` ,
332+ 'DeprecationWarning' , 'DEP0111' ) ;
333+ internalBindingWarned . add ( name ) ;
334+ }
335+ return internalBinding ( name ) ;
336+ }
337+ return processBinding ( name ) ;
338+ } ;
321339 }
322340
323341 function setupGlobalVariables ( ) {
Original file line number Diff line number Diff line change 1+ // Flags: --no-warnings
2+ 'use strict' ;
3+
4+ const common = require ( '../common' ) ;
5+ const assert = require ( 'assert' ) ;
6+
7+ common . expectWarning (
8+ 'DeprecationWarning' ,
9+ 'Use of process.binding(\'uv\') is deprecated.' ,
10+ 'DEP0111'
11+ ) ;
12+
13+ assert ( process . binding ( 'uv' ) ) ;
You can’t perform that action at this time.
0 commit comments