Created
January 29, 2016 04:26
-
-
Save mattness/adc451d095349c1d5468 to your computer and use it in GitHub Desktop.
Anonymous vs Named functions in backtraces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var EventEmitter = require('events').EventEmitter; | |
var e = new EventEmitter(); | |
e.on('something', function() { | |
throw new Error('anonymous function crash'); | |
}); | |
e.on('something_else', function foo() { | |
throw new Error('named function crash'); | |
}); | |
e.emit(process.argv[2]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a good practice to follow. Thank you ^ ^