File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1+ // eslint-disable-next-line filenames/match-exported
12'use strict'
23
34const process = require ( 'process' )
@@ -10,15 +11,16 @@ const EVENTS = require('./events')
1011const { emitLimitedWarning } = require ( './limit' )
1112
1213// Add event handling for all process-related errors
13- const init = function ( opts ) {
14+ const logProcessErrors = function ( opts ) {
1415 const optsA = getOptions ( { opts } )
1516
1617 removeWarningListener ( )
1718
1819 const listeners = addListeners ( { opts : optsA } )
1920
20- const stopLoggingA = stopLogging . bind ( null , listeners )
21- return stopLoggingA
21+ // Do not use `function.bind()` to keep the right `function.name`
22+ const stopLogProcessErrors = ( ) => stopLogging ( listeners )
23+ return stopLogProcessErrors
2224}
2325
2426const addListeners = function ( { opts } ) {
@@ -59,4 +61,4 @@ const removeListener = function({ eventListener, eventName }) {
5961 process . removeListener ( eventName , eventListener )
6062}
6163
62- module . exports = init
64+ module . exports = logProcessErrors
You can’t perform that action at this time.
0 commit comments