Skip to content

Commit e2b2fdd

Browse files
committed
Fix function names
1 parent 3c46886 commit e2b2fdd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/init.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line filenames/match-exported
12
'use strict'
23

34
const process = require('process')
@@ -10,15 +11,16 @@ const EVENTS = require('./events')
1011
const { 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

2426
const 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

0 commit comments

Comments
 (0)